mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-22 23:00:56 +01:00
Creating an own column (fs_link) for symlinks, as fs_content is a BLOB
and therefore not aware of charsets
This commit is contained in:
parent
5b2da78e32
commit
6617bec9ef
@ -901,9 +901,8 @@ 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'.
|
||||
",CASE fs_mime WHEN '".self::SYMLINK_MIME_TYPE."' THEN fs_content ELSE NULL END AS readlink FROM ".self::TABLE.
|
||||
" WHERE fs_dir=? ORDER BY fs_mime='httpd/unix-directory' DESC, fs_name ASC";
|
||||
$query = 'SELECT fs_id,fs_name,fs_mode,fs_uid,fs_gid,fs_size,fs_mime,fs_created,fs_modified,fs_link'.
|
||||
' 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;
|
||||
|
||||
@ -971,9 +970,8 @@ 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'.
|
||||
",CASE fs_mime WHEN '".self::SYMLINK_MIME_TYPE."' THEN fs_content ELSE NULL END AS readlink FROM ".self::TABLE.
|
||||
' WHERE fs_name'.self::$case_sensitive_equal.'? AND fs_dir=';
|
||||
$base_query = 'SELECT fs_id,fs_name,fs_mode,fs_uid,fs_gid,fs_size,fs_mime,fs_created,fs_modified,fs_link'.
|
||||
' FROM '.self::TABLE.' WHERE fs_name'.self::$case_sensitive_equal.'? AND fs_dir=';
|
||||
$parts = explode('/',$path);
|
||||
|
||||
// if we have extendes acl access to the url, we dont need and can NOT include the sql for the readable check
|
||||
@ -1153,8 +1151,8 @@ class sqlfs_stream_wrapper implements iface_stream_wrapper
|
||||
if (self::LOG_LEVEL > 0) error_log(__METHOD__."('$target','$link') returning false! (!stat('$link') || !is_writable('$dir'))");
|
||||
return false; // $link already exists or parent dir does not
|
||||
}
|
||||
$query = 'INSERT INTO '.self::TABLE.' (fs_name,fs_dir,fs_mode,fs_uid,fs_gid,fs_created,fs_modified,fs_creator,fs_mime,fs_size,fs_content'.
|
||||
') VALUES (:fs_name,:fs_dir,:fs_mode,:fs_uid,:fs_gid,:fs_created,:fs_modified,:fs_creator,:fs_mime,:fs_size,:fs_content)';
|
||||
$query = 'INSERT INTO '.self::TABLE.' (fs_name,fs_dir,fs_mode,fs_uid,fs_gid,fs_created,fs_modified,fs_creator,fs_mime,fs_size,fs_link'.
|
||||
') VALUES (:fs_name,:fs_dir,:fs_mode,:fs_uid,:fs_gid,:fs_created,:fs_modified,:fs_creator,:fs_mime,:fs_size,:fs_link)';
|
||||
if (self::LOG_LEVEL > 2) $query = '/* '.__METHOD__.': '.__LINE__.' */ '.$query;
|
||||
$stmt = self::$pdo->prepare($query);
|
||||
unset(self::$stat_cache[$link]);
|
||||
@ -1170,7 +1168,7 @@ class sqlfs_stream_wrapper implements iface_stream_wrapper
|
||||
'fs_creator' => egw_vfs::$user,
|
||||
'fs_mime' => self::SYMLINK_MIME_TYPE,
|
||||
'fs_size' => bytes($target),
|
||||
'fs_content' => $target,
|
||||
'fs_link' => $target,
|
||||
));
|
||||
}
|
||||
|
||||
@ -1429,7 +1427,7 @@ class sqlfs_stream_wrapper implements iface_stream_wrapper
|
||||
'nlink' => $info['fs_mime'] == self::DIR_MIME_TYPE ? 2 : 1,
|
||||
// eGW addition to return some extra values
|
||||
'mime' => $info['fs_mime'],
|
||||
'readlink' => $info['readlink'],
|
||||
'readlink' => $info['fs_link'],
|
||||
);
|
||||
if (self::LOG_LEVEL > 1) error_log(__METHOD__."($info[name]) = ".array2string($stat));
|
||||
return $stat;
|
||||
|
@ -12,7 +12,7 @@
|
||||
/* Basic information about this app */
|
||||
$setup_info['phpgwapi']['name'] = 'phpgwapi';
|
||||
$setup_info['phpgwapi']['title'] = 'eGroupWare API';
|
||||
$setup_info['phpgwapi']['version'] = '1.7.001';
|
||||
$setup_info['phpgwapi']['version'] = '1.7.002';
|
||||
$setup_info['phpgwapi']['versions']['current_header'] = '1.29';
|
||||
$setup_info['phpgwapi']['enable'] = 3;
|
||||
$setup_info['phpgwapi']['app_order'] = 1;
|
||||
@ -75,3 +75,4 @@ $setup_info['groupdav']['author'] = $setup_info['groupdav']['maintainer'] = arra
|
||||
'email' => 'RalfBecker@outdoor-training.de'
|
||||
);
|
||||
$setup_info['groupdav']['license'] = 'GPL';
|
||||
|
||||
|
@ -446,7 +446,8 @@ $phpgw_baseline = array(
|
||||
'fs_creator' => array('type' => 'int','precision' => '4','nullable' => False),
|
||||
'fs_modifier' => array('type' => 'int','precision' => '4'),
|
||||
'fs_active' => array('type' => 'bool','nullable' => False,'default' => 't'),
|
||||
'fs_content' => array('type' => 'blob')
|
||||
'fs_content' => array('type' => 'blob'),
|
||||
'fs_link' => array('type' => 'varchar','precision' => '255')
|
||||
),
|
||||
'pk' => array('fs_id'),
|
||||
'fk' => array(),
|
||||
|
@ -27,3 +27,16 @@ function phpgwapi_upgrade1_6_001()
|
||||
{
|
||||
return $GLOBALS['setup_info']['phpgwapi']['currentver'] = '1.7.001';
|
||||
}
|
||||
|
||||
function phpgwapi_upgrade1_7_001()
|
||||
{
|
||||
$GLOBALS['egw_setup']->oProc->AddColumn('egw_sqlfs','fs_link',array(
|
||||
'type' => 'varchar',
|
||||
'precision' => '255'
|
||||
));
|
||||
// moving symlinks from fs_content to fs_link
|
||||
$GLOBALS['egw_setup']->oProc->query("UPDATE egw_sqlfs SET fs_link=fs_content,fs_content=NULL WHERE fs_mime='application/x-symlink'",__LINE__,__FILE__);
|
||||
|
||||
return $GLOBALS['setup_info']['phpgwapi']['currentver'] = '1.7.002';
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user