update Piwik to version 2.16 (fixes #91)
This commit is contained in:
parent
296343bf3b
commit
d885a4baa9
5833 changed files with 418860 additions and 226988 deletions
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
/**
|
||||
* Piwik - Open source web analytics
|
||||
* Piwik - free/libre analytics platform
|
||||
*
|
||||
* @link http://piwik.org
|
||||
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
|
||||
|
|
@ -17,12 +17,10 @@ if (!defined('PIWIK_USER_PATH')) {
|
|||
define('PIWIK_USER_PATH', PIWIK_INCLUDE_PATH);
|
||||
}
|
||||
|
||||
if (!class_exists('Piwik\Console', false)) {
|
||||
define('PIWIK_ENABLE_DISPATCH', false);
|
||||
define('PIWIK_ENABLE_ERROR_HANDLER', false);
|
||||
define('PIWIK_ENABLE_SESSION_START', false);
|
||||
require_once PIWIK_INCLUDE_PATH . "/index.php";
|
||||
}
|
||||
define('PIWIK_ENABLE_ERROR_HANDLER', false);
|
||||
define('PIWIK_ENABLE_SESSION_START', false);
|
||||
|
||||
require_once PIWIK_INCLUDE_PATH . '/core/Common.php';
|
||||
|
||||
if (!empty($_SERVER['argv'][0])) {
|
||||
$callee = $_SERVER['argv'][0];
|
||||
|
|
@ -35,17 +33,43 @@ if (false !== strpos($callee, 'archive.php')) {
|
|||
echo "
|
||||
-------------------------------------------------------
|
||||
Using this 'archive.php' script is no longer recommended.
|
||||
Please use '/path/to/php $piwikHome/console core:archive " . implode(' ', array_slice($_SERVER['argv'], 1)) . "' instead.
|
||||
Please use '/path/to/php $piwikHome/console core:archive " . implode('', array_slice($_SERVER['argv'], 1)) . "' instead.
|
||||
To get help use '/path/to/php $piwikHome/console core:archive --help'
|
||||
See also: http://piwik.org/docs/setup-auto-archiving/
|
||||
|
||||
If you cannot use the console because it requires CLI
|
||||
try 'php archive.php --url=http://your.piwik/path'
|
||||
-------------------------------------------------------
|
||||
\n\n";
|
||||
}
|
||||
|
||||
$archiving = new Piwik\CronArchive();
|
||||
try {
|
||||
$archiving->main();
|
||||
} catch (Piwik\CronArchiveFatalException $ex) {
|
||||
$ex->logAndExit($archiving);
|
||||
} catch (Exception $e) {
|
||||
$archiving->logFatalExceptionAndExit($e);
|
||||
}
|
||||
|
||||
if (Piwik\Common::isPhpCliMode()) {
|
||||
require_once PIWIK_INCLUDE_PATH . "/core/bootstrap.php";
|
||||
|
||||
$console = new Piwik\Console();
|
||||
|
||||
// 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();
|
||||
} 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 "
|
||||
<b>You must specify the Super User token_auth as a parameter to this script, eg. <code>?token_auth=XYZ</code> if you wish to run this script through the browser. </b><br>
|
||||
However it is recommended to run it <a href='http://piwik.org/docs/setup-auto-archiving/'>via cron in the command line</a>, since it can take a long time to run.<br/>
|
||||
In a shell, execute for example the following to trigger archiving on the local Piwik server:<br/>
|
||||
<code>$ /path/to/php /path/to/piwik/console core:archive --url=http://your-website.org/path/to/piwik/</code>
|
||||
\n\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once PIWIK_INCLUDE_PATH . "/index.php";
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue