diff options
author | diosmosis <benaka@piwik.pro> | 2015-04-19 14:20:22 +0300 |
---|---|---|
committer | diosmosis <benaka@piwik.pro> | 2015-05-10 08:44:11 +0300 |
commit | 396d9bc111921d8d3a5e358d86e7c3219f1843f2 (patch) | |
tree | 8990ecc60caaeaa81e250a57c95e259e3eabcdc0 /misc | |
parent | ff8fa3f3ffdfdc12e0bbf4aaec4a86843dc97d24 (diff) |
Move logging hack from archive.php to CoreAdminHome.runCronArchiving method.
Diffstat (limited to 'misc')
-rw-r--r-- | misc/cron/archive.php | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/misc/cron/archive.php b/misc/cron/archive.php index b2528ecf04..6f903cdd91 100644 --- a/misc/cron/archive.php +++ b/misc/cron/archive.php @@ -9,16 +9,6 @@ * @package Piwik */ -// TODO: this file should be moved to an API method that is only accessible to the super user. -// then we can finally deprecate this file. - -use Monolog\Handler\StreamHandler; -use Monolog\Logger; -use Piwik\Container\StaticContainer; -use Symfony\Bridge\Monolog\Handler\ConsoleHandler; -use Symfony\Component\Console\Output\ConsoleOutput; -use Symfony\Component\Console\Output\OutputInterface; - if (!defined('PIWIK_INCLUDE_PATH')) { define('PIWIK_INCLUDE_PATH', realpath(dirname(__FILE__) . "/../..")); } @@ -63,15 +53,7 @@ if (Piwik\Common::isPhpCliMode()) { array_unshift($_SERVER['argv'], $script); $console->run(); -} else { // if running via web request, use CronArchive directly - - // HTTP request: logs needs to be dumped in the HTTP response (on top of existing log destinations) - /** @var \Monolog\Logger $logger */ - $logger = StaticContainer::get('Psr\Log\LoggerInterface'); - $handler = new StreamHandler('php://output', Logger::INFO); - $handler->setFormatter(StaticContainer::get('Piwik\Plugins\Monolog\Formatter\LineMessageFormatter')); - $logger->pushHandler($handler); - +} else { // if running via web request, use CoreAdminHome.runCronArchiving method $_GET['module'] = 'API'; $_GET['method'] = 'CoreAdminHome.runCronArchiving'; |