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