Removed unknownAsBin parameter of isBinary() in Util/Repository.php

This commit is contained in:
Sebastiaan Stok
2012-08-31 16:46:45 +02:00
parent 0f841547df
commit 716a304706

View File

@@ -137,16 +137,13 @@ class Repository
* Returns whether the file is binary. * Returns whether the file is binary.
* *
* @param string $file * @param string $file
* @param boolean $unknownAsBin if the file-type is unknown tread it as binary
* *
* @return boolean * @return boolean
*/ */
public function isBinary($file, $unknownAsBin = false) public function isBinary($file)
{ {
if (($pos = strrpos($file, '.')) !== false) { if (($pos = strrpos($file, '.')) !== false) {
$fileType = substr($file, $pos + 1); $fileType = substr($file, $pos + 1);
} elseif ($unknownAsBin) {
return true;
} else { } else {
return false; return false;
} }
@@ -155,17 +152,11 @@ class Repository
return true; return true;
} }
if (!empty($this->app['binary_filetypes'])) { if (!empty($this->app['binary_filetypes']) && array_key_exists($fileType, $this->app['binary_filetypes'])) {
if (array_key_exists($fileType, $this->app['binary_filetypes'])) { return $this->app['binary_filetypes'][$fileType];
return $this->app['binary_filetypes'][$fileType];
}
} }
if ($unknownAsBin) { return false;
return true;
} else {
return false;
}
} }
public function getReadme($repo, $branch = 'master') public function getReadme($repo, $branch = 'master')