Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config/environment/cli.php29
-rw-r--r--core/Container/ContainerFactory.php16
-rw-r--r--piwik.php4
-rw-r--r--plugins/Monolog/config/config.php4
4 files changed, 18 insertions, 35 deletions
diff --git a/config/environment/cli.php b/config/environment/cli.php
deleted file mode 100644
index 0db3009ad4..0000000000
--- a/config/environment/cli.php
+++ /dev/null
@@ -1,29 +0,0 @@
-<?php
-
-use Interop\Container\ContainerInterface;
-use Monolog\Logger;
-use Symfony\Bridge\Monolog\Formatter\ConsoleFormatter;
-use Symfony\Bridge\Monolog\Handler\ConsoleHandler;
-use Symfony\Component\Console\Output\OutputInterface;
-
-return array(
-
- // Log
- 'log.handlers' => array(
- DI\get('Symfony\Bridge\Monolog\Handler\ConsoleHandler'),
- ),
- 'Symfony\Bridge\Monolog\Handler\ConsoleHandler' => function (ContainerInterface $c) {
- // Override the default verbosity map to make it more verbose by default
- $verbosityMap = array(
- OutputInterface::VERBOSITY_NORMAL => Logger::INFO,
- OutputInterface::VERBOSITY_VERBOSE => Logger::DEBUG,
- OutputInterface::VERBOSITY_VERY_VERBOSE => Logger::DEBUG,
- OutputInterface::VERBOSITY_DEBUG => Logger::DEBUG,
- );
- $handler = new ConsoleHandler(null, true, $verbosityMap);
- $handler->setFormatter(new ConsoleFormatter($c->get('log.console.format'), null, true, true));
- return $handler;
- },
- 'log.console.format' => '%start_tag%%level_name% %extra.class%[%datetime%]%end_tag% %message%' . PHP_EOL,
-
-);
diff --git a/core/Container/ContainerFactory.php b/core/Container/ContainerFactory.php
index af2a09b695..9abad4f5ce 100644
--- a/core/Container/ContainerFactory.php
+++ b/core/Container/ContainerFactory.php
@@ -90,7 +90,9 @@ class ContainerFactory
$file = sprintf('%s/config/environment/%s.php', PIWIK_USER_PATH, $this->environment);
- $builder->addDefinitions($file);
+ if (file_exists($file)) {
+ $builder->addDefinitions($file);
+ }
}
private function addPluginConfigs(ContainerBuilder $builder)
@@ -98,13 +100,17 @@ class ContainerFactory
$plugins = Manager::getInstance()->getActivatedPluginsFromConfig();
foreach ($plugins as $plugin) {
- $file = Manager::getPluginsDirectory() . $plugin . '/config/config.php';
+ $baseDir = Manager::getPluginsDirectory() . $plugin;
- if (! file_exists($file)) {
- continue;
+ $file = $baseDir . '/config/config.php';
+ if (file_exists($file)) {
+ $builder->addDefinitions($file);
}
- $builder->addDefinitions($file);
+ $environmentFile = $baseDir . '/config/' . $this->environment . '.php';
+ if (file_exists($environmentFile)) {
+ $builder->addDefinitions($environmentFile);
+ }
}
}
}
diff --git a/piwik.php b/piwik.php
index 95cc6271f1..dcca10e408 100644
--- a/piwik.php
+++ b/piwik.php
@@ -48,6 +48,10 @@ require_once PIWIK_INCLUDE_PATH . '/core/Tracker/Cache.php';
require_once PIWIK_INCLUDE_PATH . '/core/Tracker/Request.php';
require_once PIWIK_INCLUDE_PATH . '/core/Cookie.php';
+\Piwik\Container\StaticContainer::setEnvironment('tracker');
+
+\Piwik\Profiler::setupProfilerXHProf(true, true);
+
Tracker::loadTrackerEnvironment();
$tracker = new Tracker();
diff --git a/plugins/Monolog/config/config.php b/plugins/Monolog/config/config.php
index 3fd3fcf63a..22cf7debee 100644
--- a/plugins/Monolog/config/config.php
+++ b/plugins/Monolog/config/config.php
@@ -6,9 +6,11 @@ use Piwik\Log;
return array(
- 'Psr\Log\LoggerInterface' => DI\object('Monolog\Logger')
+ 'Monolog\Logger' => DI\object('Monolog\Logger')
->constructor('piwik', DI\get('log.handlers'), DI\get('log.processors')),
+ 'Psr\Log\LoggerInterface' => DI\get('Monolog\Logger'),
+
'log.handlers' => DI\factory(function (ContainerInterface $c) {
if ($c->has('ini.log.log_writers')) {
$writerNames = $c->get('ini.log.log_writers');