forked from extern/egroupware
"allow egw_vfs::mount() to work in setup:
- need to read fs-tab - need to load wrapper (otherwise file_exists($url) fails)"
This commit is contained in:
parent
f124b889d8
commit
88c9aca3f3
@ -280,6 +280,15 @@ class egw_vfs extends vfs_stream_wrapper
|
|||||||
*/
|
*/
|
||||||
static function mount($url=null,$path=null)
|
static function mount($url=null,$path=null)
|
||||||
{
|
{
|
||||||
|
if (!isset($GLOBALS['egw_info']['server']['vfs_fstab'])) // happens eg. in setup
|
||||||
|
{
|
||||||
|
$api_config = config::read('phpgwapi');
|
||||||
|
if (isset($api_config['vfs_fstab']) && is_array($api_config['vfs_fstab']))
|
||||||
|
{
|
||||||
|
self::$fstab = $api_config['vfs_fstab'];
|
||||||
|
}
|
||||||
|
unset($api_config);
|
||||||
|
}
|
||||||
if (is_null($url) || is_null($path))
|
if (is_null($url) || is_null($path))
|
||||||
{
|
{
|
||||||
if (self::LOG_LEVEL > 1) error_log(__METHOD__.'('.array2string($url).','.array2string($path).') returns '.array2string(self::$fstab));
|
if (self::LOG_LEVEL > 1) error_log(__METHOD__.'('.array2string($url).','.array2string($path).') returns '.array2string(self::$fstab));
|
||||||
@ -295,6 +304,8 @@ class egw_vfs extends vfs_stream_wrapper
|
|||||||
if (self::LOG_LEVEL > 0) error_log(__METHOD__.'('.array2string($url).','.array2string($path).') already mounted.');
|
if (self::LOG_LEVEL > 0) error_log(__METHOD__.'('.array2string($url).','.array2string($path).') already mounted.');
|
||||||
return true; // already mounted
|
return true; // already mounted
|
||||||
}
|
}
|
||||||
|
self::load_wrapper(parse_url($url,PHP_URL_SCHEME));
|
||||||
|
|
||||||
if (!file_exists($url) || opendir($url) === false)
|
if (!file_exists($url) || opendir($url) === false)
|
||||||
{
|
{
|
||||||
if (self::LOG_LEVEL > 0) error_log(__METHOD__.'('.array2string($url).','.array2string($path).') url does NOT exist!');
|
if (self::LOG_LEVEL > 0) error_log(__METHOD__.'('.array2string($url).','.array2string($path).') url does NOT exist!');
|
||||||
|
Loading…
Reference in New Issue
Block a user