mirror of
https://github.com/getformwork/formwork.git
synced 2025-01-17 21:49:04 +01:00
Remove unused FileSystem::root()
Prevents unexpected behavior with `FileSystem::list()`
This commit is contained in:
parent
aad7496799
commit
aad99d4658
@ -10,11 +10,6 @@ class FileSystem
|
|||||||
|
|
||||||
protected static $units = array('B', 'KB', 'MB', 'GB', 'TB');
|
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)
|
public static function dirname($path)
|
||||||
{
|
{
|
||||||
return dirname($path);
|
return dirname($path);
|
||||||
@ -256,11 +251,8 @@ class FileSystem
|
|||||||
return rtrim($path, DS) . DS;
|
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);
|
static::assert($path);
|
||||||
if (!static::isDirectory($path)) {
|
if (!static::isDirectory($path)) {
|
||||||
throw new RuntimeException('Unable to list: ' . $path . ', specified path is not a directory');
|
throw new RuntimeException('Unable to list: ' . $path . ', specified path is not a directory');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user