MDL-23824 CLI script improvements - just define('CLI_SCRIPT', true) before require config.php; all incorrect uses of cli and web scripts are detected; refactored cron script - now in two separate sctipts; fix cli inline docs and help - we have to sudo to apache account; standardised cli script locations in auth plugins

This commit is contained in:
Petr Skoda
2010-08-17 12:33:30 +00:00
parent e890316899
commit 28bd3d9ad3
18 changed files with 911 additions and 724 deletions
+6 -3
View File
@@ -30,9 +30,11 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define('CLI_SCRIPT', true);
// extra execution prevention - we can not just require config.php here
if (isset($_SERVER['REMOTE_ADDR'])) {
error_log("admin/cli/install.php can not be called from web server!");
exit;
exit(1);
}
$help =
@@ -68,7 +70,8 @@ Options:
required in non-interactive mode.
-h, --help Print out this help
Example: \$sudo -u wwwrun /usr/bin/php admin/cli/install.php --lang=cs
Example:
\$sudo -u www-data /usr/bin/php admin/cli/install.php --lang=cs
"; //TODO: localize, mark as needed in install - to be translated later when everything is finished