mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-23 07:09:20 +01:00
"implemented dir() and scandir() for egw_vfs"
This commit is contained in:
parent
4890a25d99
commit
2408fbb0c9
@ -124,7 +124,7 @@ class egw_vfs extends vfs_stream_wrapper
|
||||
}
|
||||
|
||||
/**
|
||||
* opendir working on just the eGW VFS
|
||||
* opendir working on just the eGW VFS: returns resource for readdir() etc.
|
||||
*
|
||||
* @param string $path filename with absolute path in the eGW VFS
|
||||
* @return resource
|
||||
@ -138,6 +138,37 @@ class egw_vfs extends vfs_stream_wrapper
|
||||
return opendir(self::PREFIX.$path);
|
||||
}
|
||||
|
||||
/**
|
||||
* dir working on just the eGW VFS: returns directory object
|
||||
*
|
||||
* @param string $path filename with absolute path in the eGW VFS
|
||||
* @return Directory
|
||||
*/
|
||||
static function dir($path)
|
||||
{
|
||||
if ($path[0] != '/')
|
||||
{
|
||||
throw new egw_exception_assertion_failed("Directory '$path' is not an absolute path!");
|
||||
}
|
||||
return dir(self::PREFIX.$path);
|
||||
}
|
||||
|
||||
/**
|
||||
* scandir working on just the eGW VFS: returns array with filenames as values
|
||||
*
|
||||
* @param string $path filename with absolute path in the eGW VFS
|
||||
* @param int $sorting_order=0 !$sorting_order (default) alphabetical in ascending order, $sorting_order alphabetical in descending order.
|
||||
* @return array
|
||||
*/
|
||||
static function scandir($path,$sorting_order=0)
|
||||
{
|
||||
if ($path[0] != '/')
|
||||
{
|
||||
throw new egw_exception_assertion_failed("Directory '$path' is not an absolute path!");
|
||||
}
|
||||
return scandir(self::PREFIX.$path,$sorting_order);
|
||||
}
|
||||
|
||||
/**
|
||||
* copy working on just the eGW VFS
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user