#1894 workaround - ensures the buffer dir exists

This commit is contained in:
tomash 2006-11-24 00:53:45 +00:00
parent 114e75e52b
commit 4259cf0c08
2 changed files with 33 additions and 11 deletions

View File

@ -58,12 +58,12 @@ $config = array(
'StationPrefsGr'=> 'StationPrefs', 'StationPrefsGr'=> 'StationPrefs',
'AllGr' => 'All', 'AllGr' => 'All',
'TrashName' => 'trash_', 'TrashName' => 'trash_',
'storageDir' => realpath(dirname(__FILE__).'/../../storageServer/var/stor'), 'storageDir' => dirname(__FILE__).'/../../storageServer/var/stor',
'bufferDir' => realpath(dirname(__FILE__).'/../../storageServer/var/stor/buffer'), 'bufferDir' => dirname(__FILE__).'/../../storageServer/var/stor/buffer',
'transDir' => realpath(dirname(__FILE__).'/../../storageServer/var/trans'), 'transDir' => dirname(__FILE__).'/../../storageServer/var/trans',
'accessDir' => realpath(dirname(__FILE__).'/../../storageServer/var/access'), 'accessDir' => dirname(__FILE__).'/../../storageServer/var/access',
'pearPath' => realpath(dirname(__FILE__).'/../../../../usr/lib/pear'), 'pearPath' => dirname(__FILE__).'/../../../../usr/lib/pear',
'cronDir' => realpath(dirname(__FILE__).'/../../storageServer/var/cron'), 'cronDir' => dirname(__FILE__).'/../../storageServer/var/cron',
'isArchive' => FALSE, 'isArchive' => FALSE,
'validate' => TRUE, 'validate' => TRUE,
'useTrash' => TRUE, 'useTrash' => TRUE,
@ -153,4 +153,15 @@ if (!is_null($this_file)) {
} }
} }
// make dirpaths better (without ../)
foreach (array('storageDir', 'bufferDir', 'transDir', 'accessDir', 'pearPath', 'cronDir') as $d) {
$rp = realpath($config[$d]);
// workaround for missing dirs
if ( $rp === FALSE ) {
mkdir( $config[$d] );
$rp = realpath($config[$d]);
}
$config[$d] = $rp;
}
?> ?>

View File

@ -56,12 +56,12 @@ $config = array(
'StationPrefsGr'=> 'StationPrefs', 'StationPrefsGr'=> 'StationPrefs',
'AllGr' => 'All', 'AllGr' => 'All',
'TrashName' => 'trash_', 'TrashName' => 'trash_',
'storageDir' => realpath(dirname(__FILE__).'/../../storageServer/var/stor'), 'storageDir' => dirname(__FILE__).'/../../storageServer/var/stor',
'bufferDir' => realpath(dirname(__FILE__).'/../../storageServer/var/stor/buffer'), 'bufferDir' => dirname(__FILE__).'/../../storageServer/var/stor/buffer',
'transDir' => realpath(dirname(__FILE__).'/../../storageServer/var/trans'), 'transDir' => dirname(__FILE__).'/../../storageServer/var/trans',
'accessDir' => realpath(dirname(__FILE__).'/../../storageServer/var/access'), 'accessDir' => dirname(__FILE__).'/../../storageServer/var/access',
'pearPath' => 'ls_lib_dir/pear', 'pearPath' => 'ls_lib_dir/pear',
'cronDir' => realpath(dirname(__FILE__).'/../../storageServer/var/cron'), 'cronDir' => dirname(__FILE__).'/../../storageServer/var/cron',
'isArchive' => FALSE, 'isArchive' => FALSE,
'validate' => TRUE, 'validate' => TRUE,
'useTrash' => TRUE, 'useTrash' => TRUE,
@ -125,4 +125,15 @@ $config['sysSubjs'] = array(
$old_ip = get_include_path(); $old_ip = get_include_path();
set_include_path('.'.PATH_SEPARATOR.$config['pearPath'].PATH_SEPARATOR.$old_ip); set_include_path('.'.PATH_SEPARATOR.$config['pearPath'].PATH_SEPARATOR.$old_ip);
// make dirpaths better (without ../)
foreach (array('storageDir', 'bufferDir', 'transDir', 'accessDir', 'pearPath', 'cronDir') as $d) {
$rp = realpath($config[$d]);
// workaround for missing dirs
if ( $rp === FALSE ) {
mkdir( $config[$d] );
$rp = realpath($config[$d]);
}
$config[$d] = $rp;
}
?> ?>