Remove unused FileSystem::root()

Prevents unexpected behavior with `FileSystem::list()`
This commit is contained in:
Giuseppe Criscione 2018-07-17 01:57:46 +02:00
parent aad7496799
commit aad99d4658

View File

@ -10,11 +10,6 @@ class FileSystem
protected static $units = array('B', 'KB', 'MB', 'GB', 'TB');
public static function root()
{
return defined(ROOT_PATH) ? ROOT_PATH : $_SERVER['DOCUMENT_ROOT'];
}
public static function dirname($path)
{
return dirname($path);
@ -256,11 +251,8 @@ class FileSystem
return rtrim($path, DS) . DS;
}
public static function list($path = null, $all = false)
public static function list($path, $all = false)
{
if (empty($path)) {
$path = static::root();
}
static::assert($path);
if (!static::isDirectory($path)) {
throw new RuntimeException('Unable to list: ' . $path . ', specified path is not a directory');