run();
} else { // if running via web request, use CoreAdminHome.runCronArchiving method
Piwik\Common::sendHeader('Content-type: text/plain');
$_GET['module'] = 'API';
$_GET['method'] = 'CoreAdminHome.runCronArchiving';
$_GET['format'] = 'console'; // will use Content-type text/plain
if(!isset($_GET['token_auth'])) {
echo "
You must specify the Super User token_auth as a parameter to this script, eg. ?token_auth=XYZ
if you wish to run this script through the browser.
However it is recommended to run it via cron in the command line, since it can take a long time to run.
In a shell, execute for example the following to trigger archiving on the local Piwik server:
$ /path/to/php /path/to/piwik/console core:archive --url=http://your-website.org/path/to/piwik/
\n\n";
exit;
}
require_once PIWIK_INCLUDE_PATH . "/index.php";
}