Skip to content

Commit

Permalink
refs #4903 make archiving via web possible again, will provide a bett…
Browse files Browse the repository at this point in the history
…er solution later
  • Loading branch information
tsteur committed Mar 26, 2014
1 parent 39caffc commit 213b5c7
Showing 1 changed file with 31 additions and 1 deletion.
32 changes: 31 additions & 1 deletion misc/cron/archive.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,37 @@
* @package Piwik
*/

if (!defined('PIWIK_INCLUDE_PATH')) {
define('PIWIK_INCLUDE_PATH', realpath(dirname(__FILE__) . "/../.."));
}

if (!defined('PIWIK_USER_PATH')) {
define('PIWIK_USER_PATH', PIWIK_INCLUDE_PATH);
}

if (empty($_SERVER['argv'])) {

define('PIWIK_ENABLE_DISPATCH', false);
define('PIWIK_ENABLE_ERROR_HANDLER', false);
define('PIWIK_ENABLE_SESSION_START', false);

require_once PIWIK_INCLUDE_PATH . "/index.php";

$archiving = new Piwik\CronArchive();
try {
$archiving->init();
$archiving->run();
$archiving->runScheduledTasks();
$archiving->end();
} catch (Exception $e) {
$archiving->logFatalError($e->getMessage());
}

return;
}

$callee = array_shift($_SERVER['argv']);

$args = array($callee);
$args[] = 'core:archive';
foreach ($_SERVER['argv'] as $arg) {
Expand All @@ -24,7 +54,7 @@

$_SERVER['argv'] = $args;

$piwikHome = realpath(dirname(__FILE__) . "/../..");
$piwikHome = PIWIK_INCLUDE_PATH;

if (false !== strpos($callee, 'archive.php')) {
echo "
Expand Down

0 comments on commit 213b5c7

Please sign in to comment.