diff --git a/phpgwapi/inc/class.egw_vfs.inc.php b/phpgwapi/inc/class.egw_vfs.inc.php index 48fb9d1bfd..76e8b3e2ba 100644 --- a/phpgwapi/inc/class.egw_vfs.inc.php +++ b/phpgwapi/inc/class.egw_vfs.inc.php @@ -568,7 +568,15 @@ class egw_vfs extends vfs_stream_wrapper { $type = $options['type']; // 'd' or 'f' - if (!($stat = self::url_stat($path,STREAM_URL_STAT_LINK))) + if ($options['url']) + { + $stat = lstat($path); + } + else + { + $stat = self::url_stat($path,STREAM_URL_STAT_LINK); + } + if (!$stat) { return; // not found, should not happen } diff --git a/phpgwapi/inc/class.sqlfs_stream_wrapper.inc.php b/phpgwapi/inc/class.sqlfs_stream_wrapper.inc.php index 15f941b3ee..47bebde510 100644 --- a/phpgwapi/inc/class.sqlfs_stream_wrapper.inc.php +++ b/phpgwapi/inc/class.sqlfs_stream_wrapper.inc.php @@ -156,6 +156,15 @@ class sqlfs_stream_wrapper implements iface_stream_wrapper */ protected $opened_dir; + /** + * Extra columns added since the intitial introduction of sqlfs + * + * Can be set to empty, so get queries running on old versions of sqlfs, eg. for schema updates + * + * @var string; + */ + static public $extra_columns = '';//',fs_link'; + /** * This method is called immediately after your stream object is created. * @@ -901,7 +910,7 @@ class sqlfs_stream_wrapper implements iface_stream_wrapper return false; } $this->opened_dir = array(); - $query = 'SELECT fs_id,fs_name,fs_mode,fs_uid,fs_gid,fs_size,fs_mime,fs_created,fs_modified,fs_link'. + $query = 'SELECT fs_id,fs_name,fs_mode,fs_uid,fs_gid,fs_size,fs_mime,fs_created,fs_modified'.self::$extra_columns. ' FROM '.self::TABLE." WHERE fs_dir=? ORDER BY fs_mime='httpd/unix-directory' DESC, fs_name ASC"; //if (self::LOG_LEVEL > 2) $query = '/* '.__METHOD__.': '.__LINE__.' */ '.$query; if (self::LOG_LEVEL > 2) $query = '/* '.__METHOD__."($url,$options)".' */ '.$query; @@ -970,7 +979,7 @@ class sqlfs_stream_wrapper implements iface_stream_wrapper { self::_pdo(); } - $base_query = 'SELECT fs_id,fs_name,fs_mode,fs_uid,fs_gid,fs_size,fs_mime,fs_created,fs_modified,fs_link'. + $base_query = 'SELECT fs_id,fs_name,fs_mode,fs_uid,fs_gid,fs_size,fs_mime,fs_created,fs_modified'.self::$extra_columns. ' FROM '.self::TABLE.' WHERE fs_name'.self::$case_sensitive_equal.'? AND fs_dir='; $parts = explode('/',$path); @@ -1479,7 +1488,9 @@ class sqlfs_stream_wrapper implements iface_stream_wrapper $pdo_available = true; } try { - self::$pdo = new PDO($dsn,$egw_db->User,$egw_db->Password); + self::$pdo = new PDO($dsn,$egw_db->User,$egw_db->Password,array( + PDO::ATTR_ERRMODE=>PDO::ERRMODE_EXCEPTION, + )); } catch(Exception $e) { // Exception reveals password, so we ignore the exception and connect again without pw, to get the right exception without pw diff --git a/phpgwapi/setup/tables_update_1_4.inc.php b/phpgwapi/setup/tables_update_1_4.inc.php index 70c3e2e07e..2ba3866a58 100644 --- a/phpgwapi/setup/tables_update_1_4.inc.php +++ b/phpgwapi/setup/tables_update_1_4.inc.php @@ -434,6 +434,7 @@ function phpgwapi_upgrade1_5_011() if ($GLOBALS['DEBUG'] && isset($_SERVER['HTTP_HOST'])) echo "
\n";
 	egw_vfs::$is_root = true;
 	egw_vfs::load_wrapper('sqlfs');
+	sqlfs_stream_wrapper::$extra_columns = '';	// no fs_link column, as it gets created in 1.7.002
 	egw_vfs::find('sqlfs://default/',array(
 		'url'  => true,
 		'depth' => true,