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--LegacyAutoloader.php26
-rw-r--r--composer.json15
-rw-r--r--composer.lock394
-rw-r--r--config/environment/dev.php2
-rw-r--r--config/environment/test.php2
-rw-r--r--config/global.php8
-rw-r--r--core/Archive.php2
-rw-r--r--core/Cache.php16
-rw-r--r--core/Common.php3
-rw-r--r--core/Config/Cache.php2
-rw-r--r--core/Config/IniFileChain.php6
-rw-r--r--core/CronArchive/SegmentArchivingRequestUrlProvider.php4
-rw-r--r--core/IP.php10
-rw-r--r--core/Metrics.php2
-rw-r--r--core/Plugin.php2
-rw-r--r--core/Tracker/Cache.php4
-rw-r--r--core/Tracker/Request.php4
-rw-r--r--core/Tracker/TableLogAction/Cache.php4
-rw-r--r--core/Tracker/Visit.php2
-rw-r--r--core/Tracker/VisitExcluded.php2
-rw-r--r--core/Translation/Loader/LoaderCache.php6
-rw-r--r--core/Unzip.php10
-rw-r--r--core/Url.php6
-rw-r--r--core/Validators/IpRanges.php2
-rw-r--r--libs/PiwikTracker/PiwikTracker.php2
-rw-r--r--misc/others/ExampleMatomoTracker.php17
-rw-r--r--misc/others/ExamplePiwikTracker.php17
-rw-r--r--misc/others/tracker_simpleImageTracker.php8
m---------plugins/AnonymousPiwikUsageMeasurement0
m---------plugins/Bandwidth0
-rw-r--r--plugins/BulkTracking/tests/System/TrackerTest.php2
-rw-r--r--plugins/Contents/tests/Fixtures/TwoVisitsWithContents.php6
-rw-r--r--plugins/CoreConsole/Commands/DevelopmentSyncProcessedSystemTests.php2
-rw-r--r--plugins/CoreHome/Columns/VisitIp.php4
-rw-r--r--plugins/CoreHome/LoginWhitelist.php2
-rw-r--r--plugins/CoreHome/tests/Integration/Column/UserIdTest.php2
-rw-r--r--plugins/CustomVariables/Archiver.php6
-rw-r--r--plugins/Diagnostics/ConfigReader.php2
-rw-r--r--plugins/Diagnostics/tests/Integration/ConfigReaderTest.php2
-rw-r--r--plugins/GeoIp2/LocationProvider/GeoIp2.php2
-rw-r--r--plugins/IntranetMeasurable/tests/Fixtures/IntranetSitesWithVisits.php2
-rw-r--r--plugins/Live/VisitorDetails.php2
-rw-r--r--plugins/Live/tests/Fixtures/VisitsWithAllActionsAndDevices.php8
-rw-r--r--plugins/Login/SystemSettings.php2
m---------plugins/MarketingCampaignsReporting0
-rw-r--r--plugins/Marketplace/Api/Client.php6
-rw-r--r--plugins/Marketplace/Plugins/InvalidLicenses.php6
-rw-r--r--plugins/Marketplace/tests/Framework/Mock/Client.php4
-rw-r--r--plugins/Marketplace/tests/Integration/Plugins/InvalidLicensesTest.php4
-rw-r--r--plugins/Monolog/tests/System/TrackerLoggingTest.php6
-rw-r--r--plugins/PrivacyManager/Dao/LogDataAnonymizer.php2
-rw-r--r--plugins/PrivacyManager/IPAnonymizer.php2
-rw-r--r--plugins/PrivacyManager/tests/Fixtures/MultipleSitesMultipleVisitsFixture.php2
-rw-r--r--plugins/PrivacyManager/tests/Unit/AnonymizeIPTest.php2
-rw-r--r--plugins/Provider/Columns/Provider.php4
-rw-r--r--plugins/RssWidget/RssRenderer.php4
-rw-r--r--plugins/SEO/Metric/ProviderCache.php3
-rw-r--r--plugins/SegmentEditor/Services/StoredSegmentService.php2
-rw-r--r--plugins/SitesManager/API.php2
-rw-r--r--plugins/SitesManager/Controller.php2
-rw-r--r--plugins/TestRunner/Commands/TestsSetupFixture.php2
-rw-r--r--plugins/UserCountry/Columns/Base.php2
-rw-r--r--plugins/UserCountry/Columns/Country.php2
-rw-r--r--plugins/UserCountry/LocationProvider.php4
-rw-r--r--plugins/UserCountry/VisitorGeolocator.php6
-rw-r--r--plugins/UserCountry/tests/Integration/VisitorGeolocatorTest.php2
m---------plugins/VisitorGenerator0
-rw-r--r--plugins/VisitsSummary/tests/Integration/VisitsSummaryTest.php2
-rw-r--r--plugins/WebsiteMeasurable/MeasurableSettings.php2
-rw-r--r--tests/LocalTracker.php4
-rw-r--r--tests/PHPUnit/Fixtures/FewVisitsWithSetVisitorId.php7
-rw-r--r--tests/PHPUnit/Fixtures/ManyVisitsWithGeoIP.php4
-rw-r--r--tests/PHPUnit/Fixtures/ManyVisitsWithGeoIPAndEcommerce.php4
-rw-r--r--tests/PHPUnit/Fixtures/ManyVisitsWithMockLocationProvider.php4
-rw-r--r--tests/PHPUnit/Fixtures/OneVisitorTwoVisits.php2
-rw-r--r--tests/PHPUnit/Fixtures/SomeVisitsCustomVariablesCampaignsNotHeuristics.php6
-rw-r--r--tests/PHPUnit/Fixtures/SomeVisitsManyPageviewsWithTransitions.php4
-rw-r--r--tests/PHPUnit/Fixtures/ThreeVisitsWithCustomEvents.php16
-rw-r--r--tests/PHPUnit/Fixtures/TwoSitesTwoVisitorsDifferentDays.php2
-rw-r--r--tests/PHPUnit/Framework/Fixture.php21
-rw-r--r--tests/PHPUnit/Framework/TestCase/BenchmarkTestCase.php2
-rw-r--r--tests/PHPUnit/Framework/TestCase/SystemTestCase.php2
-rw-r--r--tests/PHPUnit/Framework/TestDataHelper/LogHelper.php2
-rw-r--r--tests/PHPUnit/Framework/TestingEnvironmentManipulator.php2
-rw-r--r--tests/PHPUnit/Integration/AccessTest.php2
-rw-r--r--tests/PHPUnit/Integration/CacheTest.php2
-rw-r--r--tests/PHPUnit/Integration/ReleaseCheckListTest.php2
-rw-r--r--tests/PHPUnit/Integration/SegmentTest.php12
-rw-r--r--tests/PHPUnit/Integration/Tracker/PingRequestTest.php2
-rw-r--r--tests/PHPUnit/Integration/Tracker/RequestTest.php2
-rw-r--r--tests/PHPUnit/Integration/Tracker/VisitTest.php2
-rw-r--r--tests/PHPUnit/System/TrackerResponseTest.php2
-rw-r--r--tests/PHPUnit/Unit/CacheTest.php6
-rw-r--r--tests/PHPUnit/Unit/LegacyAutoLoaderTest.php57
-rw-r--r--tests/PHPUnit/Unit/Tracker/RequestTest.php2
-rw-r--r--tests/PHPUnit/Unit/Translation/Loader/LoaderCacheTest.php8
-rw-r--r--tests/PHPUnit/bootstrap.php2
-rw-r--r--tests/resources/MatomoDummyClass.php7
98 files changed, 485 insertions, 400 deletions
diff --git a/LegacyAutoloader.php b/LegacyAutoloader.php
new file mode 100644
index 0000000000..511cf8ce29
--- /dev/null
+++ b/LegacyAutoloader.php
@@ -0,0 +1,26 @@
+<?php
+
+class LegacyAutoloader
+{
+ public function __construct()
+ {
+ spl_autoload_register(array($this, 'load_class'));
+ }
+
+ public static function register()
+ {
+ new LegacyAutoloader();
+ }
+
+ public function load_class($className)
+ {
+ if (strpos($className, 'Piwik\\') === 0) {
+ $newName = 'Matomo' . substr($className, 5);
+ if (class_exists($newName)) {
+ class_alias($newName, $className);
+ }
+ }
+ }
+}
+
+LegacyAutoloader::register(); \ No newline at end of file
diff --git a/composer.json b/composer.json
index 2c4cfbe76d..78f8362fc8 100644
--- a/composer.json
+++ b/composer.json
@@ -31,10 +31,9 @@
"symfony/console": "~2.6.0",
"mustangostang/spyc": "~0.6.0",
"piwik/device-detector": "~3.0",
- "piwik/decompress": "~1.0",
- "piwik/network": "~0",
- "piwik/cache": "~1.0.0",
- "piwik/ini": "^1.0.8",
+ "matomo/decompress": "~2.0",
+ "matomo/cache": "~2.0",
+ "matomo/ini": "~2.0",
"php-di/php-di": "^5.0.0",
"psr/log": "~1.0",
"monolog/monolog": "~1.11",
@@ -44,12 +43,13 @@
"matomo/referrer-spam-blacklist": "~1.0",
"matomo/searchengine-and-social-list": "~1.0",
"tecnickcom/tcpdf": "~6.0",
- "piwik/piwik-php-tracker": "^1.0.0",
"composer/semver": "~1.3.0",
"szymach/c-pchart": "^2.0",
"geoip2/geoip2": "^2.8",
"davaxi/sparkline": "dev-multiple-series",
- "matomo-org/jshrink": "1.3.1"
+ "matomo-org/jshrink": "1.3.1",
+ "matomo/network": "~2.0",
+ "matomo/matomo-php-tracker": "~2.0"
},
"require-dev": {
"aws/aws-sdk-php": "2.7.1",
@@ -148,7 +148,8 @@
"HTML_": "libs/",
"PEAR_": "libs/",
"Archive_": "libs/"
- }
+ },
+ "files": ["LegacyAutoloader.php"]
},
"autoload-dev": {
"psr-4": {
diff --git a/composer.lock b/composer.lock
index 5449d8e122..a9ac37a510 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "3d99d35ca04c2630aa60587ece9195de",
+ "content-hash": "67420faa2591c5239b3769fa93239f84",
"packages": [
{
"name": "composer/ca-bundle",
@@ -400,6 +400,202 @@
]
},
{
+ "name": "matomo/cache",
+ "version": "2.0.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/matomo-org/component-cache.git",
+ "reference": "01e82b9dc0f2f8b0ee070212b0e9e91045f60926"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/matomo-org/component-cache/zipball/01e82b9dc0f2f8b0ee070212b0e9e91045f60926",
+ "reference": "01e82b9dc0f2f8b0ee070212b0e9e91045f60926",
+ "shasum": ""
+ },
+ "require": {
+ "doctrine/cache": "~1.4",
+ "php": ">=5.5.9"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "~5.7"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "Matomo\\Cache\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "LGPL-3.0"
+ ],
+ "authors": [
+ {
+ "name": "The Matomo Team",
+ "email": "hello@matomo.org",
+ "homepage": "https://matomo.org/the-matomo-team/"
+ }
+ ],
+ "description": "PHP caching library based on Doctrine cache",
+ "keywords": [
+ "array",
+ "cache",
+ "file",
+ "redis"
+ ],
+ "time": "2019-07-14T20:55:17+00:00"
+ },
+ {
+ "name": "matomo/decompress",
+ "version": "2.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/matomo-org/component-decompress.git",
+ "reference": "1220757676c8d5cc8faa9d1cb0a48bf0b1fedc9c"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/matomo-org/component-decompress/zipball/1220757676c8d5cc8faa9d1cb0a48bf0b1fedc9c",
+ "reference": "1220757676c8d5cc8faa9d1cb0a48bf0b1fedc9c",
+ "shasum": ""
+ },
+ "require": {
+ "pear/archive_tar": "~1.3,>=1.3.15",
+ "php": ">=5.3.2"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "4.4"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "Matomo\\Decompress\\": "src/"
+ },
+ "classmap": [
+ "libs/PclZip"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "LGPL-3.0"
+ ],
+ "time": "2018-02-09T12:19:44+00:00"
+ },
+ {
+ "name": "matomo/ini",
+ "version": "2.0.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/matomo-org/component-ini.git",
+ "reference": "4cf2d9d73f884a1ce0d9a8c8a119d56f44771c80"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/matomo-org/component-ini/zipball/4cf2d9d73f884a1ce0d9a8c8a119d56f44771c80",
+ "reference": "4cf2d9d73f884a1ce0d9a8c8a119d56f44771c80",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3"
+ },
+ "require-dev": {
+ "athletic/athletic": "0.1.*",
+ "phpunit/phpunit": "~4.0"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "Matomo\\Ini\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "LGPL-3.0"
+ ],
+ "time": "2019-07-03T07:42:01+00:00"
+ },
+ {
+ "name": "matomo/matomo-php-tracker",
+ "version": "2.0.3",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/matomo-org/matomo-php-tracker.git",
+ "reference": "d8a30200b0bd144f38282df9a8cb5da194da9296"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/matomo-org/matomo-php-tracker/zipball/d8a30200b0bd144f38282df9a8cb5da194da9296",
+ "reference": "d8a30200b0bd144f38282df9a8cb5da194da9296",
+ "shasum": ""
+ },
+ "require": {
+ "ext-json": "*",
+ "php": ">=5.3"
+ },
+ "suggest": {
+ "ext-curl": "Using this extension to issue the HTTPS request to Matomo"
+ },
+ "type": "library",
+ "autoload": {
+ "classmap": [
+ "."
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-2-Clause"
+ ],
+ "authors": [
+ {
+ "name": "The Matomo Team",
+ "email": "hello@matomo.org",
+ "homepage": "https://matomo.org/team/"
+ }
+ ],
+ "description": "PHP Client for Matomo Analytics Tracking API",
+ "homepage": "https://matomo.org",
+ "keywords": [
+ "analytics",
+ "matomo",
+ "piwik",
+ "tracker"
+ ],
+ "time": "2020-01-14T19:33:53+00:00"
+ },
+ {
+ "name": "matomo/network",
+ "version": "2.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/matomo-org/component-network.git",
+ "reference": "010e49629115e7227bec08c39639e0efeb048905"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/matomo-org/component-network/zipball/010e49629115e7227bec08c39639e0efeb048905",
+ "reference": "010e49629115e7227bec08c39639e0efeb048905",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.4"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^4.8.36"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "Matomo\\Network\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "LGPL-3.0"
+ ],
+ "time": "2020-01-01T12:57:48+00:00"
+ },
+ {
"name": "matomo/referrer-spam-blacklist",
"version": "1.1.2",
"source": {
@@ -1035,91 +1231,6 @@
"time": "2019-09-26T11:24:58+00:00"
},
{
- "name": "piwik/cache",
- "version": "1.0.3",
- "source": {
- "type": "git",
- "url": "https://github.com/matomo-org/component-cache.git",
- "reference": "b000c45ce257b6949e2de4df7c094046986d85bc"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/matomo-org/component-cache/zipball/b000c45ce257b6949e2de4df7c094046986d85bc",
- "reference": "b000c45ce257b6949e2de4df7c094046986d85bc",
- "shasum": ""
- },
- "require": {
- "doctrine/cache": "~1.4",
- "php": ">=5.5.9"
- },
- "require-dev": {
- "phpunit/phpunit": "~4.0"
- },
- "type": "library",
- "autoload": {
- "psr-4": {
- "Piwik\\Cache\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "LGPL-3.0"
- ],
- "authors": [
- {
- "name": "The Piwik Team",
- "email": "hello@piwik.org",
- "homepage": "http://piwik.org/the-piwik-team/"
- }
- ],
- "description": "PHP caching library based on Doctrine cache",
- "keywords": [
- "array",
- "cache",
- "file",
- "redis"
- ],
- "abandoned": "matomo/cache",
- "time": "2019-07-14T20:55:33+00:00"
- },
- {
- "name": "piwik/decompress",
- "version": "1.2.2",
- "source": {
- "type": "git",
- "url": "https://github.com/matomo-org/component-decompress.git",
- "reference": "15088059c38378939db8a3490b67b569797a6a3a"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/matomo-org/component-decompress/zipball/15088059c38378939db8a3490b67b569797a6a3a",
- "reference": "15088059c38378939db8a3490b67b569797a6a3a",
- "shasum": ""
- },
- "require": {
- "pear/archive_tar": "~1.3,>=1.3.15",
- "php": ">=5.3.2"
- },
- "require-dev": {
- "phpunit/phpunit": "4.4"
- },
- "type": "library",
- "autoload": {
- "psr-4": {
- "Piwik\\Decompress\\": "src/"
- },
- "classmap": [
- "libs/PclZip"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "LGPL-3.0"
- ],
- "abandoned": "matomo/decompress",
- "time": "2017-07-14T10:45:10+00:00"
- },
- {
"name": "piwik/device-detector",
"version": "3.12.2",
"source": {
@@ -1175,112 +1286,6 @@
"time": "2019-12-22T21:23:31+00:00"
},
{
- "name": "piwik/ini",
- "version": "1.0.8",
- "source": {
- "type": "git",
- "url": "https://github.com/matomo-org/component-ini.git",
- "reference": "663d4fdedd8f344407fd1599e623f41912fe2ebd"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/matomo-org/component-ini/zipball/663d4fdedd8f344407fd1599e623f41912fe2ebd",
- "reference": "663d4fdedd8f344407fd1599e623f41912fe2ebd",
- "shasum": ""
- },
- "require": {
- "php": ">=5.3.3"
- },
- "require-dev": {
- "athletic/athletic": "0.1.*",
- "phpunit/phpunit": "~4.0"
- },
- "type": "library",
- "autoload": {
- "psr-4": {
- "Piwik\\Ini\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "LGPL-3.0"
- ],
- "abandoned": "matomo/ini",
- "time": "2019-12-21T20:06:47+00:00"
- },
- {
- "name": "piwik/network",
- "version": "0.2.1",
- "source": {
- "type": "git",
- "url": "https://github.com/matomo-org/component-network.git",
- "reference": "fb847317b79fe41d52f5eb5fd92f197df4538b7d"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/matomo-org/component-network/zipball/fb847317b79fe41d52f5eb5fd92f197df4538b7d",
- "reference": "fb847317b79fe41d52f5eb5fd92f197df4538b7d",
- "shasum": ""
- },
- "require": {
- "php": ">=5.4"
- },
- "require-dev": {
- "phpunit/phpunit": "^4.8.36"
- },
- "type": "library",
- "autoload": {
- "psr-4": {
- "Piwik\\Network\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "LGPL-3.0"
- ],
- "time": "2019-11-06T19:13:42+00:00"
- },
- {
- "name": "piwik/piwik-php-tracker",
- "version": "1.5.2",
- "source": {
- "type": "git",
- "url": "https://github.com/matomo-org/matomo-php-tracker.git",
- "reference": "314e6d00039cb9d99837c81cdf4cbcd19f5683e0"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/matomo-org/matomo-php-tracker/zipball/314e6d00039cb9d99837c81cdf4cbcd19f5683e0",
- "reference": "314e6d00039cb9d99837c81cdf4cbcd19f5683e0",
- "shasum": ""
- },
- "type": "library",
- "autoload": {
- "classmap": [
- "."
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-2-Clause"
- ],
- "authors": [
- {
- "name": "The Piwik Team",
- "email": "hello@piwik.org",
- "homepage": "http://piwik.org/the-piwik-team/"
- }
- ],
- "description": "PHP Client for Piwik Analytics Tracking API",
- "homepage": "http://piwik.org",
- "keywords": [
- "analytics",
- "piwik",
- "tracker"
- ],
- "time": "2019-12-23T21:48:04+00:00"
- },
- {
"name": "psr/container",
"version": "1.0.0",
"source": {
@@ -2731,7 +2736,6 @@
"mock",
"xunit"
],
- "abandoned": true,
"time": "2015-10-02T06:51:40+00:00"
},
{
@@ -3277,10 +3281,10 @@
"prefer-stable": false,
"prefer-lowest": false,
"platform": {
- "php": ">=5.5.9"
+ "php": ">=7.2.0"
},
"platform-dev": [],
"platform-overrides": {
- "php": "5.5.9"
+ "php": "7.2.0"
}
}
diff --git a/config/environment/dev.php b/config/environment/dev.php
index a8bedecca9..f0d1514d17 100644
--- a/config/environment/dev.php
+++ b/config/environment/dev.php
@@ -2,7 +2,7 @@
return array(
- 'Piwik\Cache\Backend' => DI\object('Piwik\Cache\Backend\ArrayCache'),
+ 'Matomo\Cache\Backend' => DI\object('Matomo\Cache\Backend\ArrayCache'),
'Piwik\Translation\Loader\LoaderInterface' => DI\object('Piwik\Translation\Loader\LoaderCache')
->constructor(DI\get('Piwik\Translation\Loader\DevelopmentLoader')),
diff --git a/config/environment/test.php b/config/environment/test.php
index 7cb8defba0..bfd8e54460 100644
--- a/config/environment/test.php
+++ b/config/environment/test.php
@@ -29,7 +29,7 @@ return array(
];
}),
- 'Piwik\Cache\Backend' => function () {
+ 'Matomo\Cache\Backend' => function () {
return \Piwik\Cache::buildBackend('file');
},
'cache.eager.cache_id' => 'eagercache-test-',
diff --git a/config/global.php b/config/global.php
index 189a2cdf77..602393e10d 100644
--- a/config/global.php
+++ b/config/global.php
@@ -2,7 +2,7 @@
use Interop\Container\ContainerInterface;
use Interop\Container\Exception\NotFoundException;
-use Piwik\Cache\Eager;
+use Matomo\Cache\Eager;
use Piwik\SettingsServer;
use Piwik\Config;
@@ -33,8 +33,8 @@ return array(
'path.cache' => DI\string('{path.tmp}/cache/tracker/'),
- 'Piwik\Cache\Eager' => function (ContainerInterface $c) {
- $backend = $c->get('Piwik\Cache\Backend');
+ 'Matomo\Cache\Eager' => function (ContainerInterface $c) {
+ $backend = $c->get('Matomo\Cache\Backend');
$cacheId = $c->get('cache.eager.cache_id');
if (SettingsServer::isTrackerApiRequest()) {
@@ -52,7 +52,7 @@ return array(
return $cache;
},
- 'Piwik\Cache\Backend' => function (ContainerInterface $c) {
+ 'Matomo\Cache\Backend' => function (ContainerInterface $c) {
// If Piwik is not installed yet, it's possible the tmp/ folder is not writable
// we prevent failing with an unclear message eg. coming from doctrine-cache
// by forcing to use a cache backend which always works ie. array
diff --git a/core/Archive.php b/core/Archive.php
index e3e3ddf0b9..19b06db4a5 100644
--- a/core/Archive.php
+++ b/core/Archive.php
@@ -163,7 +163,7 @@ class Archive implements ArchiveQuery
private $params;
/**
- * @var \Piwik\Cache\Cache
+ * @var \Matomo\Cache\Cache
*/
private static $cache;
diff --git a/core/Cache.php b/core/Cache.php
index dc6d87b8d8..2ced0cb23e 100644
--- a/core/Cache.php
+++ b/core/Cache.php
@@ -19,22 +19,22 @@ class Cache
* an entry from the cache it will fetch the entry. Cache entries might be persisted but not necessarily. It
* depends on the configured backend.
*
- * @return Cache\Lazy
+ * @return \Matomo\Cache\Lazy
*/
public static function getLazyCache()
{
- return StaticContainer::get('Piwik\Cache\Lazy');
+ return StaticContainer::get('Matomo\Cache\Lazy');
}
/**
* This class is used to cache any data during one request. It won't be persisted between requests and it can
* cache all kind of data, even objects or resources. This cache is very fast.
*
- * @return Cache\Transient
+ * @return \Matomo\Cache\Transient
*/
public static function getTransientCache()
{
- return StaticContainer::get('Piwik\Cache\Transient');
+ return StaticContainer::get('Matomo\Cache\Transient');
}
/**
@@ -48,11 +48,11 @@ class Cache
* All cache entries it contains have the same life time. For fast performance it won't validate any cache ids.
* It is not possible to cache any objects using this cache.
*
- * @return Cache\Eager
+ * @return \Matomo\Cache\Eager
*/
public static function getEagerCache()
{
- return StaticContainer::get('Piwik\Cache\Eager');
+ return StaticContainer::get('Matomo\Cache\Eager');
}
public static function flushAll()
@@ -64,11 +64,11 @@ class Cache
/**
* @param $type
- * @return Cache\Backend
+ * @return \Matomo\Cache\Backend
*/
public static function buildBackend($type)
{
- $factory = new Cache\Backend\Factory();
+ $factory = new \Matomo\Cache\Backend\Factory();
$options = self::getOptions($type);
$backend = $factory->buildBackend($type, $options);
diff --git a/core/Common.php b/core/Common.php
index 295f2bfc40..11602fe11c 100644
--- a/core/Common.php
+++ b/core/Common.php
@@ -723,8 +723,7 @@ class Common
*/
public static function convertUserIdToVisitorIdBin($userId)
{
- require_once PIWIK_INCLUDE_PATH . '/libs/PiwikTracker/PiwikTracker.php';
- $userIdHashed = \PiwikTracker::getUserIdHashed($userId);
+ $userIdHashed = \MatomoTracker::getUserIdHashed($userId);
return self::convertVisitorIdToBin($userIdHashed);
}
diff --git a/core/Config/Cache.php b/core/Config/Cache.php
index 1538c65d94..c61d50c567 100644
--- a/core/Config/Cache.php
+++ b/core/Config/Cache.php
@@ -8,7 +8,7 @@
namespace Piwik\Config;
-use Piwik\Cache\Backend\File;
+use Matomo\Cache\Backend\File;
use Piwik\Common;
use Piwik\Piwik;
use Piwik\Url;
diff --git a/core/Config/IniFileChain.php b/core/Config/IniFileChain.php
index a3ac25d746..7e064b0dad 100644
--- a/core/Config/IniFileChain.php
+++ b/core/Config/IniFileChain.php
@@ -8,9 +8,9 @@
namespace Piwik\Config;
use Piwik\Common;
-use Piwik\Ini\IniReader;
-use Piwik\Ini\IniReadingException;
-use Piwik\Ini\IniWriter;
+use Matomo\Ini\IniReader;
+use Matomo\Ini\IniReadingException;
+use Matomo\Ini\IniWriter;
use Piwik\Piwik;
/**
diff --git a/core/CronArchive/SegmentArchivingRequestUrlProvider.php b/core/CronArchive/SegmentArchivingRequestUrlProvider.php
index d7863db58e..307f0c8547 100644
--- a/core/CronArchive/SegmentArchivingRequestUrlProvider.php
+++ b/core/CronArchive/SegmentArchivingRequestUrlProvider.php
@@ -7,8 +7,8 @@
*/
namespace Piwik\CronArchive;
-use Piwik\Cache\Cache;
-use Piwik\Cache\Transient;
+use Matomo\Cache\Cache;
+use Matomo\Cache\Transient;
use Piwik\Container\StaticContainer;
use Piwik\Date;
use Piwik\Period\Factory as PeriodFactory;
diff --git a/core/IP.php b/core/IP.php
index 6e6abfc693..2a86a9c3b0 100644
--- a/core/IP.php
+++ b/core/IP.php
@@ -9,7 +9,7 @@
namespace Piwik;
-use Piwik\Network\IPUtils;
+use Matomo\Network\IPUtils;
/**
* Contains IP address helper functions (for both IPv4 and IPv6).
@@ -17,9 +17,9 @@ use Piwik\Network\IPUtils;
* As of Piwik 2.9, most methods in this class are deprecated. You are
* encouraged to use classes from the Piwik "Network" component:
*
- * @see \Piwik\Network\IP
- * @see \Piwik\Network\IPUtils
- * @link https://github.com/piwik/component-network
+ * @see \Matomo\Network\IP
+ * @see \Matomo\Network\IPUtils
+ * @link https://github.com/matomo-org/component-network
*
* As of Piwik 1.3, IP addresses are stored in the DB has VARBINARY(16),
* and passed around in network address format which has the advantage of
@@ -113,7 +113,7 @@ class IP
if(empty($element)) {
continue;
}
- $ip = \Piwik\Network\IP::fromStringIP(IPUtils::sanitizeIp($element));
+ $ip = \Matomo\Network\IP::fromStringIP(IPUtils::sanitizeIp($element));
if (empty($excludedIps) || (!in_array($element, $excludedIps) && !$ip->isInRanges($excludedIps))) {
return $element;
}
diff --git a/core/Metrics.php b/core/Metrics.php
index 4649822a7b..7445ed4244 100644
--- a/core/Metrics.php
+++ b/core/Metrics.php
@@ -178,7 +178,7 @@ class Metrics
public static function getMappingFromIdToName()
{
- $cache = StaticContainer::get(PiwikCache\Transient::class);
+ $cache = PiwikCache::getTransientCache();
$cacheKey = CacheId::siteAware(CacheId::pluginAware('Metrics.mappingFromIdToName'));
$value = $cache->fetch($cacheKey);
diff --git a/core/Plugin.php b/core/Plugin.php
index 092c28b3cf..2d3cb5978e 100644
--- a/core/Plugin.php
+++ b/core/Plugin.php
@@ -107,7 +107,7 @@ class Plugin
* perfect but efficient. If the cache is used we need to make sure to call setId() before usage as there
* is maybe a different key set since last usage.
*
- * @var \Piwik\Cache\Eager
+ * @var \Matomo\Cache\Eager
*/
private $cache;
diff --git a/core/Tracker/Cache.php b/core/Tracker/Cache.php
index d1fde4aec6..c3928b83aa 100644
--- a/core/Tracker/Cache.php
+++ b/core/Tracker/Cache.php
@@ -28,12 +28,12 @@ class Cache
/**
* Public for tests only
- * @var \Piwik\Cache\Lazy
+ * @var \Matomo\Cache\Lazy
*/
public static $cache;
/**
- * @return \Piwik\Cache\Lazy
+ * @return \Matomo\Cache\Lazy
*/
private static function getCache()
{
diff --git a/core/Tracker/Request.php b/core/Tracker/Request.php
index 4054446a41..f33bed656d 100644
--- a/core/Tracker/Request.php
+++ b/core/Tracker/Request.php
@@ -16,7 +16,7 @@ use Piwik\Cookie;
use Piwik\Exception\InvalidRequestParameterException;
use Piwik\Exception\UnexpectedWebsiteFoundException;
use Piwik\IP;
-use Piwik\Network\IPUtils;
+use Matomo\Network\IPUtils;
use Piwik\Piwik;
use Piwik\Plugins\CustomVariables\CustomVariables;
use Piwik\Plugins\UsersManager\UsersManager;
@@ -869,7 +869,7 @@ class Request
}
/**
- * Matches implementation of PiwikTracker::getUserIdHashed
+ * Matches implementation of MatomoTracker::getUserIdHashed
*
* @param $userId
* @return string
diff --git a/core/Tracker/TableLogAction/Cache.php b/core/Tracker/TableLogAction/Cache.php
index 32e132d76c..4cea0ed7c0 100644
--- a/core/Tracker/TableLogAction/Cache.php
+++ b/core/Tracker/TableLogAction/Cache.php
@@ -31,11 +31,11 @@ class Cache
private $logger;
/**
- * @var \Piwik\Cache\Lazy
+ * @var \Matomo\Cache\Lazy
*/
private $cache;
- public function __construct(LoggerInterface $logger, Config $config, \Piwik\Cache\Lazy $cache)
+ public function __construct(LoggerInterface $logger, Config $config, \Matomo\Cache\Lazy $cache)
{
$this->isEnabled = (bool)$config->General['enable_segments_subquery_cache'];
$this->limitActionIds = $config->General['segments_subquery_cache_limit'];
diff --git a/core/Tracker/Visit.php b/core/Tracker/Visit.php
index 9c76967adc..a425851285 100644
--- a/core/Tracker/Visit.php
+++ b/core/Tracker/Visit.php
@@ -15,7 +15,7 @@ use Piwik\Config;
use Piwik\Container\StaticContainer;
use Piwik\Date;
use Piwik\Exception\UnexpectedWebsiteFoundException;
-use Piwik\Network\IPUtils;
+use Matomo\Network\IPUtils;
use Piwik\Plugin\Dimension\VisitDimension;
use Piwik\Plugins\UserCountry\Columns\Base;
use Piwik\Tracker;
diff --git a/core/Tracker/VisitExcluded.php b/core/Tracker/VisitExcluded.php
index 838f0cf2a7..bc330b0996 100644
--- a/core/Tracker/VisitExcluded.php
+++ b/core/Tracker/VisitExcluded.php
@@ -13,7 +13,7 @@ use Piwik\Common;
use Piwik\Container\StaticContainer;
use Piwik\DeviceDetector\DeviceDetectorFactory;
use Piwik\Exception\UnexpectedWebsiteFoundException;
-use Piwik\Network\IP;
+use Matomo\Network\IP;
use Piwik\Piwik;
use Piwik\Plugins\SitesManager\SiteUrls;
use Piwik\Tracker\Visit\ReferrerSpamFilter;
diff --git a/core/Translation/Loader/LoaderCache.php b/core/Translation/Loader/LoaderCache.php
index 0726ef58f8..b84af80b6b 100644
--- a/core/Translation/Loader/LoaderCache.php
+++ b/core/Translation/Loader/LoaderCache.php
@@ -8,7 +8,7 @@
namespace Piwik\Translation\Loader;
-use Piwik\Cache;
+use Matomo\Cache\Lazy;
/**
* Caches the translations loaded by another loader.
@@ -21,11 +21,11 @@ class LoaderCache implements LoaderInterface
private $loader;
/**
- * @var Cache\Lazy
+ * @var Lazy
*/
private $cache;
- public function __construct(LoaderInterface $loader, Cache\Lazy $cache)
+ public function __construct(LoaderInterface $loader, Lazy $cache)
{
$this->loader = $loader;
$this->cache = $cache;
diff --git a/core/Unzip.php b/core/Unzip.php
index 4f43d1824f..80d648d6ed 100644
--- a/core/Unzip.php
+++ b/core/Unzip.php
@@ -8,10 +8,10 @@
namespace Piwik;
-use Piwik\Decompress\Gzip;
-use Piwik\Decompress\PclZip;
-use Piwik\Decompress\Tar;
-use Piwik\Decompress\ZipArchive;
+use Matomo\Decompress\Gzip;
+use Matomo\Decompress\PclZip;
+use Matomo\Decompress\Tar;
+use Matomo\Decompress\ZipArchive;
/**
* Factory for Decompress adapters.
@@ -23,7 +23,7 @@ class Unzip
*
* @param string $name Name of unarchiver
* @param string $filename Name of .zip archive
- * @return \Piwik\Decompress\DecompressInterface
+ * @return \Matomo\Decompress\DecompressInterface
*/
public static function factory($name, $filename)
{
diff --git a/core/Url.php b/core/Url.php
index 8d87f5e929..834d4c7062 100644
--- a/core/Url.php
+++ b/core/Url.php
@@ -9,7 +9,7 @@
namespace Piwik;
use Exception;
-use Piwik\Network\IPUtils;
+use Matomo\Network\IPUtils;
/**
* Provides URL related helper methods.
@@ -613,8 +613,8 @@ class Url
*/
public static function getHostSanitized($host)
{
- if (!class_exists("Piwik\\Network\\IPUtils")) {
- throw new Exception("Piwik\\Network\\IPUtils could not be found, maybe you are using Matomo from git and need to update Composer. $ php composer.phar update");
+ if (!class_exists("Matomo\\Network\\IPUtils")) {
+ throw new Exception("Matomo\\Network\\IPUtils could not be found, maybe you are using Matomo from git and need to update Composer. $ php composer.phar update");
}
return IPUtils::sanitizeIp($host);
}
diff --git a/core/Validators/IpRanges.php b/core/Validators/IpRanges.php
index 5e52f3751b..0bb6b7893c 100644
--- a/core/Validators/IpRanges.php
+++ b/core/Validators/IpRanges.php
@@ -9,7 +9,7 @@
namespace Piwik\Validators;
-use Piwik\Network\IPUtils;
+use Matomo\Network\IPUtils;
use Piwik\Piwik;
class IpRanges extends BaseValidator
diff --git a/libs/PiwikTracker/PiwikTracker.php b/libs/PiwikTracker/PiwikTracker.php
index 48b2869be5..b8775bf577 100644
--- a/libs/PiwikTracker/PiwikTracker.php
+++ b/libs/PiwikTracker/PiwikTracker.php
@@ -11,7 +11,7 @@
// code, this file has been left as a redirect to its new location in the
// vendor directory.
if (!class_exists('PiwikTracker')) {
- require_once __DIR__ . '/../../vendor/piwik/piwik-php-tracker/PiwikTracker.php';
+ require_once __DIR__ . '/../../vendor/matomo/matomo-php-tracker/PiwikTracker.php';
}
if (PiwikTracker::VERSION !== 1) {
diff --git a/misc/others/ExampleMatomoTracker.php b/misc/others/ExampleMatomoTracker.php
new file mode 100644
index 0000000000..4f784b0159
--- /dev/null
+++ b/misc/others/ExampleMatomoTracker.php
@@ -0,0 +1,17 @@
+<?php
+// Example file to demonstrate MatomoTracker.php
+// See https://matomo.org/docs/tracking-api/
+require_once '../../vendor/matomo/matomo-php-tracker/MatomoTracker.php';
+MatomoTracker::$URL = 'http://localhost/trunk/';
+
+$matomoTracker = new MatomoTracker($idSite = 1);
+// You can manually set the Visitor details (resolution, time, plugins)
+// See all other ->set* functions available in the MatomoTracker class
+$matomoTracker->setResolution(1600, 1400);
+
+// Sends Tracker request via http
+$matomoTracker->doTrackPageView('Document title of current page view');
+// You can also track Goal conversions
+$matomoTracker->doTrackGoal($idGoal = 1, $revenue = 42);
+
+echo 'done'; \ No newline at end of file
diff --git a/misc/others/ExamplePiwikTracker.php b/misc/others/ExamplePiwikTracker.php
deleted file mode 100644
index 5daa2d7701..0000000000
--- a/misc/others/ExamplePiwikTracker.php
+++ /dev/null
@@ -1,17 +0,0 @@
-<?php
-// Example file to demonstrate PiwikTracker.php
-// See http://piwik.org/docs/tracking-api/
-require_once '../../libs/PiwikTracker/PiwikTracker.php';
-PiwikTracker::$URL = 'http://localhost/trunk/';
-
-$piwikTracker = new PiwikTracker($idSite = 1);
-// You can manually set the Visitor details (resolution, time, plugins)
-// See all other ->set* functions available in the PiwikTracker class
-$piwikTracker->setResolution(1600, 1400);
-
-// Sends Tracker request via http
-$piwikTracker->doTrackPageView('Document title of current page view');
-// You can also track Goal conversions
-$piwikTracker->doTrackGoal($idGoal = 1, $revenue = 42);
-
-echo 'done'; \ No newline at end of file
diff --git a/misc/others/tracker_simpleImageTracker.php b/misc/others/tracker_simpleImageTracker.php
index bf4ac796c5..aa81319560 100644
--- a/misc/others/tracker_simpleImageTracker.php
+++ b/misc/others/tracker_simpleImageTracker.php
@@ -1,9 +1,9 @@
<?php
-// -- Piwik Tracking API init --
-require_once "../../libs/PiwikTracker/PiwikTracker.php";
-PiwikTracker::$URL = 'http://localhost/matomo-master/';
+// -- Matomo Tracking API init --
+require_once '../../vendor/matomo/matomo-php-tracker/MatomoTracker.php';
+MatomoTracker::$URL = 'http://localhost/matomo-master/';
// Example 1: Tracks a pageview for Website id = {$IDSITE}
-$trackingURL = Piwik_getUrlTrackPageView($idSite = 16, $customTitle = 'This title will appear in the report Actions > Page titles');
+$trackingURL = Matomo_getUrlTrackPageView($idSite = 16, $customTitle = 'This title will appear in the report Actions > Page titles');
?>
<html>
diff --git a/plugins/AnonymousPiwikUsageMeasurement b/plugins/AnonymousPiwikUsageMeasurement
-Subproject 66269ff14c32ed433d86b46fb772e4082ac66cb
+Subproject caac998ad29770aa068cbb859214f395b4d5913
diff --git a/plugins/Bandwidth b/plugins/Bandwidth
-Subproject cf4bc33047985ac8308ed0fc39f2a24d523cde4
+Subproject 70b77298680c1341440294f03b3438fee93d91e
diff --git a/plugins/BulkTracking/tests/System/TrackerTest.php b/plugins/BulkTracking/tests/System/TrackerTest.php
index 4c3be14816..3be6fd139e 100644
--- a/plugins/BulkTracking/tests/System/TrackerTest.php
+++ b/plugins/BulkTracking/tests/System/TrackerTest.php
@@ -22,7 +22,7 @@ class TrackerTest extends SystemTestCase
public static $fixture = null;
/**
- * @var \PiwikTracker
+ * @var \MatomoTracker
*/
private $tracker;
diff --git a/plugins/Contents/tests/Fixtures/TwoVisitsWithContents.php b/plugins/Contents/tests/Fixtures/TwoVisitsWithContents.php
index 4285d3ee08..aea0a68c51 100644
--- a/plugins/Contents/tests/Fixtures/TwoVisitsWithContents.php
+++ b/plugins/Contents/tests/Fixtures/TwoVisitsWithContents.php
@@ -10,7 +10,7 @@ namespace Piwik\Plugins\Contents\tests\Fixtures;
use Piwik\Date;
use Piwik\Plugins\Goals\API as APIGoals;
use Piwik\Tests\Framework\Fixture;
-use PiwikTracker;
+use MatomoTracker;
/**
* Tracks contents
@@ -56,13 +56,13 @@ class TwoVisitsWithContents extends Fixture
$this->trackContentImpressionsAndInteractions($vis2);
}
- private function moveTimeForward(PiwikTracker $vis, $minutes)
+ private function moveTimeForward(MatomoTracker $vis, $minutes)
{
$hour = $minutes / 60;
$vis->setForceVisitDateTime(Date::factory($this->dateTime)->addHour($hour)->getDatetime());
}
- protected function trackContentImpressionsAndInteractions(PiwikTracker $vis)
+ protected function trackContentImpressionsAndInteractions(MatomoTracker $vis)
{
$vis->setUrl('http://www.example.org/page');
$vis->setGenerationTime(333);
diff --git a/plugins/CoreConsole/Commands/DevelopmentSyncProcessedSystemTests.php b/plugins/CoreConsole/Commands/DevelopmentSyncProcessedSystemTests.php
index cd777e6e97..2daa351f77 100644
--- a/plugins/CoreConsole/Commands/DevelopmentSyncProcessedSystemTests.php
+++ b/plugins/CoreConsole/Commands/DevelopmentSyncProcessedSystemTests.php
@@ -11,7 +11,7 @@ namespace Piwik\Plugins\CoreConsole\Commands;
use Piwik\Common;
use Piwik\Container\StaticContainer;
-use Piwik\Decompress\Tar;
+use Matomo\Decompress\Tar;
use Piwik\Development;
use Piwik\Filesystem;
use Piwik\Http;
diff --git a/plugins/CoreHome/Columns/VisitIp.php b/plugins/CoreHome/Columns/VisitIp.php
index 8875cd2149..f7f09e56f4 100644
--- a/plugins/CoreHome/Columns/VisitIp.php
+++ b/plugins/CoreHome/Columns/VisitIp.php
@@ -10,7 +10,7 @@ namespace Piwik\Plugins\CoreHome\Columns;
use Piwik\Common;
use Piwik\Metrics\Formatter;
-use Piwik\Network\IPUtils;
+use Matomo\Network\IPUtils;
use Piwik\Plugin\Dimension\VisitDimension;
use Piwik\Plugin\Segment;
@@ -27,7 +27,7 @@ class VisitIp extends VisitDimension
protected $nameSingular = 'General_VisitorIP';
protected $namePlural = 'General_VisitorIPs';
protected $acceptValues = '13.54.122.1. </code>Select IP ranges with notation: <code>visitIp>13.54.122.0;visitIp<13.54.122.255';
- protected $sqlFilterValue = array('Piwik\Network\IPUtils', 'stringToBinaryIP');
+ protected $sqlFilterValue = array('Matomo\Network\IPUtils', 'stringToBinaryIP');
public function formatValue($value, $idSite, Formatter $formatter)
{
diff --git a/plugins/CoreHome/LoginWhitelist.php b/plugins/CoreHome/LoginWhitelist.php
index 677736a3c5..b4e7f1eac1 100644
--- a/plugins/CoreHome/LoginWhitelist.php
+++ b/plugins/CoreHome/LoginWhitelist.php
@@ -11,7 +11,7 @@ namespace Piwik\Plugins\CoreHome;
use Piwik\Common;
use Piwik\Config;
use Piwik\Container\StaticContainer;
-use Piwik\Network\IP as NetworkIp;
+use Matomo\Network\IP as NetworkIp;
use Piwik\NoAccessException;
use Piwik\Piwik;
use Piwik\SettingsServer;
diff --git a/plugins/CoreHome/tests/Integration/Column/UserIdTest.php b/plugins/CoreHome/tests/Integration/Column/UserIdTest.php
index 115fd76314..ef41206d23 100644
--- a/plugins/CoreHome/tests/Integration/Column/UserIdTest.php
+++ b/plugins/CoreHome/tests/Integration/Column/UserIdTest.php
@@ -244,7 +244,7 @@ class UserIdTest extends IntegrationTestCase
}
}
- private function trackPageview(\PiwikTracker $tracker, $userId, $url = null)
+ private function trackPageview(\MatomoTracker $tracker, $userId, $url = null)
{
if (null !== $url) {
$tracker->setUrl('http://www.example.org' . $url);
diff --git a/plugins/CustomVariables/Archiver.php b/plugins/CustomVariables/Archiver.php
index 221f916cf4..5d2448e7a4 100644
--- a/plugins/CustomVariables/Archiver.php
+++ b/plugins/CustomVariables/Archiver.php
@@ -16,8 +16,6 @@ use Piwik\Metrics;
use Piwik\Tracker\GoalManager;
use Piwik\Tracker;
-require_once PIWIK_INCLUDE_PATH . '/libs/PiwikTracker/PiwikTracker.php';
-
class Archiver extends \Piwik\Plugin\Archiver
{
const LABEL_CUSTOM_VALUE_NOT_DEFINED = "Value not defined";
@@ -109,7 +107,7 @@ class Archiver extends \Piwik\Plugin\Archiver
// then we also query the "Product page view" price which was possibly recorded.
$additionalSelects = false;
- if (in_array($slot, array(\PiwikTracker::CVAR_INDEX_ECOMMERCE_ITEM_SKU, \PiwikTracker::CVAR_INDEX_ECOMMERCE_ITEM_NAME, \PiwikTracker::CVAR_INDEX_ECOMMERCE_ITEM_CATEGORY))) {
+ if (in_array($slot, array(\MatomoTracker::CVAR_INDEX_ECOMMERCE_ITEM_SKU, \MatomoTracker::CVAR_INDEX_ECOMMERCE_ITEM_NAME, \MatomoTracker::CVAR_INDEX_ECOMMERCE_ITEM_CATEGORY))) {
$additionalSelects = array($this->getSelectAveragePrice());
}
$query = $this->getLogAggregator()->queryActionsByDimension($dimensions, $where, $additionalSelects);
@@ -121,7 +119,7 @@ class Archiver extends \Piwik\Plugin\Archiver
protected function getSelectAveragePrice()
{
- $field = "custom_var_v" . \PiwikTracker::CVAR_INDEX_ECOMMERCE_ITEM_PRICE;
+ $field = "custom_var_v" . \MatomoTracker::CVAR_INDEX_ECOMMERCE_ITEM_PRICE;
return LogAggregator::getSqlRevenue("AVG(log_link_visit_action." . $field . ")") . " as `" . Metrics::INDEX_ECOMMERCE_ITEM_PRICE_VIEWED . "`";
}
diff --git a/plugins/Diagnostics/ConfigReader.php b/plugins/Diagnostics/ConfigReader.php
index 9f98ab94cb..824dc4f362 100644
--- a/plugins/Diagnostics/ConfigReader.php
+++ b/plugins/Diagnostics/ConfigReader.php
@@ -8,7 +8,7 @@
namespace Piwik\Plugins\Diagnostics;
use Piwik\Development;
-use Piwik\Ini\IniReader;
+use Matomo\Ini\IniReader;
use Piwik\Application\Kernel\GlobalSettingsProvider;
use Piwik\Settings as PiwikSettings;
use Piwik\Plugin\Settings as PluginSettings;
diff --git a/plugins/Diagnostics/tests/Integration/ConfigReaderTest.php b/plugins/Diagnostics/tests/Integration/ConfigReaderTest.php
index 05b5f0af50..f5d78fb1c1 100644
--- a/plugins/Diagnostics/tests/Integration/ConfigReaderTest.php
+++ b/plugins/Diagnostics/tests/Integration/ConfigReaderTest.php
@@ -9,7 +9,7 @@
namespace Piwik\Plugins\Diagnostics\tests\Integration\Commands;
use Piwik\Application\Kernel\GlobalSettingsProvider;
-use Piwik\Ini\IniReader;
+use Matomo\Ini\IniReader;
use Piwik\Plugins\Diagnostics\ConfigReader;
use Piwik\Plugins\ExampleSettingsPlugin\SystemSettings;
use Piwik\Settings\FieldConfig;
diff --git a/plugins/GeoIp2/LocationProvider/GeoIp2.php b/plugins/GeoIp2/LocationProvider/GeoIp2.php
index e4e9a7efa3..3a17da686d 100644
--- a/plugins/GeoIp2/LocationProvider/GeoIp2.php
+++ b/plugins/GeoIp2/LocationProvider/GeoIp2.php
@@ -245,7 +245,7 @@ abstract class GeoIp2 extends LocationProvider
*/
protected function getIpFromInfo($info)
{
- $ip = \Piwik\Network\IP::fromStringIP($info['ip']);
+ $ip = \Matomo\Network\IP::fromStringIP($info['ip']);
return $ip->toString();
}
diff --git a/plugins/IntranetMeasurable/tests/Fixtures/IntranetSitesWithVisits.php b/plugins/IntranetMeasurable/tests/Fixtures/IntranetSitesWithVisits.php
index 25fac65727..a842449a11 100644
--- a/plugins/IntranetMeasurable/tests/Fixtures/IntranetSitesWithVisits.php
+++ b/plugins/IntranetMeasurable/tests/Fixtures/IntranetSitesWithVisits.php
@@ -49,7 +49,7 @@ class IntranetSitesWithVisits extends Fixture
}
}
- private function configureSameDevice(\PiwikTracker $t)
+ private function configureSameDevice(\MatomoTracker $t)
{
// to make purpose of test more clear we configure the device partially...
$t->setIp('56.11.55.70');
diff --git a/plugins/Live/VisitorDetails.php b/plugins/Live/VisitorDetails.php
index 98c0c52c9d..37b3c71215 100644
--- a/plugins/Live/VisitorDetails.php
+++ b/plugins/Live/VisitorDetails.php
@@ -14,7 +14,7 @@ use Piwik\Config;
use Piwik\Date;
use Piwik\DataTable;
use Piwik\Metrics\Formatter;
-use Piwik\Network\IPUtils;
+use Matomo\Network\IPUtils;
use Piwik\Piwik;
use Piwik\Site;
use Piwik\Plugins\SitesManager\API as APISitesManager;
diff --git a/plugins/Live/tests/Fixtures/VisitsWithAllActionsAndDevices.php b/plugins/Live/tests/Fixtures/VisitsWithAllActionsAndDevices.php
index 987ea6fc51..d21bed8221 100644
--- a/plugins/Live/tests/Fixtures/VisitsWithAllActionsAndDevices.php
+++ b/plugins/Live/tests/Fixtures/VisitsWithAllActionsAndDevices.php
@@ -69,7 +69,7 @@ class VisitsWithAllActionsAndDevices extends Fixture
// empty
}
- private function trackVisitSmartphone(\PiwikTracker $t, $dateTime)
+ private function trackVisitSmartphone(\MatomoTracker $t, $dateTime)
{
$t->setForceVisitDateTime($dateTime);
$t->setUserAgent('Mozilla/5.0 (Linux; U; Android 4.4.2; fr-fr; HTC One_M8 Build/KOT49H) AppleWebKit/537.16 (KHTML, like Gecko) Version/4.0 Mobile Safari/537.16');
@@ -147,7 +147,7 @@ class VisitsWithAllActionsAndDevices extends Fixture
self::checkResponse($t->doTrackAction('http://vendor.site', 'link'));
}
- private function trackVisitTablet(\PiwikTracker $t, $dateTime)
+ private function trackVisitTablet(\MatomoTracker $t, $dateTime)
{
$t->setForceVisitDateTime($dateTime);
$t->setUserAgent('Mozilla/5.0 (Linux; U; en-us; KFAPWI Build/JDQ39) AppleWebKit/535.19 (KHTML, like Gecko) Silk/3.8 Safari/535.19 Silk-Accelerated=true');
@@ -187,7 +187,7 @@ class VisitsWithAllActionsAndDevices extends Fixture
$t->doTrackContentImpression('product slider', 'product_16.jpg', 'http://example.org/product16');
}
- private function trackVisitMediaPlayer(\PiwikTracker $t, $dateTime)
+ private function trackVisitMediaPlayer(\MatomoTracker $t, $dateTime)
{
$t->setForceVisitDateTime($dateTime);
$t->setUserAgent('Mozilla/5.0 (iPod; U; CPU iPhone OS 4_2_1 like Mac OS X; ja-jp) AppleWebKit/533.17.9 (KHTML, like Gecko) Mobile/8C148');
@@ -213,7 +213,7 @@ class VisitsWithAllActionsAndDevices extends Fixture
self::checkResponse($t->doTrackPageView('Action without url'));
}
- private function trackDeviceVisit(\PiwikTracker $t, $dateTime, $useragent)
+ private function trackDeviceVisit(\MatomoTracker $t, $dateTime, $useragent)
{
$t->setForceVisitDateTime($dateTime);
$t->setUserAgent($useragent);
diff --git a/plugins/Login/SystemSettings.php b/plugins/Login/SystemSettings.php
index 360add240c..93c1f799e5 100644
--- a/plugins/Login/SystemSettings.php
+++ b/plugins/Login/SystemSettings.php
@@ -8,7 +8,7 @@
namespace Piwik\Plugins\Login;
-use Piwik\Network\IP;
+use Matomo\Network\IP;
use Piwik\Piwik;
use Piwik\Settings\Setting;
use Piwik\Settings\FieldConfig;
diff --git a/plugins/MarketingCampaignsReporting b/plugins/MarketingCampaignsReporting
-Subproject 7131f1af70ef02787db7d817d3f3f01dfe7c90f
+Subproject 263d8dbf5664fb54728863a854728bbeb64fd9e
diff --git a/plugins/Marketplace/Api/Client.php b/plugins/Marketplace/Api/Client.php
index 7334d2f629..b1e42b9ee9 100644
--- a/plugins/Marketplace/Api/Client.php
+++ b/plugins/Marketplace/Api/Client.php
@@ -8,7 +8,7 @@
*/
namespace Piwik\Plugins\Marketplace\Api;
-use Piwik\Cache;
+use Matomo\Cache\Lazy;
use Piwik\Common;
use Piwik\Container\StaticContainer;
use Piwik\Filesystem;
@@ -34,7 +34,7 @@ class Client
private $service;
/**
- * @var Cache\Lazy
+ * @var Lazy
*/
private $cache;
@@ -53,7 +53,7 @@ class Client
*/
private $environment;
- public function __construct(Service $service, Cache\Lazy $cache, LoggerInterface $logger, Environment $environment)
+ public function __construct(Service $service, Lazy $cache, LoggerInterface $logger, Environment $environment)
{
$this->service = $service;
$this->cache = $cache;
diff --git a/plugins/Marketplace/Plugins/InvalidLicenses.php b/plugins/Marketplace/Plugins/InvalidLicenses.php
index 2439a06117..faae824031 100644
--- a/plugins/Marketplace/Plugins/InvalidLicenses.php
+++ b/plugins/Marketplace/Plugins/InvalidLicenses.php
@@ -8,7 +8,7 @@
*/
namespace Piwik\Plugins\Marketplace\Plugins;
-use Piwik\Cache;
+use Matomo\Cache\Eager;
use Piwik\Piwik;
use Piwik\Plugin;
use Piwik\Plugins\Marketplace\Api\Client;
@@ -37,7 +37,7 @@ class InvalidLicenses
private $translator;
/**
- * @var Cache\Eager
+ * @var Eager
*/
private $cache;
@@ -50,7 +50,7 @@ class InvalidLicenses
private $cacheKey = 'Marketplace_ExpiredPlugins';
- public function __construct(Client $client, Cache\Eager $cache, Translator $translator, Plugins $plugins)
+ public function __construct(Client $client, Eager $cache, Translator $translator, Plugins $plugins)
{
$this->client = $client;
$this->translator = $translator;
diff --git a/plugins/Marketplace/tests/Framework/Mock/Client.php b/plugins/Marketplace/tests/Framework/Mock/Client.php
index 1fab955c2d..813ad08934 100644
--- a/plugins/Marketplace/tests/Framework/Mock/Client.php
+++ b/plugins/Marketplace/tests/Framework/Mock/Client.php
@@ -8,8 +8,8 @@
namespace Piwik\Plugins\Marketplace\tests\Framework\Mock;
-use Piwik\Cache\Backend\NullCache;
-use Piwik\Cache\Lazy;
+use Matomo\Cache\Backend\NullCache;
+use Matomo\Cache\Lazy;
use Psr\Log\NullLogger;
class Client {
diff --git a/plugins/Marketplace/tests/Integration/Plugins/InvalidLicensesTest.php b/plugins/Marketplace/tests/Integration/Plugins/InvalidLicensesTest.php
index 132ec6f211..1d3203548b 100644
--- a/plugins/Marketplace/tests/Integration/Plugins/InvalidLicensesTest.php
+++ b/plugins/Marketplace/tests/Integration/Plugins/InvalidLicensesTest.php
@@ -8,8 +8,8 @@
namespace Piwik\Plugins\Marketplace\tests\Integration\Plugins;
-use Piwik\Cache\Backend\ArrayCache;
-use Piwik\Cache\Eager;
+use Matomo\Cache\Backend\ArrayCache;
+use Matomo\Cache\Eager;
use Piwik\Container\StaticContainer;
use Piwik\Plugins\Marketplace\Consumer;
use Piwik\Plugins\Marketplace\Plugins;
diff --git a/plugins/Monolog/tests/System/TrackerLoggingTest.php b/plugins/Monolog/tests/System/TrackerLoggingTest.php
index 0942be7560..f0281e47eb 100644
--- a/plugins/Monolog/tests/System/TrackerLoggingTest.php
+++ b/plugins/Monolog/tests/System/TrackerLoggingTest.php
@@ -10,12 +10,10 @@ namespace Piwik\Plugins\Monolog\tests\System;
use Piwik\Config;
use Piwik\Date;
-use Piwik\Plugins\Monolog\Handler\EchoHandler;
use Piwik\Tests\Framework\Fixture;
use Piwik\Tests\Framework\TestCase\SystemTestCase;
use Piwik\Tests\Framework\TestingEnvironmentVariables;
-use PiwikTracker;
-use Psr\Container\ContainerInterface;
+use MatomoTracker;
/**
* @group Monolog
@@ -72,7 +70,7 @@ class TrackerLoggingTest extends SystemTestCase
return $t;
}
- private function assertTrackerResponseContainsLogOutput(PiwikTracker $t)
+ private function assertTrackerResponseContainsLogOutput(MatomoTracker $t)
{
$response = $t->doTrackPageView('incredible title!');
diff --git a/plugins/PrivacyManager/Dao/LogDataAnonymizer.php b/plugins/PrivacyManager/Dao/LogDataAnonymizer.php
index d4d7319acc..0ddf6c8ef2 100644
--- a/plugins/PrivacyManager/Dao/LogDataAnonymizer.php
+++ b/plugins/PrivacyManager/Dao/LogDataAnonymizer.php
@@ -11,7 +11,7 @@ namespace Piwik\Plugins\PrivacyManager\Dao;
use Piwik\Common;
use Piwik\Db;
use Piwik\DbHelper;
-use Piwik\Network\IP;
+use Matomo\Network\IP;
use Piwik\Plugins\PrivacyManager\Config;
use Piwik\Plugins\PrivacyManager\IPAnonymizer;
use Piwik\Plugins\PrivacyManager\Tracker\RequestProcessor;
diff --git a/plugins/PrivacyManager/IPAnonymizer.php b/plugins/PrivacyManager/IPAnonymizer.php
index f92b4dccd1..2280492d55 100644
--- a/plugins/PrivacyManager/IPAnonymizer.php
+++ b/plugins/PrivacyManager/IPAnonymizer.php
@@ -9,7 +9,7 @@
namespace Piwik\Plugins\PrivacyManager;
use Piwik\Common;
-use Piwik\Network\IP;
+use Matomo\Network\IP;
/**
* Anonymize visitor IP addresses to comply with the privacy laws/guidelines in countries, such as Germany.
diff --git a/plugins/PrivacyManager/tests/Fixtures/MultipleSitesMultipleVisitsFixture.php b/plugins/PrivacyManager/tests/Fixtures/MultipleSitesMultipleVisitsFixture.php
index 73e47b5a86..37ba33c83b 100644
--- a/plugins/PrivacyManager/tests/Fixtures/MultipleSitesMultipleVisitsFixture.php
+++ b/plugins/PrivacyManager/tests/Fixtures/MultipleSitesMultipleVisitsFixture.php
@@ -160,7 +160,7 @@ class MultipleSitesMultipleVisitsFixture extends Fixture
public $idSite = 1;
public $numVisitsPerIteration = 32;
/**
- * @var \PiwikTracker
+ * @var \MatomoTracker
*/
private $tracker;
diff --git a/plugins/PrivacyManager/tests/Unit/AnonymizeIPTest.php b/plugins/PrivacyManager/tests/Unit/AnonymizeIPTest.php
index c9ae38e952..d0e331c1dd 100644
--- a/plugins/PrivacyManager/tests/Unit/AnonymizeIPTest.php
+++ b/plugins/PrivacyManager/tests/Unit/AnonymizeIPTest.php
@@ -8,7 +8,7 @@
namespace Piwik\Plugins\PrivacyManager\tests;
-use Piwik\Network\IP;
+use Matomo\Network\IP;
use Piwik\Plugins\PrivacyManager\IPAnonymizer;
require_once PIWIK_INCLUDE_PATH . '/plugins/PrivacyManager/IPAnonymizer.php';
diff --git a/plugins/Provider/Columns/Provider.php b/plugins/Provider/Columns/Provider.php
index 4d15833ad8..337683c742 100644
--- a/plugins/Provider/Columns/Provider.php
+++ b/plugins/Provider/Columns/Provider.php
@@ -9,8 +9,8 @@
namespace Piwik\Plugins\Provider\Columns;
use Piwik\Common;
-use Piwik\Network\IP;
-use Piwik\Network\IPUtils;
+use Matomo\Network\IP;
+use Matomo\Network\IPUtils;
use Piwik\Plugin\Dimension\VisitDimension;
use Piwik\Tracker\Action;
use Piwik\Tracker\Request;
diff --git a/plugins/RssWidget/RssRenderer.php b/plugins/RssWidget/RssRenderer.php
index ed3dcd13c7..884f51ccd2 100644
--- a/plugins/RssWidget/RssRenderer.php
+++ b/plugins/RssWidget/RssRenderer.php
@@ -8,7 +8,9 @@
*/
namespace Piwik\Plugins\RssWidget;
+
use Piwik\Cache;
+use Matomo\Cache\Lazy;
use Piwik\Http;
/**
@@ -21,7 +23,7 @@ class RssRenderer
protected $showDescription = false;
protected $showContent = false;
/**
- * @var Cache\Lazy
+ * @var Lazy
*/
private $cache;
diff --git a/plugins/SEO/Metric/ProviderCache.php b/plugins/SEO/Metric/ProviderCache.php
index 6066f6d677..d8f6d44ff9 100644
--- a/plugins/SEO/Metric/ProviderCache.php
+++ b/plugins/SEO/Metric/ProviderCache.php
@@ -9,6 +9,7 @@
namespace Piwik\Plugins\SEO\Metric;
use Piwik\Cache;
+use Matomo\Cache\Lazy;
/**
* Caches another provider.
@@ -21,7 +22,7 @@ class ProviderCache implements MetricsProvider
private $provider;
/**
- * @var Cache\Lazy
+ * @var Lazy
*/
private $cache;
diff --git a/plugins/SegmentEditor/Services/StoredSegmentService.php b/plugins/SegmentEditor/Services/StoredSegmentService.php
index a5cee090dd..96a9dcd8ac 100644
--- a/plugins/SegmentEditor/Services/StoredSegmentService.php
+++ b/plugins/SegmentEditor/Services/StoredSegmentService.php
@@ -9,7 +9,7 @@
namespace Piwik\Plugins\SegmentEditor\Services;
use Piwik\Plugins\SegmentEditor\Model;
-use Piwik\Cache\Transient as TransientCache;
+use Matomo\Cache\Transient as TransientCache;
/**
diff --git a/plugins/SitesManager/API.php b/plugins/SitesManager/API.php
index b217593ab2..1230e3e4b6 100644
--- a/plugins/SitesManager/API.php
+++ b/plugins/SitesManager/API.php
@@ -15,7 +15,7 @@ use Piwik\Common;
use Piwik\Container\StaticContainer;
use Piwik\Date;
use Piwik\Intl\Data\Provider\CurrencyDataProvider;
-use Piwik\Network\IPUtils;
+use Matomo\Network\IPUtils;
use Piwik\Option;
use Piwik\Piwik;
use Piwik\Plugin\SettingsProvider;
diff --git a/plugins/SitesManager/Controller.php b/plugins/SitesManager/Controller.php
index 807757b845..be4ea71120 100644
--- a/plugins/SitesManager/Controller.php
+++ b/plugins/SitesManager/Controller.php
@@ -102,6 +102,8 @@ class Controller extends \Piwik\Plugin\ControllerAdmin
/**
* User will download a file called PiwikTracker.php that is the content of the actual script
+ *
+ * @deprecated seems unused and PiwikTracker is now MatomoTracker
*/
function downloadPiwikTracker()
{
diff --git a/plugins/TestRunner/Commands/TestsSetupFixture.php b/plugins/TestRunner/Commands/TestsSetupFixture.php
index 1df6f47bb7..f44e7f301d 100644
--- a/plugins/TestRunner/Commands/TestsSetupFixture.php
+++ b/plugins/TestRunner/Commands/TestsSetupFixture.php
@@ -256,8 +256,6 @@ class TestsSetupFixture extends ConsoleCommand
private function requireFixtureFiles(InputInterface $input)
{
- require_once PIWIK_INCLUDE_PATH . '/libs/PiwikTracker/PiwikTracker.php';
-
$file = $input->getOption('file');
if ($file) {
if (is_file($file)) {
diff --git a/plugins/UserCountry/Columns/Base.php b/plugins/UserCountry/Columns/Base.php
index 1ee6ea9d18..fb9468f68d 100644
--- a/plugins/UserCountry/Columns/Base.php
+++ b/plugins/UserCountry/Columns/Base.php
@@ -10,7 +10,7 @@ namespace Piwik\Plugins\UserCountry\Columns;
use Piwik\Common;
use Piwik\Exception\InvalidRequestParameterException;
-use Piwik\Network\IPUtils;
+use Matomo\Network\IPUtils;
use Piwik\Plugin\Dimension\VisitDimension;
use Piwik\Plugins\UserCountry\VisitorGeolocator;
use Piwik\Plugins\PrivacyManager\Config as PrivacyManagerConfig;
diff --git a/plugins/UserCountry/Columns/Country.php b/plugins/UserCountry/Columns/Country.php
index 6138c0278d..608be68e6b 100644
--- a/plugins/UserCountry/Columns/Country.php
+++ b/plugins/UserCountry/Columns/Country.php
@@ -13,7 +13,7 @@ use Piwik\Config;
use Piwik\Container\StaticContainer;
use Piwik\Intl\Data\Provider\RegionDataProvider;
use Piwik\Metrics\Formatter;
-use Piwik\Network\IP;
+use Matomo\Network\IP;
use Piwik\Piwik;
use Piwik\Plugin\Manager;
use Piwik\Plugin\Segment;
diff --git a/plugins/UserCountry/LocationProvider.php b/plugins/UserCountry/LocationProvider.php
index bd0ca86ff6..95f08a9a8d 100644
--- a/plugins/UserCountry/LocationProvider.php
+++ b/plugins/UserCountry/LocationProvider.php
@@ -498,9 +498,9 @@ abstract class LocationProvider
*/
protected function getIpFromInfo($info)
{
- $ip = \Piwik\Network\IP::fromStringIP($info['ip']);
+ $ip = \Matomo\Network\IP::fromStringIP($info['ip']);
- if ($ip instanceof \Piwik\Network\IPv6 && $ip->isMappedIPv4()) {
+ if ($ip instanceof \Matomo\Network\IPv6 && $ip->isMappedIPv4()) {
return $ip->toIPv4String();
} else {
return $ip->toString();
diff --git a/plugins/UserCountry/VisitorGeolocator.php b/plugins/UserCountry/VisitorGeolocator.php
index 5f992af396..ba2b884e80 100644
--- a/plugins/UserCountry/VisitorGeolocator.php
+++ b/plugins/UserCountry/VisitorGeolocator.php
@@ -8,12 +8,12 @@
*/
namespace Piwik\Plugins\UserCountry;
-use Piwik\Cache\Cache;
-use Piwik\Cache\Transient;
+use Matomo\Cache\Cache;
+use Matomo\Cache\Transient;
use Piwik\Common;
use Piwik\Container\StaticContainer;
use Piwik\DataAccess\RawLogDao;
-use Piwik\Network\IPUtils;
+use Matomo\Network\IPUtils;
use Piwik\Plugins\UserCountry\LocationProvider\DefaultProvider;
use Piwik\Tracker\Visit;
use Psr\Log\LoggerInterface;
diff --git a/plugins/UserCountry/tests/Integration/VisitorGeolocatorTest.php b/plugins/UserCountry/tests/Integration/VisitorGeolocatorTest.php
index e315a9ee77..f0b83490ef 100644
--- a/plugins/UserCountry/tests/Integration/VisitorGeolocatorTest.php
+++ b/plugins/UserCountry/tests/Integration/VisitorGeolocatorTest.php
@@ -11,7 +11,7 @@ namespace Piwik\Plugins\UserCountry\tests\Integration;
use PHPUnit_Framework_MockObject_MockObject;
use Piwik\Common;
use Piwik\Db;
-use Piwik\Network\IPUtils;
+use Matomo\Network\IPUtils;
use Piwik\Plugins\UserCountry\VisitorGeolocator;
use Piwik\Plugins\UserCountry\LocationProvider;
use Piwik\Tests\Framework\TestCase\IntegrationTestCase;
diff --git a/plugins/VisitorGenerator b/plugins/VisitorGenerator
-Subproject 39b582f70784895649667c3464f120ccc6fe75e
+Subproject 2f671813cd59b9d89745f6157ae71e84496a8ea
diff --git a/plugins/VisitsSummary/tests/Integration/VisitsSummaryTest.php b/plugins/VisitsSummary/tests/Integration/VisitsSummaryTest.php
index 090741ddff..221f48daa0 100644
--- a/plugins/VisitsSummary/tests/Integration/VisitsSummaryTest.php
+++ b/plugins/VisitsSummary/tests/Integration/VisitsSummaryTest.php
@@ -150,7 +150,7 @@ class VisitsSummaryTest extends IntegrationTestCase
}
}
- private function trackPageview(\PiwikTracker $tracker, $userId, $url)
+ private function trackPageview(\MatomoTracker $tracker, $userId, $url)
{
$tracker->setUrl('http://www.example.org' . $url);
$tracker->setUserId($userId);
diff --git a/plugins/WebsiteMeasurable/MeasurableSettings.php b/plugins/WebsiteMeasurable/MeasurableSettings.php
index bc07b254a1..7c0ff2e9eb 100644
--- a/plugins/WebsiteMeasurable/MeasurableSettings.php
+++ b/plugins/WebsiteMeasurable/MeasurableSettings.php
@@ -9,7 +9,7 @@
namespace Piwik\Plugins\WebsiteMeasurable;
use Piwik\IP;
use Piwik\Measurable\Type\TypeManager;
-use Piwik\Network\IPUtils;
+use Matomo\Network\IPUtils;
use Piwik\Piwik;
use Piwik\Plugin;
use Piwik\Plugins\WebsiteMeasurable\Settings\Urls;
diff --git a/tests/LocalTracker.php b/tests/LocalTracker.php
index fd98ccfd89..1510b15b74 100644
--- a/tests/LocalTracker.php
+++ b/tests/LocalTracker.php
@@ -12,12 +12,11 @@ require_once PIWIK_INCLUDE_PATH . '/core/Tracker/IgnoreCookie.php';
require_once PIWIK_INCLUDE_PATH . '/core/Tracker/Visit.php';
require_once PIWIK_INCLUDE_PATH . '/core/Tracker/GoalManager.php';
require_once PIWIK_INCLUDE_PATH . '/core/Tracker/Action.php';
-require_once PIWIK_INCLUDE_PATH . '/libs/PiwikTracker/PiwikTracker.php';
/**
* Tracker that uses core/Tracker.php directly.
*/
-class Piwik_LocalTracker extends PiwikTracker
+class Matomo_LocalTracker extends MatomoTracker
{
protected function sendRequest($url, $method = 'GET', $data = null, $force = false)
{
@@ -125,3 +124,4 @@ class Piwik_LocalTracker extends PiwikTracker
}
}
+class_alias('Matomo_LocalTracker', 'Piwik_LocalTracker'); \ No newline at end of file
diff --git a/tests/PHPUnit/Fixtures/FewVisitsWithSetVisitorId.php b/tests/PHPUnit/Fixtures/FewVisitsWithSetVisitorId.php
index b182324bb6..f678ff0e56 100644
--- a/tests/PHPUnit/Fixtures/FewVisitsWithSetVisitorId.php
+++ b/tests/PHPUnit/Fixtures/FewVisitsWithSetVisitorId.php
@@ -9,9 +9,8 @@ namespace Piwik\Tests\Fixtures;
use Piwik\Date;
use Piwik\Plugins\Goals\API;
-use Piwik\Tracker\Visit;
use Piwik\Tests\Framework\Fixture;
-use PiwikTracker;
+use MatomoTracker;
use Exception;
/**
@@ -193,7 +192,7 @@ class FewVisitsWithSetVisitorId extends Fixture
}
- private function settingInvalidVisitorIdShouldThrow(PiwikTracker $t)
+ private function settingInvalidVisitorIdShouldThrow(MatomoTracker $t)
{
try {
$t->setVisitorId('test');
@@ -215,7 +214,7 @@ class FewVisitsWithSetVisitorId extends Fixture
}
}
- private function settingInvalidUserIdShouldThrow(PiwikTracker $t)
+ private function settingInvalidUserIdShouldThrow(MatomoTracker $t)
{
try {
$t->setUserId('');
diff --git a/tests/PHPUnit/Fixtures/ManyVisitsWithGeoIP.php b/tests/PHPUnit/Fixtures/ManyVisitsWithGeoIP.php
index 39f5129cdd..a34fd1f3c4 100644
--- a/tests/PHPUnit/Fixtures/ManyVisitsWithGeoIP.php
+++ b/tests/PHPUnit/Fixtures/ManyVisitsWithGeoIP.php
@@ -129,13 +129,13 @@ class ManyVisitsWithGeoIP extends Fixture
/**
* Insert a new visit into the database.
- * @param \PiwikTracker $t The tracker to record the visits on
+ * @param \MatomoTracker $t The tracker to record the visits on
* @param int $fixtureCounter Number of times this fixture has been run
* @param int $visitorCounter Visitor counter within this execution of the fixture
* @param boolean $doBulk Should this visit be left for bulk insert later, or processed now?
* @param array $params Other params as required to set up the visit
*/
- protected function trackVisit(\PiwikTracker $t, $fixtureCounter, $visitorCounter, $doBulk, array $params)
+ protected function trackVisit(\MatomoTracker $t, $fixtureCounter, $visitorCounter, $doBulk, array $params)
{
$setIp = isset($params['setIp']) && $params['setIp'];
diff --git a/tests/PHPUnit/Fixtures/ManyVisitsWithGeoIPAndEcommerce.php b/tests/PHPUnit/Fixtures/ManyVisitsWithGeoIPAndEcommerce.php
index db094351a5..cb9e24c543 100644
--- a/tests/PHPUnit/Fixtures/ManyVisitsWithGeoIPAndEcommerce.php
+++ b/tests/PHPUnit/Fixtures/ManyVisitsWithGeoIPAndEcommerce.php
@@ -12,13 +12,13 @@ class ManyVisitsWithGeoIPAndEcommerce extends ManyVisitsWithGeoIP
{
/**
* Insert a new visit into the database.
- * @param \PiwikTracker $t The tracker to record the visits on
+ * @param \MatomoTracker $t The tracker to record the visits on
* @param int $fixtureCounter Number of times this fixture has been run
* @param int $visitorCounter Visitor counter within this execution of the fixture
* @param boolean $doBulk Should this visit be left for bulk insert later, or processed now?
* @param array $params Other params as required to set up the visit
*/
- protected function trackVisit(\PiwikTracker $t, $fixtureCounter, $visitorCounter, $doBulk, array $params)
+ protected function trackVisit(\MatomoTracker $t, $fixtureCounter, $visitorCounter, $doBulk, array $params)
{
parent::trackVisit($t, $fixtureCounter, $visitorCounter, $doBulk, $params);
diff --git a/tests/PHPUnit/Fixtures/ManyVisitsWithMockLocationProvider.php b/tests/PHPUnit/Fixtures/ManyVisitsWithMockLocationProvider.php
index 887f542d7c..78f77c134e 100644
--- a/tests/PHPUnit/Fixtures/ManyVisitsWithMockLocationProvider.php
+++ b/tests/PHPUnit/Fixtures/ManyVisitsWithMockLocationProvider.php
@@ -138,7 +138,7 @@ class ManyVisitsWithMockLocationProvider extends Fixture
$this->trackOrders($t);
}
- private function trackActions(\PiwikTracker $t, &$visitorCounter, $actionType, $userAgents, $resolutions,
+ private function trackActions(\MatomoTracker $t, &$visitorCounter, $actionType, $userAgents, $resolutions,
$referrers = null, $customVars = null)
{
for ($i = 0; $i != 5; ++$i, ++$visitorCounter) {
@@ -207,7 +207,7 @@ class ManyVisitsWithMockLocationProvider extends Fixture
}
}
- private function trackAction(\PiwikTracker $t, $actionType, $visitorCounter, $actionNum)
+ private function trackAction(\MatomoTracker $t, $actionType, $visitorCounter, $actionNum)
{
if ($actionType == 'pageview') {
self::checkResponse($t->doTrackPageView(
diff --git a/tests/PHPUnit/Fixtures/OneVisitorTwoVisits.php b/tests/PHPUnit/Fixtures/OneVisitorTwoVisits.php
index ed4a717aa8..a4945fcaba 100644
--- a/tests/PHPUnit/Fixtures/OneVisitorTwoVisits.php
+++ b/tests/PHPUnit/Fixtures/OneVisitorTwoVisits.php
@@ -192,7 +192,7 @@ class OneVisitorTwoVisits extends Fixture
$t->setForceVisitDateTime(Date::factory($dateTime)->addHour(1)->getDatetime());
$t->setUrl('http://example.org/store/purchase.htm');
$t->setUrlReferrer('http://search.yahoo.com/search?p=purchase');
- // Temporary, until we implement 1st party cookies in PiwikTracker
+ // Temporary, until we implement 1st party cookies in MatomoTracker
$t->DEBUG_APPEND_URL = '&_idvc=2';
// Goal Tracking URL matching, testing custom referrer including keyword
diff --git a/tests/PHPUnit/Fixtures/SomeVisitsCustomVariablesCampaignsNotHeuristics.php b/tests/PHPUnit/Fixtures/SomeVisitsCustomVariablesCampaignsNotHeuristics.php
index d8bd02903f..22c2ff5c20 100644
--- a/tests/PHPUnit/Fixtures/SomeVisitsCustomVariablesCampaignsNotHeuristics.php
+++ b/tests/PHPUnit/Fixtures/SomeVisitsCustomVariablesCampaignsNotHeuristics.php
@@ -11,7 +11,7 @@ use Piwik\Date;
use Piwik\Plugins\Goals\API;
use Piwik\Tests\Framework\Fixture;
use Piwik\Tests\Framework\TestingEnvironmentVariables;
-use PiwikTracker;
+use MatomoTracker;
/**
* Add one site and track many visits with custom variables & campaign IDs and
@@ -211,7 +211,7 @@ class SomeVisitsCustomVariablesCampaignsNotHeuristics extends Fixture
private function getFirstPartyCookieDomainHash()
{
$host = \Piwik\Url::getHost();
- $cookiePath = PiwikTracker::DEFAULT_COOKIE_PATH;
+ $cookiePath = MatomoTracker::DEFAULT_COOKIE_PATH;
return substr(sha1( $host . $cookiePath), 0, 4);
}
@@ -219,7 +219,7 @@ class SomeVisitsCustomVariablesCampaignsNotHeuristics extends Fixture
* Test setting/getting the first party cookie via the PHP Tracking Client
* @param $t
*/
- private function testFirstPartyCookies(PiwikTracker $t)
+ private function testFirstPartyCookies(MatomoTracker $t)
{
$domainHash = $this->getFirstPartyCookieDomainHash();
$idCookieName = '_pk_id_1_' . $domainHash;
diff --git a/tests/PHPUnit/Fixtures/SomeVisitsManyPageviewsWithTransitions.php b/tests/PHPUnit/Fixtures/SomeVisitsManyPageviewsWithTransitions.php
index 3a91bf6a91..21f011f75c 100644
--- a/tests/PHPUnit/Fixtures/SomeVisitsManyPageviewsWithTransitions.php
+++ b/tests/PHPUnit/Fixtures/SomeVisitsManyPageviewsWithTransitions.php
@@ -9,7 +9,7 @@ namespace Piwik\Tests\Fixtures;
use Piwik\Date;
use Piwik\Tests\Framework\Fixture;
-use PiwikTracker;
+use MatomoTracker;
/**
* Adds one site and tracks a couple visits with many pageviews. The
@@ -137,7 +137,7 @@ class SomeVisitsManyPageviewsWithTransitions extends Fixture
$prefix = $prefixes[$this->prefixCounter % 4];
$this->prefixCounter = $this->prefixCounter + 1;
- /** @var $visit PiwikTracker */
+ /** @var $visit MatomoTracker */
$visit->setUrl($prefix . 'example.org/' . $path);
$visit->setForceVisitDateTime(Date::factory($dateTime)->addHour($timeOffset)->getDatetime());
diff --git a/tests/PHPUnit/Fixtures/ThreeVisitsWithCustomEvents.php b/tests/PHPUnit/Fixtures/ThreeVisitsWithCustomEvents.php
index 078a315078..0096500959 100644
--- a/tests/PHPUnit/Fixtures/ThreeVisitsWithCustomEvents.php
+++ b/tests/PHPUnit/Fixtures/ThreeVisitsWithCustomEvents.php
@@ -10,7 +10,7 @@ namespace Piwik\Tests\Fixtures;
use Piwik\Date;
use Piwik\Plugins\Goals\API as APIGoals;
use Piwik\Tests\Framework\Fixture;
-use PiwikTracker;
+use MatomoTracker;
/**
* Tracks custom events
@@ -82,13 +82,13 @@ class ThreeVisitsWithCustomEvents extends Fixture
}
- private function moveTimeForward(PiwikTracker $vis, $minutes)
+ private function moveTimeForward(MatomoTracker $vis, $minutes)
{
$hour = $minutes / 60;
return $vis->setForceVisitDateTime(Date::factory($this->dateTime)->addHour($hour)->getDatetime());
}
- protected function trackEventWithoutUrl(PiwikTracker $vis)
+ protected function trackEventWithoutUrl(MatomoTracker $vis)
{
$url = $vis->pageUrl;
$vis->setUrl('');
@@ -108,7 +108,7 @@ class ThreeVisitsWithCustomEvents extends Fixture
$vis->setUrl($url);
}
- protected function trackMusicPlaying(PiwikTracker $vis)
+ protected function trackMusicPlaying(MatomoTracker $vis)
{
$this->moveTimeForward($vis, 1);
$this->setMusicEventCustomVar($vis);
@@ -129,7 +129,7 @@ class ThreeVisitsWithCustomEvents extends Fixture
self::checkResponse($vis->doTrackEvent('Music', 'playEnd', 'La fiancée de l\'eau'));
}
- protected function trackMusicRatings(PiwikTracker $vis)
+ protected function trackMusicRatings(MatomoTracker $vis)
{
$this->moveTimeForward($vis, 5);
$this->setMusicEventCustomVar($vis);
@@ -140,7 +140,7 @@ class ThreeVisitsWithCustomEvents extends Fixture
self::checkResponse($vis->doTrackEvent('Music', 'rating', 'La fiancée de l\'eau', 10));
}
- protected function trackMovieWatchingIncludingInterval(PiwikTracker $vis)
+ protected function trackMovieWatchingIncludingInterval(MatomoTracker $vis)
{
// First a pageview so the time on page is tracked properly
$this->moveTimeForward($vis, 30);
@@ -208,14 +208,14 @@ class ThreeVisitsWithCustomEvents extends Fixture
self::checkResponse($vis->doTrackEvent('Movie', 'Purchase'));
}
- private function setMusicEventCustomVar(PiwikTracker $vis)
+ private function setMusicEventCustomVar(MatomoTracker $vis)
{
$vis->setCustomVariable($id = 1, $name = 'Page Scope Custom var', $value = 'should not appear in events report', $scope = 'page');
$vis->setCustomVariable($id = 1, $name = 'album', $value = 'En attendant les caravanes...', $scope = 'event');
$vis->setCustomVariable($id = 1, $name = 'genre', $value = 'World music', $scope = 'event');
}
- private function setMovieEventCustomVar(PiwikTracker $vis)
+ private function setMovieEventCustomVar(MatomoTracker $vis)
{
$vis->setCustomVariable($id = 1, $name = 'country', $value = '日本', $scope = 'event');
$vis->setCustomVariable($id = 2, $name = 'genre', $value = 'Greatest animated films', $scope = 'event');
diff --git a/tests/PHPUnit/Fixtures/TwoSitesTwoVisitorsDifferentDays.php b/tests/PHPUnit/Fixtures/TwoSitesTwoVisitorsDifferentDays.php
index 1f6afab1b8..ba89314897 100644
--- a/tests/PHPUnit/Fixtures/TwoSitesTwoVisitorsDifferentDays.php
+++ b/tests/PHPUnit/Fixtures/TwoSitesTwoVisitorsDifferentDays.php
@@ -132,7 +132,7 @@ class TwoSitesTwoVisitorsDifferentDays extends Fixture
$visitorB->setForceVisitDateTime(Date::factory($dateTime)->addHour($hoursOffset)->getDatetime());
// visitor_returning is set to 1 only when visit count more than 1
- // Temporary, until we implement 1st party cookies in PiwikTracker
+ // Temporary, until we implement 1st party cookies in MatomoTracker
$visitorB->DEBUG_APPEND_URL .= '&_idvc=2&_viewts=' . Date::factory($dateTime)->getTimestamp();
$protocol = (0 === $days % 2) ? 'http' : 'https';
diff --git a/tests/PHPUnit/Framework/Fixture.php b/tests/PHPUnit/Framework/Fixture.php
index 3656785150..88b057f4e1 100644
--- a/tests/PHPUnit/Framework/Fixture.php
+++ b/tests/PHPUnit/Framework/Fixture.php
@@ -13,7 +13,7 @@ use Piwik\Archive;
use Piwik\ArchiveProcessor\PluginsArchiver;
use Piwik\Auth;
use Piwik\Auth\Password;
-use Piwik\Cache\Backend\File;
+use Matomo\Cache\Backend\File;
use Piwik\Cache as PiwikCache;
use Piwik\Common;
use Piwik\Config;
@@ -24,7 +24,7 @@ use Piwik\Date;
use Piwik\Db;
use Piwik\DbHelper;
use Piwik\FrontController;
-use Piwik\Ini\IniReader;
+use Matomo\Ini\IniReader;
use Piwik\Log;
use Piwik\NumberFormatter;
use Piwik\Option;
@@ -52,11 +52,8 @@ use Piwik\Tests\Framework\TestCase\SystemTestCase;
use Piwik\Tracker;
use Piwik\Tracker\Cache;
use Piwik\Translate;
-use Piwik\Url;
-use PHPUnit_Framework_Assert;
-use Piwik\Tests\Framework\TestingEnvironmentVariables;
-use PiwikTracker;
-use Piwik_LocalTracker;
+use MatomoTracker;
+use Matomo_LocalTracker;
use Piwik\Updater;
use Exception;
use ReflectionClass;
@@ -589,22 +586,22 @@ class Fixture extends \PHPUnit_Framework_Assert
}
/**
- * Returns a PiwikTracker object that you can then use to track pages or goals.
+ * Returns a MatomoTracker object that you can then use to track pages or goals.
*
* @param int $idSite
* @param string $dateTime
* @param boolean $defaultInit If set to true, the tracker object will have default IP, user agent, time, resolution, etc.
* @param bool $useLocal
*
- * @return PiwikTracker
+ * @return MatomoTracker
*/
public static function getTracker($idSite, $dateTime, $defaultInit = true, $useLocal = false)
{
if ($useLocal) {
require_once PIWIK_INCLUDE_PATH . '/tests/LocalTracker.php';
- $t = new Piwik_LocalTracker($idSite, self::getTrackerUrl());
+ $t = new Matomo_LocalTracker($idSite, self::getTrackerUrl());
} else {
- $t = new PiwikTracker($idSite, self::getTrackerUrl());
+ $t = new MatomoTracker($idSite, self::getTrackerUrl());
}
$t->setForceVisitDateTime($dateTime);
@@ -634,7 +631,7 @@ class Fixture extends \PHPUnit_Framework_Assert
$trans_gif_64 = "R0lGODlhAQABAIAAAAAAAAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==";
$expectedResponse = base64_decode($trans_gif_64);
- $url = "\n =========================== \n URL was: " . PiwikTracker::$DEBUG_LAST_REQUESTED_URL;
+ $url = "\n =========================== \n URL was: " . MatomoTracker::$DEBUG_LAST_REQUESTED_URL;
self::assertEquals($expectedResponse, $response, "Expected GIF beacon, got: <br/>\n"
. var_export($response, true)
. "\n If you are stuck, you can enable [Tracker] debug=1; in config.ini.php to get more debug info."
diff --git a/tests/PHPUnit/Framework/TestCase/BenchmarkTestCase.php b/tests/PHPUnit/Framework/TestCase/BenchmarkTestCase.php
index 3790b0f2a1..011d8aa8e0 100644
--- a/tests/PHPUnit/Framework/TestCase/BenchmarkTestCase.php
+++ b/tests/PHPUnit/Framework/TestCase/BenchmarkTestCase.php
@@ -83,7 +83,7 @@ abstract class BenchmarkTestCase extends SystemTestCase
{
require_once PIWIK_INCLUDE_PATH . '/tests/LocalTracker.php';
- $t = new \Piwik_LocalTracker($idSite, Fixture::getTrackerUrl());
+ $t = new \Matomo_LocalTracker($idSite, Fixture::getTrackerUrl());
$t->setUserAgent("Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.2.6) Gecko/20100625 Firefox/3.6.6 (.NET CLR 3.5.30729)");
$t->setBrowserLanguage('fr');
$t->setLocalTime('12:34:06');
diff --git a/tests/PHPUnit/Framework/TestCase/SystemTestCase.php b/tests/PHPUnit/Framework/TestCase/SystemTestCase.php
index 3494cebd68..49963e32d0 100644
--- a/tests/PHPUnit/Framework/TestCase/SystemTestCase.php
+++ b/tests/PHPUnit/Framework/TestCase/SystemTestCase.php
@@ -34,8 +34,6 @@ use Piwik\Tests\Framework\Fixture;
use Piwik\Translation\Translator;
use Piwik\Url;
-require_once PIWIK_INCLUDE_PATH . '/libs/PiwikTracker/PiwikTracker.php';
-
/**
* Base class for System tests.
*
diff --git a/tests/PHPUnit/Framework/TestDataHelper/LogHelper.php b/tests/PHPUnit/Framework/TestDataHelper/LogHelper.php
index 2346191dd2..0aaac97cd4 100644
--- a/tests/PHPUnit/Framework/TestDataHelper/LogHelper.php
+++ b/tests/PHPUnit/Framework/TestDataHelper/LogHelper.php
@@ -9,7 +9,7 @@
namespace Piwik\Tests\Framework\TestDataHelper;
use Piwik\Common;
-use Piwik\Network\IPUtils;
+use Matomo\Network\IPUtils;
use Piwik\Db;
/**
diff --git a/tests/PHPUnit/Framework/TestingEnvironmentManipulator.php b/tests/PHPUnit/Framework/TestingEnvironmentManipulator.php
index 12b648fe67..e9a5a9cb81 100644
--- a/tests/PHPUnit/Framework/TestingEnvironmentManipulator.php
+++ b/tests/PHPUnit/Framework/TestingEnvironmentManipulator.php
@@ -107,7 +107,7 @@ class TestingEnvironmentManipulator implements EnvironmentManipulator
\Piwik\Profiler::setupProfilerXHProf($mainRun = false, $setupDuringTracking = true);
}
- \Piwik\Cache\Backend\File::$invalidateOpCacheBeforeRead = true;
+ \Matomo\Cache\Backend\File::$invalidateOpCacheBeforeRead = true;
}
public function onEnvironmentBootstrapped()
diff --git a/tests/PHPUnit/Integration/AccessTest.php b/tests/PHPUnit/Integration/AccessTest.php
index 69c3898712..daf6a3008e 100644
--- a/tests/PHPUnit/Integration/AccessTest.php
+++ b/tests/PHPUnit/Integration/AccessTest.php
@@ -11,7 +11,7 @@ namespace Piwik\Tests\Integration;
use Exception;
use Piwik\Access;
use Piwik\AuthResult;
-use Piwik\Cache\Cache;
+use Matomo\Cache\Cache;
use Piwik\Db;
use Piwik\NoAccessException;
use Piwik\Piwik;
diff --git a/tests/PHPUnit/Integration/CacheTest.php b/tests/PHPUnit/Integration/CacheTest.php
index a2d1fe06b8..097553a900 100644
--- a/tests/PHPUnit/Integration/CacheTest.php
+++ b/tests/PHPUnit/Integration/CacheTest.php
@@ -25,7 +25,7 @@ class CacheTest extends IntegrationTestCase
$cache->save('test', 'mycontent'); // make sure something was changed, otherwise it won't save anything
/** @var Cache\Backend $backend */
- $backend = StaticContainer::get('Piwik\Cache\Backend');
+ $backend = StaticContainer::get('Matomo\Cache\Backend');
$this->assertFalse($backend->doContains($storageId));
$result = ''; $module = 'CoreHome'; $action = 'index'; $params = array();
diff --git a/tests/PHPUnit/Integration/ReleaseCheckListTest.php b/tests/PHPUnit/Integration/ReleaseCheckListTest.php
index b4e4964e51..5e9bb24a3e 100644
--- a/tests/PHPUnit/Integration/ReleaseCheckListTest.php
+++ b/tests/PHPUnit/Integration/ReleaseCheckListTest.php
@@ -13,7 +13,7 @@ use Piwik\Config;
use Piwik\Container\StaticContainer;
use Piwik\Filesystem;
use Piwik\Http;
-use Piwik\Ini\IniReader;
+use Matomo\Ini\IniReader;
use Piwik\Plugin\Manager;
use Piwik\Tests\Framework\TestCase\SystemTestCase;
use Piwik\Tracker;
diff --git a/tests/PHPUnit/Integration/SegmentTest.php b/tests/PHPUnit/Integration/SegmentTest.php
index 5cb987fdd6..2b0d015a38 100644
--- a/tests/PHPUnit/Integration/SegmentTest.php
+++ b/tests/PHPUnit/Integration/SegmentTest.php
@@ -1696,17 +1696,17 @@ log_visit.visit_total_actions
{
$self = $this;
- $cacheProxy = $this->getMockBuilder('Piwik\Cache\Lazy')
+ $cacheProxy = $this->getMockBuilder('Matomo\Cache\Lazy')
->setMethods(array('fetch', 'contains', 'save', 'delete', 'flushAll'))
->disableOriginalConstructor()
->getMock();
$cacheProxy->expects($this->any())->method('fetch')->willReturnCallback(function ($id) {
- $realCache = StaticContainer::get('Piwik\Cache\Lazy');
+ $realCache = StaticContainer::get('Matomo\Cache\Lazy');
return $realCache->fetch($id);
});
$cacheProxy->expects($this->any())->method('contains')->willReturnCallback(function ($id) use ($self) {
- $realCache = StaticContainer::get('Piwik\Cache\Lazy');
+ $realCache = StaticContainer::get('Matomo\Cache\Lazy');
$result = $realCache->contains($id);
if ($result) {
@@ -1716,15 +1716,15 @@ log_visit.visit_total_actions
return $result;
});
$cacheProxy->expects($this->any())->method('save')->willReturnCallback(function ($id, $data, $lifetime = 0) {
- $realCache = StaticContainer::get('Piwik\Cache\Lazy');
+ $realCache = StaticContainer::get('Matomo\Cache\Lazy');
return $realCache->save($id, $data, $lifetime);
});
$cacheProxy->expects($this->any())->method('delete')->willReturnCallback(function ($id) {
- $realCache = StaticContainer::get('Piwik\Cache\Lazy');
+ $realCache = StaticContainer::get('Matomo\Cache\Lazy');
return $realCache->delete($id);
});
$cacheProxy->expects($this->any())->method('flushAll')->willReturnCallback(function () {
- $realCache = StaticContainer::get('Piwik\Cache\Lazy');
+ $realCache = StaticContainer::get('Matomo\Cache\Lazy');
return $realCache->flushAll();
});
diff --git a/tests/PHPUnit/Integration/Tracker/PingRequestTest.php b/tests/PHPUnit/Integration/Tracker/PingRequestTest.php
index cb103514cb..353e9c7d26 100644
--- a/tests/PHPUnit/Integration/Tracker/PingRequestTest.php
+++ b/tests/PHPUnit/Integration/Tracker/PingRequestTest.php
@@ -183,7 +183,7 @@ class PingRequestTest extends IntegrationTestCase
return Db::fetchOne("SELECT $columnName FROM " . Common::prefixTable('log_visit') . " WHERE idvisit = ?", array($idVisit));
}
- private function doPingRequest(\PiwikTracker $tracker, $pingTime, $changeDimensionValues)
+ private function doPingRequest(\MatomoTracker $tracker, $pingTime, $changeDimensionValues)
{
if ($changeDimensionValues) {
$tracker->setUserAgent(self::CHANGED_USER_AGENT);
diff --git a/tests/PHPUnit/Integration/Tracker/RequestTest.php b/tests/PHPUnit/Integration/Tracker/RequestTest.php
index 7465cc7dc8..aea944fa15 100644
--- a/tests/PHPUnit/Integration/Tracker/RequestTest.php
+++ b/tests/PHPUnit/Integration/Tracker/RequestTest.php
@@ -8,7 +8,7 @@
namespace Piwik\Tests\Integration\Tracker;
-use Piwik\Network\IPUtils;
+use Matomo\Network\IPUtils;
use Piwik\Piwik;
use Piwik\Plugins\CustomVariables\CustomVariables;
use Piwik\Plugins\UsersManager\API;
diff --git a/tests/PHPUnit/Integration/Tracker/VisitTest.php b/tests/PHPUnit/Integration/Tracker/VisitTest.php
index e62f6e6482..7d0cb60440 100644
--- a/tests/PHPUnit/Integration/Tracker/VisitTest.php
+++ b/tests/PHPUnit/Integration/Tracker/VisitTest.php
@@ -11,7 +11,7 @@ namespace Piwik\Tests\Integration\Tracker;
use Piwik\Cache;
use Piwik\Container\StaticContainer;
use Piwik\Date;
-use Piwik\Network\IPUtils;
+use Matomo\Network\IPUtils;
use Piwik\Plugin\Manager;
use Piwik\Plugins\SitesManager\API;
use Piwik\Tests\Framework\Fixture;
diff --git a/tests/PHPUnit/System/TrackerResponseTest.php b/tests/PHPUnit/System/TrackerResponseTest.php
index 427a664e82..35813e870c 100644
--- a/tests/PHPUnit/System/TrackerResponseTest.php
+++ b/tests/PHPUnit/System/TrackerResponseTest.php
@@ -20,7 +20,7 @@ class TrackerResponseTest extends SystemTestCase
public static $fixture = null;
/**
- * @var \PiwikTracker
+ * @var \MatomoTracker
*/
private $tracker;
diff --git a/tests/PHPUnit/Unit/CacheTest.php b/tests/PHPUnit/Unit/CacheTest.php
index c56964d54e..8b01843f97 100644
--- a/tests/PHPUnit/Unit/CacheTest.php
+++ b/tests/PHPUnit/Unit/CacheTest.php
@@ -19,7 +19,7 @@ class CacheTest extends \PHPUnit_Framework_TestCase
{
$cache = Cache::getLazyCache();
- $this->assertTrue($cache instanceof Cache\Lazy);
+ $this->assertTrue($cache instanceof \Matomo\Cache\Lazy);
}
public function test_getLazyCache_shouldAlwaysReturnTheSameInstance()
@@ -34,7 +34,7 @@ class CacheTest extends \PHPUnit_Framework_TestCase
{
$cache = Cache::getEagerCache();
- $this->assertTrue($cache instanceof Cache\Eager);
+ $this->assertTrue($cache instanceof \Matomo\Cache\Eager);
}
public function test_getEagerCache_shouldAlwaysReturnTheSameInstance()
@@ -49,7 +49,7 @@ class CacheTest extends \PHPUnit_Framework_TestCase
{
$cache = Cache::getTransientCache();
- $this->assertTrue($cache instanceof Cache\Transient);
+ $this->assertTrue($cache instanceof \Matomo\Cache\Transient);
}
public function test_getTransientCache_shouldAlwaysReturnTheSameInstance()
diff --git a/tests/PHPUnit/Unit/LegacyAutoLoaderTest.php b/tests/PHPUnit/Unit/LegacyAutoLoaderTest.php
new file mode 100644
index 0000000000..ea0f9dadb0
--- /dev/null
+++ b/tests/PHPUnit/Unit/LegacyAutoLoaderTest.php
@@ -0,0 +1,57 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link https://matomo.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+
+namespace Piwik\Tests\Unit;
+
+/**
+ * @group Core
+ * @group LegacyAutoLoader
+ */
+class LegacyAutoLoaderTest extends \PHPUnit_Framework_TestCase
+{
+ public function testPackageClassWorks()
+ {
+ $class = new \Piwik\Ini\IniWriter();
+
+ $this->assertInstanceOf(\Matomo\Ini\IniWriter::class, $class);
+ }
+
+ public function testPackageClassStaticMethodWorks()
+ {
+ $ip = '123.13.12.123';
+
+ $binary = \Piwik\Network\IPUtils::stringToBinaryIP($ip);
+
+ $this->assertEquals($ip, \Matomo\Network\IPUtils::binaryToStringIP($binary));
+ }
+
+ public function testManuallyRequiredClassWorks()
+ {
+ require_once PIWIK_INCLUDE_PATH . '/tests/resources/MatomoDummyClass.php';
+
+ $class = new \Piwik\DummyClass();
+
+ $this->assertInstanceOf(\Matomo\DummyClass::class, $class);
+ }
+
+ /**
+ * @expectedException \Error
+ */
+ public function testNotExistingMatomoClassStillFails()
+ {
+ $class = new \Matomo\ClassNotFound();
+ }
+
+ /**
+ * @expectedException \Error
+ */
+ public function testNotExistingPiwikClassStillFails()
+ {
+ $class = new \Piwik\ClassNotFound();
+ }
+}
diff --git a/tests/PHPUnit/Unit/Tracker/RequestTest.php b/tests/PHPUnit/Unit/Tracker/RequestTest.php
index 81eded4f3b..b5563f5bd1 100644
--- a/tests/PHPUnit/Unit/Tracker/RequestTest.php
+++ b/tests/PHPUnit/Unit/Tracker/RequestTest.php
@@ -9,7 +9,7 @@
namespace Piwik\Tests\Unit\Tracker;
use Piwik\Cookie;
-use Piwik\Network\IPUtils;
+use Matomo\Network\IPUtils;
use Piwik\Piwik;
use Piwik\Plugins\CustomVariables\CustomVariables;
use Piwik\Tests\Framework\TestCase\UnitTestCase;
diff --git a/tests/PHPUnit/Unit/Translation/Loader/LoaderCacheTest.php b/tests/PHPUnit/Unit/Translation/Loader/LoaderCacheTest.php
index 9aa552e1a1..bace2d8b35 100644
--- a/tests/PHPUnit/Unit/Translation/Loader/LoaderCacheTest.php
+++ b/tests/PHPUnit/Unit/Translation/Loader/LoaderCacheTest.php
@@ -8,8 +8,8 @@
namespace Piwik\Tests\Unit\Translation\Loader;
-use Piwik\Cache\Backend\ArrayCache;
-use Piwik\Cache\Lazy;
+use Matomo\Cache\Backend\ArrayCache;
+use Matomo\Cache\Lazy;
use Piwik\Translation\Loader\LoaderCache;
/**
@@ -19,7 +19,7 @@ class LoaderCacheTest extends \PHPUnit_Framework_TestCase
{
public function test_shouldNotLoad_ifInCache()
{
- $cache = $this->getMock('Piwik\Cache\Lazy', array(), array(), '', false);
+ $cache = $this->getMock('Matomo\Cache\Lazy', array(), array(), '', false);
$cache->expects($this->any())
->method('fetch')
->willReturn(array('translations!'));
@@ -35,7 +35,7 @@ class LoaderCacheTest extends \PHPUnit_Framework_TestCase
public function test_shouldLoad_ifNotInCache()
{
- $cache = $this->getMock('Piwik\Cache\Lazy', array(), array(), '', false);
+ $cache = $this->getMock('Matomo\Cache\Lazy', array(), array(), '', false);
$cache->expects($this->any())
->method('fetch')
->willReturn(null);
diff --git a/tests/PHPUnit/bootstrap.php b/tests/PHPUnit/bootstrap.php
index 8aa0f0a842..c5bc17aa18 100644
--- a/tests/PHPUnit/bootstrap.php
+++ b/tests/PHPUnit/bootstrap.php
@@ -45,8 +45,6 @@ $GLOBALS['MATOMO_PLUGIN_DIRS'] = array(
require_once PIWIK_INCLUDE_PATH . '/core/bootstrap.php';
-require_once PIWIK_INCLUDE_PATH . '/libs/PiwikTracker/PiwikTracker.php';
-
if (getenv('PIWIK_USE_XHPROF') == 1) {
\Piwik\Profiler::setupProfilerXHProf();
}
diff --git a/tests/resources/MatomoDummyClass.php b/tests/resources/MatomoDummyClass.php
new file mode 100644
index 0000000000..5ca637c4b6
--- /dev/null
+++ b/tests/resources/MatomoDummyClass.php
@@ -0,0 +1,7 @@
+<?php
+
+namespace Matomo;
+
+class DummyClass {
+
+} \ No newline at end of file