diff options
author | Stefan Giehl <stefan@matomo.org> | 2020-09-03 04:51:18 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-03 04:51:18 +0300 |
commit | 3565da78bff718f201247fc2f692c0be29220fde (patch) | |
tree | e8268373b284c293c307935a8bfa20d5cd920b48 /config | |
parent | 21cafb0533d07acbe0a574e23bd972b20d72aa90 (diff) |
Updates php-di to 6.2.1 (#16311)
Diffstat (limited to 'config')
-rw-r--r-- | config/environment/dev.php | 8 | ||||
-rw-r--r-- | config/environment/test.php | 18 | ||||
-rw-r--r-- | config/environment/ui-test.php | 8 | ||||
-rw-r--r-- | config/global.php | 22 |
4 files changed, 27 insertions, 29 deletions
diff --git a/config/environment/dev.php b/config/environment/dev.php index f0d1514d17..0b3109e9d1 100644 --- a/config/environment/dev.php +++ b/config/environment/dev.php @@ -2,11 +2,11 @@ return array( - 'Matomo\Cache\Backend' => DI\object('Matomo\Cache\Backend\ArrayCache'), + 'Matomo\Cache\Backend' => DI\autowire('Matomo\Cache\Backend\ArrayCache'), - 'Piwik\Translation\Loader\LoaderInterface' => DI\object('Piwik\Translation\Loader\LoaderCache') - ->constructor(DI\get('Piwik\Translation\Loader\DevelopmentLoader')), - 'Piwik\Translation\Loader\DevelopmentLoader' => DI\object() + 'Piwik\Translation\Loader\LoaderInterface' => DI\autowire('Piwik\Translation\Loader\LoaderCache') + ->constructorParameter('loader', DI\get('Piwik\Translation\Loader\DevelopmentLoader')), + 'Piwik\Translation\Loader\DevelopmentLoader' => DI\create() ->constructor(DI\get('Piwik\Translation\Loader\JsonFileLoader')), ); diff --git a/config/environment/test.php b/config/environment/test.php index 13c5c390cd..63af43d95b 100644 --- a/config/environment/test.php +++ b/config/environment/test.php @@ -1,6 +1,6 @@ <?php -use Interop\Container\ContainerInterface; +use Psr\Container\ContainerInterface; use Piwik\Common; use Piwik\Tests\Framework\Mock\FakeAccess; use Piwik\Tests\Framework\Mock\TestConfig; @@ -98,29 +98,29 @@ return array( 'observers.global' => DI\add(array( - array('AssetManager.getStylesheetFiles', function (&$stylesheets) { + array('AssetManager.getStylesheetFiles', DI\value(function (&$stylesheets) { $useOverrideCss = \Piwik\Container\StaticContainer::get('test.vars.useOverrideCss'); if ($useOverrideCss) { $stylesheets[] = 'tests/resources/screenshot-override/override.css'; } - }), + })), - array('AssetManager.getJavaScriptFiles', function (&$jsFiles) { + array('AssetManager.getJavaScriptFiles', DI\value(function (&$jsFiles) { $useOverrideJs = \Piwik\Container\StaticContainer::get('test.vars.useOverrideJs'); if ($useOverrideJs) { $jsFiles[] = 'tests/resources/screenshot-override/override.js'; } - }), + })), - array('Updater.checkForUpdates', function () { + array('Updater.checkForUpdates', \DI\value(function () { try { @\Piwik\Filesystem::deleteAllCacheOnUpdate(); } catch (Exception $ex) { // pass } - }), + })), - array('Test.Mail.send', function (\PHPMailer\PHPMailer\PHPMailer $mail) { + array('Test.Mail.send', \DI\value(function (\PHPMailer\PHPMailer\PHPMailer $mail) { $outputFile = PIWIK_INCLUDE_PATH . '/tmp/' . Common::getRequestVar('module', '') . '.' . Common::getRequestVar('action', '') . '.mail.json'; $outputContent = str_replace("=\n", "", $mail->Body ?: $mail->AltBody); $outputContent = str_replace("=0A", "\n", $outputContent); @@ -132,6 +132,6 @@ return array( 'contents' => $outputContent ); file_put_contents($outputFile, json_encode($outputContents)); - }), + })), )), ); diff --git a/config/environment/ui-test.php b/config/environment/ui-test.php index 8b46ede218..aae19a5bb6 100644 --- a/config/environment/ui-test.php +++ b/config/environment/ui-test.php @@ -21,7 +21,7 @@ return array( // removes port from all URLs to the test Piwik server so UI tests will pass no matter // what port is used - array('Request.dispatch.end', function (&$result) { + array('Request.dispatch.end', DI\value(function (&$result) { $request = $_GET + $_POST; $apiblacklist = StaticContainer::get('tests.ui.url_normalizer_blacklist.api'); @@ -50,11 +50,11 @@ return array( // remove PIWIK_INCLUDE_PATH from result so tests don't change based on the machine used $result = str_replace(realpath(PIWIK_INCLUDE_PATH), '', $result); - }), + })), - array('Controller.RssWidget.rssPiwik.end', function (&$result, $parameters) { + array('Controller.RssWidget.rssPiwik.end', DI\value(function (&$result, $parameters) { $result = ""; - }), + })), \Piwik\Tests\Framework\XssTesting::getJavaScriptAddEvent(), ]), diff --git a/config/global.php b/config/global.php index 9b199520dc..bd51022f7f 100644 --- a/config/global.php +++ b/config/global.php @@ -1,10 +1,8 @@ <?php -use Interop\Container\ContainerInterface; -use Interop\Container\Exception\NotFoundException; +use Psr\Container\ContainerInterface; use Matomo\Cache\Eager; use Piwik\SettingsServer; -use Piwik\Config; return array( @@ -61,7 +59,7 @@ return array( } else { try { $backend = $c->get('ini.Cache.backend'); - } catch (NotFoundException $ex) { + } catch (\DI\NotFoundException $ex) { $backend = 'chained'; // happens if global.ini.php is not available } } @@ -74,12 +72,12 @@ return array( 'entities.idNames' => DI\add(array('idGoal', 'idDimension')), - 'Psr\Log\LoggerInterface' => DI\object('Psr\Log\NullLogger'), + 'Psr\Log\LoggerInterface' => DI\create('Psr\Log\NullLogger'), - 'Piwik\Translation\Loader\LoaderInterface' => DI\object('Piwik\Translation\Loader\LoaderCache') - ->constructor(DI\get('Piwik\Translation\Loader\JsonFileLoader')), + 'Piwik\Translation\Loader\LoaderInterface' => DI\autowire('Piwik\Translation\Loader\LoaderCache') + ->constructorParameter('loader', DI\get('Piwik\Translation\Loader\JsonFileLoader')), - 'DeviceDetector\Cache\Cache' => DI\object('Piwik\DeviceDetector\DeviceDetectorCache')->constructor(86400), + 'DeviceDetector\Cache\Cache' => DI\autowire('Piwik\DeviceDetector\DeviceDetectorCache')->constructor(86400), 'observers.global' => array(), @@ -146,7 +144,7 @@ return array( '*.travis.yml', )), - 'Piwik\EventDispatcher' => DI\object()->constructorParameter('observers', DI\get('observers.global')), + 'Piwik\EventDispatcher' => DI\autowire()->constructorParameter('observers', DI\get('observers.global')), 'login.whitelist.ips' => function (ContainerInterface $c) { /** @var Piwik\Config\ $config */ @@ -174,17 +172,17 @@ return array( return $ipsResolved; }, - 'Piwik\Tracker\VisitorRecognizer' => DI\object() + 'Piwik\Tracker\VisitorRecognizer' => DI\autowire() ->constructorParameter('trustCookiesOnly', DI\get('ini.Tracker.trust_visitors_cookies')) ->constructorParameter('visitStandardLength', DI\get('ini.Tracker.visit_standard_length')) ->constructorParameter('lookbackNSecondsCustom', DI\get('ini.Tracker.window_look_back_for_visitor')), - 'Piwik\Tracker\Settings' => DI\object() + 'Piwik\Tracker\Settings' => DI\autowire() ->constructorParameter('isSameFingerprintsAcrossWebsites', DI\get('ini.Tracker.enable_fingerprinting_across_websites')), 'archiving.performance.logger' => null, - \Piwik\CronArchive\Performance\Logger::class => DI\object()->constructorParameter('logger', DI\get('archiving.performance.logger')), + \Piwik\CronArchive\Performance\Logger::class => DI\autowire()->constructorParameter('logger', DI\get('archiving.performance.logger')), \Piwik\Concurrency\LockBackend::class => \DI\get(\Piwik\Concurrency\LockBackend\MySqlLockBackend::class), |