From 88c9aca3f3feac7f7170ea8e24613738a3242493 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Thu, 28 May 2009 11:29:17 +0000 Subject: [PATCH] "allow egw_vfs::mount() to work in setup: - need to read fs-tab - need to load wrapper (otherwise file_exists($url) fails)" --- phpgwapi/inc/class.egw_vfs.inc.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/phpgwapi/inc/class.egw_vfs.inc.php b/phpgwapi/inc/class.egw_vfs.inc.php index 9cc2a4cd67..48fb9d1bfd 100644 --- a/phpgwapi/inc/class.egw_vfs.inc.php +++ b/phpgwapi/inc/class.egw_vfs.inc.php @@ -280,6 +280,15 @@ class egw_vfs extends vfs_stream_wrapper */ 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 (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.'); return true; // already mounted } + self::load_wrapper(parse_url($url,PHP_URL_SCHEME)); + if (!file_exists($url) || opendir($url) === false) { if (self::LOG_LEVEL > 0) error_log(__METHOD__.'('.array2string($url).','.array2string($path).') url does NOT exist!');