"implemented dir() and scandir() for egw_vfs"

This commit is contained in:
Ralf Becker 2009-05-16 08:22:20 +00:00
parent 4890a25d99
commit 2408fbb0c9

View File

@ -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 * @param string $path filename with absolute path in the eGW VFS
* @return resource * @return resource
@ -138,6 +138,37 @@ class egw_vfs extends vfs_stream_wrapper
return opendir(self::PREFIX.$path); 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 * copy working on just the eGW VFS
* *