diff --git a/campcaster/src/modules/storageServer/var/conf.php b/campcaster/src/modules/storageServer/var/conf.php index 8d251b175..a9f661dd6 100644 --- a/campcaster/src/modules/storageServer/var/conf.php +++ b/campcaster/src/modules/storageServer/var/conf.php @@ -58,12 +58,12 @@ $config = array( 'StationPrefsGr'=> 'StationPrefs', 'AllGr' => 'All', 'TrashName' => 'trash_', - 'storageDir' => realpath(dirname(__FILE__).'/../../storageServer/var/stor'), - 'bufferDir' => realpath(dirname(__FILE__).'/../../storageServer/var/stor/buffer'), - 'transDir' => realpath(dirname(__FILE__).'/../../storageServer/var/trans'), - 'accessDir' => realpath(dirname(__FILE__).'/../../storageServer/var/access'), - 'pearPath' => realpath(dirname(__FILE__).'/../../../../usr/lib/pear'), - 'cronDir' => realpath(dirname(__FILE__).'/../../storageServer/var/cron'), + 'storageDir' => dirname(__FILE__).'/../../storageServer/var/stor', + 'bufferDir' => dirname(__FILE__).'/../../storageServer/var/stor/buffer', + 'transDir' => dirname(__FILE__).'/../../storageServer/var/trans', + 'accessDir' => dirname(__FILE__).'/../../storageServer/var/access', + 'pearPath' => dirname(__FILE__).'/../../../../usr/lib/pear', + 'cronDir' => dirname(__FILE__).'/../../storageServer/var/cron', 'isArchive' => FALSE, 'validate' => 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; +} + ?> \ No newline at end of file diff --git a/campcaster/src/modules/storageServer/var/conf.php.template b/campcaster/src/modules/storageServer/var/conf.php.template index aca24011b..8f7445324 100644 --- a/campcaster/src/modules/storageServer/var/conf.php.template +++ b/campcaster/src/modules/storageServer/var/conf.php.template @@ -56,12 +56,12 @@ $config = array( 'StationPrefsGr'=> 'StationPrefs', 'AllGr' => 'All', 'TrashName' => 'trash_', - 'storageDir' => realpath(dirname(__FILE__).'/../../storageServer/var/stor'), - 'bufferDir' => realpath(dirname(__FILE__).'/../../storageServer/var/stor/buffer'), - 'transDir' => realpath(dirname(__FILE__).'/../../storageServer/var/trans'), - 'accessDir' => realpath(dirname(__FILE__).'/../../storageServer/var/access'), + 'storageDir' => dirname(__FILE__).'/../../storageServer/var/stor', + 'bufferDir' => dirname(__FILE__).'/../../storageServer/var/stor/buffer', + 'transDir' => dirname(__FILE__).'/../../storageServer/var/trans', + 'accessDir' => dirname(__FILE__).'/../../storageServer/var/access', 'pearPath' => 'ls_lib_dir/pear', - 'cronDir' => realpath(dirname(__FILE__).'/../../storageServer/var/cron'), + 'cronDir' => dirname(__FILE__).'/../../storageServer/var/cron', 'isArchive' => FALSE, 'validate' => TRUE, 'useTrash' => TRUE, @@ -125,4 +125,15 @@ $config['sysSubjs'] = array( $old_ip = get_include_path(); 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; +} + ?> \ No newline at end of file