Skip to content

Commit 3565da7

Browse files
authored
Updates php-di to 6.2.1 (matomo-org#16311)
1 parent 21cafb0 commit 3565da7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+554
-200
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,10 @@ These are only recommendations (because we will keep backward compatibility for
143143
* The following dimensions have been removed and replaced with versions that measure seconds: visitor_days_since_first, visitor_days_since_last, visitor_days_since_order
144144
* The _idvc, _idts, _viewts and _ects tracker parameters are no longer used, the values are calculated server side.
145145
Note: tracking these values server side means replaying log data in the past will result in inaccurate values for these dimensions.
146+
* The Dependency Injection library PHP-DI was updated. [Some definitions need to be updated]((https://php-di.org/doc/migration/6.0.html)):
147+
* The Method `\DI\object()` has been removed. You can use `\DI\autowire()` or `\DI\create()` instead.
148+
* The Method `\DI\link()` has been removed. Use `\DI\get()` instead.
149+
* Defining global observer functions in config now requires the functions to be wrapped in `\DI\value()`, unless they are a factory.
146150

147151
## Matomo 3.14.0
148152

DIObject.php

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
3+
namespace DI;
4+
5+
/**
6+
* This file aims to circumvent problems when updating to Matomo 4.
7+
* Matomo 4 includes a newer version of PHP-DI, which does not include \DI\object() any longer
8+
* To not run into any problems with plugins still using that we forward this method to \DI\autowire
9+
*/
10+
11+
if (!function_exists("\DI\object")) {
12+
13+
function object()
14+
{
15+
return call_user_func_array("\DI\autowire", func_get_args());
16+
}
17+
18+
}
19+
20+
if (!function_exists("\DI\link")) {
21+
22+
function link()
23+
{
24+
return call_user_func_array("\DI\get", func_get_args());
25+
}
26+
27+
}

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"monolog/monolog": "~1.11",
4343
"mustangostang/spyc": "~0.6.0",
4444
"pear/pear_exception": "~1.0.0",
45-
"php-di/php-di": "^5.0.0",
45+
"php-di/php-di": "^6.0.0",
4646
"phpmailer/phpmailer": "^6.1",
4747
"piwik/device-detector": "~3.0",
4848
"psr/log": "~1.0",

0 commit comments

Comments
 (0)