From 68ca1b5a95dd313a687eb4eafb049f918bc0b7f5 Mon Sep 17 00:00:00 2001 From: tomash Date: Thu, 7 Sep 2006 00:16:26 +0000 Subject: [PATCH] #1781 missing cron part added to conf.php.template. --- .../src/modules/storageServer/etc/Makefile.in | 1 + .../storageServer/var/conf.php.template | 31 +++++++++++++++---- 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/livesupport/src/modules/storageServer/etc/Makefile.in b/livesupport/src/modules/storageServer/etc/Makefile.in index ed37a1126..4d0df2434 100644 --- a/livesupport/src/modules/storageServer/etc/Makefile.in +++ b/livesupport/src/modules/storageServer/etc/Makefile.in @@ -108,6 +108,7 @@ REPLACE_SED_STRING="s/ls_lib_dir/${USR_LIB_DIR_S}/; \ s/ls_dbpassword/${DB_PASSWORD}/; \ s/ls_dbserver/${DB_SERVER}/; \ s/ls_database/${DATABASE}/; \ + s/ls_apache_group/${APACHE_GROUP}/; \ s/ls_storageUrlPath/\/${PHP_URL_PREFIX_S}\/storageServer\/var/; \ s/ls_php_host/${HOSTNAME}/; \ s/ls_php_port/${WWW_PORT}/; \ diff --git a/livesupport/src/modules/storageServer/var/conf.php.template b/livesupport/src/modules/storageServer/var/conf.php.template index 21a2281ae..33f55efe7 100644 --- a/livesupport/src/modules/storageServer/var/conf.php.template +++ b/livesupport/src/modules/storageServer/var/conf.php.template @@ -33,7 +33,8 @@ * storageServer configuration file */ -define('LS_VERSION', '1.0'); +define('LS_VERSION', '1.1'); +define('PHP5', version_compare( phpversion(), "5.0.0", ">=" )); /** * configuration structure: @@ -84,11 +85,12 @@ $config = array( 'StationPrefsGr'=> 'StationPrefs', 'AllGr' => 'All', 'TrashName' => 'trash_', - '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', + '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' => 'ls_lib_dir/pear', + 'cronDir' => realpath(dirname(__FILE__).'/../../storageServer/var/cron'), 'isArchive' => FALSE, 'validate' => TRUE, 'useTrash' => TRUE, @@ -139,10 +141,27 @@ $config = array( /* ============================================== auxiliary configuration */ 'RootNode' => 'RootNode', 'tmpRootPass' => 'q', + + /* =================================================== cron configuration */ + 'cronUserName' => 'ls_apache_group', + 'lockfile' => dirname(__FILE__).'/cron/cron.lock', + 'cronfile' => dirname(__FILE__).'/cron/croncall.php', + 'paramdir' => dirname(__FILE__).'/cron/params', ); $config['sysSubjs'] = array( 'root', $config['AdminsGr'], $config['AllGr'], $config['StationPrefsGr'] ); $old_ip = get_include_path(); set_include_path('.'.PATH_SEPARATOR.$config['pearPath'].PATH_SEPARATOR.$old_ip); -?> + +if(!PHP5){ + eval(' + define("FILE_APPEND", TRUE); + function file_put_contents($f, $s, $ap=FALSE){ + $fp=fopen($f, $ap==FILE_APPEND ? "a" : "w"); + fwrite($fp,$s); + fclose($fp); + } +'); +} +?> \ No newline at end of file