cvs: doc-editor /php conf.inc.php /scripts/cron check_build.php update_data.php
| From: | Yannick Torres | Date: | Sun, 17 May 2009 16:18:42 +0000 |
| Subject: | cvs: doc-editor /php conf.inc.php /scripts/cron check_build.php update_data.php | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-4030@lists.php.net to get a copy of this message | ||
yannick Sun May 17 16:18:42 2009 UTC
Added files:
/doc-editor/scripts/cron update_data.php
Modified files:
/doc-editor/php conf.inc.php
/doc-editor/scripts/cron check_build.php
Log:
- Add new cron script witch update all data.
- Fix some file path too
http://cvs.php.net/viewvc.cgi/doc-editor/php/conf.inc.php?r1=1.4&r2=1.5&diff_format=u
Index: doc-editor/php/conf.inc.php
diff -u doc-editor/php/conf.inc.php:1.4 doc-editor/php/conf.inc.php:1.5
--- doc-editor/php/conf.inc.php:1.4 Sun Mar 29 18:10:16 2009
+++ doc-editor/php/conf.inc.php Sun May 17 16:18:42 2009
@@ -1,6 +1,14 @@
<?php
/**
+ * WWW user
+ */
+define('DOC_EDITOR_WWW_USER', 'www-data');
+/**
+ * WWW group
+ */
+define('DOC_EDITOR_WWW_GROUP', 'www-data');
+/**
* MySQL server
*/
define('DOC_EDITOR_SQL_HOST', 'localhost');
@@ -46,7 +54,7 @@
/**
* Data path
*/
-define('DOC_EDITOR_DATA_PATH', '../' . 'data/');
+define('DOC_EDITOR_DATA_PATH', dirname(__FILE__).'/../' . 'data/');
/**
* CVS checkout path
*/
http://cvs.php.net/viewvc.cgi/doc-editor/scripts/cron/check_build.php?r1=1.2&r2=1.3&diff_format=u
Index: doc-editor/scripts/cron/check_build.php
diff -u doc-editor/scripts/cron/check_build.php:1.2 doc-editor/scripts/cron/check_build.php:1.3
--- doc-editor/scripts/cron/check_build.php:1.2 Sat May 16 20:40:51 2009
+++ doc-editor/scripts/cron/check_build.php Sun May 17 16:18:42 2009
@@ -14,7 +14,7 @@
// For all language, we check the build
while (list(, $lang) = each($phpDoc->availableLanguage)) {
- $cmd = 'cd
'.dirname(__FILE__).'/../'.DOC_EDITOR_CVS_PATH.';/usr/bin/php configure.php
--with-lang='.$lang.' --disable-segfault-error';
+ $cmd = 'cd '.DOC_EDITOR_CVS_PATH.';/usr/bin/php configure.php
--with-lang='.$lang.' --disable-segfault-error';
$output = array();
exec($cmd, $output);
http://cvs.php.net/viewvc.cgi/doc-editor/scripts/cron/update_data.php?view=markup&rev=1.1
Index: doc-editor/scripts/cron/update_data.php
+++ doc-editor/scripts/cron/update_data.php
<?php
/***
* This script is intended to be placed in a cronjob.
* It must be run every day, at 00hOO for example.
* On Unix, you can use crontab -e and place this :
* 00 00 * * * /usr/bin/php /path/to/your/cvs/dir/doc-editor/scripts/cron/update_data.php
****/
require_once dirname(__FILE__) . '/../../php/class.php';
$phpDoc = new phpDoc();
// Cvs update
$phpDoc->updateRepository();
// After update the repo, we need to chmod all file to be able to save it again as www server user
$cmd = "cd ".DOC_EDITOR_CVS_PATH."; chmod -R 777 ./; chown -R
".DOC_EDITOR_WWW_USER.":".DOC_EDITOR_WWW_GROUP." ./";
exec($cmd);
// Clean Up DB
$phpDoc->cleanUp();
// Set the lock File
$lock = new LockFile('lock_apply_tools');
if ($lock->lock()) {
// Start Revcheck
$phpDoc->revDoRevCheck();
// Search for Old Files
$phpDoc->checkOldFiles();
// Parse translators
$phpDoc->revParseTranslation();
// Set lastUpdate date/time
$phpDoc->setLastUpdate();
}
$lock->release();
?>