diff options
author | diosmosis <benakamoorthi@fastmail.fm> | 2014-07-21 12:18:57 +0400 |
---|---|---|
committer | diosmosis <benakamoorthi@fastmail.fm> | 2014-07-21 12:24:05 +0400 |
commit | bb6526966b959194fa56418b06c58312a7b4a600 (patch) | |
tree | 9812c7c6fde3df88b71671ff243e92b9048e7c28 /misc | |
parent | d3131478d3ffe5eee0485fb6f05b4b9b594c94f1 (diff) |
Fixes #5807, refactor CronArchive class so it does not configure itself based on command line arguments. It now has properties that must be set. The core:archive command has been refactored to set these properties based on command line args.
Also includes:
- bug fix to CronArchive::initLog method (config was modified after log instance created which negated it's effect)
- misc/archive.php no longer uses Archive.php but executes the core:archive console command using Piwik\Console
- remove forcelogtoscreen parameter (no longer necessary due to initLog changes)
Diffstat (limited to 'misc')
-rw-r--r-- | misc/cron/archive.php | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/misc/cron/archive.php b/misc/cron/archive.php index 6bb0de5011..693bd8d948 100644 --- a/misc/cron/archive.php +++ b/misc/cron/archive.php @@ -42,9 +42,12 @@ See also: http://piwik.org/docs/setup-auto-archiving/ \n\n"; } -$archiving = new Piwik\CronArchive(); -try { - $archiving->main(); -} catch (Exception $e) { - $archiving->logFatalError($e->getMessage()); -} +$console = new Piwik\Console(); +$console->init(); + +// manipulate command line arguments so CoreArchiver command will be executed +$script = array_shift($_SERVER['argv']); +array_unshift($_SERVER['argv'], 'core:archive'); +array_unshift($_SERVER['argv'], $script); + +$console->run();
\ No newline at end of file |