diff options
169 files changed, 1415 insertions, 626 deletions
diff --git a/.travis.yml b/.travis.yml index e5e670be84..df1fc50aac 100644 --- a/.travis.yml +++ b/.travis.yml @@ -41,12 +41,6 @@ matrix: env: MYSQL_ADAPTER=PDO_MYSQL COVERAGE=Integration - php: 5.6 env: MYSQL_ADAPTER=PDO_MYSQL COVERAGE=Unit - include: - # Code Coverage - - php: 5.6 - env: MYSQL_ADAPTER=PDO_MYSQL COVERAGE=Integration - - php: 5.6 - env: MYSQL_ADAPTER=PDO_MYSQL COVERAGE=Unit exclude: # Run test suites separately only on PHP 5.4 with PDO - php: 5.3.3 diff --git a/LEGALNOTICE b/LEGALNOTICE index 006d1658af..041aea3089 100644 --- a/LEGALNOTICE +++ b/LEGALNOTICE @@ -69,6 +69,14 @@ SEPARATELY LICENSED COMPONENTS AND LIBRARIES Link: https://github.com/piwik/device-detector License: LGPL + Name: Piwik/Decompress + Link: https://github.com/piwik/component-decompress + License: LGPL v3.0 + + Name: Piwik/Network + Link: https://github.com/piwik/component-network + License: LGPL v3.0 + THIRD-PARTY COMPONENTS AND LIBRARIES @@ -224,6 +232,10 @@ THIRD-PARTY COMPONENTS AND LIBRARIES Link: https://github.com/ccampbell/mousetrap License: Apache 2.0 + Name: PHP-DI + Link: http://php-di.org/ + License: MIT (Expat) + THIRD-PARTY CONTENT @@ -101,7 +101,7 @@ The Piwik project uses an ever-expanding comprehensive set of thousands of unit Build status (master branch) [![Build Status](https://travis-ci.org/piwik/piwik.svg?branch=master)](https://travis-ci.org/piwik/piwik) - Screenshot tests Build [![Build Status](https://travis-ci.org/piwik/piwik-ui-tests.svg?branch=master)](https://travis-ci.org/piwik/piwik-ui-tests) -Code Coverage: [![Coverage Status](https://coveralls.io/repos/piwik/piwik/badge.png?branch=master)](https://coveralls.io/r/piwik/piwik?branch=master) +Code Coverage: [![Code Coverage](https://scrutinizer-ci.com/g/piwik/piwik/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/piwik/piwik/?branch=master) Issue tracker metrics: [![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/piwik/piwik.svg)](http://isitmaintained.com/project/piwik/piwik "Average time to resolve an issue") - [![Percentage of issues still open](http://isitmaintained.com/badge/open/piwik/piwik.svg)](http://isitmaintained.com/project/piwik/piwik "Percentage of issues still open") diff --git a/composer.json b/composer.json index 47886d558b..91fffba957 100644 --- a/composer.json +++ b/composer.json @@ -44,7 +44,8 @@ "mustangostang/spyc": "~0.5.0", "piwik/device-detector": "~2.0", "piwik/decompress": "~0.1.1", - "piwik/network": "~0.1.0" + "piwik/network": "~0.1.0", + "mnapoli/php-di": "5.0.x-dev" }, "require-dev": { "aws/aws-sdk-php": "2.7.1", diff --git a/composer.lock b/composer.lock index d522b5755d..3221f0ad25 100644 --- a/composer.lock +++ b/composer.lock @@ -4,9 +4,225 @@ "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "7fe1e059c2372246332679bfd15ca4a6", + "hash": "92499fc432a629fefcd5c1b912e44d9c", "packages": [ { + "name": "container-interop/container-interop", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/container-interop/container-interop.git", + "reference": "b4274c871bfd1ae8d8e527ba11734f4df1573e48" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/container-interop/container-interop/zipball/b4274c871bfd1ae8d8e527ba11734f4df1573e48", + "reference": "b4274c871bfd1ae8d8e527ba11734f4df1573e48", + "shasum": "" + }, + "type": "library", + "autoload": { + "psr-4": { + "Interop\\Container\\": "src/Interop/Container/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Promoting the interoperability of container objects (DIC, SL, etc.)", + "time": "2014-03-16 14:50:05" + }, + { + "name": "doctrine/annotations", + "version": "v1.2.1", + "source": { + "type": "git", + "url": "https://github.com/doctrine/annotations.git", + "reference": "6a6bec0670bb6e71a263b08bc1b98ea242928633" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/6a6bec0670bb6e71a263b08bc1b98ea242928633", + "reference": "6a6bec0670bb6e71a263b08bc1b98ea242928633", + "shasum": "" + }, + "require": { + "doctrine/lexer": "1.*", + "php": ">=5.3.2" + }, + "require-dev": { + "doctrine/cache": "1.*", + "phpunit/phpunit": "4.*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" + } + }, + "autoload": { + "psr-0": { + "Doctrine\\Common\\Annotations\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "Docblock Annotations Parser", + "homepage": "http://www.doctrine-project.org", + "keywords": [ + "annotations", + "docblock", + "parser" + ], + "time": "2014-09-25 16:45:30" + }, + { + "name": "doctrine/cache", + "version": "v1.3.1", + "source": { + "type": "git", + "url": "https://github.com/doctrine/cache.git", + "reference": "cf483685798a72c93bf4206e3dd6358ea07d64e7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/cache/zipball/cf483685798a72c93bf4206e3dd6358ea07d64e7", + "reference": "cf483685798a72c93bf4206e3dd6358ea07d64e7", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "conflict": { + "doctrine/common": ">2.2,<2.4" + }, + "require-dev": { + "phpunit/phpunit": ">=3.7", + "satooshi/php-coveralls": "~0.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4.x-dev" + } + }, + "autoload": { + "psr-0": { + "Doctrine\\Common\\Cache\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "Caching library offering an object-oriented API for many cache backends", + "homepage": "http://www.doctrine-project.org", + "keywords": [ + "cache", + "caching" + ], + "time": "2014-09-17 14:24:04" + }, + { + "name": "doctrine/lexer", + "version": "v1.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/lexer.git", + "reference": "2f708a85bb3aab5d99dab8be435abd73e0b18acb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/2f708a85bb3aab5d99dab8be435abd73e0b18acb", + "reference": "2f708a85bb3aab5d99dab8be435abd73e0b18acb", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "type": "library", + "autoload": { + "psr-0": { + "Doctrine\\Common\\Lexer\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com", + "homepage": "http://www.instaclick.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com", + "homepage": "https://github.com/schmittjoh", + "role": "Developer of wrapped JMSSerializerBundle" + } + ], + "description": "Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers.", + "homepage": "http://www.doctrine-project.org", + "keywords": [ + "lexer", + "parser" + ], + "time": "2013-01-12 18:59:04" + }, + { "name": "leafo/lessphp", "version": "v0.4.0", "source": { @@ -48,6 +264,99 @@ "time": "2013-08-09 17:09:19" }, { + "name": "mnapoli/php-di", + "version": "5.0.x-dev", + "source": { + "type": "git", + "url": "https://github.com/mnapoli/PHP-DI.git", + "reference": "018126838b9c3922ee23afff2d779af3d88f6740" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mnapoli/PHP-DI/zipball/018126838b9c3922ee23afff2d779af3d88f6740", + "reference": "018126838b9c3922ee23afff2d779af3d88f6740", + "shasum": "" + }, + "require": { + "container-interop/container-interop": "~1.0", + "doctrine/annotations": "1.*", + "doctrine/cache": "1.*", + "mnapoli/phpdocreader": "~1.3", + "myclabs/php-enum": "1.*", + "php": ">=5.3.3" + }, + "require-dev": { + "ocramius/proxy-manager": "~0.3", + "phpunit/phpunit": "~4.0" + }, + "suggest": { + "ocramius/proxy-manager": "Install it if you want to use lazy injection" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0.x-dev" + } + }, + "autoload": { + "psr-0": { + "DI\\": "src/", + "IntegrationTests\\": "tests/", + "UnitTests\\": "tests/" + }, + "files": [ + "src/DI/functions.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHP-DI is a Container that makes Dependency Injection as practical as possible in PHP", + "homepage": "http://mnapoli.github.com/PHP-DI/", + "keywords": [ + "container", + "dependency injection", + "di" + ], + "time": "2014-10-31 00:34:51" + }, + { + "name": "mnapoli/phpdocreader", + "version": "1.3.0", + "source": { + "type": "git", + "url": "https://github.com/mnapoli/PhpDocReader.git", + "reference": "8a6e123fd1ce54f7fcbd71747b3bf04e465da229" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mnapoli/PhpDocReader/zipball/8a6e123fd1ce54f7fcbd71747b3bf04e465da229", + "reference": "8a6e123fd1ce54f7fcbd71747b3bf04e465da229", + "shasum": "" + }, + "require": { + "doctrine/annotations": "1.*", + "php": ">=5.3.0" + }, + "type": "library", + "autoload": { + "psr-0": { + "PhpDocReader": "src/", + "UnitTest": "tests/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "keywords": [ + "phpdoc", + "reflection" + ], + "time": "2014-08-21 08:20:45" + }, + { "name": "mustangostang/spyc", "version": "0.5.1", "source": { @@ -95,6 +404,37 @@ "time": "2013-02-21 10:52:01" }, { + "name": "myclabs/php-enum", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/myclabs/php-enum.git", + "reference": "b52c2f215f5b251693369309ea7f537f9d92ec5e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/php-enum/zipball/b52c2f215f5b251693369309ea7f537f9d92ec5e", + "reference": "b52c2f215f5b251693369309ea7f537f9d92ec5e", + "shasum": "" + }, + "type": "library", + "autoload": { + "psr-0": { + "MyCLabs": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHP Enum implementation", + "homepage": "http://github.com/myclabs/php-enum", + "keywords": [ + "enum" + ], + "time": "2013-11-11 18:29:08" + }, + { "name": "piwik/decompress", "version": "0.1.1", "source": { @@ -131,16 +471,16 @@ }, { "name": "piwik/device-detector", - "version": "2.5.1", + "version": "2.6", "source": { "type": "git", "url": "https://github.com/piwik/device-detector.git", - "reference": "a15c326733bf596e23c19b319c15c8780be9fe34" + "reference": "60831e80b45d296e19b07cde198fe8dff7311bec" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/piwik/device-detector/zipball/a15c326733bf596e23c19b319c15c8780be9fe34", - "reference": "a15c326733bf596e23c19b319c15c8780be9fe34", + "url": "https://api.github.com/repos/piwik/device-detector/zipball/60831e80b45d296e19b07cde198fe8dff7311bec", + "reference": "60831e80b45d296e19b07cde198fe8dff7311bec", "shasum": "" }, "require": { @@ -174,7 +514,7 @@ "parser", "useragent" ], - "time": "2014-10-06 20:13:03" + "time": "2014-10-30 13:45:01" }, { "name": "piwik/network", @@ -210,17 +550,17 @@ }, { "name": "symfony/console", - "version": "v2.5.5", + "version": "v2.5.6", "target-dir": "Symfony/Component/Console", "source": { "type": "git", "url": "https://github.com/symfony/Console.git", - "reference": "ca053eaa031c93afb68a71e4eb1f4168dfd4a661" + "reference": "6f177fca24200a5b97aef5ce7a5c98124a0f0db0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Console/zipball/ca053eaa031c93afb68a71e4eb1f4168dfd4a661", - "reference": "ca053eaa031c93afb68a71e4eb1f4168dfd4a661", + "url": "https://api.github.com/repos/symfony/Console/zipball/6f177fca24200a5b97aef5ce7a5c98124a0f0db0", + "reference": "6f177fca24200a5b97aef5ce7a5c98124a0f0db0", "shasum": "" }, "require": { @@ -261,7 +601,7 @@ ], "description": "Symfony Console Component", "homepage": "http://symfony.com", - "time": "2014-09-25 09:53:56" + "time": "2014-10-05 13:57:04" }, { "name": "tedivm/jshrink", @@ -306,16 +646,16 @@ }, { "name": "twig/twig", - "version": "v1.16.1", + "version": "v1.16.2", "source": { "type": "git", "url": "https://github.com/fabpot/Twig.git", - "reference": "7c4c01dcf578523cfcddf383641a4f12790270ec" + "reference": "42f758d9fe2146d1f0470604fc05ee43580873fc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/fabpot/Twig/zipball/7c4c01dcf578523cfcddf383641a4f12790270ec", - "reference": "7c4c01dcf578523cfcddf383641a4f12790270ec", + "url": "https://api.github.com/repos/fabpot/Twig/zipball/42f758d9fe2146d1f0470604fc05ee43580873fc", + "reference": "42f758d9fe2146d1f0470604fc05ee43580873fc", "shasum": "" }, "require": { @@ -359,7 +699,7 @@ "keywords": [ "templating" ], - "time": "2014-10-10 14:09:53" + "time": "2014-10-17 12:53:44" } ], "packages-dev": [ @@ -952,16 +1292,16 @@ }, { "name": "phpunit/phpunit", - "version": "4.3.3", + "version": "4.3.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "5a0bc4dcbb7340c0a9a9bc3507854a67c564edc4" + "reference": "23e4e0310f037aae873cc81b8658dbbb82878f71" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/5a0bc4dcbb7340c0a9a9bc3507854a67c564edc4", - "reference": "5a0bc4dcbb7340c0a9a9bc3507854a67c564edc4", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/23e4e0310f037aae873cc81b8658dbbb82878f71", + "reference": "23e4e0310f037aae873cc81b8658dbbb82878f71", "shasum": "" }, "require": { @@ -972,7 +1312,7 @@ "ext-spl": "*", "php": ">=5.3.3", "phpunit/php-code-coverage": "~2.0", - "phpunit/php-file-iterator": "~1.3.1", + "phpunit/php-file-iterator": "~1.3.2", "phpunit/php-text-template": "~1.2", "phpunit/php-timer": "~1.0.2", "phpunit/phpunit-mock-objects": "~2.3", @@ -1022,7 +1362,7 @@ "testing", "xunit" ], - "time": "2014-10-16 16:53:00" + "time": "2014-10-22 11:43:12" }, { "name": "phpunit/phpunit-mock-objects", @@ -1197,16 +1537,16 @@ }, { "name": "sebastian/environment", - "version": "1.1.0", + "version": "1.2.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "6288ebbf6fa3ed2b2ff2d69c356fbaaf4f0971a7" + "reference": "0d9bf79554d2a999da194a60416c15cf461eb67d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/6288ebbf6fa3ed2b2ff2d69c356fbaaf4f0971a7", - "reference": "6288ebbf6fa3ed2b2ff2d69c356fbaaf4f0971a7", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/0d9bf79554d2a999da194a60416c15cf461eb67d", + "reference": "0d9bf79554d2a999da194a60416c15cf461eb67d", "shasum": "" }, "require": { @@ -1218,7 +1558,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1.x-dev" + "dev-master": "1.2.x-dev" } }, "autoload": { @@ -1243,7 +1583,7 @@ "environment", "hhvm" ], - "time": "2014-10-07 09:23:16" + "time": "2014-10-22 06:38:05" }, { "name": "sebastian/exporter", @@ -1347,17 +1687,17 @@ }, { "name": "symfony/event-dispatcher", - "version": "v2.5.5", + "version": "v2.5.6", "target-dir": "Symfony/Component/EventDispatcher", "source": { "type": "git", "url": "https://github.com/symfony/EventDispatcher.git", - "reference": "f6281337bf5f985f585d1db6a83adb05ce531f46" + "reference": "804eb28dbbfba9ffdab21fe2066744906cea2212" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/f6281337bf5f985f585d1db6a83adb05ce531f46", - "reference": "f6281337bf5f985f585d1db6a83adb05ce531f46", + "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/804eb28dbbfba9ffdab21fe2066744906cea2212", + "reference": "804eb28dbbfba9ffdab21fe2066744906cea2212", "shasum": "" }, "require": { @@ -1400,21 +1740,21 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "http://symfony.com", - "time": "2014-09-28 15:56:11" + "time": "2014-10-01 15:43:05" }, { "name": "symfony/yaml", - "version": "v2.5.5", + "version": "v2.5.6", "target-dir": "Symfony/Component/Yaml", "source": { "type": "git", "url": "https://github.com/symfony/Yaml.git", - "reference": "b1dbc53593b98c2d694ebf383660ac9134d30b96" + "reference": "2d9f527449cabfa8543dd7fa3a466d6ae83d6726" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Yaml/zipball/b1dbc53593b98c2d694ebf383660ac9134d30b96", - "reference": "b1dbc53593b98c2d694ebf383660ac9134d30b96", + "url": "https://api.github.com/repos/symfony/Yaml/zipball/2d9f527449cabfa8543dd7fa3a466d6ae83d6726", + "reference": "2d9f527449cabfa8543dd7fa3a466d6ae83d6726", "shasum": "" }, "require": { @@ -1447,17 +1787,22 @@ ], "description": "Symfony Yaml Component", "homepage": "http://symfony.com", - "time": "2014-09-22 09:14:18" + "time": "2014-10-01 05:50:18" } ], - "aliases": [], + "aliases": [ + + ], "minimum-stability": "stable", "stability-flags": { + "mnapoli/php-di": 20, "facebook/xhprof": 20 }, "prefer-stable": false, "platform": { "php": ">=5.3.3" }, - "platform-dev": [] + "platform-dev": [ + + ] } diff --git a/config/global.php b/config/global.php new file mode 100644 index 0000000000..9a25907242 --- /dev/null +++ b/config/global.php @@ -0,0 +1,4 @@ +<?php + +return array( +); diff --git a/core/Exceptions/HtmlMessageException.php b/core/Exceptions/HtmlMessageException.php index 69f809e1e0..243a0f1726 100644 --- a/core/Exceptions/HtmlMessageException.php +++ b/core/Exceptions/HtmlMessageException.php @@ -16,7 +16,15 @@ use Exception; * * @api */ -class HtmlMessageException extends Exception implements HtmlMessageExceptionInterface +class HtmlMessageException extends Exception { - // empty + /** + * Returns the exception message. + * + * @return string + */ + public function getHtmlMessage() + { + return $this->getMessage(); + } }
\ No newline at end of file diff --git a/core/Exceptions/HtmlMessageExceptionInterface.php b/core/Exceptions/HtmlMessageExceptionInterface.php deleted file mode 100644 index b96c2e0a84..0000000000 --- a/core/Exceptions/HtmlMessageExceptionInterface.php +++ /dev/null @@ -1,20 +0,0 @@ -<?php -/** - * Piwik - free/libre analytics platform - * - * @link http://piwik.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - * - */ -namespace Piwik\Exceptions; - -/** - * Exceptions that implement this interface are assumed to have HTML content - * in their messages. - * - * @api - */ -interface HtmlMessageExceptionInterface -{ - // empty -}
\ No newline at end of file diff --git a/core/FrontController.php b/core/FrontController.php index 33dab49e47..16d5930fe2 100644 --- a/core/FrontController.php +++ b/core/FrontController.php @@ -13,14 +13,12 @@ use Exception; use Piwik\API\Request; use Piwik\API\ResponseBuilder; use Piwik\Exceptions\HtmlMessageException; -use Piwik\Exceptions\HtmlMessageExceptionInterface; use Piwik\Http\Router; use Piwik\Plugin\Controller; use Piwik\Plugin\Report; use Piwik\Plugin\Widgets; use Piwik\Plugins\CoreAdminHome\CustomLogo; use Piwik\Session; -use Piwik\Plugins\CoreHome\Controller as CoreHomeController; /** * This singleton dispatches requests to the appropriate plugin Controller. @@ -114,6 +112,8 @@ class FrontController extends Singleton protected function makeController($module, $action, &$parameters) { + $container = StaticContainer::getContainer(); + $controllerClassName = $this->getClassNameController($module); // TRY TO FIND ACTION IN CONTROLLER @@ -121,7 +121,7 @@ class FrontController extends Singleton $class = $this->getClassNameController($module); /** @var $controller Controller */ - $controller = new $class; + $controller = $container->make($class); $controllerAction = $action; if ($controllerAction === false) { @@ -147,7 +147,7 @@ class FrontController extends Singleton $parameters['widgetModule'] = $module; $parameters['widgetMethod'] = $action; - return array(new CoreHomeController(), 'renderWidget'); + return array($container->make('Piwik\Plugins\CoreHome\Controller'), 'renderWidget'); } // TRY TO FIND ACTION IN REPORT @@ -158,7 +158,7 @@ class FrontController extends Singleton $parameters['reportModule'] = $module; $parameters['reportAction'] = $action; - return array(new CoreHomeController(), 'renderReportWidget'); + return array($container->make('Piwik\Plugins\CoreHome\Controller'), 'renderReportWidget'); } if (!empty($action) && Report::PREFIX_ACTION_IN_MENU === substr($action, 0, strlen(Report @@ -170,7 +170,7 @@ class FrontController extends Singleton $parameters['reportModule'] = $module; $parameters['reportAction'] = $reportAction; - return array(new CoreHomeController(), 'renderReportMenu'); + return array($container->make('Piwik\Plugins\CoreHome\Controller'), 'renderReportMenu'); } } @@ -614,8 +614,8 @@ class FrontController extends Singleton { $debugTrace = $ex->getTraceAsString(); - if ($ex instanceof HtmlMessageExceptionInterface) { - $message = $ex->getMessage(); + if (method_exists($ex, 'getHtmlMessage')) { + $message = $ex->getHtmlMessage(); } else { $message = Common::sanitizeInputValue($ex->getMessage()); } diff --git a/core/Plugin/Manager.php b/core/Plugin/Manager.php index aa89483b62..9f8941170b 100644 --- a/core/Plugin/Manager.php +++ b/core/Plugin/Manager.php @@ -360,7 +360,7 @@ class Manager extends Singleton if ($this->isPluginLoaded($pluginName)) { throw new \Exception("To uninstall the plugin $pluginName, first disable it in Piwik > Settings > Plugins"); } - $this->returnLoadedPluginsInfo(); + $this->loadAllPluginsAndGetTheirInfo(); \Piwik\Settings\Manager::cleanupPluginSettings($pluginName); @@ -541,7 +541,7 @@ class Manager extends Singleton * See {@link Piwik\Plugin::getInformation()}. * @api */ - public function returnLoadedPluginsInfo() + public function loadAllPluginsAndGetTheirInfo() { $language = Translate::getLanguageToLoad(); @@ -646,7 +646,7 @@ class Manager extends Singleton { $pluginsToLoad = array_unique($pluginsToLoad); $this->pluginsToLoad = $pluginsToLoad; - $this->reloadPlugins(); + $this->reloadActivatedPlugins(); } /** @@ -828,7 +828,7 @@ class Manager extends Singleton * Load the plugins classes installed. * Register the observers for every plugin. */ - private function reloadPlugins() + private function reloadActivatedPlugins() { if ($this->doLoadAlwaysActivatedPlugins) { $this->pluginsToLoad = array_merge($this->pluginsToLoad, $this->pluginToAlwaysActivate); diff --git a/core/StaticContainer.php b/core/StaticContainer.php new file mode 100644 index 0000000000..49b025fa5b --- /dev/null +++ b/core/StaticContainer.php @@ -0,0 +1,65 @@ +<?php +/** + * Piwik - free/libre analytics platform + * + * @link http://piwik.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ + +namespace Piwik; + +use DI\Container; +use DI\ContainerBuilder; +use Doctrine\Common\Cache\ArrayCache; + +/** + * This class provides a static access to the container. + * + * @deprecated This class is introduced only to keep BC with the current static architecture. It will be removed in 3.0. + * - it is global state (that class makes the container a global variable) + * - using the container directly is the "service locator" anti-pattern (which is not dependency injection) + */ +class StaticContainer +{ + /** + * @var Container + */ + private static $container; + + /** + * @return Container + */ + public static function getContainer() + { + if (self::$container === null) { + self::$container = self::createContainer(); + } + + return self::$container; + } + + /** + * @link http://php-di.org/doc/container-configuration.html + */ + private static function createContainer() + { + if (!class_exists("DI\\ContainerBuilder")) { + throw new \Exception("DI\\ContainerBuilder could not be found, maybe you are using Piwik from git and need to update Composer. $ php composer.phar update"); + } + $builder = new ContainerBuilder(); + + // TODO add cache + $builder->setDefinitionCache(new ArrayCache()); + // $builder->writeProxiesToFile(true, PIWIK_USER_PATH . '/tmp/proxies'); + + // Global config + $builder->addDefinitions(PIWIK_USER_PATH . '/config/global.php'); + + // User config + if (file_exists(PIWIK_USER_PATH . '/config/config.php')) { + $builder->addDefinitions(PIWIK_USER_PATH . '/config/config.php'); + } + + return $builder->build(); + } +} diff --git a/core/Updates/2.9.0-b1.php b/core/Updates/2.9.0-b1.php index 9791edbe63..f36f52a6bd 100644 --- a/core/Updates/2.9.0-b1.php +++ b/core/Updates/2.9.0-b1.php @@ -4,25 +4,43 @@ * * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - * */ namespace Piwik\Updates; use Piwik\Common; use Piwik\Db; +use Piwik\Option; use Piwik\Plugin\Manager; use Piwik\Updater; use Piwik\Updates; -/** - */ class Updates_2_9_0_b1 extends Updates { static function getSql() { $sql = array(); + $sql = self::updateBrowserEngine($sql); + + return $sql; + } + + static function update() + { + Updater::updateDatabase(__FILE__, self::getSql()); + + self::updateIPAnonymizationSettings(); + + try { + Manager::getInstance()->activatePlugin('TestRunner'); + } catch (\Exception $e) { + + } + } + + private static function updateBrowserEngine($sql) + { $sql[sprintf("ALTER TABLE `%s` ADD COLUMN `config_browser_engine` VARCHAR(10) NOT NULL", Common::prefixTable('log_visit'))] = 1060; $browserEngineMatch = array( @@ -57,14 +75,18 @@ class Updates_2_9_0_b1 extends Updates return $sql; } - static function update() + private static function updateIPAnonymizationSettings() { - Updater::updateDatabase(__FILE__, self::getSql()); + $optionName = 'PrivacyManager.ipAnonymizerEnabled'; - try { - Manager::getInstance()->activatePlugin('TestRunner'); - } catch (\Exception $e) { + $value = Option::get($optionName); + if ($value !== false) { + // If the config is defined, nothing to do + return; } + + // We disable IP anonymization if it wasn't configured (because by default it has gone from disabled to enabled) + Option::set($optionName, '0'); } } diff --git a/core/Url.php b/core/Url.php index dd9503ca66..d57276d5a5 100644 --- a/core/Url.php +++ b/core/Url.php @@ -586,6 +586,9 @@ 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 Piwik from git and need to update Composer. $ php composer.phar update"); + } return IPUtils::sanitizeIp($host); } diff --git a/core/Version.php b/core/Version.php index cf2377419e..af6db311ed 100644 --- a/core/Version.php +++ b/core/Version.php @@ -21,5 +21,5 @@ final class Version * The current Piwik version. * @var string */ - const VERSION = '2.9.0-b1'; + const VERSION = '2.9.0-b4'; } diff --git a/misc/cron/updatetoken.php b/misc/cron/updatetoken.php index 3936f04f9d..4638f8bd27 100644 --- a/misc/cron/updatetoken.php +++ b/misc/cron/updatetoken.php @@ -32,16 +32,35 @@ if (!Common::isPhpCliMode()) { $testmode = in_array('--testmode', $_SERVER['argv']); if ($testmode) { require_once PIWIK_INCLUDE_PATH . "/tests/PHPUnit/TestingEnvironment.php"; - \Piwik_TestingEnvironment::addHooks(); } + +function getPiwikDomain() +{ + foreach($_SERVER['argv'] as $param) { + $pattern = '--piwik-domain='; + if(false !== strpos($param, $pattern)) { + return substr($param, strlen($pattern)); + } + } + return null; +} + +$piwikDomain = getPiwikDomain(); +if($piwikDomain) { + Url::setHost($piwikDomain); +} + $token = Db::get()->fetchOne("SELECT token_auth FROM " . Common::prefixTable("user") . " WHERE superuser_access = 1 ORDER BY date_registered ASC"); $filename = PIWIK_INCLUDE_PATH . '/tmp/cache/token.php'; + +$filename = SettingsPiwik::rewriteTmpPathWithInstanceId($filename); + $content = "<?php exit; //\t" . $token; file_put_contents($filename, $content); echo $filename;
\ No newline at end of file diff --git a/misc/log-analytics/import_logs.py b/misc/log-analytics/import_logs.py index 9d797efcc9..90a7f4f709 100755 --- a/misc/log-analytics/import_logs.py +++ b/misc/log-analytics/import_logs.py @@ -630,6 +630,9 @@ class Configuration(object): if self.options.enable_testmode: command.append('--testmode') + hostname = urlparse.urlparse( self.options.piwik_url ).hostname + command.append('--piwik-domain=' + hostname ) + command = subprocess.list2cmdline(command) process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True) [stdout, stderr] = process.communicate() diff --git a/misc/package/README.md b/misc/package/README.md new file mode 100644 index 0000000000..f8a1c6b0b7 --- /dev/null +++ b/misc/package/README.md @@ -0,0 +1,3 @@ +# Piwik Packages + +We build the main Piwik packages and Debian package using https://github.com/piwik/piwik-package
\ No newline at end of file diff --git a/misc/package/build.sh b/misc/package/build.sh deleted file mode 100755 index 09366b1fa4..0000000000 --- a/misc/package/build.sh +++ /dev/null @@ -1,217 +0,0 @@ -#!/bin/bash -# Syntax: build.sh version - -# Setup environment once: -# $ curl -sS https://getcomposer.org/installer | php -# git clone -- https://github.com/piwik/piwik.git /home/piwik-builds/builds/piwik_last_version || die "Problem checking out the last version tag" - -# Before running this script, tag a new version: -# $ git tag 1.11-b3 -# $ git push origin tags/1.11-b3 - -VERSION="$1" -DEST_PATH=/home/piwik-builds/builds -URL_REPO=https://github.com/piwik/piwik.git -# repo should be in DEST_PATH/piwik_last_version eg. /home/piwik-builds/builds/piwik_last_version -HTTP_PATH=/home/piwik-builds/www/builds.piwik.org -API_SCP_LATEST=piwik-api@localhost:/home/piwik-api/www/api.piwik.org/ -WWW_SCP_LATEST=piwik@localhost:/home/piwik/www/ - -# report error and exit -function die() { - echo -e "$0: $1" - exit 2 -} - -# clean up the workspace -function cleanupWorkspace() { - rm -rf piwik - rm -f *.html - rm -f *.xml - rm -f *.sql - rm -f *.md - rm -f *.html.* -} - -# organize files for packaging -function organizePackage() { - curl -sS https://getcomposer.org/installer | php - php composer.phar install --no-dev - cd ../ - rm -rf piwik/composer.phar - rm -rf piwik/vendor/twig/twig/test/ - rm -rf piwik/vendor/twig/twig/doc/ - rm -rf piwik/vendor/symfony/console/Symfony/Component/Console/Tests - rm -rf piwik/vendor/symfony/console/Symfony/Component/Console/Resources/bin - rm -rf piwik/vendor/piwik/device-detector/Tests/ - - rm -rf piwik/libs/PhpDocumentor-1.3.2/ - rm -rf piwik/libs/FirePHPCore/ - rm -f piwik/libs/open-flash-chart/php-ofc-library/ofc_upload_image.php - - rm -rf piwik/tmp/* - rm -rf piwik/tmp/.gitkeep - rm -f piwik/misc/updateLanguageFiles.sh - rm -f piwik/misc/others/db-schema* - rm -f piwik/misc/others/diagram_general_request* - rm -f piwik/.travis* - - # delete submodules empty dirs - for path_to_delete in `cat piwik/.gitmodules | grep "path = " | sed "s/.*path = //"` ; do rmdir piwik/$path_to_delete; done - rm -rf piwik/.git* - - cp piwik/tests/README.md . - find piwik -name 'tests' -type d -prune -exec rm -rf {} \; - mkdir piwik/tests - mv README.md piwik/tests/ - - cp piwik/misc/How\ to\ install\ Piwik.html . - if [ -e piwik/misc/package ]; then - cp piwik/misc/package/WebAppGallery/*.* . - rm -rf piwik/misc/package/ - else - if [ -e piwik/misc/WebAppGallery ]; then - cp piwik/misc/WebAppGallery/*.* . - rm -rf piwik/misc/WebAppGallery - fi - fi - - find piwik -type f -printf '%s ' -exec md5sum {} \; \ - | grep -v "user/.htaccess" \ - | egrep -v 'manifest.inc.php|autoload.php|autoload_real.php' \ - | sed '1,$ s/\([0-9]*\) \([a-z0-9]*\) *piwik\/\(.*\)/\t\t"\3" => array("\1", "\2"),/;' \ - | sort \ - | sed '1 s/^/<?php\n\/\/ This file is automatically generated during the Piwik build process \ -namespace Piwik;\nclass Manifest {\n\tstatic $files=array(\n/; $ s/$/\n\t);\n}/' \ - > piwik/config/manifest.inc.php - -} - -if [ -z "$VERSION" ]; then - die "Expected a version number as a parameter" -fi - -# Fail script, if Piwik has already been built, to prevent re-building a given release -destination=$HTTP_PATH/piwik-$VERSION.zip -if [ -f "$destination" ] -then - die "Piwik $VERSION has already been packaged. You must increase Piwik version number before packaging Piwik." -fi - -############################ -echo "Starting build...." -############################ - -# Setting umask so it works for most users, see https://github.com/piwik/piwik/issues/3869 -UMASK=`umask` -umask 0022 - -if [ ! -e $DEST_PATH ] ; then - echo "Destination directory does not exist... Creating it!"; - mkdir -p $DEST_PATH; -fi - -cd $DEST_PATH -cleanupWorkspace - -if [ ! -e $DEST_PATH/piwik_last_version ] ; then - git clone -- $URL_REPO $DEST_PATH/piwik_last_version -fi -echo "checkout repository for tag $VERSION..." -cd $DEST_PATH/piwik_last_version -git checkout master -git pull -git checkout tags/$VERSION - -if [ $? -eq 1 ] ; then - echo "Tag $VERSION does not exist in repository" -fi - -echo "copying files to a new directory..." -cd .. -rm -Rf piwik -cp -R piwik_last_version piwik -cd piwik -git checkout master -git pull - -if [ `git describe --exact-match --tags HEAD` != "$VERSION" ] -then - echo "=====> could not checkout to the tag for this version, make sure tag exists <======" - exit 1 -fi - -cd $DEST_PATH/piwik -git checkout tags/$VERSION - -echo "preparing release $VERSION" - -echo `grep "'$VERSION'" core/Version.php` -if [ `grep "'$VERSION'" core/Version.php | wc -l` -ne 1 ]; then - echo "version $VERSION does not match core/Version.php"; - exit -fi - -echo "organizing files and generating manifest file..." -organizePackage - -echo "packaging release..." -zip -r piwik-$VERSION.zip piwik How\ to\ install\ Piwik.html > /dev/null -tar -czf piwik-$VERSION.tar.gz piwik How\ to\ install\ Piwik.html -mv piwik-$VERSION.{zip,tar.gz} $HTTP_PATH - -zip -r piwik-$VERSION-WAG.zip piwik *.xml *.sql > /dev/null 2> /dev/null -mkdir $HTTP_PATH/WebAppGallery 2> /dev/null -mv piwik-$VERSION-WAG.zip $HTTP_PATH/WebAppGallery/piwik-$VERSION.zip - -# setting back umask -umask $UMASK - -if [ `echo $VERSION | grep -E 'rc|b|a|alpha|beta|dev' -i | wc -l` -eq 1 ]; then - if [ `echo $VERSION | grep -E 'rc|b|beta' -i | wc -l` -eq 1 ]; then - echo "Beta or RC release"; - echo $VERSION > $HTTP_PATH/LATEST_BETA - fi - echo "build finished! http://builds.piwik.org/piwik-$VERSION.zip" -else - echo "Stable release"; - - #hard linking piwik.org/latest.zip to the newly created build - for i in zip tar.gz; do - ln -sf $HTTP_PATH/piwik-$VERSION.$i $HTTP_PATH/latest.$i - ln -sf $HTTP_PATH/piwik-$VERSION.$i $HTTP_PATH/piwik-latest.$i - ln -sf $HTTP_PATH/piwik-$VERSION.$i $HTTP_PATH/piwik.$i - done - - # record filesize in Mb - ls -l $HTTP_PATH/piwik-$VERSION.zip | awk '/d|-/{printf("%.3f %s\n",$5/(1024*1024),$9)}' > LATEST_SIZE - - echo $VERSION > $HTTP_PATH/LATEST - echo $VERSION > $HTTP_PATH/LATEST_BETA - - CMD="scp $HTTP_PATH/LATEST $API_SCP_LATEST" - echo $CMD - $CMD - - CMD="scp $HTTP_PATH/LATEST LATEST_SIZE $WWW_SCP_LATEST" - echo $CMD - $CMD - - SHA1_WINDOWS="$(sha1sum $HTTP_PATH/WebAppGallery/piwik-$VERSION.zip | cut -d' ' -f1)" - - echo -e "Sending email to Microsoft web team \n\n" - echo -e "Hello, \n\n\ -We are proud to announce a new release for Piwik! \n\ -Piwik $VERSION can be downloaded at: http://builds.piwik.org/WebAppGallery/piwik-$VERSION.zip \n\ -SHA1 checksum is: $SHA1_WINDOWS \n\n\ -Please consult the changelog for list of closed tickets: http://piwik.org/changelog/ \n\n\ -We're looking forward to seeing this Piwik version on Microsoft Web App Gallery. \n\ -If you have any question, feel free to ask at feedback@piwik.org. \n\n\ -Thank you,\n\n\ -Piwik team" | mail -s"New Piwik Version $VERSION" "appgal@microsoft.com,hello@piwik.org" - - echo "build finished! http://builds.piwik.org/piwik.zip" -fi - -cleanupWorkspace - diff --git a/plugins/Actions/Actions.php b/plugins/Actions/Actions.php index 4fc8f8a74b..8cff52d8d7 100644 --- a/plugins/Actions/Actions.php +++ b/plugins/Actions/Actions.php @@ -107,10 +107,8 @@ class Actions extends \Piwik\Plugin $jsFiles[] = "plugins/Actions/javascripts/actionsDataTable.js"; } - public function isSiteSearchEnabled() + public function isSiteSearchEnabled($idSites, $idSite) { - $idSite = Common::getRequestVar('idSite', 0, 'int'); - $idSites = Common::getRequestVar('idSites', '', 'string'); $idSites = Site::getIdSitesFromIdSitesString($idSites, true); if (!empty($idSite)) { diff --git a/plugins/Actions/Menu.php b/plugins/Actions/Menu.php index e9ce436b75..9a7424b4e9 100644 --- a/plugins/Actions/Menu.php +++ b/plugins/Actions/Menu.php @@ -8,6 +8,7 @@ */ namespace Piwik\Plugins\Actions; +use Piwik\Common; use Piwik\Menu\MenuReporting; class Menu extends \Piwik\Plugin\Menu @@ -16,8 +17,11 @@ class Menu extends \Piwik\Plugin\Menu { $menu->addActionsItem('', $this->urlForAction('menuGetPageUrls'), 15); + $idSite = Common::getRequestVar('idSite', 0, 'int'); + $idSites = Common::getRequestVar('idSites', '', 'string'); + $actions = new Actions(); - if ($actions->isSiteSearchEnabled()) { + if ($actions->isSiteSearchEnabled($idSites, $idSite)) { $menu->addActionsItem('Actions_SubmenuSitesearch', $this->urlForAction('indexSiteSearch'), 5); } } diff --git a/plugins/Actions/Reports/GetSiteSearchCategories.php b/plugins/Actions/Reports/GetSiteSearchCategories.php index 5acf9e93ae..6d41e3c334 100644 --- a/plugins/Actions/Reports/GetSiteSearchCategories.php +++ b/plugins/Actions/Reports/GetSiteSearchCategories.php @@ -27,9 +27,9 @@ class GetSiteSearchCategories extends SiteSearchBase $this->widgetTitle = 'Actions_WidgetSearchCategories'; } - public function isEnabled() + protected function isEnabledForIdSites($idSites, $idSite) { - return parent::isEnabled() && Actions::isCustomVariablesPluginsEnabled(); + return parent::isEnabledForIdSites($idSites, $idSite) && Actions::isCustomVariablesPluginsEnabled(); } public function getMetrics() diff --git a/plugins/Actions/Reports/SiteSearchBase.php b/plugins/Actions/Reports/SiteSearchBase.php index 5212732e49..942710b792 100644 --- a/plugins/Actions/Reports/SiteSearchBase.php +++ b/plugins/Actions/Reports/SiteSearchBase.php @@ -8,6 +8,7 @@ */ namespace Piwik\Plugins\Actions\Reports; +use Piwik\Common; use Piwik\Piwik; use Piwik\Plugin\ViewDataTable; use Piwik\Plugins\Actions\Actions; @@ -22,8 +23,31 @@ abstract class SiteSearchBase extends Base public function isEnabled() { + $idSites = Common::getRequestVar('idSites', '', 'string'); + $idSite = Common::getRequestVar('idSite', 0, 'int'); + + return $this->isEnabledForIdSites($idSites, $idSite); + } + + protected function isEnabledForIdSites($idSites, $idSite) + { $actions = new Actions(); - return $actions->isSiteSearchEnabled(); + return $actions->isSiteSearchEnabled($idSites, $idSite); + } + + public function configureReportMetadata(&$availableReports, $infos) + { + $idSites = !empty($infos['idSites']) ? $infos['idSites'] : array(); + + if (!$this->isEnabledForIdSites($idSites, 0)) { + return; + } + + $report = $this->buildReportMetadata(); + + if (!empty($report)) { + $availableReports[] = $report; + } } protected function addSiteSearchDisplayProperties(ViewDataTable $view) diff --git a/plugins/CoreAdminHome/CustomLogo.php b/plugins/CoreAdminHome/CustomLogo.php index eda7ef0638..76f328e139 100644 --- a/plugins/CoreAdminHome/CustomLogo.php +++ b/plugins/CoreAdminHome/CustomLogo.php @@ -11,6 +11,7 @@ namespace Piwik\Plugins\CoreAdminHome; use Piwik\Config; use Piwik\Filesystem; use Piwik\Option; +use Piwik\Plugin\Manager; use Piwik\SettingsPiwik; class CustomLogo @@ -114,7 +115,12 @@ class CustomLogo $logo = $defaultLogo; - $themeName = \Piwik\Plugin\Manager::getInstance()->getThemeEnabled()->getPluginName(); + $theme = \Piwik\Plugin\Manager::getInstance()->getThemeEnabled(); + if(!$theme) { + $themeName = Manager::DEFAULT_THEME; + } else { + $themeName = $theme->getPluginName(); + } $themeLogo = sprintf($themeLogo, $themeName); if (file_exists($pathToPiwikRoot . '/' . $themeLogo)) { diff --git a/plugins/CorePluginsAdmin/Controller.php b/plugins/CorePluginsAdmin/Controller.php index 245a24ce11..b87fc91579 100644 --- a/plugins/CorePluginsAdmin/Controller.php +++ b/plugins/CorePluginsAdmin/Controller.php @@ -284,7 +284,7 @@ class Controller extends Plugin\ControllerAdmin protected function getPluginsInfo($themesOnly = false) { $pluginManager = \Piwik\Plugin\Manager::getInstance(); - $plugins = $pluginManager->returnLoadedPluginsInfo(); + $plugins = $pluginManager->loadAllPluginsAndGetTheirInfo(); foreach ($plugins as $pluginName => &$plugin) { @@ -370,7 +370,7 @@ class Controller extends Plugin\ControllerAdmin $view->lastError = $lastError; $view->isSuperUser = Piwik::hasUserSuperUserAccess(); $view->isAnonymousUser = Piwik::isUserIsAnonymous(); - $view->plugins = Plugin\Manager::getInstance()->returnLoadedPluginsInfo(); + $view->plugins = Plugin\Manager::getInstance()->loadAllPluginsAndGetTheirInfo(); $view->deactivateNonce = Nonce::getNonce(static::DEACTIVATE_NONCE); $view->uninstallNonce = Nonce::getNonce(static::UNINSTALL_NONCE); $view->emailSuperUser = implode(',', Piwik::getAllSuperUserAccessEmailAddresses()); diff --git a/plugins/CorePluginsAdmin/Marketplace.php b/plugins/CorePluginsAdmin/Marketplace.php index 3b876131cf..6cb5a28105 100644 --- a/plugins/CorePluginsAdmin/Marketplace.php +++ b/plugins/CorePluginsAdmin/Marketplace.php @@ -105,7 +105,7 @@ class Marketplace public function getPluginsHavingUpdate($themesOnly) { $pluginManager = \Piwik\Plugin\Manager::getInstance(); - $pluginManager->returnLoadedPluginsInfo(); + $pluginManager->loadAllPluginsAndGetTheirInfo(); $loadedPlugins = $pluginManager->getLoadedPlugins(); try { diff --git a/plugins/CoreUpdater/Controller.php b/plugins/CoreUpdater/Controller.php index cc27c3e9aa..5dbc14b565 100644 --- a/plugins/CoreUpdater/Controller.php +++ b/plugins/CoreUpdater/Controller.php @@ -36,7 +36,6 @@ use Piwik\View; */ class Controller extends \Piwik\Plugin\Controller { - const CONFIG_FILE_BACKUP = '/config/global.ini.auto-backup-before-update.php'; const PATH_TO_EXTRACT_LATEST_VERSION = '/tmp/latest/'; private $coreError = false; @@ -97,7 +96,6 @@ class Controller extends \Piwik\Plugin\Controller array('oneClick_Download', Piwik::translate('CoreUpdater_DownloadingUpdateFromX', $url)), array('oneClick_Unpack', Piwik::translate('CoreUpdater_UnpackingTheUpdate')), array('oneClick_Verify', Piwik::translate('CoreUpdater_VerifyingUnpackedFiles')), - array('oneClick_CreateConfigFileBackup', Piwik::translate('CoreUpdater_CreatingBackupOfConfigurationFile', self::CONFIG_FILE_BACKUP)) ); $incompatiblePlugins = $this->getIncompatiblePlugins($this->newVersion); if (!empty($incompatiblePlugins)) { @@ -216,13 +214,6 @@ class Controller extends \Piwik\Plugin\Controller } } - private function oneClick_CreateConfigFileBackup() - { - $configFileBefore = PIWIK_USER_PATH . '/config/global.ini.php'; - $configFileAfter = PIWIK_USER_PATH . self::CONFIG_FILE_BACKUP; - Filesystem::copy($configFileBefore, $configFileAfter); - } - private function oneClick_DisableIncompatiblePlugins() { $plugins = $this->getIncompatiblePlugins($this->newVersion); diff --git a/plugins/CoreUpdater/lang/am.json b/plugins/CoreUpdater/lang/am.json index fcf1dbba92..a28166b813 100644 --- a/plugins/CoreUpdater/lang/am.json +++ b/plugins/CoreUpdater/lang/am.json @@ -1,6 +1,5 @@ { "CoreUpdater": { - "CreatingBackupOfConfigurationFile": "የውቅረት ፋይሉን መጠባበቂያ በመፍጠር ላይ %s", "CriticalErrorDuringTheUpgradeProcess": "በማላቅ ሂደት ላይ ያጋጠመ ከባድ እንከን:", "DatabaseUpgradeRequired": "የውሂብ ጎታ ማላቅ ያስፈልጋል", "DownloadX": "አውርድ %s", diff --git a/plugins/CoreUpdater/lang/ar.json b/plugins/CoreUpdater/lang/ar.json index 659bebab73..c674bcc644 100644 --- a/plugins/CoreUpdater/lang/ar.json +++ b/plugins/CoreUpdater/lang/ar.json @@ -1,7 +1,6 @@ { "CoreUpdater": { "ClickHereToViewSqlQueries": "انقر هنا لمشاهدة ونسخ قائمة استعلامات SQL والتي سيتم تنفيذها.", - "CreatingBackupOfConfigurationFile": "جاري حفظ ملف الإعدادات احتياطياً في %s", "CriticalErrorDuringTheUpgradeProcess": "خطأ حرج أثناء عملية التحديث:", "DatabaseUpgradeRequired": "تحديث قاعدة البيانات مطلوب", "DownloadingUpdateFromX": "جاري تحميل التحديث من %s", diff --git a/plugins/CoreUpdater/lang/be.json b/plugins/CoreUpdater/lang/be.json index aece46353f..21b5ca2a6c 100644 --- a/plugins/CoreUpdater/lang/be.json +++ b/plugins/CoreUpdater/lang/be.json @@ -1,7 +1,6 @@ { "CoreUpdater": { "ClickHereToViewSqlQueries": "Націсніце тут для прагляду і капіравання спісу SQL запытаў, якія будуць выкананы", - "CreatingBackupOfConfigurationFile": "Содаю рэзервовую копію файла канфігурацыі ў %s", "CriticalErrorDuringTheUpgradeProcess": "Крытычная памылка падчас абнаўлення:", "DatabaseUpgradeRequired": "Патрабуецца абнаўленне базы дадзеных", "DownloadingUpdateFromX": "Запампоўка абнаўленняў %s", diff --git a/plugins/CoreUpdater/lang/bg.json b/plugins/CoreUpdater/lang/bg.json index e645926fff..a2aa8b7fc7 100644 --- a/plugins/CoreUpdater/lang/bg.json +++ b/plugins/CoreUpdater/lang/bg.json @@ -1,7 +1,6 @@ { "CoreUpdater": { "ClickHereToViewSqlQueries": "Щракнете тук, за да видите и копие на списъка на SQL заявката, която ще изпълнява", - "CreatingBackupOfConfigurationFile": "Създадено е резервно копие на конфигурационния файл в %s", "CriticalErrorDuringTheUpgradeProcess": "Открита е КРИТИЧНА грешка по време на обновяването:", "DatabaseUpgradeRequired": "Необходимо е да се обнови базата от данни (БД)", "DisablingIncompatiblePlugins": "Изключване на несъвместими добавки: %s", diff --git a/plugins/CoreUpdater/lang/ca.json b/plugins/CoreUpdater/lang/ca.json index ef7d7bd6c5..1125a5ecca 100644 --- a/plugins/CoreUpdater/lang/ca.json +++ b/plugins/CoreUpdater/lang/ca.json @@ -1,7 +1,6 @@ { "CoreUpdater": { "ClickHereToViewSqlQueries": "Feu click aquí per veure i copiar la llista de consultes SQL que s'executaran", - "CreatingBackupOfConfigurationFile": "S'està creant una còpia de seguretat del fitxer de configuració a %s", "CriticalErrorDuringTheUpgradeProcess": "Hi ha hagut un error crític durant el procés d'actualització:", "DatabaseUpgradeRequired": "És necessari actualitzar la base de dades", "DownloadingUpdateFromX": "S'està descarregant l'actualització de %s", diff --git a/plugins/CoreUpdater/lang/cs.json b/plugins/CoreUpdater/lang/cs.json index 576d0cf93b..7753d8a6bd 100644 --- a/plugins/CoreUpdater/lang/cs.json +++ b/plugins/CoreUpdater/lang/cs.json @@ -1,7 +1,6 @@ { "CoreUpdater": { "ClickHereToViewSqlQueries": "Klikněte zde pro zobrazení SQL dotazů s možností je zkopírovat, které mají být spuštěny", - "CreatingBackupOfConfigurationFile": "Vytvářím zálohu konfiguračního souboru v %s", "CriticalErrorDuringTheUpgradeProcess": "Při aktualizaci nastala kritická chyba:", "DatabaseUpgradeRequired": "Vyžadováno povýšení databáze", "DisablingIncompatiblePlugins": "Zakazování nekompatibilních zásuvných modulů %s", diff --git a/plugins/CoreUpdater/lang/da.json b/plugins/CoreUpdater/lang/da.json index efc93c3a73..4293aa66b3 100644 --- a/plugins/CoreUpdater/lang/da.json +++ b/plugins/CoreUpdater/lang/da.json @@ -1,7 +1,6 @@ { "CoreUpdater": { "ClickHereToViewSqlQueries": "Klik her for at se og kopiere listen over SQL-forespørgsler, der vil blive udført", - "CreatingBackupOfConfigurationFile": "Opretter sikkerhedskopi af konfigurationsfiler i %s", "CriticalErrorDuringTheUpgradeProcess": "Kritisk fejl under opdateringen:", "DatabaseUpgradeRequired": "Database opdatering er nødvendig", "DisablingIncompatiblePlugins": "Deaktivere inkompatible programudvidelsen: %s", diff --git a/plugins/CoreUpdater/lang/de.json b/plugins/CoreUpdater/lang/de.json index 07acce08be..33144f11b1 100644 --- a/plugins/CoreUpdater/lang/de.json +++ b/plugins/CoreUpdater/lang/de.json @@ -1,7 +1,6 @@ { "CoreUpdater": { "ClickHereToViewSqlQueries": "Klicken Sie hier, um die Liste der auszuführenden SQL-Befehle anzuzeigen.", - "CreatingBackupOfConfigurationFile": "Eine Sicherheitskopie der Konfigurationsdatei wird in %s erstellt", "CriticalErrorDuringTheUpgradeProcess": "Kritischer Fehler während der Aktualisierung:", "DatabaseUpgradeRequired": "Die Datenbank muss aktualisiert werden", "DisablingIncompatiblePlugins": "Deaktiviere inkompatible Plugins: %s", diff --git a/plugins/CoreUpdater/lang/el.json b/plugins/CoreUpdater/lang/el.json index 936e02d32b..3ecad1186c 100644 --- a/plugins/CoreUpdater/lang/el.json +++ b/plugins/CoreUpdater/lang/el.json @@ -1,7 +1,6 @@ { "CoreUpdater": { "ClickHereToViewSqlQueries": "Πατήστε εδώ για να δείτε και να αντιγράψετε τη λίστα των ερωτημάτων που θα εκτελεστούν", - "CreatingBackupOfConfigurationFile": "Δημιουργία εφεδρείας του αρχείου ρυθμίσεων στο %s", "CriticalErrorDuringTheUpgradeProcess": "Κρίσιμο σφάλμα κατά τη διαδικασία αναβάθμισης:", "DatabaseUpgradeRequired": "Απαιτείται Αναβάθμιση της Βάσης Δεδομένων", "DisablingIncompatiblePlugins": "Απενεργοποίηση των μη συμβατών πρόσθετων: %s", diff --git a/plugins/CoreUpdater/lang/en.json b/plugins/CoreUpdater/lang/en.json index 15285300eb..1b94754223 100644 --- a/plugins/CoreUpdater/lang/en.json +++ b/plugins/CoreUpdater/lang/en.json @@ -1,7 +1,6 @@ { "CoreUpdater": { "ClickHereToViewSqlQueries": "Click here to view and copy the list of SQL queries that will get executed", - "CreatingBackupOfConfigurationFile": "Creating a backup of the configuration file in %s", "CriticalErrorDuringTheUpgradeProcess": "Critical Error during the update process:", "DatabaseUpgradeRequired": "Database Upgrade Required", "DisablingIncompatiblePlugins": "Disabling incompatible plugins: %s", diff --git a/plugins/CoreUpdater/lang/es.json b/plugins/CoreUpdater/lang/es.json index b3210a311b..4f1cb647be 100644 --- a/plugins/CoreUpdater/lang/es.json +++ b/plugins/CoreUpdater/lang/es.json @@ -1,7 +1,6 @@ { "CoreUpdater": { "ClickHereToViewSqlQueries": "Clic aquí para ver y copiar la lista de sentencias SQL que será ejecutada", - "CreatingBackupOfConfigurationFile": "Creando una copia de seguridad del archivo de configuración en %s", "CriticalErrorDuringTheUpgradeProcess": "Error crítico durante el proceso de actualización:", "DatabaseUpgradeRequired": "La base de datos necesita actualizarse", "DisablingIncompatiblePlugins": "Desactivando plugins incompatibles: %s", diff --git a/plugins/CoreUpdater/lang/et.json b/plugins/CoreUpdater/lang/et.json index f53995cd9f..62e1e91e75 100644 --- a/plugins/CoreUpdater/lang/et.json +++ b/plugins/CoreUpdater/lang/et.json @@ -1,7 +1,6 @@ { "CoreUpdater": { "ClickHereToViewSqlQueries": "Vajuta siia, et näha ja kopeerida teostamisele minevad SQL päringud", - "CreatingBackupOfConfigurationFile": "Loon seadete varukoopiat faili %s", "CriticalErrorDuringTheUpgradeProcess": "Kriitiline viga uuendamise protsessi ajal:", "DatabaseUpgradeRequired": "Andmebaasi uuendus on vajalik", "DownloadingUpdateFromX": "Laen uuendust %s", diff --git a/plugins/CoreUpdater/lang/eu.json b/plugins/CoreUpdater/lang/eu.json index 4bf29dd84f..7f616edec9 100644 --- a/plugins/CoreUpdater/lang/eu.json +++ b/plugins/CoreUpdater/lang/eu.json @@ -1,6 +1,5 @@ { "CoreUpdater": { - "CreatingBackupOfConfigurationFile": "Konfigurazio-fitxategiaren babeskopia sortzen %s kokalekuan", "CriticalErrorDuringTheUpgradeProcess": "Errore kritikoa eguneraketa prozesuan:", "DatabaseUpgradeRequired": "Datu-basearen bertsio-berritzea beharrezkoa", "DownloadingUpdateFromX": "Eguneraketa deskargatzen: %s", diff --git a/plugins/CoreUpdater/lang/fa.json b/plugins/CoreUpdater/lang/fa.json index 7d78145a07..9d7dad97d1 100644 --- a/plugins/CoreUpdater/lang/fa.json +++ b/plugins/CoreUpdater/lang/fa.json @@ -1,7 +1,6 @@ { "CoreUpdater": { "ClickHereToViewSqlQueries": "اینجا کلیک کنید تا فهرست پرس و جوهای SQL ی را که اجرا شده اند مشاهده و کپی نمایید.", - "CreatingBackupOfConfigurationFile": "یک بکآپ از فایل تنظیمات ایجاد کنید در %s", "CriticalErrorDuringTheUpgradeProcess": "خطای بحرانی در فرآیند به روز رسانی:", "DatabaseUpgradeRequired": "بانک اطلاعاتی به بروزرسانی نیاز دارد.", "DownloadingUpdateFromX": "دانلود آپدیت از %s", diff --git a/plugins/CoreUpdater/lang/fi.json b/plugins/CoreUpdater/lang/fi.json index d734f38359..6dab965b17 100644 --- a/plugins/CoreUpdater/lang/fi.json +++ b/plugins/CoreUpdater/lang/fi.json @@ -1,7 +1,6 @@ { "CoreUpdater": { "ClickHereToViewSqlQueries": "Paina tästä nähdäksesi tarvittavat SQL-kyselyt", - "CreatingBackupOfConfigurationFile": "Luodaan varmuuskopiota asetustiedostosta: %s", "CriticalErrorDuringTheUpgradeProcess": "Kriittinen virhe päivitysprosessissa:", "DatabaseUpgradeRequired": "Tietokannan päivitys tarvitaan", "DisablingIncompatiblePlugins": "Poistetaan epäyhteensopivat lisäosat käytöstä: %s", diff --git a/plugins/CoreUpdater/lang/fr.json b/plugins/CoreUpdater/lang/fr.json index ab997bf1a8..13d8cee023 100644 --- a/plugins/CoreUpdater/lang/fr.json +++ b/plugins/CoreUpdater/lang/fr.json @@ -1,7 +1,6 @@ { "CoreUpdater": { "ClickHereToViewSqlQueries": "Cliquez ici pour visualiser la liste des commandes SQL qui vont être exécutées", - "CreatingBackupOfConfigurationFile": "Création d'une sauvegarde du fichier de configuration dans le répertoire %s", "CriticalErrorDuringTheUpgradeProcess": "Erreur Critique pendant le procédé de mise à jour :", "DatabaseUpgradeRequired": "Mise à jour de la base de données requise", "DisablingIncompatiblePlugins": "Désactivation des plugins incompatibles : %s", diff --git a/plugins/CoreUpdater/lang/he.json b/plugins/CoreUpdater/lang/he.json index b62781c82d..1448ea4d63 100644 --- a/plugins/CoreUpdater/lang/he.json +++ b/plugins/CoreUpdater/lang/he.json @@ -1,7 +1,6 @@ { "CoreUpdater": { "ClickHereToViewSqlQueries": "צפייה והעתקת השאילתות שירוצו", - "CreatingBackupOfConfigurationFile": "יוצר גיבוי של קובץ ההגדרות ב%s", "CriticalErrorDuringTheUpgradeProcess": "שגיאה קריטית במהלך תהליך השדרוג:", "DatabaseUpgradeRequired": "שדרוג בסיס נתונים נדרש", "DownloadingUpdateFromX": "מוריד עדכון מ%s", diff --git a/plugins/CoreUpdater/lang/hi.json b/plugins/CoreUpdater/lang/hi.json index e57cefe6c6..57f5009694 100644 --- a/plugins/CoreUpdater/lang/hi.json +++ b/plugins/CoreUpdater/lang/hi.json @@ -1,7 +1,6 @@ { "CoreUpdater": { "ClickHereToViewSqlQueries": "क्रियान्वित किया जाएगा कि एसक्यूएल प्रश्नों की सूची देखने और कॉपी करने के लिए यहां क्लिक करें", - "CreatingBackupOfConfigurationFile": "%s में विन्यास फाइल का बैकअप बनाना", "CriticalErrorDuringTheUpgradeProcess": "अद्यतन प्रक्रिया के दौरान गंभीर त्रुटि:", "DatabaseUpgradeRequired": "डेटाबेस नवीनीकरण आवश्यक", "DownloadingUpdateFromX": "%s से अद्यतन डाउनलोड कर रहा है", diff --git a/plugins/CoreUpdater/lang/hu.json b/plugins/CoreUpdater/lang/hu.json index 13a2a96578..42320746f6 100644 --- a/plugins/CoreUpdater/lang/hu.json +++ b/plugins/CoreUpdater/lang/hu.json @@ -1,7 +1,6 @@ { "CoreUpdater": { "ClickHereToViewSqlQueries": "Kattints ide a végrehajtásra kerülő SQL parancsok listájának megtekintéséhez vagy kimásolásához.", - "CreatingBackupOfConfigurationFile": "Konfigurációs fájl biztonsági mentése ide: %s", "CriticalErrorDuringTheUpgradeProcess": "Kritikus hiba lépett fel a frissítés során:", "DatabaseUpgradeRequired": "Adatbázis-frissítés szükséges", "DownloadingUpdateFromX": "Frissítés letöltése innen: %s", diff --git a/plugins/CoreUpdater/lang/id.json b/plugins/CoreUpdater/lang/id.json index c9605381f1..8d498e1f2b 100644 --- a/plugins/CoreUpdater/lang/id.json +++ b/plugins/CoreUpdater/lang/id.json @@ -1,7 +1,6 @@ { "CoreUpdater": { "ClickHereToViewSqlQueries": "Klik di sini untuk melihat dan menyalin daftar kueri SQL yang akan dieksekusi", - "CreatingBackupOfConfigurationFile": "Membuat cadangan berkas konfigurasi di %s", "CriticalErrorDuringTheUpgradeProcess": "Kesalahan fatal terjadi selama pembaruan:", "DatabaseUpgradeRequired": "Membutuhkan Pembaruan Basisdata", "DownloadingUpdateFromX": "Mengunduh pembaruan dari %s", diff --git a/plugins/CoreUpdater/lang/it.json b/plugins/CoreUpdater/lang/it.json index d7e106b5de..c7bff9c093 100644 --- a/plugins/CoreUpdater/lang/it.json +++ b/plugins/CoreUpdater/lang/it.json @@ -1,7 +1,6 @@ { "CoreUpdater": { "ClickHereToViewSqlQueries": "Leggi e copia la lista di query SQL che dovranno essere eseguite", - "CreatingBackupOfConfigurationFile": "Sto creando un backup del file di configurazione in %s", "CriticalErrorDuringTheUpgradeProcess": "Errore critico durante l'aggiornamento:", "DatabaseUpgradeRequired": "Aggiornamento del Database richiesto", "DisablingIncompatiblePlugins": "Disabilitazione plugins incompatibili: %s", diff --git a/plugins/CoreUpdater/lang/ja.json b/plugins/CoreUpdater/lang/ja.json index 6e2aa2f923..f462cbe36d 100644 --- a/plugins/CoreUpdater/lang/ja.json +++ b/plugins/CoreUpdater/lang/ja.json @@ -1,7 +1,6 @@ { "CoreUpdater": { "ClickHereToViewSqlQueries": "実行する SQL クエリーのリストを表示し、コピーするには、ここをクリックしてください", - "CreatingBackupOfConfigurationFile": "%s の設定ファイルのバックアップを作成中", "CriticalErrorDuringTheUpgradeProcess": "アップグレード処理中の致命的なエラー:", "DatabaseUpgradeRequired": "データベースのアップグレードが必要", "DisablingIncompatiblePlugins": "互換性のないプラグインを無効にします: %s", diff --git a/plugins/CoreUpdater/lang/ka.json b/plugins/CoreUpdater/lang/ka.json index 6a9fbbd17e..224b596e3e 100644 --- a/plugins/CoreUpdater/lang/ka.json +++ b/plugins/CoreUpdater/lang/ka.json @@ -1,7 +1,6 @@ { "CoreUpdater": { "ClickHereToViewSqlQueries": "დააწკაპუნეთ აქ, რომ იხილოთ და გადაწეროთ SQL ბრძანებები, რომლებიც საჭიროა შესრულდეს", - "CreatingBackupOfConfigurationFile": "კონფიგურაციის ფაილის სარეზერვო ასლის შექმნა %s საქაღალდეში", "CriticalErrorDuringTheUpgradeProcess": "განახლების პროცესის დროს მომხდარი კრიტიკული შეცდომა:", "DatabaseUpgradeRequired": "საჭიროა მონაცემთა ბაზის განახლება", "DownloadingUpdateFromX": "ჩამოტვირთეთ განახლება აქედან %s", diff --git a/plugins/CoreUpdater/lang/ko.json b/plugins/CoreUpdater/lang/ko.json index 239ca1f042..57e4de79ef 100644 --- a/plugins/CoreUpdater/lang/ko.json +++ b/plugins/CoreUpdater/lang/ko.json @@ -1,7 +1,6 @@ { "CoreUpdater": { "ClickHereToViewSqlQueries": "이 목록을 실행하는 SQL 쿼리를 조회하고 복사하려면 여기를 클릭하세요", - "CreatingBackupOfConfigurationFile": "%s 안의 설정 파일 백업 생성중", "CriticalErrorDuringTheUpgradeProcess": "업데이트 과정중에 치명적인 에러 발생:", "DatabaseUpgradeRequired": "데이터베이스 업그레이드 필요함", "DownloadingUpdateFromX": "%s에서 업데이트를 다운로드 중", diff --git a/plugins/CoreUpdater/lang/lt.json b/plugins/CoreUpdater/lang/lt.json index 7aba2b0c1a..2dbf68d04a 100644 --- a/plugins/CoreUpdater/lang/lt.json +++ b/plugins/CoreUpdater/lang/lt.json @@ -1,7 +1,6 @@ { "CoreUpdater": { "ClickHereToViewSqlQueries": "Spauskite čia SQL užklausų, kurias reikia įvykdyti, sąrašui gauti.", - "CreatingBackupOfConfigurationFile": "Sukuriama atsarginė konfigūracijos failų kopija %s", "CriticalErrorDuringTheUpgradeProcess": "Kritinė klaida atnaujinimo metu:", "DatabaseUpgradeRequired": "Reikalingas duombazės atnaujinimas", "DownloadingUpdateFromX": "Atsisiunčiamas atnaujinimas iš %s", diff --git a/plugins/CoreUpdater/lang/lv.json b/plugins/CoreUpdater/lang/lv.json index ebb9c202fb..0f078b5bb7 100644 --- a/plugins/CoreUpdater/lang/lv.json +++ b/plugins/CoreUpdater/lang/lv.json @@ -1,6 +1,5 @@ { "CoreUpdater": { - "CreatingBackupOfConfigurationFile": "Tiek veikta iestatījumu datnes rezerver kopēšana kā %s", "DatabaseUpgradeRequired": "Vajadzīgs datubāzes atjauninājums", "DownloadingUpdateFromX": "Notiek atjauninājuma ielāde no %s", "DownloadX": "Lejupielādē %s", diff --git a/plugins/CoreUpdater/lang/nb.json b/plugins/CoreUpdater/lang/nb.json index 2307bf5521..1d5f7e1b85 100644 --- a/plugins/CoreUpdater/lang/nb.json +++ b/plugins/CoreUpdater/lang/nb.json @@ -1,7 +1,6 @@ { "CoreUpdater": { "ClickHereToViewSqlQueries": "Klikk her for å se og kopiere listen med SQL-spørringer som vil bli utført.", - "CreatingBackupOfConfigurationFile": "Oppretter en sikkerhetskopi av konfigurasjonsfilene i %s", "CriticalErrorDuringTheUpgradeProcess": "Kritisk feil under oppdateringen:", "DatabaseUpgradeRequired": "Databaseoppgradering er nødvendig", "DownloadingUpdateFromX": "Laster ned oppdatering fra %s", diff --git a/plugins/CoreUpdater/lang/nl.json b/plugins/CoreUpdater/lang/nl.json index 5b0521c8d8..4794de88f1 100644 --- a/plugins/CoreUpdater/lang/nl.json +++ b/plugins/CoreUpdater/lang/nl.json @@ -1,7 +1,6 @@ { "CoreUpdater": { "ClickHereToViewSqlQueries": "Klik hier voor een lijst van de SQL query's dat zullen worden uitgevoerd.", - "CreatingBackupOfConfigurationFile": "Bezig met het maken van een backup van het configuratie bestand in %s", "CriticalErrorDuringTheUpgradeProcess": "Kritieke fout tijdens upgrade:", "DatabaseUpgradeRequired": "Database upgrade vereist", "DownloadingUpdateFromX": "Bezig met downloaden van de update van %s", @@ -37,6 +36,7 @@ "PiwikWillBeUpgradedFromVersionXToVersionY": "Piwik Database zal ge-upgrade worden van versie %1$s naar de nieuwe versie %2$s", "PluginDescription": "Piwik updating mechanisme", "ReadyToGo": "Klaar om te starten?", + "TheFollowingDimensionsWillBeUpgradedX": "De volgende onderdelen zullen worden geupdate: %s.", "TheFollowingPluginsWillBeUpgradedX": "De volgende plugins zullen ge-upgrade worden: %s.", "ThereIsNewPluginVersionAvailableForUpdate": "Somige plugins die u gebruikt zijn bijgewerkt op de Marktplaats:", "ThereIsNewVersionAvailableForUpdate": "Er is een nieuwe versie van Piwik beschikbaar als update", diff --git a/plugins/CoreUpdater/lang/nn.json b/plugins/CoreUpdater/lang/nn.json index 88af7e311a..eb7a51437b 100644 --- a/plugins/CoreUpdater/lang/nn.json +++ b/plugins/CoreUpdater/lang/nn.json @@ -1,7 +1,6 @@ { "CoreUpdater": { "ClickHereToViewSqlQueries": "Klikk her for å sjå og kopiera SQL-spurnadene som vil bli køyrd", - "CreatingBackupOfConfigurationFile": "Lagar tryggleikskopi av konfigurasjonsfila i %s", "CriticalErrorDuringTheUpgradeProcess": "Kritisk feil under oppdateringa:", "DatabaseUpgradeRequired": "Databaseoppdatering krevst", "DownloadingUpdateFromX": "Lastar ned oppdatering frå %s", diff --git a/plugins/CoreUpdater/lang/pl.json b/plugins/CoreUpdater/lang/pl.json index e5d1ea2269..60cc601d89 100644 --- a/plugins/CoreUpdater/lang/pl.json +++ b/plugins/CoreUpdater/lang/pl.json @@ -1,7 +1,6 @@ { "CoreUpdater": { "ClickHereToViewSqlQueries": "Kliknij tutaj, aby wyświetlić i skopiować listę zapytań SQL, która zostanie wykonana", - "CreatingBackupOfConfigurationFile": "Utworzenie archiwum pliku konfiguracyjnego w %s", "CriticalErrorDuringTheUpgradeProcess": "Błąd krytyczny w trakcie procesu aktualizacji:", "DatabaseUpgradeRequired": "Wymagana aktualizacja bazy danych", "DisablingIncompatiblePlugins": "Wyłączanie niekompatybilnych wtyczek: %s", diff --git a/plugins/CoreUpdater/lang/pt-br.json b/plugins/CoreUpdater/lang/pt-br.json index 80d7a26e30..a9d756a014 100644 --- a/plugins/CoreUpdater/lang/pt-br.json +++ b/plugins/CoreUpdater/lang/pt-br.json @@ -1,7 +1,6 @@ { "CoreUpdater": { "ClickHereToViewSqlQueries": "Clique aqui para ver e copiar a lista de queries SQL que serão executadas", - "CreatingBackupOfConfigurationFile": "Criando uma cópia dos arquivos de configuração em %s", "CriticalErrorDuringTheUpgradeProcess": "Erro crítico durante o processo de atualização:", "DatabaseUpgradeRequired": "Atualização do banco de dados requerida", "DownloadingUpdateFromX": "Baixando atualização de %s", diff --git a/plugins/CoreUpdater/lang/pt.json b/plugins/CoreUpdater/lang/pt.json index 9885740f48..44d4270d17 100644 --- a/plugins/CoreUpdater/lang/pt.json +++ b/plugins/CoreUpdater/lang/pt.json @@ -1,7 +1,6 @@ { "CoreUpdater": { "ClickHereToViewSqlQueries": "Clique aqui para ver e copiar a lista de consultas SQL que serão executadas", - "CreatingBackupOfConfigurationFile": "A criar uma cópia de segurança do ficheiro de configuração em %s", "CriticalErrorDuringTheUpgradeProcess": "Erro Crítico durante o processo de actualização:", "DatabaseUpgradeRequired": "Actualização da Base de Dados Necessário", "DownloadingUpdateFromX": "A transferir actualização de %s", diff --git a/plugins/CoreUpdater/lang/ro.json b/plugins/CoreUpdater/lang/ro.json index d569b795aa..9901fb4bb8 100644 --- a/plugins/CoreUpdater/lang/ro.json +++ b/plugins/CoreUpdater/lang/ro.json @@ -1,7 +1,6 @@ { "CoreUpdater": { "ClickHereToViewSqlQueries": "Click aici pentru a vedea si a copia lista cu interogarile SQL care vor fi executate", - "CreatingBackupOfConfigurationFile": "Crează o copie a fişierului configuraţie în %s", "CriticalErrorDuringTheUpgradeProcess": "Eroare critica a procesului de actualizare :", "DatabaseUpgradeRequired": "Actualizare necesara a bazei de date", "DisablingIncompatiblePlugins": "Se dezactiveaza pluginurile incompatibile: %s", diff --git a/plugins/CoreUpdater/lang/ru.json b/plugins/CoreUpdater/lang/ru.json index 46fa3f90b7..bba05fe6c0 100644 --- a/plugins/CoreUpdater/lang/ru.json +++ b/plugins/CoreUpdater/lang/ru.json @@ -1,7 +1,6 @@ { "CoreUpdater": { "ClickHereToViewSqlQueries": "Нажмите здесь чтобы просмотреть и скопировать список SQL запросов, который необходимо выполнить", - "CreatingBackupOfConfigurationFile": "Создаю резервную копию файла конфигурации в %s", "CriticalErrorDuringTheUpgradeProcess": "Критическая ошибка во время обновления:", "DatabaseUpgradeRequired": "Требуется обновление базы данных", "DisablingIncompatiblePlugins": "Отключить несовместимые плагины: %s", diff --git a/plugins/CoreUpdater/lang/sk.json b/plugins/CoreUpdater/lang/sk.json index 9932182d92..a7994f6fc2 100644 --- a/plugins/CoreUpdater/lang/sk.json +++ b/plugins/CoreUpdater/lang/sk.json @@ -1,6 +1,5 @@ { "CoreUpdater": { - "CreatingBackupOfConfigurationFile": "Vytváranie zálohy konfiguračného súboru v %s", "CriticalErrorDuringTheUpgradeProcess": "Kritická chyba počas procesu aktualizácie:", "DatabaseUpgradeRequired": "Vyžaduje sa aktualizácia databázy", "DownloadX": "Stiahnuť %s", diff --git a/plugins/CoreUpdater/lang/sl.json b/plugins/CoreUpdater/lang/sl.json index 50476844e0..95b7c1bef5 100644 --- a/plugins/CoreUpdater/lang/sl.json +++ b/plugins/CoreUpdater/lang/sl.json @@ -1,7 +1,6 @@ { "CoreUpdater": { "ClickHereToViewSqlQueries": "Kliknite tu, za ogled ter kopiranje seznama SQL proizvedb, ki bodo uveljavljene", - "CreatingBackupOfConfigurationFile": "Ustvarjam varnostno kopijo konfiguracijske datoteke v %s", "DatabaseUpgradeRequired": "Potrebna je nadgraditev baze podatkov", "DownloadingUpdateFromX": "Prenašam posodobitev iz %s", "DownloadX": "Prenos %s", diff --git a/plugins/CoreUpdater/lang/sq.json b/plugins/CoreUpdater/lang/sq.json index 4d65c9dc55..85e9856f68 100644 --- a/plugins/CoreUpdater/lang/sq.json +++ b/plugins/CoreUpdater/lang/sq.json @@ -1,7 +1,6 @@ { "CoreUpdater": { "ClickHereToViewSqlQueries": "Klikoni këtu që të shihni dhe të kopjoni listën e kërkesave SQL që ka për t'u ekzekutuar", - "CreatingBackupOfConfigurationFile": "Po krijohet një kopjeruajtje e kartelës së formësimit te %s", "CriticalErrorDuringTheUpgradeProcess": "Gabim Kritik gjatë procesit të përditësimit:", "DatabaseUpgradeRequired": "Lypset Përmirësim i Bazës së të Dhënave", "DownloadingUpdateFromX": "Po shkarkohet përditësimi prej %s", diff --git a/plugins/CoreUpdater/lang/sr.json b/plugins/CoreUpdater/lang/sr.json index a9351a9431..8aa8e33828 100644 --- a/plugins/CoreUpdater/lang/sr.json +++ b/plugins/CoreUpdater/lang/sr.json @@ -1,7 +1,6 @@ { "CoreUpdater": { "ClickHereToViewSqlQueries": "Kliknite ovde kako biste videli i iskopirali SQL upite koje je potrebno izvršiti", - "CreatingBackupOfConfigurationFile": "Kreiranje rezervne kopije datoteke sa podešavanjima u %s", "CriticalErrorDuringTheUpgradeProcess": "Kritične greške nastale tokom procesa nadogradnje:", "DatabaseUpgradeRequired": "Potrebna je nadogradnja baze", "DisablingIncompatiblePlugins": "Isključivanje nekompatibilnih dodataka: %s", diff --git a/plugins/CoreUpdater/lang/sv.json b/plugins/CoreUpdater/lang/sv.json index 48d7781bef..19d7874cbe 100644 --- a/plugins/CoreUpdater/lang/sv.json +++ b/plugins/CoreUpdater/lang/sv.json @@ -1,7 +1,6 @@ { "CoreUpdater": { "ClickHereToViewSqlQueries": "Klicka här för att visa och kopiera listan över SQL-frågor som kommer att exekveras", - "CreatingBackupOfConfigurationFile": "Skapar en backup av konfigurationsfilen i %s", "CriticalErrorDuringTheUpgradeProcess": "Kritiskt fel uppstod under uppdateringsprocessen:", "DatabaseUpgradeRequired": "Databasuppgradering krävs", "DisablingIncompatiblePlugins": "Inaktiverar inkompatibla tillägg: %s", diff --git a/plugins/CoreUpdater/lang/ta.json b/plugins/CoreUpdater/lang/ta.json index a04fe3940b..4f197fc24a 100644 --- a/plugins/CoreUpdater/lang/ta.json +++ b/plugins/CoreUpdater/lang/ta.json @@ -1,7 +1,6 @@ { "CoreUpdater": { "ClickHereToViewSqlQueries": "செய்து முடிக்கதக்க எஸ்கியூஎல் வினாப்பட்டியலை காண மற்றும் நகல் எடுக்க, இங்கே சொடுக்கவும்", - "CreatingBackupOfConfigurationFile": "கட்டமைப்புக் கோப்பு இங்கே, %s -இல் காப்பெடுக்கப்படுகிறது", "CriticalErrorDuringTheUpgradeProcess": "புதுப்பிக்கும் போது, விமர்சன பிழை எழுகிறது:", "DatabaseUpgradeRequired": "தரவுத்தள மேம்பாடு தேவைப்படுகிறது", "DownloadingUpdateFromX": "%s -இல் இருந்து புதுப்பிக்கபட்ட பதிவு தரவிறக்கம் செய்யப்படுகிறது.", diff --git a/plugins/CoreUpdater/lang/th.json b/plugins/CoreUpdater/lang/th.json index 4d282e3a7b..c270bdc090 100644 --- a/plugins/CoreUpdater/lang/th.json +++ b/plugins/CoreUpdater/lang/th.json @@ -1,7 +1,6 @@ { "CoreUpdater": { "ClickHereToViewSqlQueries": "คลิกที่นี่เพื่อดู และคัดลอกรายการ รันคิวรี SQL ที่จะได้รับดำเนินการ", - "CreatingBackupOfConfigurationFile": "สำรองไฟล์ข้อมูลการตั้งค่าใน %s", "CriticalErrorDuringTheUpgradeProcess": "ข้อผิดพลาดร้ายแรง ในระหว่างกระบวนการอัพเดต", "DatabaseUpgradeRequired": "จำเป็นต้องอัพเกรดฐานข้อมูล", "DownloadingUpdateFromX": "ดาวน์โหลดโปรแกรมอัพเดตจาก %s", diff --git a/plugins/CoreUpdater/lang/tr.json b/plugins/CoreUpdater/lang/tr.json index 4c37fed6ae..aaa0db860e 100644 --- a/plugins/CoreUpdater/lang/tr.json +++ b/plugins/CoreUpdater/lang/tr.json @@ -1,7 +1,6 @@ { "CoreUpdater": { "ClickHereToViewSqlQueries": "Çalıştırılacak olan SQL sorgularının listesini görmek ve kopyalamak için tıklayın", - "CreatingBackupOfConfigurationFile": "%s konumunda ayar dosyasının yedeği oluşturuluyor", "DatabaseUpgradeRequired": "Veritabanı güncellemesi gerekiyor", "DownloadingUpdateFromX": "Güncelleme %sdan indiriliyor", "DownloadX": "İndir %s", diff --git a/plugins/CoreUpdater/lang/uk.json b/plugins/CoreUpdater/lang/uk.json index 505f2c0a7e..8a1507e949 100644 --- a/plugins/CoreUpdater/lang/uk.json +++ b/plugins/CoreUpdater/lang/uk.json @@ -1,7 +1,6 @@ { "CoreUpdater": { "ClickHereToViewSqlQueries": "Клацніть тут для перегляду та копіювання пеерліку SQL запитів що повинні бути виконані.", - "CreatingBackupOfConfigurationFile": "Створення резервної копії файлів конфігурції в %s", "CriticalErrorDuringTheUpgradeProcess": "Критична помилка протягом процесу поновлення:", "DatabaseUpgradeRequired": "Необхідно поновити базу даних", "DownloadingUpdateFromX": "Завантажити поновлення від %s", diff --git a/plugins/CoreUpdater/lang/vi.json b/plugins/CoreUpdater/lang/vi.json index 8445aea785..4585a0abd6 100644 --- a/plugins/CoreUpdater/lang/vi.json +++ b/plugins/CoreUpdater/lang/vi.json @@ -1,7 +1,6 @@ { "CoreUpdater": { "ClickHereToViewSqlQueries": "Click vào đây để xem và sao chép danh sách các truy vấn SQL sẽ được thực hiện.", - "CreatingBackupOfConfigurationFile": "Tạo một bản sao lưu của file cấu hình ở %s", "CriticalErrorDuringTheUpgradeProcess": "Lỗi nghiêm trọng trong quá trình cập nhạt:", "DatabaseUpgradeRequired": "Nâng cấp cơ sở dữ liệu", "DownloadingUpdateFromX": "Đang download để update từ %s", diff --git a/plugins/CoreUpdater/lang/zh-cn.json b/plugins/CoreUpdater/lang/zh-cn.json index 7b5379bdbc..84f2a401ae 100644 --- a/plugins/CoreUpdater/lang/zh-cn.json +++ b/plugins/CoreUpdater/lang/zh-cn.json @@ -1,7 +1,6 @@ { "CoreUpdater": { "ClickHereToViewSqlQueries": "选择这里来查看并复制即将执行的 SQL 语句列表", - "CreatingBackupOfConfigurationFile": "正在生成配置文件的备份 %s", "CriticalErrorDuringTheUpgradeProcess": "在升级过程中发生严重的错误:", "DatabaseUpgradeRequired": "数据库需要升级", "DownloadingUpdateFromX": "正在从 %s 下载新版本", diff --git a/plugins/CoreUpdater/lang/zh-tw.json b/plugins/CoreUpdater/lang/zh-tw.json index 6ed2fe2a42..fe601a4a16 100644 --- a/plugins/CoreUpdater/lang/zh-tw.json +++ b/plugins/CoreUpdater/lang/zh-tw.json @@ -1,7 +1,6 @@ { "CoreUpdater": { "ClickHereToViewSqlQueries": "點選這裡來查看並複製即將執行的 SQL 語法列表", - "CreatingBackupOfConfigurationFile": "建立一個設定檔的備份於 %s", "CriticalErrorDuringTheUpgradeProcess": "在更新過程中發生嚴重的錯誤:", "DatabaseUpgradeRequired": "資料庫需要升級", "DownloadingUpdateFromX": "從 %s 下載更新中", diff --git a/plugins/ExamplePlugin/tests/System/expected/test___API.get_day.xml b/plugins/ExamplePlugin/tests/System/expected/test___API.get_day.xml index 58296797c0..c04d73d2c7 100644 --- a/plugins/ExamplePlugin/tests/System/expected/test___API.get_day.xml +++ b/plugins/ExamplePlugin/tests/System/expected/test___API.get_day.xml @@ -3,7 +3,7 @@ <nb_uniq_visitors>2</nb_uniq_visitors> <nb_visits>2</nb_visits> <nb_users>0</nb_users> - <nb_actions>4</nb_actions> + <nb_actions>4</nb_actions> <max_actions>2</max_actions> <bounce_rate>0%</bounce_rate> <nb_actions_per_visit>2</nb_actions_per_visit> @@ -11,6 +11,10 @@ <nb_visits_returning>0</nb_visits_returning> <nb_actions_returning>0</nb_actions_returning> <nb_uniq_visitors_returning>0</nb_uniq_visitors_returning> + <sum_visit_length_returning>0</sum_visit_length_returning> + <nb_users_returning>0</nb_users_returning> + <nb_visits_converted_returning>0</nb_visits_converted_returning> + <max_actions_returning>0</max_actions_returning> <bounce_rate_returning>0%</bounce_rate_returning> <nb_actions_per_visit_returning>0</nb_actions_per_visit_returning> <avg_time_on_site_returning>0</avg_time_on_site_returning> diff --git a/plugins/Installation/Controller.php b/plugins/Installation/Controller.php index 0dffcd343c..a3c858f08c 100644 --- a/plugins/Installation/Controller.php +++ b/plugins/Installation/Controller.php @@ -24,6 +24,7 @@ use Piwik\Piwik; use Piwik\Plugin\Manager; use Piwik\Plugins\CoreUpdater\CoreUpdater; use Piwik\Plugins\LanguagesManager\LanguagesManager; +use Piwik\Plugins\PrivacyManager\IPAnonymizer; use Piwik\Plugins\SitesManager\API as APISitesManager; use Piwik\Plugins\UserCountry\LocationProvider; use Piwik\Plugins\UsersManager\API as APIUsersManager; @@ -362,8 +363,6 @@ class Controller extends \Piwik\Plugin\ControllerAdmin { $this->checkPiwikIsNotInstalled(); - $this->markInstallationAsCompleted(); - $view = new View( '@Installation/trackingCode', $this->getInstallationSteps(), @@ -395,6 +394,8 @@ class Controller extends \Piwik\Plugin\ControllerAdmin */ public function finished() { + $this->checkPiwikIsNotInstalled(); + $this->markInstallationAsCompleted(); $view = new View( @@ -403,6 +404,34 @@ class Controller extends \Piwik\Plugin\ControllerAdmin __FUNCTION__ ); + $form = new FormDefaultSettings(); + + /** + * Triggered on initialization of the form to customize default Piwik settings (at the end of the installation process). + * + * @param \Piwik\Plugins\Installation\FormDefaultSettings $form + */ + Piwik::postEvent('Installation.defaultSettingsForm.init', array($form)); + + $form->addElement('submit', 'submit', array('value' => Piwik::translate('General_ContinueToPiwik') . ' »', 'class' => 'submit')); + + if ($form->validate()) { + try { + /** + * Triggered on submission of the form to customize default Piwik settings (at the end of the installation process). + * + * @param \Piwik\Plugins\Installation\FormDefaultSettings $form + */ + Piwik::postEvent('Installation.defaultSettingsForm.submit', array($form)); + + Url::redirectToUrl('index.php'); + } catch (Exception $e) { + $view->errorMessage = $e->getMessage(); + } + } + + $view->addForm($form); + $view->showNextStep = false; $output = $view->render(); diff --git a/plugins/Installation/FormDefaultSettings.php b/plugins/Installation/FormDefaultSettings.php new file mode 100644 index 0000000000..19f24e6cda --- /dev/null +++ b/plugins/Installation/FormDefaultSettings.php @@ -0,0 +1,23 @@ +<?php +/** + * Piwik - free/libre analytics platform + * + * @link http://piwik.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ + +namespace Piwik\Plugins\Installation; + +use Piwik\QuickForm2; + +class FormDefaultSettings extends QuickForm2 +{ + public function __construct($id = 'defaultsettingsform', $method = 'post', $attributes = null, $trackSubmit = false) + { + parent::__construct($id, $method, $attributes, $trackSubmit); + } + + public function init() + { + } +} diff --git a/plugins/Installation/SystemCheck.php b/plugins/Installation/SystemCheck.php index 29f87f2415..b175528310 100644 --- a/plugins/Installation/SystemCheck.php +++ b/plugins/Installation/SystemCheck.php @@ -332,7 +332,7 @@ class SystemCheck public static function isPhpVersionValid($phpVersion) { global $piwik_minimumPHPVersion; - return version_compare($piwik_minimumPHPVersion, $phpVersion) === -1; + return version_compare($piwik_minimumPHPVersion, $phpVersion) <= 0; } }
\ No newline at end of file diff --git a/plugins/Installation/lang/en.json b/plugins/Installation/lang/en.json index 742bc0744d..df8fd6e53a 100644 --- a/plugins/Installation/lang/en.json +++ b/plugins/Installation/lang/en.json @@ -43,6 +43,8 @@ "PercentDone": "%s %% Done", "PleaseFixTheFollowingErrors": "Please fix the following errors", "PluginDescription": "Installation process of Piwik. The Installation is usually done once only. If the configuration file config\/config.inc.php is deleted, the installation will start again.", + "DefaultSettings": "Default Piwik settings", + "DefaultSettingsHelp": "Piwik comes with default settings. You can customize them now or do so later in the admin screen.", "Requirements": "Piwik Requirements", "RestartWebServer": "After making this change, restart your web server.", "ReusingTables": "Reusing the Tables", diff --git a/plugins/Installation/templates/_systemCheckSection.twig b/plugins/Installation/templates/_systemCheckSection.twig index fb2d26a3aa..22247455ae 100755 --- a/plugins/Installation/templates/_systemCheckSection.twig +++ b/plugins/Installation/templates/_systemCheckSection.twig @@ -5,7 +5,7 @@ <table class="infosServer" id="systemCheckRequired"> <tr> - {% set MinPHP %}{{ 'Installation_SystemCheckPhp'|translate }} > {{ infos.phpVersion_minimum }}{% endset %} + {% set MinPHP %}{{ 'Installation_SystemCheckPhp'|translate }} >= {{ infos.phpVersion_minimum }}{% endset %} <td class="label">{{ MinPHP }}</td> <td> diff --git a/plugins/Installation/templates/finished.twig b/plugins/Installation/templates/finished.twig index 81b2e03276..468fe0600b 100644 --- a/plugins/Installation/templates/finished.twig +++ b/plugins/Installation/templates/finished.twig @@ -1,23 +1,34 @@ {% extends '@Installation/layout.twig' %} {% block content %} -<h2>{{ 'Installation_Congratulations'|translate|raw }}</h2> +<h2>{{ 'Installation_Congratulations'|translate|raw }}</h2> {{ 'Installation_CongratulationsHelp'|translate|raw }} +<br/> - <br/> <h2>{{ 'Installation_WelcomeToCommunity'|translate }}</h2> <p> -{{ 'Installation_CollaborativeProject'|translate }} -</p><p> + {{ 'Installation_CollaborativeProject'|translate }} +</p> +<p> {{ 'Installation_GetInvolved'|translate('<a target="_blank" href="http://piwik.org/get-involved/">','</a>')|raw }} - {{ 'General_HelpTranslatePiwik'|translate("<a target='_blank' href=\'http://piwik.org/translations/\'>","<\/a>")|raw }} + {{ 'General_HelpTranslatePiwik'|translate("<a target='_blank' href=\'http://piwik.org/translations/\'>","<\/a>")|raw }} </p> - <p>{{ 'Installation_WeHopeYouWillEnjoyPiwik'|translate }}</p> - <p><i>{{ 'Installation_HappyAnalysing'|translate }}</i></p> +<p>{{ 'Installation_WeHopeYouWillEnjoyPiwik'|translate }}</p> +<p><i>{{ 'Installation_HappyAnalysing'|translate }}</i></p> +<br/> -<p class="nextStep"> - <a class="submit" href="index.php">{{ 'General_ContinueToPiwik'|translate }} »</a> +<h2>{{ 'Installation_DefaultSettings'|translate }}</h2> +<p>{{ 'Installation_DefaultSettingsHelp'|translate }}</p> +{% if errorMessage is defined %} + <div class="error"> + <img src="plugins/Morpheus/images/error_medium.png"/> + {{ 'General_Error'|translate }}: + <br/>- {{ errorMessage|raw }} + </div> +{% endif %} +{% if form_data is defined %} + {% include "genericForm.twig" %} +{% endif %} -</p> {% endblock %} diff --git a/plugins/PrivacyManager/Config.php b/plugins/PrivacyManager/Config.php index a1e3929fa5..ac6e143b11 100644 --- a/plugins/PrivacyManager/Config.php +++ b/plugins/PrivacyManager/Config.php @@ -28,9 +28,9 @@ class Config { private $properties = array( 'useAnonymizedIpForVisitEnrichment' => array('type' => 'boolean', 'default' => true), - 'ipAddressMaskLength' => array('type' => 'integer', 'default' => 1), + 'ipAddressMaskLength' => array('type' => 'integer', 'default' => 2), 'doNotTrackEnabled' => array('type' => 'boolean', 'default' => true), - 'ipAnonymizerEnabled' => array('type' => 'boolean', 'default' => false), + 'ipAnonymizerEnabled' => array('type' => 'boolean', 'default' => true), ); public function __set($name, $value) diff --git a/plugins/PrivacyManager/PrivacyManager.php b/plugins/PrivacyManager/PrivacyManager.php index b96cc7beed..ddce27fa3c 100644 --- a/plugins/PrivacyManager/PrivacyManager.php +++ b/plugins/PrivacyManager/PrivacyManager.php @@ -8,6 +8,7 @@ */ namespace Piwik\Plugins\PrivacyManager; +use HTML_QuickForm2_DataSource_Array; use Piwik\Common; use Piwik\Config as PiwikConfig; use Piwik\DataTable\DataTableInterface; @@ -17,7 +18,10 @@ use Piwik\Metrics; use Piwik\Option; use Piwik\Period; use Piwik\Period\Range; +use Piwik\Piwik; +use Piwik\Plugin; use Piwik\Plugins\Goals\Archiver; +use Piwik\Plugins\Installation\FormDefaultSettings; use Piwik\Site; use Piwik\Tracker\GoalManager; @@ -32,7 +36,7 @@ require_once PIWIK_INCLUDE_PATH . '/plugins/PrivacyManager/IPAnonymizer.php'; /** */ -class PrivacyManager extends \Piwik\Plugin +class PrivacyManager extends Plugin { const OPTION_LAST_DELETE_PIWIK_LOGS = "lastDelete_piwik_logs"; const OPTION_LAST_DELETE_PIWIK_REPORTS = 'lastDelete_piwik_reports'; @@ -133,10 +137,12 @@ class PrivacyManager extends \Piwik\Plugin public function getListHooksRegistered() { return array( - 'AssetManager.getJavaScriptFiles' => 'getJsFiles', - 'Tracker.setTrackerCacheGeneral' => 'setTrackerCacheGeneral', - 'Tracker.isExcludedVisit' => array($this->dntChecker, 'checkHeaderInTracker'), - 'Tracker.setVisitorIp' => array($this->ipAnonymizer, 'setVisitorIpAddress'), + 'AssetManager.getJavaScriptFiles' => 'getJsFiles', + 'Tracker.setTrackerCacheGeneral' => 'setTrackerCacheGeneral', + 'Tracker.isExcludedVisit' => array($this->dntChecker, 'checkHeaderInTracker'), + 'Tracker.setVisitorIp' => array($this->ipAnonymizer, 'setVisitorIpAddress'), + 'Installation.defaultSettingsForm.init' => 'installationFormInit', + 'Installation.defaultSettingsForm.submit' => 'installationFormSubmit', ); } @@ -152,6 +158,53 @@ class PrivacyManager extends \Piwik\Plugin } /** + * Customize the Installation "default settings" form. + * + * @param FormDefaultSettings $form + */ + public function installationFormInit(FormDefaultSettings $form) + { + $form->addElement('checkbox', 'do_not_track', null, + array( + 'content' => ' ' . Piwik::translate('PrivacyManager_DoNotTrack_Enable') . '<br>' + . Piwik::translate('PrivacyManager_DoNotTrack_EnabledMoreInfo'), + )); + $form->addElement('checkbox', 'anonymise_ip', null, + array( + 'content' => ' ' . Piwik::translate('PrivacyManager_AnonymizeIpInlineHelp') . '<br>' + . Piwik::translate('PrivacyManager_AnonymizeIpExtendedHelp', array('213.34.51.91', '213.34.0.0')), + )); + + // default values + $form->addDataSource(new HTML_QuickForm2_DataSource_Array(array( + 'do_not_track' => DoNotTrackHeaderChecker::isActive(), + 'anonymise_ip' => IPAnonymizer::isActive(), + ))); + } + + /** + * Process the submit on the Installation "default settings" form. + * + * @param FormDefaultSettings $form + */ + public function installationFormSubmit(FormDefaultSettings $form) + { + $doNotTrack = (bool) $form->getSubmitValue('do_not_track'); + if ($doNotTrack) { + DoNotTrackHeaderChecker::activate(); + } else { + DoNotTrackHeaderChecker::deactivate(); + } + + $anonymiseIp = (bool) $form->getSubmitValue('anonymise_ip'); + if ($anonymiseIp) { + IPAnonymizer::activate(); + } else { + IPAnonymizer::deactivate(); + } + } + + /** * Returns the settings for the data purging feature. * * @return array diff --git a/plugins/PrivacyManager/lang/en.json b/plugins/PrivacyManager/lang/en.json index 801cb91dec..aa84139e89 100644 --- a/plugins/PrivacyManager/lang/en.json +++ b/plugins/PrivacyManager/lang/en.json @@ -2,6 +2,7 @@ "PrivacyManager": { "AnonymizeIpDescription": "Select \"Yes\" if you want Piwik not to track fully qualified IP-Addresses.", "AnonymizeIpInlineHelp": "Anonymize the last byte(s) of visitors IP addresses to comply with your local privacy laws\/guidelines.", + "AnonymizeIpExtendedHelp": "When users visit your website, Piwik will not use the full IP address (such as %s) but instead Piwik will anonymise it first (to %s). IP address anonymisation is one of the requirements set by the privacy laws in some countries such as Germany.", "AnonymizeIpMaskLengtDescription": "Select how many bytes of the visitors' IPs should be masked.", "AnonymizeIpMaskLength": "%s byte(s) - e.g. %s", "CannotLockSoDeleteLogActions": "The log_action table will not be purged: please grant the LOCK TABLES privilege to the '%s' MYSQL user.", diff --git a/plugins/PrivacyManager/tests/Integration/PrivacyManagerConfigTest.php b/plugins/PrivacyManager/tests/Integration/PrivacyManagerConfigTest.php index 4d2a121ee3..1e17f7253f 100644 --- a/plugins/PrivacyManager/tests/Integration/PrivacyManagerConfigTest.php +++ b/plugins/PrivacyManager/tests/Integration/PrivacyManagerConfigTest.php @@ -13,8 +13,6 @@ use Piwik\Plugins\PrivacyManager\Config as PrivacyManagerConfig; use Piwik\Tests\Framework\TestCase\IntegrationTestCase; /** - * Class Plugins_SitesManagerTest - * * @group Plugins */ class PrivacyManagerConfigTest extends IntegrationTestCase @@ -59,16 +57,16 @@ class PrivacyManagerConfigTest extends IntegrationTestCase public function test_ipAnonymizerEnabled() { - $this->assertFalse($this->config->ipAnonymizerEnabled); + $this->assertTrue($this->config->ipAnonymizerEnabled); - $this->config->ipAnonymizerEnabled = true; + $this->config->ipAnonymizerEnabled = false; - $this->assertTrue($this->config->ipAnonymizerEnabled); + $this->assertFalse($this->config->ipAnonymizerEnabled); } public function test_ipAddressMaskLength() { - $this->assertSame(1, $this->config->ipAddressMaskLength); + $this->assertSame(2, $this->config->ipAddressMaskLength); $this->config->ipAddressMaskLength = '19'; @@ -81,8 +79,8 @@ class PrivacyManagerConfigTest extends IntegrationTestCase $expected = array( 'existingEntry' => 'test', - 'PrivacyManager.ipAddressMaskLength' => 1, - 'PrivacyManager.ipAnonymizerEnabled' => false, + 'PrivacyManager.ipAddressMaskLength' => 2, + 'PrivacyManager.ipAnonymizerEnabled' => true, 'PrivacyManager.doNotTrackEnabled' => true, 'PrivacyManager.useAnonymizedIpForVisitEnrichment' => true, ); diff --git a/plugins/TestRunner/Aws/Instance.php b/plugins/TestRunner/Aws/Instance.php index 8afa292b66..622f7cf9bf 100644 --- a/plugins/TestRunner/Aws/Instance.php +++ b/plugins/TestRunner/Aws/Instance.php @@ -128,15 +128,21 @@ class Instance { $instances = $resources->getPath('Reservations/*/Instances'); + if (empty($instances)) { + return; + } + $instanceToUse = null; foreach ($instances as $index => $instance) { - foreach ($instance['Tags'] as $tag) { - if (!empty($this->testSuite) - && $tag['Key'] === 'TestSuite' - && $tag['Value'] === $this->testSuite) { - - $instanceToUse = $instance; + if (!empty($instance['Tags'])) { + foreach ($instance['Tags'] as $tag) { + if (!empty($this->testSuite) + && $tag['Key'] === 'TestSuite' + && $tag['Value'] === $this->testSuite) { + + $instanceToUse = $instance; + } } } } diff --git a/plugins/TestRunner/Commands/TestsRunOnAws.php b/plugins/TestRunner/Commands/TestsRunOnAws.php index 6f88dd4a5d..c894f80e90 100644 --- a/plugins/TestRunner/Commands/TestsRunOnAws.php +++ b/plugins/TestRunner/Commands/TestsRunOnAws.php @@ -148,7 +148,7 @@ This feature is still beta and there might be problems with pictures and/or bina private function buildFinishedMessage($testSuite, $host) { if (in_array($testSuite, array('system', 'all'))) { - $message = "<info>Tests finished. You can browse processed files at </info><comment>http://$host/tests/PHPUnit/System/processed/</comment>"; + $message = "<info>Tests finished. You can browse processed files and download artifacts at </info><comment>http://$host/tests/PHPUnit/System/processed/</comment>"; } elseif ('ui' === $testSuite) { $message = "<info>Tests finished. You can browse processed screenshots at </info><comment>http://$host/tests/PHPUnit/UI/screenshot-diffs/diffviewer.html</comment>"; } else { diff --git a/plugins/TestRunner/README.md b/plugins/TestRunner/README.md index 822b05dbba..be10873613 100644 --- a/plugins/TestRunner/README.md +++ b/plugins/TestRunner/README.md @@ -48,4 +48,17 @@ __How can I change the base image (AMI) that is used for AWS tests?__ * Once everything works remove the outdated AMI by selecting it and clicking `Actions => Deregister`. In the future once everything is completely automated we would simple create a new instance out of ((Vagrant || Docker) && Puppet) whenever we need a change but it takes a lot of time to do this and is not worth it right now. -
\ No newline at end of file + +__How do I create a new EC2 key/pair for a developer?__ + +1. Go to: https://console.aws.amazon.com/ec2/v2/home?region=us-east-1 +2. Click `Create Key Pair` +3. Send PGP email +``` +Here are info for running tests on Ec2 + * Access Key ID: + * Secret Access Key: + * aws_keyname = "piwik-xyz" + * PEM file content is: +``` + diff --git a/plugins/TestRunner/Runner/Remote.php b/plugins/TestRunner/Runner/Remote.php index 04753d6cea..49127c45f9 100644 --- a/plugins/TestRunner/Runner/Remote.php +++ b/plugins/TestRunner/Runner/Remote.php @@ -28,10 +28,10 @@ class Remote $this->ssh->exec('git reset --hard'); $this->ssh->exec('git submodule foreach --recursive git reset --hard'); $this->ssh->exec('git clean -d -f'); + $this->ssh->exec('git submodule foreach git clean -f'); $this->ssh->exec('git fetch --all'); $this->ssh->exec('git checkout ' . trim($gitHash)); $this->ssh->exec('git submodule update --recursive --force'); - $this->ssh->exec('git submodule foreach git clean -f'); $this->ssh->exec('composer.phar install'); } @@ -78,6 +78,8 @@ class Remote private function doRunTests($testSuite) { + $this->ssh->exec("ps -ef | grep \"php console tests:run\" | grep -v grep | awk '{print $2}' | xargs kill -9"); + if ('all' === $testSuite) { $this->ssh->exec('php console tests:run --options="--colors"'); } elseif ('ui' === $testSuite) { @@ -86,5 +88,9 @@ class Remote $this->ssh->exec('php console tests:run --options="--colors" --testsuite="unit"'); $this->ssh->exec('php console tests:run --options="--colors" --testsuite="' . $testSuite . '"'); } + + if ('system' === $testSuite) { + $this->ssh->exec("tar -cjf tests/PHPUnit/System/processed/processed.tar.bz2 tests/PHPUnit/System/processed/ plugins/*/tests/System/processed/ --exclude='.gitkeep' --exclude='tests/PHPUnit/System/processed/processed.tar.bz2'"); + } } } diff --git a/plugins/VisitFrequency/Reports/Get.php b/plugins/VisitFrequency/Reports/Get.php index 2c7d8fb21f..5db2ebebf6 100644 --- a/plugins/VisitFrequency/Reports/Get.php +++ b/plugins/VisitFrequency/Reports/Get.php @@ -18,7 +18,19 @@ class Get extends \Piwik\Plugin\Report $this->category = 'General_Visitors'; $this->name = Piwik::translate('VisitFrequency_ColumnReturningVisits'); $this->documentation = ''; // TODO - $this->metrics = array('nb_visits_returning', 'nb_actions_returning', 'avg_time_on_site_returning', 'bounce_rate_returning', 'nb_actions_per_visit_returning', 'nb_uniq_visitors_returning'); + $this->metrics = array( + 'nb_visits_returning', + 'nb_actions_returning', + 'avg_time_on_site_returning', + 'bounce_rate_returning', + 'nb_actions_per_visit_returning', + 'nb_uniq_visitors_returning', + 'sum_visit_length_returning', + 'nb_users_returning', + 'nb_visits_converted_returning', + 'sum_visit_length_returning', + 'max_actions_returning' + ); $this->processedMetrics = false; $this->order = 40; } diff --git a/plugins/VisitFrequency/VisitFrequency.php b/plugins/VisitFrequency/VisitFrequency.php index 079b5ddf60..ad7451e0ce 100644 --- a/plugins/VisitFrequency/VisitFrequency.php +++ b/plugins/VisitFrequency/VisitFrequency.php @@ -31,7 +31,8 @@ class VisitFrequency extends \Piwik\Plugin 'avg_time_on_site_returning' => 'VisitFrequency_ColumnAverageVisitDurationForReturningVisitors', 'bounce_rate_returning' => 'VisitFrequency_ColumnBounceRateForReturningVisits', 'nb_actions_per_visit_returning' => 'VisitFrequency_ColumnAvgActionsPerReturningVisit', - 'nb_uniq_visitors_returning' => 'VisitFrequency_ColumnUniqueReturningVisitors' + 'nb_uniq_visitors_returning' => 'VisitFrequency_ColumnUniqueReturningVisitors', + 'nb_users_returning' => 'VisitFrequency_ColumnReturningUsers' ); $translations = array_merge($translations, $metrics); diff --git a/plugins/VisitFrequency/lang/en.json b/plugins/VisitFrequency/lang/en.json index 8d2fb230e7..ac8a2c3cd1 100644 --- a/plugins/VisitFrequency/lang/en.json +++ b/plugins/VisitFrequency/lang/en.json @@ -10,6 +10,7 @@ "ColumnReturningVisits": "Returning Visits", "ColumnSumVisitLengthReturning": "Total time spent by returning visitors (in seconds)", "ColumnUniqueReturningVisitors": "Unique returning visitors", + "ColumnReturningUsers": "Returning Users", "PluginDescription": "Reports various statistics about the Returning Visitor versus the First time visitor.", "ReturnActions": "%s actions by the returning visits", "ReturnAverageVisitDuration": "%s average visit duration for returning visitors", diff --git a/tests/PHPUnit/System/expected/test_ArchiveCronTest_archive_php_cron_output.txt b/tests/PHPUnit/System/expected/test_ArchiveCronTest_archive_php_cron_output.txt index 16bfe19f8c..814737fdd4 100644 --- a/tests/PHPUnit/System/expected/test_ArchiveCronTest_archive_php_cron_output.txt +++ b/tests/PHPUnit/System/expected/test_ArchiveCronTest_archive_php_cron_output.txt @@ -1,8 +1,8 @@ ------------------------------------------------------- Using this 'archive.php' script is no longer recommended. -Please use '/path/to/php /home/matt/dev/piwik-master/tests/PHPUnit/proxy/../../..//console core:archive --url=http://localhost/piwik-master/tests/PHPUnit/proxy/index.php' instead. -To get help use '/path/to/php /home/matt/dev/piwik-master/tests/PHPUnit/proxy/../../..//console core:archive --help' +Please use '/path/to/php /home/travis/build/piwik/piwik/tests/PHPUnit/proxy/../../..//console core:archive --url=http://localhost/tests/PHPUnit/proxy/index.php' instead. +To get help use '/path/to/php /home/travis/build/piwik/piwik/tests/PHPUnit/proxy/../../..//console core:archive --help' See also: http://piwik.org/docs/setup-auto-archiving/ If you cannot use the console because it requires CLI diff --git a/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_csv__API.get_month.csv b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_csv__API.get_month.csv Binary files differindex 6fed0a71f2..86a07c0d50 100644 --- a/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_csv__API.get_month.csv +++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_csv__API.get_month.csv diff --git a/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_VisitFrequency.get_firstSite_lastN__API.getProcessedReport_day.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_VisitFrequency.get_firstSite_lastN__API.getProcessedReport_day.xml index fa28a54c25..0c51c09208 100644 --- a/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_VisitFrequency.get_firstSite_lastN__API.getProcessedReport_day.xml +++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_VisitFrequency.get_firstSite_lastN__API.getProcessedReport_day.xml @@ -14,6 +14,10 @@ <bounce_rate_returning>Bounce Rate for Returning Visits</bounce_rate_returning> <nb_actions_per_visit_returning>Avg. Actions per Returning Visit</nb_actions_per_visit_returning> <nb_uniq_visitors_returning>Unique returning visitors</nb_uniq_visitors_returning> + <sum_visit_length_returning>Total time spent by returning visitors (in seconds)</sum_visit_length_returning> + <nb_users_returning>Returning Users</nb_users_returning> + <nb_visits_converted_returning>Number of converted returning visits</nb_visits_converted_returning> + <max_actions_returning>Maximum actions in one returning visit</max_actions_returning> </metrics> <imageGraphUrl>index.php?module=API&method=ImageGraph.get&idSite=1&apiModule=VisitFrequency&apiAction=get&period=day&date=2010-01-03,2010-01-09</imageGraphUrl> <imageGraphEvolutionUrl>index.php?module=API&method=ImageGraph.get&idSite=1&apiModule=VisitFrequency&apiAction=get&period=day&date=2010-01-03,2010-01-09</imageGraphEvolutionUrl> @@ -26,46 +30,70 @@ <bounce_rate_returning>Bounce Rate for Returning Visits</bounce_rate_returning> <nb_actions_per_visit_returning>Avg. Actions per Returning Visit</nb_actions_per_visit_returning> <nb_uniq_visitors_returning>Unique returning visitors</nb_uniq_visitors_returning> + <sum_visit_length_returning>Total time spent by returning visitors (in seconds)</sum_visit_length_returning> + <nb_users_returning>Returning Users</nb_users_returning> + <nb_visits_converted_returning>Number of converted returning visits</nb_visits_converted_returning> + <max_actions_returning>Maximum actions in one returning visit</max_actions_returning> </columns> <reportData> <result prettyDate="Sunday 3 January 2010" /> <result prettyDate="Monday 4 January 2010" /> <result prettyDate="Tuesday 5 January 2010"> <nb_uniq_visitors_returning>1</nb_uniq_visitors_returning> + <nb_users_returning>0</nb_users_returning> <nb_visits_returning>1</nb_visits_returning> <nb_actions_returning>5</nb_actions_returning> + <nb_visits_converted_returning>0</nb_visits_converted_returning> + <sum_visit_length_returning>901</sum_visit_length_returning> + <max_actions_returning>5</max_actions_returning> <bounce_rate_returning>0%</bounce_rate_returning> <nb_actions_per_visit_returning>5</nb_actions_per_visit_returning> <avg_time_on_site_returning>00:15:01</avg_time_on_site_returning> </result> <result prettyDate="Wednesday 6 January 2010"> <nb_uniq_visitors_returning>1</nb_uniq_visitors_returning> + <nb_users_returning>0</nb_users_returning> <nb_visits_returning>1</nb_visits_returning> <nb_actions_returning>5</nb_actions_returning> + <nb_visits_converted_returning>0</nb_visits_converted_returning> + <sum_visit_length_returning>901</sum_visit_length_returning> + <max_actions_returning>5</max_actions_returning> <bounce_rate_returning>0%</bounce_rate_returning> <nb_actions_per_visit_returning>5</nb_actions_per_visit_returning> <avg_time_on_site_returning>00:15:01</avg_time_on_site_returning> </result> <result prettyDate="Thursday 7 January 2010"> <nb_uniq_visitors_returning>1</nb_uniq_visitors_returning> + <nb_users_returning>0</nb_users_returning> <nb_visits_returning>1</nb_visits_returning> <nb_actions_returning>5</nb_actions_returning> + <nb_visits_converted_returning>0</nb_visits_converted_returning> + <sum_visit_length_returning>901</sum_visit_length_returning> + <max_actions_returning>5</max_actions_returning> <bounce_rate_returning>0%</bounce_rate_returning> <nb_actions_per_visit_returning>5</nb_actions_per_visit_returning> <avg_time_on_site_returning>00:15:01</avg_time_on_site_returning> </result> <result prettyDate="Friday 8 January 2010"> <nb_uniq_visitors_returning>1</nb_uniq_visitors_returning> + <nb_users_returning>0</nb_users_returning> <nb_visits_returning>1</nb_visits_returning> <nb_actions_returning>5</nb_actions_returning> + <nb_visits_converted_returning>0</nb_visits_converted_returning> + <sum_visit_length_returning>901</sum_visit_length_returning> + <max_actions_returning>5</max_actions_returning> <bounce_rate_returning>0%</bounce_rate_returning> <nb_actions_per_visit_returning>5</nb_actions_per_visit_returning> <avg_time_on_site_returning>00:15:01</avg_time_on_site_returning> </result> <result prettyDate="Saturday 9 January 2010"> <nb_uniq_visitors_returning>1</nb_uniq_visitors_returning> + <nb_users_returning>0</nb_users_returning> <nb_visits_returning>1</nb_visits_returning> <nb_actions_returning>5</nb_actions_returning> + <nb_visits_converted_returning>0</nb_visits_converted_returning> + <sum_visit_length_returning>901</sum_visit_length_returning> + <max_actions_returning>5</max_actions_returning> <bounce_rate_returning>0%</bounce_rate_returning> <nb_actions_per_visit_returning>5</nb_actions_per_visit_returning> <avg_time_on_site_returning>00:15:01</avg_time_on_site_returning> diff --git a/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_in_csv__ScheduledReports.generateReport_month.original.csv b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_in_csv__ScheduledReports.generateReport_month.original.csv index bf15c6292e..fa013321e7 100644 --- a/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_in_csv__ScheduledReports.generateReport_month.original.csv +++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_in_csv__ScheduledReports.generateReport_month.original.csv @@ -169,6 +169,21 @@ No data available Event Names No data available +Site Search Keywords +No data available + +Search Keywords with No Results +No data available + +Search Categories +No data available + +Pages Following a Site Search +No data available + +Page Titles Following a Site Search +No data available + Referrer Type label,nb_visits,nb_actions,nb_actions_per_visit,avg_time_on_site,bounce_rate,revenue Websites,5,22,4.4,00:13:13,0%,$ 0 @@ -290,8 +305,8 @@ New visits,2 365+ days,0 Returning Visits -nb_uniq_visitors_returning,nb_visits_returning,nb_actions_returning,bounce_rate_returning,nb_actions_per_visit_returning,avg_time_on_site_returning -1,8,40,0%,5,00:15:01 +nb_uniq_visitors_returning,nb_users_returning,nb_visits_returning,nb_actions_returning,nb_visits_converted_returning,sum_visit_length_returning,max_actions_returning,bounce_rate_returning,nb_actions_per_visit_returning,avg_time_on_site_returning +1,0,8,40,0,7208,5,0%,5,00:15:01 Provider label,nb_visits,nb_actions,conversion_rate,nb_actions_per_visit,avg_time_on_site,bounce_rate diff --git a/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_in_html_tables_only__ScheduledReports.generateReport_month.original.html b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_in_html_tables_only__ScheduledReports.generateReport_month.original.html index 4b376fdace..912f27a164 100644 --- a/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_in_html_tables_only__ScheduledReports.generateReport_month.original.html +++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_in_html_tables_only__ScheduledReports.generateReport_month.original.html @@ -145,6 +145,31 @@ </a> </li> <li> + <a href="#Actions_getSiteSearchKeywords" style="text-decoration:none; color: rgb(68,68,68);"> + Site Search Keywords + </a> + </li> + <li> + <a href="#Actions_getSiteSearchNoResultKeywords" style="text-decoration:none; color: rgb(68,68,68);"> + Search Keywords with No Results + </a> + </li> + <li> + <a href="#Actions_getSiteSearchCategories" style="text-decoration:none; color: rgb(68,68,68);"> + Search Categories + </a> + </li> + <li> + <a href="#Actions_getPageUrlsFollowingSiteSearch" style="text-decoration:none; color: rgb(68,68,68);"> + Pages Following a Site Search + </a> + </li> + <li> + <a href="#Actions_getPageTitlesFollowingSiteSearch" style="text-decoration:none; color: rgb(68,68,68);"> + Page Titles Following a Site Search + </a> + </li> + <li> <a href="#Referrers_getReferrerType" style="text-decoration:none; color: rgb(68,68,68);"> Referrer Type </a> @@ -3068,6 +3093,31 @@ </h2> There is no data for this report. +<h2 id="Actions_getSiteSearchKeywords" style="color: rgb(126,115,99); font-size: 11pt;"> + Site Search Keywords +</h2> + + There is no data for this report. +<h2 id="Actions_getSiteSearchNoResultKeywords" style="color: rgb(126,115,99); font-size: 11pt;"> + Search Keywords with No Results +</h2> + + There is no data for this report. +<h2 id="Actions_getSiteSearchCategories" style="color: rgb(126,115,99); font-size: 11pt;"> + Search Categories +</h2> + + There is no data for this report. +<h2 id="Actions_getPageUrlsFollowingSiteSearch" style="color: rgb(126,115,99); font-size: 11pt;"> + Pages Following a Site Search +</h2> + + There is no data for this report. +<h2 id="Actions_getPageTitlesFollowingSiteSearch" style="color: rgb(126,115,99); font-size: 11pt;"> + Page Titles Following a Site Search +</h2> + + There is no data for this report. <h2 id="Referrers_getReferrerType" style="color: rgb(126,115,99); font-size: 11pt;"> Referrer Type </h2> @@ -4307,13 +4357,21 @@ <tr style="background-color: rgb(249,250,250)"> <td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;"> + Returning Users </td> + <td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;"> + 0 + </td> + </tr> + + <tr style=""> + <td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;"> Returning Visits </td> <td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;"> 8 </td> </tr> - <tr style=""> + <tr style="background-color: rgb(249,250,250)"> <td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;"> Actions by Returning Visits </td> <td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;"> @@ -4321,6 +4379,30 @@ </td> </tr> + <tr style=""> + <td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;"> + Number of converted returning visits </td> + <td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;"> + 0 + </td> + </tr> + + <tr style="background-color: rgb(249,250,250)"> + <td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;"> + Total time spent by returning visitors (in seconds) </td> + <td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;"> + 7208 + </td> + </tr> + + <tr style=""> + <td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;"> + Maximum actions in one returning visit </td> + <td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;"> + 5 + </td> + </tr> + <tr style="background-color: rgb(249,250,250)"> <td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;"> Bounce Rate for Returning Visits </td> diff --git a/tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getDefaultMetricTranslations.xml b/tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getDefaultMetricTranslations.xml index 82c64dfc5c..a878da03dd 100644 --- a/tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getDefaultMetricTranslations.xml +++ b/tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getDefaultMetricTranslations.xml @@ -82,5 +82,6 @@ <bounce_rate_returning>Bounce Rate for Returning Visits</bounce_rate_returning> <nb_actions_per_visit_returning>Avg. Actions per Returning Visit</nb_actions_per_visit_returning> <nb_uniq_visitors_returning>Unique returning visitors</nb_uniq_visitors_returning> + <nb_users_returning>Returning Users</nb_users_returning> </row> </result>
\ No newline at end of file diff --git a/tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getReportMetadata_day.xml b/tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getReportMetadata_day.xml index 6f338b56b1..f17475d50d 100644 --- a/tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getReportMetadata_day.xml +++ b/tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getReportMetadata_day.xml @@ -1645,6 +1645,10 @@ <bounce_rate_returning>Bounce Rate for Returning Visits</bounce_rate_returning> <nb_actions_per_visit_returning>Avg. Actions per Returning Visit</nb_actions_per_visit_returning> <nb_uniq_visitors_returning>Unique returning visitors</nb_uniq_visitors_returning> + <sum_visit_length_returning>Total time spent by returning visitors (in seconds)</sum_visit_length_returning> + <nb_users_returning>Returning Users</nb_users_returning> + <nb_visits_converted_returning>Number of converted returning visits</nb_visits_converted_returning> + <max_actions_returning>Maximum actions in one returning visit</max_actions_returning> </metrics> <imageGraphUrl>index.php?module=API&method=ImageGraph.get&idSite=1&apiModule=VisitFrequency&apiAction=get&period=day&date=2008-12-06,2009-01-04</imageGraphUrl> <imageGraphEvolutionUrl>index.php?module=API&method=ImageGraph.get&idSite=1&apiModule=VisitFrequency&apiAction=get&period=day&date=2008-12-06,2009-01-04</imageGraphEvolutionUrl> @@ -1944,6 +1948,10 @@ <bounce_rate_returning>Bounce Rate for Returning Visits</bounce_rate_returning> <nb_actions_per_visit_returning>Avg. Actions per Returning Visit</nb_actions_per_visit_returning> <nb_uniq_visitors_returning>Unique returning visitors</nb_uniq_visitors_returning> + <sum_visit_length_returning>Total time spent by returning visitors (in seconds)</sum_visit_length_returning> + <nb_users_returning>Returning Users</nb_users_returning> + <nb_visits_converted_returning>Number of converted returning visits</nb_visits_converted_returning> + <max_actions_returning>Maximum actions in one returning visit</max_actions_returning> </metrics> <metricsDocumentation> <nb_uniq_visitors>The number of unduplicated visitors coming to your website. Every user is only counted once, even if he visits the website multiple times a day.</nb_uniq_visitors> diff --git a/tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.get_day.xml b/tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.get_day.xml index 8615d546da..fe0924b8d9 100644 --- a/tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.get_day.xml +++ b/tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.get_day.xml @@ -11,6 +11,10 @@ <nb_visits_returning>0</nb_visits_returning> <nb_actions_returning>0</nb_actions_returning> <nb_uniq_visitors_returning>0</nb_uniq_visitors_returning> + <sum_visit_length_returning>0</sum_visit_length_returning> + <nb_users_returning>0</nb_users_returning> + <nb_visits_converted_returning>0</nb_visits_converted_returning> + <max_actions_returning>0</max_actions_returning> <bounce_rate_returning>0%</bounce_rate_returning> <nb_actions_per_visit_returning>0</nb_actions_per_visit_returning> <avg_time_on_site_returning>0</avg_time_on_site_returning> diff --git a/tests/PHPUnit/System/expected/test_apiGetReportMetadata_phpRenderer__API.getDefaultMetricTranslations.php b/tests/PHPUnit/System/expected/test_apiGetReportMetadata_phpRenderer__API.getDefaultMetricTranslations.php index d9144d3e39..008dacefe9 100644 --- a/tests/PHPUnit/System/expected/test_apiGetReportMetadata_phpRenderer__API.getDefaultMetricTranslations.php +++ b/tests/PHPUnit/System/expected/test_apiGetReportMetadata_phpRenderer__API.getDefaultMetricTranslations.php @@ -1 +1 @@ -a:1:{i:0;a:81:{s:9:"nb_visits";s:6:"Visits";s:16:"nb_uniq_visitors";s:15:"Unique visitors";s:10:"nb_actions";s:7:"Actions";s:8:"nb_users";s:5:"Users";s:20:"nb_actions_per_visit";s:17:"Actions per Visit";s:16:"avg_time_on_site";s:20:"Avg. Time on Website";s:11:"bounce_rate";s:11:"Bounce Rate";s:15:"conversion_rate";s:15:"Conversion Rate";s:5:"label";s:5:"Label";s:4:"date";s:4:"Date";s:16:"avg_time_on_page";s:17:"Avg. time on page";s:14:"sum_time_spent";s:41:"Total time spent by visitors (in seconds)";s:16:"sum_visit_length";s:41:"Total time spent by visitors (in seconds)";s:12:"bounce_count";s:7:"Bounces";s:22:"bounce_count_returning";s:33:"Bounce Count for Returning Visits";s:11:"max_actions";s:28:"Maximum actions in one visit";s:21:"max_actions_returning";s:38:"Maximum actions in one returning visit";s:29:"nb_visits_converted_returning";s:36:"Number of converted returning visits";s:26:"sum_visit_length_returning";s:51:"Total time spent by returning visitors (in seconds)";s:19:"nb_visits_converted";s:23:"Visits with Conversions";s:14:"nb_conversions";s:11:"Conversions";s:7:"revenue";s:7:"Revenue";s:7:"nb_hits";s:9:"Pageviews";s:15:"entry_nb_visits";s:9:"Entrances";s:22:"entry_nb_uniq_visitors";s:16:"Unique entrances";s:14:"exit_nb_visits";s:5:"Exits";s:21:"exit_nb_uniq_visitors";s:12:"Unique exits";s:18:"entry_bounce_count";s:7:"Bounces";s:17:"exit_bounce_count";s:7:"Bounces";s:9:"exit_rate";s:9:"Exit rate";s:26:"sum_daily_nb_uniq_visitors";s:27:"Unique visitors (daily sum)";s:18:"sum_daily_nb_users";s:17:"Users (daily sum)";s:32:"sum_daily_entry_nb_uniq_visitors";s:28:"Unique entrances (daily sum)";s:31:"sum_daily_exit_nb_uniq_visitors";s:24:"Unique exits (daily sum)";s:16:"entry_nb_actions";s:27:"Actions after entering here";s:22:"entry_sum_visit_length";s:61:"Total time spent by visitors (in seconds) after entering here";s:12:"nb_pageviews";s:9:"Pageviews";s:17:"nb_uniq_pageviews";s:16:"Unique Pageviews";s:12:"nb_downloads";s:9:"Downloads";s:17:"nb_uniq_downloads";s:16:"Unique Downloads";s:11:"nb_outlinks";s:8:"Outlinks";s:16:"nb_uniq_outlinks";s:15:"Unique Outlinks";s:11:"nb_searches";s:8:"Searches";s:11:"nb_keywords";s:15:"Unique Keywords";s:19:"avg_time_generation";s:20:"Avg. generation time";s:19:"nb_pages_per_search";s:20:"Search Results pages";s:24:"nb_hits_following_search";s:25:"Clicked in search results";s:14:"nb_impressions";s:11:"Impressions";s:15:"nb_interactions";s:12:"Interactions";s:16:"interaction_rate";s:16:"Interaction Rate";s:9:"nb_events";s:12:"Total events";s:15:"sum_event_value";s:11:"Total value";s:15:"min_event_value";s:13:"Minimum value";s:15:"max_event_value";s:13:"Maximum value";s:15:"avg_event_value";s:13:"Average value";s:20:"nb_events_with_value";s:19:"Events with a value";s:6:"orders";s:16:"Ecommerce Orders";s:17:"ecommerce_revenue";s:15:"Product Revenue";s:17:"revenue_per_visit";s:17:"Revenue per Visit";s:8:"quantity";s:8:"Quantity";s:9:"avg_price";s:13:"Average Price";s:12:"avg_quantity";s:16:"Average Quantity";s:16:"revenue_subtotal";s:8:"Subtotal";s:11:"revenue_tax";s:3:"Tax";s:16:"revenue_shipping";s:8:"Shipping";s:16:"revenue_discount";s:8:"Discount";s:17:"avg_order_revenue";s:19:"Average Order Value";s:16:"visits_evolution";s:16:"Visits Evolution";s:17:"actions_evolution";s:17:"Actions Evolution";s:19:"pageviews_evolution";s:19:"Pageviews Evolution";s:17:"revenue_evolution";s:17:"Revenue Evolution";s:24:"nb_conversions_evolution";s:21:"Conversions Evolution";s:16:"orders_evolution";s:26:"Ecommerce Orders Evolution";s:27:"ecommerce_revenue_evolution";s:25:"Product Revenue Evolution";s:20:"nb_visits_percentage";s:8:"% Visits";s:19:"nb_visits_returning";s:16:"Returning Visits";s:20:"nb_actions_returning";s:27:"Actions by Returning Visits";s:26:"avg_time_on_site_returning";s:43:"Avg. Duration of a Returning Visit (in sec)";s:21:"bounce_rate_returning";s:32:"Bounce Rate for Returning Visits";s:30:"nb_actions_per_visit_returning";s:32:"Avg. Actions per Returning Visit";s:26:"nb_uniq_visitors_returning";s:25:"Unique returning visitors";}}
\ No newline at end of file +a:1:{i:0;a:82:{s:9:"nb_visits";s:6:"Visits";s:16:"nb_uniq_visitors";s:15:"Unique visitors";s:10:"nb_actions";s:7:"Actions";s:8:"nb_users";s:5:"Users";s:20:"nb_actions_per_visit";s:17:"Actions per Visit";s:16:"avg_time_on_site";s:20:"Avg. Time on Website";s:11:"bounce_rate";s:11:"Bounce Rate";s:15:"conversion_rate";s:15:"Conversion Rate";s:5:"label";s:5:"Label";s:4:"date";s:4:"Date";s:16:"avg_time_on_page";s:17:"Avg. time on page";s:14:"sum_time_spent";s:41:"Total time spent by visitors (in seconds)";s:16:"sum_visit_length";s:41:"Total time spent by visitors (in seconds)";s:12:"bounce_count";s:7:"Bounces";s:22:"bounce_count_returning";s:33:"Bounce Count for Returning Visits";s:11:"max_actions";s:28:"Maximum actions in one visit";s:21:"max_actions_returning";s:38:"Maximum actions in one returning visit";s:29:"nb_visits_converted_returning";s:36:"Number of converted returning visits";s:26:"sum_visit_length_returning";s:51:"Total time spent by returning visitors (in seconds)";s:19:"nb_visits_converted";s:23:"Visits with Conversions";s:14:"nb_conversions";s:11:"Conversions";s:7:"revenue";s:7:"Revenue";s:7:"nb_hits";s:9:"Pageviews";s:15:"entry_nb_visits";s:9:"Entrances";s:22:"entry_nb_uniq_visitors";s:16:"Unique entrances";s:14:"exit_nb_visits";s:5:"Exits";s:21:"exit_nb_uniq_visitors";s:12:"Unique exits";s:18:"entry_bounce_count";s:7:"Bounces";s:17:"exit_bounce_count";s:7:"Bounces";s:9:"exit_rate";s:9:"Exit rate";s:26:"sum_daily_nb_uniq_visitors";s:27:"Unique visitors (daily sum)";s:18:"sum_daily_nb_users";s:17:"Users (daily sum)";s:32:"sum_daily_entry_nb_uniq_visitors";s:28:"Unique entrances (daily sum)";s:31:"sum_daily_exit_nb_uniq_visitors";s:24:"Unique exits (daily sum)";s:16:"entry_nb_actions";s:27:"Actions after entering here";s:22:"entry_sum_visit_length";s:61:"Total time spent by visitors (in seconds) after entering here";s:12:"nb_pageviews";s:9:"Pageviews";s:17:"nb_uniq_pageviews";s:16:"Unique Pageviews";s:12:"nb_downloads";s:9:"Downloads";s:17:"nb_uniq_downloads";s:16:"Unique Downloads";s:11:"nb_outlinks";s:8:"Outlinks";s:16:"nb_uniq_outlinks";s:15:"Unique Outlinks";s:11:"nb_searches";s:8:"Searches";s:11:"nb_keywords";s:15:"Unique Keywords";s:19:"avg_time_generation";s:20:"Avg. generation time";s:19:"nb_pages_per_search";s:20:"Search Results pages";s:24:"nb_hits_following_search";s:25:"Clicked in search results";s:14:"nb_impressions";s:11:"Impressions";s:15:"nb_interactions";s:12:"Interactions";s:16:"interaction_rate";s:16:"Interaction Rate";s:9:"nb_events";s:12:"Total events";s:15:"sum_event_value";s:11:"Total value";s:15:"min_event_value";s:13:"Minimum value";s:15:"max_event_value";s:13:"Maximum value";s:15:"avg_event_value";s:13:"Average value";s:20:"nb_events_with_value";s:19:"Events with a value";s:6:"orders";s:16:"Ecommerce Orders";s:17:"ecommerce_revenue";s:15:"Product Revenue";s:17:"revenue_per_visit";s:17:"Revenue per Visit";s:8:"quantity";s:8:"Quantity";s:9:"avg_price";s:13:"Average Price";s:12:"avg_quantity";s:16:"Average Quantity";s:16:"revenue_subtotal";s:8:"Subtotal";s:11:"revenue_tax";s:3:"Tax";s:16:"revenue_shipping";s:8:"Shipping";s:16:"revenue_discount";s:8:"Discount";s:17:"avg_order_revenue";s:19:"Average Order Value";s:16:"visits_evolution";s:16:"Visits Evolution";s:17:"actions_evolution";s:17:"Actions Evolution";s:19:"pageviews_evolution";s:19:"Pageviews Evolution";s:17:"revenue_evolution";s:17:"Revenue Evolution";s:24:"nb_conversions_evolution";s:21:"Conversions Evolution";s:16:"orders_evolution";s:26:"Ecommerce Orders Evolution";s:27:"ecommerce_revenue_evolution";s:25:"Product Revenue Evolution";s:20:"nb_visits_percentage";s:8:"% Visits";s:19:"nb_visits_returning";s:16:"Returning Visits";s:20:"nb_actions_returning";s:27:"Actions by Returning Visits";s:26:"avg_time_on_site_returning";s:43:"Avg. Duration of a Returning Visit (in sec)";s:21:"bounce_rate_returning";s:32:"Bounce Rate for Returning Visits";s:30:"nb_actions_per_visit_returning";s:32:"Avg. Actions per Returning Visit";s:26:"nb_uniq_visitors_returning";s:25:"Unique returning visitors";s:18:"nb_users_returning";s:15:"Returning Users";}}
\ No newline at end of file diff --git a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_scheduled_report_in_csv__ScheduledReports.generateReport_week.original.csv b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_scheduled_report_in_csv__ScheduledReports.generateReport_week.original.csv index 2ee92aac5f..e39db8b32d 100644 --- a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_scheduled_report_in_csv__ScheduledReports.generateReport_week.original.csv +++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_scheduled_report_in_csv__ScheduledReports.generateReport_week.original.csv @@ -267,6 +267,21 @@ No data available Event Names No data available +Site Search Keywords +No data available + +Search Keywords with No Results +No data available + +Search Categories +No data available + +Pages Following a Site Search +No data available + +Page Titles Following a Site Search +No data available + Referrer Type label,nb_visits,nb_actions,revenue,nb_actions_per_visit,avg_time_on_site,bounce_rate Direct Entry,5,16,$ 13361.11,3.2,00:22:49,20% @@ -448,8 +463,8 @@ New visits,1 365+ days,0 Returning Visits -nb_uniq_visitors_returning,nb_visits_returning,nb_actions_returning,bounce_rate_returning,nb_actions_per_visit_returning,avg_time_on_site_returning -1,4,12,25%,3,00:25:32 +nb_uniq_visitors_returning,nb_users_returning,nb_visits_returning,nb_actions_returning,nb_visits_converted_returning,sum_visit_length_returning,max_actions_returning,bounce_rate_returning,nb_actions_per_visit_returning,avg_time_on_site_returning +1,0,4,12,3,6126,6,25%,3,00:25:32 Provider label,nb_visits,nb_actions,conversion_rate,nb_actions_per_visit,avg_time_on_site,bounce_rate diff --git a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_scheduled_report_in_html_tables_only__ScheduledReports.generateReport_week.original.html b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_scheduled_report_in_html_tables_only__ScheduledReports.generateReport_week.original.html index 2a5bb4aa2b..69fb2047fb 100644 --- a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_scheduled_report_in_html_tables_only__ScheduledReports.generateReport_week.original.html +++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_scheduled_report_in_html_tables_only__ScheduledReports.generateReport_week.original.html @@ -190,6 +190,31 @@ </a> </li> <li> + <a href="#Actions_getSiteSearchKeywords" style="text-decoration:none; color: rgb(68,68,68);"> + Site Search Keywords + </a> + </li> + <li> + <a href="#Actions_getSiteSearchNoResultKeywords" style="text-decoration:none; color: rgb(68,68,68);"> + Search Keywords with No Results + </a> + </li> + <li> + <a href="#Actions_getSiteSearchCategories" style="text-decoration:none; color: rgb(68,68,68);"> + Search Categories + </a> + </li> + <li> + <a href="#Actions_getPageUrlsFollowingSiteSearch" style="text-decoration:none; color: rgb(68,68,68);"> + Pages Following a Site Search + </a> + </li> + <li> + <a href="#Actions_getPageTitlesFollowingSiteSearch" style="text-decoration:none; color: rgb(68,68,68);"> + Page Titles Following a Site Search + </a> + </li> + <li> <a href="#Referrers_getReferrerType" style="text-decoration:none; color: rgb(68,68,68);"> Referrer Type </a> @@ -4290,6 +4315,31 @@ </h2> There is no data for this report. +<h2 id="Actions_getSiteSearchKeywords" style="color: rgb(126,115,99); font-size: 11pt;"> + Site Search Keywords +</h2> + + There is no data for this report. +<h2 id="Actions_getSiteSearchNoResultKeywords" style="color: rgb(126,115,99); font-size: 11pt;"> + Search Keywords with No Results +</h2> + + There is no data for this report. +<h2 id="Actions_getSiteSearchCategories" style="color: rgb(126,115,99); font-size: 11pt;"> + Search Categories +</h2> + + There is no data for this report. +<h2 id="Actions_getPageUrlsFollowingSiteSearch" style="color: rgb(126,115,99); font-size: 11pt;"> + Pages Following a Site Search +</h2> + + There is no data for this report. +<h2 id="Actions_getPageTitlesFollowingSiteSearch" style="color: rgb(126,115,99); font-size: 11pt;"> + Page Titles Following a Site Search +</h2> + + There is no data for this report. <h2 id="Referrers_getReferrerType" style="color: rgb(126,115,99); font-size: 11pt;"> Referrer Type </h2> @@ -6024,13 +6074,21 @@ <tr style="background-color: rgb(249,250,250)"> <td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;"> + Returning Users </td> + <td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;"> + 0 + </td> + </tr> + + <tr style=""> + <td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;"> Returning Visits </td> <td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;"> 4 </td> </tr> - <tr style=""> + <tr style="background-color: rgb(249,250,250)"> <td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;"> Actions by Returning Visits </td> <td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;"> @@ -6038,6 +6096,30 @@ </td> </tr> + <tr style=""> + <td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;"> + Number of converted returning visits </td> + <td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;"> + 3 + </td> + </tr> + + <tr style="background-color: rgb(249,250,250)"> + <td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;"> + Total time spent by returning visitors (in seconds) </td> + <td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;"> + 6126 + </td> + </tr> + + <tr style=""> + <td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;"> + Maximum actions in one returning visit </td> + <td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;"> + 6 + </td> + </tr> + <tr style="background-color: rgb(249,250,250)"> <td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;"> Bounce Rate for Returning Visits </td> diff --git a/tests/PHPUnit/UI b/tests/PHPUnit/UI -Subproject 990155a77da0d587cc3750ba41cf663bac8c998 +Subproject 171b25d3333ab4334ee9c636b6a10b22a3c4790 diff --git a/tests/PHPUnit/Unit/API/ApiRendererTest.php b/tests/PHPUnit/Unit/API/ApiRendererTest.php index ebe1952a90..1434e34ff4 100644 --- a/tests/PHPUnit/Unit/API/ApiRendererTest.php +++ b/tests/PHPUnit/Unit/API/ApiRendererTest.php @@ -6,35 +6,38 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests\Unit\API; + use Piwik\API\ApiRenderer; +use Piwik\Plugin\Manager; /** * @group Core * @group Only2 */ -class ApiRendererTest extends PHPUnit_Framework_TestCase +class ApiRendererTest extends \PHPUnit_Framework_TestCase { public function setUp() { - \Piwik\Plugin\Manager::getInstance()->loadPlugins(array('API')); + Manager::getInstance()->loadPlugins(array('API')); } public function test_factory_shouldCreateAnInstance_IfValidFormatGiven() { $renderer = ApiRenderer::factory('php', array()); - $this->assertInstanceOf('\\Piwik\\Plugins\\API\\Renderer\\Php', $renderer); + $this->assertInstanceOf('Piwik\Plugins\API\Renderer\Php', $renderer); $renderer = ApiRenderer::factory('PHP', array()); - $this->assertInstanceOf('\\Piwik\\Plugins\\API\\Renderer\\Php', $renderer); + $this->assertInstanceOf('Piwik\Plugins\API\Renderer\Php', $renderer); $renderer = ApiRenderer::factory('pHp', array()); - $this->assertInstanceOf('\\Piwik\\Plugins\\API\\Renderer\\Php', $renderer); + $this->assertInstanceOf('Piwik\Plugins\API\Renderer\Php', $renderer); $renderer = ApiRenderer::factory('xmL', array()); - $this->assertInstanceOf('\\Piwik\\Plugins\\API\\Renderer\\Xml', $renderer); + $this->assertInstanceOf('Piwik\Plugins\API\Renderer\Xml', $renderer); $renderer = ApiRenderer::factory('OriginAl', array()); - $this->assertInstanceOf('\\Piwik\\Plugins\\API\\Renderer\\Original', $renderer); + $this->assertInstanceOf('Piwik\Plugins\API\Renderer\Original', $renderer); } /** diff --git a/tests/PHPUnit/Unit/API/ResponseBuilderTest.php b/tests/PHPUnit/Unit/API/ResponseBuilderTest.php index 9d6d0bc779..d9e6769818 100644 --- a/tests/PHPUnit/Unit/API/ResponseBuilderTest.php +++ b/tests/PHPUnit/Unit/API/ResponseBuilderTest.php @@ -6,17 +6,21 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests\Unit\API; + +use Exception; use Piwik\API\ResponseBuilder; use Piwik\DataTable; +use Piwik\Plugin\Manager; /** * @group Core */ -class ResponseBuilderTest extends PHPUnit_Framework_TestCase +class ResponseBuilderTest extends \PHPUnit_Framework_TestCase { public function setUp() { - \Piwik\Plugin\Manager::getInstance()->loadPlugins(array('API')); + Manager::getInstance()->loadPlugins(array('API')); } public function test_getResponseException_shouldFormatExceptionDependingOnFormatAndAddDebugHelp() diff --git a/tests/PHPUnit/Unit/AssetManager/PluginManagerMock.php b/tests/PHPUnit/Unit/AssetManager/PluginManagerMock.php index 2dd91867f2..7aeaeb0f66 100644 --- a/tests/PHPUnit/Unit/AssetManager/PluginManagerMock.php +++ b/tests/PHPUnit/Unit/AssetManager/PluginManagerMock.php @@ -6,6 +6,8 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests\Unit\AssetManager; + use Piwik\Plugin\Manager; use Piwik\Plugin; use Piwik\Theme; diff --git a/tests/PHPUnit/Unit/AssetManager/PluginMock.php b/tests/PHPUnit/Unit/AssetManager/PluginMock.php index 6b6e8919ab..c29c03dd67 100644 --- a/tests/PHPUnit/Unit/AssetManager/PluginMock.php +++ b/tests/PHPUnit/Unit/AssetManager/PluginMock.php @@ -6,6 +6,8 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests\Unit\AssetManager; + use Piwik\Plugin; class PluginMock extends Plugin diff --git a/tests/PHPUnit/Unit/AssetManager/ThemeMock.php b/tests/PHPUnit/Unit/AssetManager/ThemeMock.php index 213a14d737..5c2d59a22d 100644 --- a/tests/PHPUnit/Unit/AssetManager/ThemeMock.php +++ b/tests/PHPUnit/Unit/AssetManager/ThemeMock.php @@ -6,6 +6,8 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests\Unit\AssetManager; + use Piwik\Plugin; use Piwik\Theme; diff --git a/tests/PHPUnit/Unit/AssetManager/UIAssetCacheBusterMock.php b/tests/PHPUnit/Unit/AssetManager/UIAssetCacheBusterMock.php index c6d2205aae..b0ebf13f88 100644 --- a/tests/PHPUnit/Unit/AssetManager/UIAssetCacheBusterMock.php +++ b/tests/PHPUnit/Unit/AssetManager/UIAssetCacheBusterMock.php @@ -6,6 +6,8 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests\Unit\AssetManager; + use Piwik\AssetManager\UIAssetCacheBuster; class UIAssetCacheBusterMock extends UIAssetCacheBuster diff --git a/tests/PHPUnit/Unit/AssetManager/UIAssetCacheBusterTest.php b/tests/PHPUnit/Unit/AssetManager/UIAssetCacheBusterTest.php index 85c4b613b3..b71903b7fa 100644 --- a/tests/PHPUnit/Unit/AssetManager/UIAssetCacheBusterTest.php +++ b/tests/PHPUnit/Unit/AssetManager/UIAssetCacheBusterTest.php @@ -6,11 +6,13 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests\Unit\AssetManager; + +use PHPUnit_Framework_TestCase; use Piwik\AssetManager\UIAssetCacheBuster; class UIAssetCacheBusterTest extends PHPUnit_Framework_TestCase { - /** * @var UIAssetCacheBuster */ diff --git a/tests/PHPUnit/Unit/AssetManager/UIAssetCatalogSorterTest.php b/tests/PHPUnit/Unit/AssetManager/UIAssetCatalogSorterTest.php index 820d8161bf..8bf96d8f4a 100644 --- a/tests/PHPUnit/Unit/AssetManager/UIAssetCatalogSorterTest.php +++ b/tests/PHPUnit/Unit/AssetManager/UIAssetCatalogSorterTest.php @@ -5,6 +5,10 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ + +namespace Piwik\Tests\Unit\AssetManager; + +use PHPUnit_Framework_TestCase; use Piwik\AssetManager\UIAsset\OnDiskUIAsset; use Piwik\AssetManager\UIAssetCatalog; use Piwik\AssetManager\UIAssetCatalogSorter; diff --git a/tests/PHPUnit/Unit/AssetManagerTest.php b/tests/PHPUnit/Unit/AssetManagerTest.php index ca1ca94433..18c61cf18c 100644 --- a/tests/PHPUnit/Unit/AssetManagerTest.php +++ b/tests/PHPUnit/Unit/AssetManagerTest.php @@ -5,6 +5,10 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ + +namespace Piwik\Tests\Unit; + +use PHPUnit_Framework_TestCase; use Piwik\AssetManager\UIAsset\OnDiskUIAsset; use Piwik\AssetManager\UIAsset; use Piwik\AssetManager; @@ -13,11 +17,10 @@ use Piwik\Config; use Piwik\Plugin; use Piwik\Plugin\Manager; use Piwik\EventDispatcher; - -require_once PIWIK_INCLUDE_PATH . "/tests/PHPUnit/Unit/AssetManager/UIAssetCacheBusterMock.php"; -require_once PIWIK_INCLUDE_PATH . "/tests/PHPUnit/Unit/AssetManager/PluginManagerMock.php"; -require_once PIWIK_INCLUDE_PATH . "/tests/PHPUnit/Unit/AssetManager/PluginMock.php"; -require_once PIWIK_INCLUDE_PATH . "/tests/PHPUnit/Unit/AssetManager/ThemeMock.php"; +use Piwik\Tests\Unit\AssetManager\PluginManagerMock; +use Piwik\Tests\Unit\AssetManager\PluginMock; +use Piwik\Tests\Unit\AssetManager\ThemeMock; +use Piwik\Tests\Unit\AssetManager\UIAssetCacheBusterMock; /** * @group AssetManagerTest @@ -50,12 +53,12 @@ class AssetManagerTest extends PHPUnit_Framework_TestCase private $mergedAsset; /** - * @var UIAssetCacheBusterMock + * @var \Piwik\Tests\Unit\AssetManager\UIAssetCacheBusterMock */ private $cacheBuster; /** - * @var PluginManagerMock + * @var \Piwik\Tests\Unit\AssetManager\PluginManagerMock */ private $pluginManager; diff --git a/tests/PHPUnit/Unit/CliMulti/OutputTest.php b/tests/PHPUnit/Unit/CliMulti/OutputTest.php index 355fe2c4c7..6dbcf12179 100644 --- a/tests/PHPUnit/Unit/CliMulti/OutputTest.php +++ b/tests/PHPUnit/Unit/CliMulti/OutputTest.php @@ -5,15 +5,17 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ + +namespace Piwik\Tests\Unit\CliMulti; + use Piwik\CliMulti\Output; +use Piwik\Url; /** - * Class OutputTest * @group Core */ -class OutputTest extends PHPUnit_Framework_TestCase +class OutputTest extends \PHPUnit_Framework_TestCase { - /** * @var Output */ @@ -21,7 +23,7 @@ class OutputTest extends PHPUnit_Framework_TestCase public function setUp() { - \Piwik\Url::setHost(false); + Url::setHost(false); $this->output = new Output('myid'); } diff --git a/tests/PHPUnit/Unit/CliMulti/ProcessTest.php b/tests/PHPUnit/Unit/CliMulti/ProcessTest.php index bc00463e3a..3db93081c6 100644 --- a/tests/PHPUnit/Unit/CliMulti/ProcessTest.php +++ b/tests/PHPUnit/Unit/CliMulti/ProcessTest.php @@ -6,13 +6,15 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests\Unit\CliMulti; + use Piwik\CliMulti\Process; +use ReflectionProperty; /** - * Class ProcessTest * @group Core */ -class ProcessTest extends PHPUnit_Framework_TestCase +class ProcessTest extends \PHPUnit_Framework_TestCase { /** * @var Process diff --git a/tests/PHPUnit/Unit/Columns/DimensionTest.php b/tests/PHPUnit/Unit/Columns/DimensionTest.php index cf0da5ff94..50a818cc55 100644 --- a/tests/PHPUnit/Unit/Columns/DimensionTest.php +++ b/tests/PHPUnit/Unit/Columns/DimensionTest.php @@ -43,7 +43,7 @@ namespace Piwik\Plugins\Test\Columns } } -namespace Piwik\Tests\Core\Columns +namespace Piwik\Tests\Unit\Columns { use Piwik\Columns\Dimension; use Piwik\Config; diff --git a/tests/PHPUnit/Unit/CommonTest.php b/tests/PHPUnit/Unit/CommonTest.php index 185fa064d3..5e820a25fd 100644 --- a/tests/PHPUnit/Unit/CommonTest.php +++ b/tests/PHPUnit/Unit/CommonTest.php @@ -1,15 +1,21 @@ <?php -use Piwik\Common; -use Piwik\Filesystem; - /** * Piwik - free/libre analytics platform * - * @backupGlobals enabled - * * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ + +namespace Piwik\Tests\Unit; + +use Exception; +use PHPUnit_Framework_TestCase; +use Piwik\Common; +use Piwik\Filesystem; + +/** + * @backupGlobals enabled + */ class Core_CommonTest extends PHPUnit_Framework_TestCase { /** diff --git a/tests/PHPUnit/Unit/ConfigTest.php b/tests/PHPUnit/Unit/ConfigTest.php index 128e198eeb..3543871b1f 100644 --- a/tests/PHPUnit/Unit/ConfigTest.php +++ b/tests/PHPUnit/Unit/ConfigTest.php @@ -6,6 +6,9 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests\Unit; + +use PHPUnit_Framework_TestCase; use Piwik\Config; /** diff --git a/tests/PHPUnit/Unit/CookieTest.php b/tests/PHPUnit/Unit/CookieTest.php index 9b77aeddaf..52adec4d0e 100644 --- a/tests/PHPUnit/Unit/CookieTest.php +++ b/tests/PHPUnit/Unit/CookieTest.php @@ -5,7 +5,10 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ -class CookieTest extends PHPUnit_Framework_TestCase + +namespace Piwik\Tests\Unit; + +class CookieTest extends \PHPUnit_Framework_TestCase { /** * Dataprovider for testJsonSerialize @@ -41,11 +44,6 @@ class CookieTest extends PHPUnit_Framework_TestCase */ public function testJsonSerialize($testData, $id) { - // @see http://bugs.php.net/38680 - if (PHP_VERSION >= '5.2.0' && PHP_VERSION < '5.2.1') { - $this->markTestSkipped('see http://bugs.php.net/38680'); - } - $this->assertEquals($testData, json_decode(json_encode($testData), $assoc = true), $id); } @@ -95,7 +93,7 @@ class CookieTest extends PHPUnit_Framework_TestCase public function testSafeUnserialize() { /* - * serialize() uses its internal maachine representation when floats expressed in E-notation, + * serialize() uses its internal machine representation when floats expressed in E-notation, * which may vary between php versions, OS, and hardware platforms */ $testData = -5.0E+142; diff --git a/tests/PHPUnit/Unit/DataTable/Filter/AddSummaryRowTest.php b/tests/PHPUnit/Unit/DataTable/Filter/AddSummaryRowTest.php index 71b41bd429..f072011675 100644 --- a/tests/PHPUnit/Unit/DataTable/Filter/AddSummaryRowTest.php +++ b/tests/PHPUnit/Unit/DataTable/Filter/AddSummaryRowTest.php @@ -5,10 +5,13 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ + +namespace Piwik\Tests\Unit\DataTable\Filter; + use Piwik\DataTable; use Piwik\DataTable\Row; -class DataTable_Filter_AddSummaryRowTest extends PHPUnit_Framework_TestCase +class DataTable_Filter_AddSummaryRowTest extends \PHPUnit_Framework_TestCase { /** * @group AddSummaryRow diff --git a/tests/PHPUnit/Unit/DataTable/Filter/ExcludeLowPopulationTest.php b/tests/PHPUnit/Unit/DataTable/Filter/ExcludeLowPopulationTest.php index 469015a24c..6e8eb733b8 100644 --- a/tests/PHPUnit/Unit/DataTable/Filter/ExcludeLowPopulationTest.php +++ b/tests/PHPUnit/Unit/DataTable/Filter/ExcludeLowPopulationTest.php @@ -5,11 +5,14 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ + +namespace Piwik\Tests\Unit\DataTable\Filter; + use Piwik\DataTable\Filter\ExcludeLowPopulation; use Piwik\DataTable; use Piwik\DataTable\Row; -class DataTable_Filter_ExcludeLowPopulationTest extends PHPUnit_Framework_TestCase +class DataTable_Filter_ExcludeLowPopulationTest extends \PHPUnit_Framework_TestCase { protected function getTestDataTable() { diff --git a/tests/PHPUnit/Unit/DataTable/Filter/LimitTest.php b/tests/PHPUnit/Unit/DataTable/Filter/LimitTest.php index 14705926a5..94d2d4c84b 100644 --- a/tests/PHPUnit/Unit/DataTable/Filter/LimitTest.php +++ b/tests/PHPUnit/Unit/DataTable/Filter/LimitTest.php @@ -5,11 +5,14 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ + +namespace Piwik\Tests\Unit\DataTable\Filter; + use Piwik\DataTable\Filter\Limit; use Piwik\DataTable; use Piwik\DataTable\Row; -class DataTable_Filter_LimitTest extends PHPUnit_Framework_TestCase +class DataTable_Filter_LimitTest extends \PHPUnit_Framework_TestCase { /** * Returns table used for the tests diff --git a/tests/PHPUnit/Unit/DataTable/Filter/PatternRecursiveTest.php b/tests/PHPUnit/Unit/DataTable/Filter/PatternRecursiveTest.php index 7ab59d8c4a..4c9cd46ab3 100644 --- a/tests/PHPUnit/Unit/DataTable/Filter/PatternRecursiveTest.php +++ b/tests/PHPUnit/Unit/DataTable/Filter/PatternRecursiveTest.php @@ -5,10 +5,13 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ + +namespace Piwik\Tests\Unit\DataTable\Filter; + use Piwik\DataTable; use Piwik\DataTable\Row; -class DataTable_Filter_PatternRecursiveTest extends PHPUnit_Framework_TestCase +class DataTable_Filter_PatternRecursiveTest extends \PHPUnit_Framework_TestCase { /** * Returns a data table for testing diff --git a/tests/PHPUnit/Unit/DataTable/Filter/PatternTest.php b/tests/PHPUnit/Unit/DataTable/Filter/PatternTest.php index 1f1c25bc61..e9d63f1d98 100644 --- a/tests/PHPUnit/Unit/DataTable/Filter/PatternTest.php +++ b/tests/PHPUnit/Unit/DataTable/Filter/PatternTest.php @@ -5,10 +5,13 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ + +namespace Piwik\Tests\Unit\DataTable\Filter; + use Piwik\DataTable; use Piwik\DataTable\Row; -class DataTable_Filter_PatternTest extends PHPUnit_Framework_TestCase +class DataTable_Filter_PatternTest extends \PHPUnit_Framework_TestCase { /** * Dataprovider for testFilterPattern diff --git a/tests/PHPUnit/Unit/DataTable/Filter/RangeCheckTest.php b/tests/PHPUnit/Unit/DataTable/Filter/RangeCheckTest.php index e9140c3aed..3c1d91a357 100644 --- a/tests/PHPUnit/Unit/DataTable/Filter/RangeCheckTest.php +++ b/tests/PHPUnit/Unit/DataTable/Filter/RangeCheckTest.php @@ -5,11 +5,14 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ + +namespace Piwik\Tests\Unit\DataTable\Filter; + use Piwik\DataTable\Filter\RangeCheck; use Piwik\DataTable; use Piwik\DataTable\Row; -class DataTable_Filter_RangeCheckTest extends PHPUnit_Framework_TestCase +class DataTable_Filter_RangeCheckTest extends \PHPUnit_Framework_TestCase { /** * @group Core diff --git a/tests/PHPUnit/Unit/DataTable/Filter/SortTest.php b/tests/PHPUnit/Unit/DataTable/Filter/SortTest.php index bf23dbd7dc..4aedcb3d7e 100644 --- a/tests/PHPUnit/Unit/DataTable/Filter/SortTest.php +++ b/tests/PHPUnit/Unit/DataTable/Filter/SortTest.php @@ -5,11 +5,14 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ + +namespace Piwik\Tests\Unit\DataTable\Filter; + use Piwik\DataTable\Filter\Sort; use Piwik\DataTable; use Piwik\DataTable\Row; -class DataTable_Filter_SortTest extends PHPUnit_Framework_TestCase +class DataTable_Filter_SortTest extends \PHPUnit_Framework_TestCase { /** * @group Core diff --git a/tests/PHPUnit/Unit/DataTable/Filter/TruncateTest.php b/tests/PHPUnit/Unit/DataTable/Filter/TruncateTest.php index 2cb53e701f..d82e8da441 100644 --- a/tests/PHPUnit/Unit/DataTable/Filter/TruncateTest.php +++ b/tests/PHPUnit/Unit/DataTable/Filter/TruncateTest.php @@ -5,11 +5,14 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ + +namespace Piwik\Tests\Unit\DataTable\Filter; + use Piwik\DataTable\Filter\Truncate; use Piwik\DataTable; use Piwik\DataTable\Row; -class DataTable_Filter_TruncateTest extends PHPUnit_Framework_TestCase +class DataTable_Filter_TruncateTest extends \PHPUnit_Framework_TestCase { /** * @group Core diff --git a/tests/PHPUnit/Unit/DataTable/MapTest.php b/tests/PHPUnit/Unit/DataTable/MapTest.php index de08a14787..659e76ac8f 100644 --- a/tests/PHPUnit/Unit/DataTable/MapTest.php +++ b/tests/PHPUnit/Unit/DataTable/MapTest.php @@ -1,10 +1,13 @@ <?php + +namespace Piwik\Tests\Unit\DataTable; + use Piwik\Config; use Piwik\DataTable\Manager; use Piwik\DataTable; use Piwik\DataTable\Row; -class Test_DataTable_Map extends PHPUnit_Framework_TestCase +class Test_DataTable_Map extends \PHPUnit_Framework_TestCase { public function setUp() { @@ -74,7 +77,7 @@ class Test_DataTable_Map extends PHPUnit_Framework_TestCase $this->mergeChildren_checkRow($result->getRowFromId(3), 'subDataTable2', 2); } - private function mergeChildren_checkRow($row, $expectedLabel, $expectedColumnValue) + private function mergeChildren_checkRow(Row $row, $expectedLabel, $expectedColumnValue) { $this->assertEquals($expectedLabel, $row->getColumn('label')); $this->assertEquals($expectedColumnValue, $row->getColumn('col1')); diff --git a/tests/PHPUnit/Unit/DataTable/Renderer/CSVTest.php b/tests/PHPUnit/Unit/DataTable/Renderer/CSVTest.php index 64ffcf6a06..85691cab26 100644 --- a/tests/PHPUnit/Unit/DataTable/Renderer/CSVTest.php +++ b/tests/PHPUnit/Unit/DataTable/Renderer/CSVTest.php @@ -5,13 +5,16 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ + +namespace Piwik\Tests\Unit\DataTable\Renderer; + use Piwik\DataTable\Manager; use Piwik\DataTable; use Piwik\DataTable\Renderer\Csv; use Piwik\DataTable\Row; use Piwik\DataTable\Simple; -class DataTable_Renderer_CSVTest extends PHPUnit_Framework_TestCase +class DataTable_Renderer_CSVTest extends \PHPUnit_Framework_TestCase { public function setUp() { diff --git a/tests/PHPUnit/Unit/DataTable/Renderer/ConsoleTest.php b/tests/PHPUnit/Unit/DataTable/Renderer/ConsoleTest.php index 7da7dedb53..686f6a1be6 100644 --- a/tests/PHPUnit/Unit/DataTable/Renderer/ConsoleTest.php +++ b/tests/PHPUnit/Unit/DataTable/Renderer/ConsoleTest.php @@ -5,12 +5,15 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ + +namespace Piwik\Tests\Unit\DataTable\Renderer; + use Piwik\DataTable\Manager; use Piwik\DataTable; use Piwik\DataTable\Renderer\Console; use Piwik\DataTable\Row; -class DataTable_Renderer_ConsoleTest extends PHPUnit_Framework_TestCase +class DataTable_Renderer_ConsoleTest extends \PHPUnit_Framework_TestCase { public function setUp() { diff --git a/tests/PHPUnit/Unit/DataTable/Renderer/JSONTest.php b/tests/PHPUnit/Unit/DataTable/Renderer/JSONTest.php index c18ee12e60..738439474c 100644 --- a/tests/PHPUnit/Unit/DataTable/Renderer/JSONTest.php +++ b/tests/PHPUnit/Unit/DataTable/Renderer/JSONTest.php @@ -5,13 +5,16 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ + +namespace Piwik\Tests\Unit\DataTable\Renderer; + use Piwik\DataTable\Manager; use Piwik\DataTable; use Piwik\DataTable\Renderer\Json; use Piwik\DataTable\Row; use Piwik\DataTable\Simple; -class DataTable_Renderer_JSONTest extends PHPUnit_Framework_TestCase +class DataTable_Renderer_JSONTest extends \PHPUnit_Framework_TestCase { public function setUp() { diff --git a/tests/PHPUnit/Unit/DataTable/Renderer/PHPTest.php b/tests/PHPUnit/Unit/DataTable/Renderer/PHPTest.php index 7ba4088e5c..e3201dfbe6 100644 --- a/tests/PHPUnit/Unit/DataTable/Renderer/PHPTest.php +++ b/tests/PHPUnit/Unit/DataTable/Renderer/PHPTest.php @@ -5,13 +5,16 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ + +namespace Piwik\Tests\Unit\DataTable\Renderer; + use Piwik\DataTable\Manager; use Piwik\DataTable; use Piwik\DataTable\Renderer\Php; use Piwik\DataTable\Row; use Piwik\DataTable\Simple; -class DataTable_Renderer_PHPTest extends PHPUnit_Framework_TestCase +class DataTable_Renderer_PHPTest extends \PHPUnit_Framework_TestCase { public function setUp() { diff --git a/tests/PHPUnit/Unit/DataTable/Renderer/XMLTest.php b/tests/PHPUnit/Unit/DataTable/Renderer/XMLTest.php index f8c2a93072..1abfe94b06 100644 --- a/tests/PHPUnit/Unit/DataTable/Renderer/XMLTest.php +++ b/tests/PHPUnit/Unit/DataTable/Renderer/XMLTest.php @@ -5,13 +5,16 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ + +namespace Piwik\Tests\Unit\DataTable\Renderer; + use Piwik\DataTable\Manager; use Piwik\DataTable; use Piwik\DataTable\Renderer\Xml; use Piwik\DataTable\Row; use Piwik\DataTable\Simple; -class DataTable_Renderer_XMLTest extends PHPUnit_Framework_TestCase +class DataTable_Renderer_XMLTest extends \PHPUnit_Framework_TestCase { public function setUp() { diff --git a/tests/PHPUnit/Unit/DataTable/RowTest.php b/tests/PHPUnit/Unit/DataTable/RowTest.php index 629a10a280..53a072fa36 100644 --- a/tests/PHPUnit/Unit/DataTable/RowTest.php +++ b/tests/PHPUnit/Unit/DataTable/RowTest.php @@ -5,13 +5,16 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ + +namespace Piwik\Tests\Unit\DataTable; + use Piwik\DataTable; use Piwik\DataTable\Row; /** * @group Core */ -class RowTest extends PHPUnit_Framework_TestCase +class RowTest extends \PHPUnit_Framework_TestCase { /** * @var Row diff --git a/tests/PHPUnit/Unit/DataTableTest.php b/tests/PHPUnit/Unit/DataTableTest.php index 1465f70a7b..355b717118 100644 --- a/tests/PHPUnit/Unit/DataTableTest.php +++ b/tests/PHPUnit/Unit/DataTableTest.php @@ -6,13 +6,15 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests\Unit; + use Piwik\Common; use Piwik\DataTable\Manager; use Piwik\DataTable\Row; use Piwik\DataTable; use Piwik\Timer; -class DataTableTest extends PHPUnit_Framework_TestCase +class DataTableTest extends \PHPUnit_Framework_TestCase { /** * @group Core @@ -311,7 +313,7 @@ class DataTableTest extends PHPUnit_Framework_TestCase * * @group Core * - * @expectedException Exception + * @expectedException \Exception */ public function testSumRow_stringException() { @@ -335,7 +337,7 @@ class DataTableTest extends PHPUnit_Framework_TestCase * * @group Core * - * @expectedException Exception + * @expectedException \Exception */ public function testSerializeWithInfiniteRecursion() { diff --git a/tests/PHPUnit/Unit/DateTest.php b/tests/PHPUnit/Unit/DateTest.php index 84041f53fd..9f2c286342 100644 --- a/tests/PHPUnit/Unit/DateTest.php +++ b/tests/PHPUnit/Unit/DateTest.php @@ -5,13 +5,17 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ + +namespace Piwik\Tests\Unit; + +use Exception; use Piwik\Date; use Piwik\SettingsServer; /** * @group Core_DateTest */ -class DateTest extends PHPUnit_Framework_TestCase +class DateTest extends \PHPUnit_Framework_TestCase { /** * create today object check that timestamp is correct (midnight) diff --git a/tests/PHPUnit/Unit/DependencyTest.php b/tests/PHPUnit/Unit/DependencyTest.php index 3c7b783e95..37912aee39 100644 --- a/tests/PHPUnit/Unit/DependencyTest.php +++ b/tests/PHPUnit/Unit/DependencyTest.php @@ -1,16 +1,21 @@ <?php -use Piwik\Plugin\Dependency; -use Piwik\Plugin\Manager as PluginManager; -use Piwik\Version; - /** * Piwik - free/libre analytics platform * * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ + +namespace Piwik\Tests\Unit; + +use Piwik\Plugin\Dependency; +use Piwik\Plugin\Manager as PluginManager; +use Piwik\Version; + +/** * @group Core */ -class DependencyTest extends PHPUnit_Framework_TestCase +class DependencyTest extends \PHPUnit_Framework_TestCase { /** * @var Dependency @@ -112,7 +117,7 @@ class DependencyTest extends PHPUnit_Framework_TestCase public function test_getMissingDependencies_detectsPluginVersion() { - PluginManager::getInstance()->returnLoadedPluginsInfo(); + PluginManager::getInstance()->loadAllPluginsAndGetTheirInfo(); $this->assertMissingDependency(array('Annotations' => '>=2.1'), array()); $this->assertMissingDependency(array('Annotations' => '>=' . Version::VERSION), array()); diff --git a/tests/PHPUnit/Unit/DeprecatedMethodsTest.php b/tests/PHPUnit/Unit/DeprecatedMethodsTest.php index 82e564cb95..46dfca652f 100644 --- a/tests/PHPUnit/Unit/DeprecatedMethodsTest.php +++ b/tests/PHPUnit/Unit/DeprecatedMethodsTest.php @@ -5,29 +5,30 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ + +namespace Piwik\Tests\Unit; + use Piwik\AssetManager; use Piwik\AssetManager\UIAsset; +use Piwik\Date; use Piwik\Plugin; +use Piwik\Version; +use ReflectionClass; /** * @group Core */ -class DeprecatedMethodsTest extends PHPUnit_Framework_TestCase +class DeprecatedMethodsTest extends \PHPUnit_Framework_TestCase { - public function test_version2_0_4() { - $validTill = '2014-11-02'; + $validTill = '2014-11-25'; $this->assertDeprecatedMethodIsRemoved('\Piwik\Period', 'factory', $validTill); - - $validTill = '2014-11-02'; $this->assertDeprecatedMethodIsRemoved('\Piwik\Config', 'getConfigSuperUserForBackwardCompatibility', $validTill); $this->assertDeprecatedMethodIsRemoved('\Piwik\Menu\MenuAdmin', 'addEntry', $validTill); $this->assertDeprecatedMethodIsRemoved('\Piwik\Menu\MenuAdmin', 'removeEntry', $validTill); $this->assertDeprecatedMethodIsRemoved('\Piwik\Menu\MenuTop', 'addEntry', $validTill); $this->assertDeprecatedMethodIsRemoved('\Piwik\Menu\MenuTop', 'removeEntry', $validTill); - - $validTill = '2014-11-02'; $this->assertDeprecatedMethodIsRemoved('\Piwik\SettingsPiwik', 'rewriteTmpPathWithHostname', $validTill); $validTill = '2015-02-06'; @@ -59,8 +60,8 @@ class DeprecatedMethodsTest extends PHPUnit_Framework_TestCase private function assertDeprecatedMethodIsRemoved($className, $method, $removalDate) { - $now = \Piwik\Date::now(); - $removalDate = \Piwik\Date::factory($removalDate); + $now = Date::now(); + $removalDate = Date::factory($removalDate); $class = new ReflectionClass($className); $methodExists = $class->hasMethod($method); @@ -79,8 +80,8 @@ class DeprecatedMethodsTest extends PHPUnit_Framework_TestCase private function assertDeprecatedClassIsRemoved($className, $removalDate) { - $now = \Piwik\Date::now(); - $removalDate = \Piwik\Date::factory($removalDate); + $now = Date::now(); + $removalDate = Date::factory($removalDate); $classExists = class_exists($className); @@ -97,7 +98,7 @@ class DeprecatedMethodsTest extends PHPUnit_Framework_TestCase private function assertDeprecatedMethodIsRemovedInPiwik3($className, $method) { - $version = \Piwik\Version::VERSION; + $version = Version::VERSION; $class = new ReflectionClass($className); $methodExists = $class->hasMethod($method); diff --git a/tests/PHPUnit/Unit/FactoryTest.php b/tests/PHPUnit/Unit/FactoryTest.php index d85efcc2ce..056b08c618 100644 --- a/tests/PHPUnit/Unit/FactoryTest.php +++ b/tests/PHPUnit/Unit/FactoryTest.php @@ -6,28 +6,29 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests\Unit; + use Piwik\BaseFactory; /** * @group Core - * @group Core_FactoryTest */ -class FactoryTest extends PHPUnit_Framework_TestCase +class FactoryTest extends \PHPUnit_Framework_TestCase { public function testCreatingExistingClassSucceeds() { - $instance = BaseFactory::factory("Piwik\\Timer"); + $instance = BaseFactory::factory('Piwik\Timer'); $this->assertNotNull($instance); - $this->assertInstanceOf("Piwik\\Timer", $instance); + $this->assertInstanceOf('Piwik\Timer', $instance); } /** - * @expectedException Exception + * @expectedException \Exception * @expectedExceptionMessage Invalid class ID */ public function testCreatingInvalidClassThrows() { BaseFactory::factory("This\\Class\\Does\\Not\\Exist"); } -}
\ No newline at end of file +} diff --git a/tests/PHPUnit/Unit/FilesystemTest.php b/tests/PHPUnit/Unit/FilesystemTest.php index 26518c1a08..263a268bbd 100644 --- a/tests/PHPUnit/Unit/FilesystemTest.php +++ b/tests/PHPUnit/Unit/FilesystemTest.php @@ -5,12 +5,15 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ + +namespace Piwik\Tests\Unit; + use Piwik\Filesystem; /** * @group Core */ -class FilesystemTest extends PHPUnit_Framework_TestCase +class FilesystemTest extends \PHPUnit_Framework_TestCase { private $testPath; diff --git a/tests/PHPUnit/Unit/IPTest.php b/tests/PHPUnit/Unit/IPTest.php index b542a74ab2..a78d7ddeca 100644 --- a/tests/PHPUnit/Unit/IPTest.php +++ b/tests/PHPUnit/Unit/IPTest.php @@ -8,11 +8,13 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests\Unit; + use Piwik\Common; use Piwik\Config; use Piwik\IP; -class IPTest extends PHPUnit_Framework_TestCase +class IPTest extends \PHPUnit_Framework_TestCase { /** * Dataprovider for long2ip test diff --git a/tests/PHPUnit/Unit/Menu/MenuReportingTest.php b/tests/PHPUnit/Unit/Menu/MenuReportingTest.php index b82c4a1aaf..78d26b6427 100644 --- a/tests/PHPUnit/Unit/Menu/MenuReportingTest.php +++ b/tests/PHPUnit/Unit/Menu/MenuReportingTest.php @@ -6,19 +6,21 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests\Unit\Menu; + use Piwik\Access; use Piwik\Plugin\Report; use Piwik\Piwik; use Piwik\Metrics; +use Piwik\Tests\Framework\Mock\FakeAccess; use Piwik\Translate; use Piwik\Menu\MenuReporting; use Piwik\Plugin\Manager as PluginManager; - /** * @group Core */ -class Menu_ReportingTest extends PHPUnit_Framework_TestCase +class ReportingTest extends \PHPUnit_Framework_TestCase { /** * @var MenuReporting diff --git a/tests/PHPUnit/Unit/MetricsTest.php b/tests/PHPUnit/Unit/MetricsTest.php index c7052102e8..610e1cf459 100644 --- a/tests/PHPUnit/Unit/MetricsTest.php +++ b/tests/PHPUnit/Unit/MetricsTest.php @@ -1,14 +1,19 @@ <?php
-use Piwik\Access;
-use Piwik\Metrics;
-
/**
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
-class Core_MetricsTest extends PHPUnit_Framework_TestCase
+
+namespace Piwik\Tests\Unit;
+
+use Piwik\Access;
+use Piwik\Metrics;
+use Piwik\Site;
+use Piwik\Tests\Framework\Mock\FakeAccess;
+
+class Core_MetricsTest extends \PHPUnit_Framework_TestCase
{
/**
* @group Core
@@ -117,7 +122,7 @@ class Core_MetricsTest extends PHPUnit_Framework_TestCase */
public function testGetUnit($column, $expected)
{
- \Piwik\Site::setSites(array(
+ Site::setSites(array(
1 => array('name' => 'TestSite', 'currency' => 'EUR')
));
diff --git a/tests/PHPUnit/Unit/NonceTest.php b/tests/PHPUnit/Unit/NonceTest.php index 6a9a90994c..c12c245ae2 100644 --- a/tests/PHPUnit/Unit/NonceTest.php +++ b/tests/PHPUnit/Unit/NonceTest.php @@ -1,16 +1,20 @@ <?php -use Piwik\Config; -use Piwik\Nonce; - /** * Piwik - free/libre analytics platform * - * @backupGlobals enabled - * * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ -class NonceTest extends PHPUnit_Framework_TestCase + +namespace Piwik\Tests\Unit; + +use Piwik\Config; +use Piwik\Nonce; + +/** + * @backupGlobals enabled + */ +class NonceTest extends \PHPUnit_Framework_TestCase { /** * Dataprovider for acceptable origins test diff --git a/tests/PHPUnit/Unit/Period/DayTest.php b/tests/PHPUnit/Unit/Period/DayTest.php index eb653fcc5c..ae1ba01844 100644 --- a/tests/PHPUnit/Unit/Period/DayTest.php +++ b/tests/PHPUnit/Unit/Period/DayTest.php @@ -5,14 +5,14 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ + +namespace Piwik\Tests\Unit\Period; + use Piwik\Date; use Piwik\Period\Day; use Piwik\Translate; -/** - * Testing Period_Day - */ -class Period_DayTest extends PHPUnit_Framework_TestCase +class Period_DayTest extends \PHPUnit_Framework_TestCase { /** * @group Core @@ -21,7 +21,7 @@ class Period_DayTest extends PHPUnit_Framework_TestCase { try { new Day('Invalid Date'); - } catch (Exception $e) { + } catch (\Exception $e) { return; } $this->fail('Expected Exception not raised'); @@ -203,7 +203,7 @@ class Period_DayTest extends PHPUnit_Framework_TestCase try { $period->addSubperiod(''); - } catch (Exception $e) { + } catch (\Exception $e) { return; } // expected string diff --git a/tests/PHPUnit/Unit/Period/MonthTest.php b/tests/PHPUnit/Unit/Period/MonthTest.php index 5821aceee5..916f925e6d 100644 --- a/tests/PHPUnit/Unit/Period/MonthTest.php +++ b/tests/PHPUnit/Unit/Period/MonthTest.php @@ -5,14 +5,14 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ + +namespace Piwik\Tests\Unit\Period; + use Piwik\Date; use Piwik\Period\Month; use Piwik\Translate; -/** - * Testing Period_Month - */ -class Period_MonthTest extends PHPUnit_Framework_TestCase +class Period_MonthTest extends \PHPUnit_Framework_TestCase { /** * testing december diff --git a/tests/PHPUnit/Unit/Period/RangeTest.php b/tests/PHPUnit/Unit/Period/RangeTest.php index b2114a4372..7c92d2119f 100644 --- a/tests/PHPUnit/Unit/Period/RangeTest.php +++ b/tests/PHPUnit/Unit/Period/RangeTest.php @@ -5,6 +5,10 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ + +namespace Piwik\Tests\Unit\Period; + +use Exception; use Piwik\Date; use Piwik\Period\Month; use Piwik\Period\Range; @@ -12,10 +16,7 @@ use Piwik\Period\Week; use Piwik\Period\Year; use Piwik\Translate; -/** - * @group Core_Period_RangeTest - */ -class Period_RangeTest extends PHPUnit_Framework_TestCase +class Period_RangeTest extends \PHPUnit_Framework_TestCase { // test range 1 /** diff --git a/tests/PHPUnit/Unit/Period/WeekTest.php b/tests/PHPUnit/Unit/Period/WeekTest.php index 2994f8e13d..c543a2db5d 100644 --- a/tests/PHPUnit/Unit/Period/WeekTest.php +++ b/tests/PHPUnit/Unit/Period/WeekTest.php @@ -5,14 +5,14 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ + +namespace Piwik\Tests\Unit\Period; + use Piwik\Date; use Piwik\Period\Week; use Piwik\Translate; -/** - * Testing Period_Week - */ -class Period_WeekTest extends PHPUnit_Framework_TestCase +class Period_WeekTest extends \PHPUnit_Framework_TestCase { /** * test week between 2 years diff --git a/tests/PHPUnit/Unit/Period/YearTest.php b/tests/PHPUnit/Unit/Period/YearTest.php index ef28d619d6..fad41535de 100644 --- a/tests/PHPUnit/Unit/Period/YearTest.php +++ b/tests/PHPUnit/Unit/Period/YearTest.php @@ -5,14 +5,14 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ + +namespace Piwik\Tests\Unit\Period; + use Piwik\Date; use Piwik\Period\Year; use Piwik\Translate; -/** - * Testing Period_Year - */ -class Period_YearTest extends PHPUnit_Framework_TestCase +class Period_YearTest extends \PHPUnit_Framework_TestCase { /** * test normal case diff --git a/tests/PHPUnit/Unit/PeriodTest.php b/tests/PHPUnit/Unit/PeriodTest.php index 8888c4c763..bbae689f95 100644 --- a/tests/PHPUnit/Unit/PeriodTest.php +++ b/tests/PHPUnit/Unit/PeriodTest.php @@ -5,6 +5,9 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ + +namespace Piwik\Tests\Unit; + use Piwik\Date; use Piwik\Period\Day; use Piwik\Period; @@ -12,7 +15,7 @@ use Piwik\Period\Month; use Piwik\Period\Week; use Piwik\Period\Year; -class PeriodTest extends PHPUnit_Framework_TestCase +class PeriodTest extends \PHPUnit_Framework_TestCase { /** * @group Core @@ -95,7 +98,7 @@ class PeriodTest extends PHPUnit_Framework_TestCase { try { Period\Factory::build('inValid', Date::today()); - } catch (Exception $e) { + } catch (\Exception $e) { return; } $this->fail('Expected Exception not raised'); diff --git a/tests/PHPUnit/Unit/RankingQueryTest.php b/tests/PHPUnit/Unit/RankingQueryTest.php index 7941c25d35..49c24e56be 100644 --- a/tests/PHPUnit/Unit/RankingQueryTest.php +++ b/tests/PHPUnit/Unit/RankingQueryTest.php @@ -6,11 +6,12 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests\Unit; + use Piwik\RankingQuery; -class RankingQueryTest extends PHPUnit_Framework_TestCase +class RankingQueryTest extends \PHPUnit_Framework_TestCase { - /** * @group Core */ @@ -146,5 +147,4 @@ class RankingQueryTest extends PHPUnit_Framework_TestCase $message = 'Unexpected query: ' . $query; $this->assertEquals($queryNoWhitespace, $expectedNoWhitespace, $message); } - } diff --git a/tests/PHPUnit/Unit/RegistryTest.php b/tests/PHPUnit/Unit/RegistryTest.php index c6c2aff894..376c857ed1 100644 --- a/tests/PHPUnit/Unit/RegistryTest.php +++ b/tests/PHPUnit/Unit/RegistryTest.php @@ -5,9 +5,12 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ + +namespace Piwik\Tests\Unit; + use Piwik\Registry; -class RegistryTest extends PHPUnit_Framework_TestCase +class RegistryTest extends \PHPUnit_Framework_TestCase { /** * @group Core diff --git a/tests/PHPUnit/Unit/ScheduledTaskTest.php b/tests/PHPUnit/Unit/ScheduledTaskTest.php index 5a131521ff..1b67ddf6f2 100644 --- a/tests/PHPUnit/Unit/ScheduledTaskTest.php +++ b/tests/PHPUnit/Unit/ScheduledTaskTest.php @@ -5,19 +5,20 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ + +namespace Piwik\Tests\Unit; + use Piwik\Plugins\ScheduledReports\ScheduledReports; use Piwik\ScheduledTask; -require_once PIWIK_INCLUDE_PATH . '/plugins/ScheduledReports/ScheduledReports.php'; - -class ScheduledTaskTest extends PHPUnit_Framework_TestCase +class ScheduledTaskTest extends \PHPUnit_Framework_TestCase { /** * @group Core */ public function testGetClassName() { - $scheduledTask = new ScheduledTask (new ScheduledReports(), null, null, null); + $scheduledTask = new ScheduledTask(new ScheduledReports(), null, null, null); $this->assertEquals('Piwik\Plugins\ScheduledReports\ScheduledReports', $scheduledTask->getClassName()); } @@ -43,5 +44,4 @@ class ScheduledTaskTest extends PHPUnit_Framework_TestCase { $this->assertEquals($expectedTaskName, ScheduledTask::getTaskName($className, $methodName, $methodParameter)); } - } diff --git a/tests/PHPUnit/Unit/ScheduledTime/DailyTest.php b/tests/PHPUnit/Unit/ScheduledTime/DailyTest.php index 1a62019392..55a6c08520 100644 --- a/tests/PHPUnit/Unit/ScheduledTime/DailyTest.php +++ b/tests/PHPUnit/Unit/ScheduledTime/DailyTest.php @@ -6,10 +6,14 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +namespace Piwik\Tests\Unit\ScheduledTime; +use Exception; +use Piwik\ScheduledTime; + /** * @group Core */ -class ScheduledTime_DailyTest extends PHPUnit_Framework_TestCase +class ScheduledTime_DailyTest extends \PHPUnit_Framework_TestCase { private static $_JANUARY_01_1971_09_00_00; private static $_JANUARY_01_1971_09_10_00; @@ -33,7 +37,7 @@ class ScheduledTime_DailyTest extends PHPUnit_Framework_TestCase public function testSetHourScheduledTimeDailyNegative() { try { - $dailySchedule = \Piwik\ScheduledTime::factory('daily'); + $dailySchedule = ScheduledTime::factory('daily'); $dailySchedule->setHour(-1); } catch (Exception $e) { @@ -48,7 +52,7 @@ class ScheduledTime_DailyTest extends PHPUnit_Framework_TestCase public function testSetHourScheduledTimeDailyOver24() { try { - $dailySchedule = \Piwik\ScheduledTime::factory('daily'); + $dailySchedule = ScheduledTime::factory('daily'); $dailySchedule->setHour(25); } catch (Exception $e) { return; @@ -62,7 +66,7 @@ class ScheduledTime_DailyTest extends PHPUnit_Framework_TestCase public function testSetDayScheduledTimeDaily() { try { - $dailySchedule = \Piwik\ScheduledTime::factory('daily'); + $dailySchedule = ScheduledTime::factory('daily'); $dailySchedule->setDay(1); } catch (Exception $e) { return; diff --git a/tests/PHPUnit/Unit/ScheduledTime/HourlyTest.php b/tests/PHPUnit/Unit/ScheduledTime/HourlyTest.php index 14f4ce3c0e..4c71c1670a 100644 --- a/tests/PHPUnit/Unit/ScheduledTime/HourlyTest.php +++ b/tests/PHPUnit/Unit/ScheduledTime/HourlyTest.php @@ -5,9 +5,13 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ + +namespace Piwik\Tests\Unit\ScheduledTime; + +use Exception; use Piwik\ScheduledTime\Hourly; -class ScheduledTime_HourlyTest extends PHPUnit_Framework_TestCase +class ScheduledTime_HourlyTest extends \PHPUnit_Framework_TestCase { private static $_JANUARY_01_1971_09_00_00; private static $_JANUARY_01_1971_09_10_00; diff --git a/tests/PHPUnit/Unit/ScheduledTime/MonthlyTest.php b/tests/PHPUnit/Unit/ScheduledTime/MonthlyTest.php index 17bde4ee6d..58ed51ab02 100644 --- a/tests/PHPUnit/Unit/ScheduledTime/MonthlyTest.php +++ b/tests/PHPUnit/Unit/ScheduledTime/MonthlyTest.php @@ -5,12 +5,15 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ + +namespace Piwik\Tests\Unit\ScheduledTime; + use Piwik\ScheduledTime\Monthly; /** * @group Core */ -class ScheduledTime_MonthlyTest extends PHPUnit_Framework_TestCase +class ScheduledTime_MonthlyTest extends \PHPUnit_Framework_TestCase { public static $_JANUARY_01_1971_09_00_00; // initialized below class definition public static $_JANUARY_02_1971_09_00_00; diff --git a/tests/PHPUnit/Unit/ScheduledTime/WeeklyTest.php b/tests/PHPUnit/Unit/ScheduledTime/WeeklyTest.php index 62b6fce8ed..793d87f9e5 100644 --- a/tests/PHPUnit/Unit/ScheduledTime/WeeklyTest.php +++ b/tests/PHPUnit/Unit/ScheduledTime/WeeklyTest.php @@ -5,12 +5,16 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ + +namespace Piwik\Tests\Unit\ScheduledTime; + +use Exception; use Piwik\ScheduledTime\Weekly; /** * @group Core */ -class ScheduledTime_WeeklyTest extends PHPUnit_Framework_TestCase +class ScheduledTime_WeeklyTest extends \PHPUnit_Framework_TestCase { public static $_JANUARY_01_1971_09_10_00; // initialized below class declaration public static $_JANUARY_04_1971_00_00_00; diff --git a/tests/PHPUnit/Unit/SegmentExpressionTest.php b/tests/PHPUnit/Unit/SegmentExpressionTest.php index 874df9e2d1..aadecc8f0e 100644 --- a/tests/PHPUnit/Unit/SegmentExpressionTest.php +++ b/tests/PHPUnit/Unit/SegmentExpressionTest.php @@ -5,9 +5,12 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ + +namespace Piwik\Tests\Unit; + use Piwik\SegmentExpression; -class SegmentExpressionTest extends PHPUnit_Framework_TestCase +class SegmentExpressionTest extends \PHPUnit_Framework_TestCase { /** * Dataprovider for testSegmentSqlSimpleNoOperation @@ -121,7 +124,7 @@ class SegmentExpressionTest extends PHPUnit_Framework_TestCase $segment = new SegmentExpression($bogus); $segment->parseSubExpressions(); $segment->getSql(); - } catch (Exception $e) { + } catch (\Exception $e) { return; } $this->fail('Expected exception not raised for:' . var_export($segment->getSql(), true)); diff --git a/tests/PHPUnit/Unit/TaskSchedulerTest.php b/tests/PHPUnit/Unit/TaskSchedulerTest.php index 70ec2f2ef4..762ae44de5 100644 --- a/tests/PHPUnit/Unit/TaskSchedulerTest.php +++ b/tests/PHPUnit/Unit/TaskSchedulerTest.php @@ -5,13 +5,20 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ + +namespace Piwik\Tests\Unit; + use Piwik\EventDispatcher; +use Piwik\Piwik; +use Piwik\Plugin; use Piwik\ScheduledTask; use Piwik\ScheduledTaskTimetable; use Piwik\TaskScheduler; use Piwik\Tests\Framework\Mock\PiwikOption; +use ReflectionMethod; +use ReflectionProperty; -class TaskSchedulerTest extends PHPUnit_Framework_TestCase +class TaskSchedulerTest extends \PHPUnit_Framework_TestCase { private static function getTestTimetable() { @@ -195,13 +202,13 @@ class TaskSchedulerTest extends PHPUnit_Framework_TestCase $scheduledTaskThree = new ScheduledTask ($this, 'scheduledTaskThree', null, $dailySchedule); $caseOneExpectedTable = array( - 'TaskSchedulerTest.scheduledTaskOne' => $scheduledTaskOne->getRescheduledTime(), - 'TaskSchedulerTest.scheduledTaskTwo_1' => $systemTime + 60000, - 'TaskSchedulerTest.scheduledTaskThree' => $scheduledTaskThree->getRescheduledTime(), + 'Piwik\Tests\Unit\TaskSchedulerTest.scheduledTaskOne' => $scheduledTaskOne->getRescheduledTime(), + 'Piwik\Tests\Unit\TaskSchedulerTest.scheduledTaskTwo_1' => $systemTime + 60000, + 'Piwik\Tests\Unit\TaskSchedulerTest.scheduledTaskThree' => $scheduledTaskThree->getRescheduledTime(), ); $caseTwoTimetableBeforeExecution = $caseOneExpectedTable; - $caseTwoTimetableBeforeExecution['TaskSchedulerTest.scheduledTaskThree'] = $systemTime; // simulate elapsed time between case 1 and 2 + $caseTwoTimetableBeforeExecution['Piwik\Tests\Unit\TaskSchedulerTest.scheduledTaskThree'] = $systemTime; // simulate elapsed time between case 1 and 2 return array( @@ -214,13 +221,13 @@ class TaskSchedulerTest extends PHPUnit_Framework_TestCase // methods that should be executed array( - 'TaskSchedulerTest.scheduledTaskOne' + 'Piwik\Tests\Unit\TaskSchedulerTest.scheduledTaskOne' ), // timetable before task execution array( - 'TaskSchedulerTest.scheduledTaskOne' => $systemTime, - 'TaskSchedulerTest.scheduledTaskTwo_1' => $systemTime + 60000, + 'Piwik\Tests\Unit\TaskSchedulerTest.scheduledTaskOne' => $systemTime, + 'Piwik\Tests\Unit\TaskSchedulerTest.scheduledTaskTwo_1' => $systemTime + 60000, ), // configured tasks array( @@ -237,13 +244,13 @@ class TaskSchedulerTest extends PHPUnit_Framework_TestCase array( // expected timetable array( - 'TaskSchedulerTest.scheduledTaskOne' => $scheduledTaskOne->getRescheduledTime(), - 'TaskSchedulerTest.scheduledTaskThree' => $scheduledTaskThree->getRescheduledTime() + 'Piwik\Tests\Unit\TaskSchedulerTest.scheduledTaskOne' => $scheduledTaskOne->getRescheduledTime(), + 'Piwik\Tests\Unit\TaskSchedulerTest.scheduledTaskThree' => $scheduledTaskThree->getRescheduledTime() ), // methods that should be executed array( - 'TaskSchedulerTest.scheduledTaskThree' + 'Piwik\Tests\Unit\TaskSchedulerTest.scheduledTaskThree' ), // timetable before task execution @@ -277,13 +284,13 @@ class TaskSchedulerTest extends PHPUnit_Framework_TestCase public function testRunTasks($expectedTimetable, $expectedExecutedTasks, $timetableBeforeTaskExecution, $configuredTasks) { // temporarily unload plugins - $plugins = \Piwik\Plugin\Manager::getInstance()->getLoadedPlugins(); - $plugins = array_map(function ($p) { return $p->getPluginName(); }, $plugins); + $plugins = Plugin\Manager::getInstance()->getLoadedPlugins(); + $plugins = array_map(function (Plugin $p) { return $p->getPluginName(); }, $plugins); - \Piwik\Plugin\Manager::getInstance()->unloadPlugins(); + Plugin\Manager::getInstance()->unloadPlugins(); // make sure the get tasks event returns our configured tasks - \Piwik\Piwik::addAction(TaskScheduler::GET_TASKS_EVENT, function(&$tasks) use($configuredTasks) { + Piwik::addAction(TaskScheduler::GET_TASKS_EVENT, function(&$tasks) use($configuredTasks) { $tasks = $configuredTasks; }); @@ -308,7 +315,7 @@ class TaskSchedulerTest extends PHPUnit_Framework_TestCase // restore loaded plugins & piwik options EventDispatcher::getInstance()->clearObservers(TaskScheduler::GET_TASKS_EVENT); - \Piwik\Plugin\Manager::getInstance()->loadPlugins($plugins); + Plugin\Manager::getInstance()->loadPlugins($plugins); self::resetPiwikOption(); } diff --git a/tests/PHPUnit/Unit/Translate/Filter/ByBaseTranslationsTest.php b/tests/PHPUnit/Unit/Translate/Filter/ByBaseTranslationsTest.php index 8ca2f09319..5cec2c7ca7 100644 --- a/tests/PHPUnit/Unit/Translate/Filter/ByBaseTranslationsTest.php +++ b/tests/PHPUnit/Unit/Translate/Filter/ByBaseTranslationsTest.php @@ -1,13 +1,16 @@ <?php -use Piwik\Translate\Filter\ByBaseTranslations; - /** * Piwik - free/libre analytics platform * * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ -class ByBaseTranslationsTest extends PHPUnit_Framework_TestCase + +namespace Piwik\Tests\Unit\Translate\Filter; + +use Piwik\Translate\Filter\ByBaseTranslations; + +class ByBaseTranslationsTest extends \PHPUnit_Framework_TestCase { public function getFilterTestData() { diff --git a/tests/PHPUnit/Unit/Translate/Filter/ByParameterCountTest.php b/tests/PHPUnit/Unit/Translate/Filter/ByParameterCountTest.php index 06c72ed24f..220e90f9a6 100644 --- a/tests/PHPUnit/Unit/Translate/Filter/ByParameterCountTest.php +++ b/tests/PHPUnit/Unit/Translate/Filter/ByParameterCountTest.php @@ -1,13 +1,16 @@ <?php -use Piwik\Translate\Filter\ByParameterCount; - /** * Piwik - free/libre analytics platform * * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ -class ByParameterCountTest extends PHPUnit_Framework_TestCase + +namespace Piwik\Tests\Unit\Translate\Filter; + +use Piwik\Translate\Filter\ByParameterCount; + +class ByParameterCountTest extends \PHPUnit_Framework_TestCase { public function getFilterTestData() { diff --git a/tests/PHPUnit/Unit/Translate/Filter/EmptyTranslationsTest.php b/tests/PHPUnit/Unit/Translate/Filter/EmptyTranslationsTest.php index a083e50a43..47ec5348db 100644 --- a/tests/PHPUnit/Unit/Translate/Filter/EmptyTranslationsTest.php +++ b/tests/PHPUnit/Unit/Translate/Filter/EmptyTranslationsTest.php @@ -1,13 +1,16 @@ <?php -use Piwik\Translate\Filter\EmptyTranslations; - /** * Piwik - free/libre analytics platform * * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ -class EmptyTranslationsTest extends PHPUnit_Framework_TestCase + +namespace Piwik\Tests\Unit\Translate\Filter; + +use Piwik\Translate\Filter\EmptyTranslations; + +class EmptyTranslationsTest extends \PHPUnit_Framework_TestCase { public function getFilterTestData() { diff --git a/tests/PHPUnit/Unit/Translate/Filter/EncodedEntitiesTest.php b/tests/PHPUnit/Unit/Translate/Filter/EncodedEntitiesTest.php index cfad46387b..19ceb5f784 100644 --- a/tests/PHPUnit/Unit/Translate/Filter/EncodedEntitiesTest.php +++ b/tests/PHPUnit/Unit/Translate/Filter/EncodedEntitiesTest.php @@ -1,13 +1,16 @@ <?php -use Piwik\Translate\Filter\EncodedEntities; - /** * Piwik - free/libre analytics platform * * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ -class EncodedEntitiesTest extends PHPUnit_Framework_TestCase + +namespace Piwik\Tests\Unit\Translate\Filter; + +use Piwik\Translate\Filter\EncodedEntities; + +class EncodedEntitiesTest extends \PHPUnit_Framework_TestCase { public function getFilterTestData() { diff --git a/tests/PHPUnit/Unit/Translate/Filter/UnnecassaryWhitespacesTest.php b/tests/PHPUnit/Unit/Translate/Filter/UnnecassaryWhitespacesTest.php index 3f86b97a0d..77cecf7e77 100644 --- a/tests/PHPUnit/Unit/Translate/Filter/UnnecassaryWhitespacesTest.php +++ b/tests/PHPUnit/Unit/Translate/Filter/UnnecassaryWhitespacesTest.php @@ -1,13 +1,16 @@ <?php -use Piwik\Translate\Filter\UnnecassaryWhitespaces; - /** * Piwik - free/libre analytics platform * * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ -class UnnecassaryWhitepsacesTest extends PHPUnit_Framework_TestCase + +namespace Piwik\Tests\Unit\Translate\Filter; + +use Piwik\Translate\Filter\UnnecassaryWhitespaces; + +class UnnecassaryWhitepsacesTest extends \PHPUnit_Framework_TestCase { public function getFilterTestData() { diff --git a/tests/PHPUnit/Unit/Translate/Validate/CoreTranslationsTest.php b/tests/PHPUnit/Unit/Translate/Validate/CoreTranslationsTest.php index 3cde1e42c8..258267fd3e 100644 --- a/tests/PHPUnit/Unit/Translate/Validate/CoreTranslationsTest.php +++ b/tests/PHPUnit/Unit/Translate/Validate/CoreTranslationsTest.php @@ -1,13 +1,16 @@ <?php -use Piwik\Translate\Validate\CoreTranslations; - /** * Piwik - free/libre analytics platform * * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ -class CoreTranslationsTest extends PHPUnit_Framework_TestCase + +namespace Piwik\Tests\Unit\Translate\Validate; + +use Piwik\Translate\Validate\CoreTranslations; + +class CoreTranslationsTest extends \PHPUnit_Framework_TestCase { public function setUp() { diff --git a/tests/PHPUnit/Unit/Translate/Validate/NoScriptsTest.php b/tests/PHPUnit/Unit/Translate/Validate/NoScriptsTest.php index e0a8f27b80..519126708d 100644 --- a/tests/PHPUnit/Unit/Translate/Validate/NoScriptsTest.php +++ b/tests/PHPUnit/Unit/Translate/Validate/NoScriptsTest.php @@ -1,13 +1,16 @@ <?php -use Piwik\Translate\Validate\NoScripts; - /** * Piwik - free/libre analytics platform * * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ -class NoScriptsTest extends PHPUnit_Framework_TestCase + +namespace Piwik\Tests\Unit\Translate\Validate; + +use Piwik\Translate\Validate\NoScripts; + +class NoScriptsTest extends \PHPUnit_Framework_TestCase { public function getFilterTestDataValid() { diff --git a/tests/PHPUnit/Unit/Translate/WriterTest.php b/tests/PHPUnit/Unit/Translate/WriterTest.php index 500009941a..66e1efe30a 100644 --- a/tests/PHPUnit/Unit/Translate/WriterTest.php +++ b/tests/PHPUnit/Unit/Translate/WriterTest.php @@ -1,4 +1,12 @@ <?php +/** + * Piwik - free/libre analytics platform + * + * @link http://piwik.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ + +namespace Piwik\Tests\Unit\Translate; use Piwik\Translate\Filter\ByBaseTranslations; use Piwik\Translate\Filter\ByParameterCount; @@ -7,13 +15,7 @@ use Piwik\Translate\Validate\CoreTranslations; use Piwik\Translate\Validate\NoScripts; use Piwik\Translate\Writer; -/** - * Piwik - free/libre analytics platform - * - * @link http://piwik.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ -class WriterTest extends PHPUnit_Framework_TestCase +class WriterTest extends \PHPUnit_Framework_TestCase { public function setUp() { @@ -46,7 +48,7 @@ class WriterTest extends PHPUnit_Framework_TestCase /** * @group Core * - * @expectedException Exception + * @expectedException \Exception */ public function testConstructorInvalid() { @@ -126,7 +128,7 @@ class WriterTest extends PHPUnit_Framework_TestCase /** * @group Core * - * @expectedException Exception + * @expectedException \Exception */ public function testSaveException() { @@ -137,7 +139,7 @@ class WriterTest extends PHPUnit_Framework_TestCase /** * @group Core * - * @expectedException Exception + * @expectedException \Exception */ public function testSaveTemporaryException() { @@ -249,7 +251,7 @@ class WriterTest extends PHPUnit_Framework_TestCase /** * @group Core * - * @expectedException Exception + * @expectedException \Exception * @dataProvider getInvalidLanguages */ public function testSetLanguageInvalid($language) diff --git a/tests/PHPUnit/Unit/TranslateTest.php b/tests/PHPUnit/Unit/TranslateTest.php index b7a99f70ee..a26c9c3713 100644 --- a/tests/PHPUnit/Unit/TranslateTest.php +++ b/tests/PHPUnit/Unit/TranslateTest.php @@ -1,14 +1,16 @@ <?php - -use Piwik\Translate; - /** * Piwik - free/libre analytics platform * * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ -class TranslateTest extends PHPUnit_Framework_TestCase + +namespace Piwik\Tests\Unit; + +use Piwik\Translate; + +class TranslateTest extends \PHPUnit_Framework_TestCase { /** * Dataprovider for testClean diff --git a/tests/PHPUnit/Unit/UrlHelperTest.php b/tests/PHPUnit/Unit/UrlHelperTest.php index 79ba4fbecd..9a006c7a40 100644 --- a/tests/PHPUnit/Unit/UrlHelperTest.php +++ b/tests/PHPUnit/Unit/UrlHelperTest.php @@ -1,13 +1,17 @@ <?php
-use Piwik\UrlHelper;
-
/**
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
-class Core_UrlHelperTest extends PHPUnit_Framework_TestCase
+
+namespace Piwik\Tests\Unit;
+
+use Piwik\UrlHelper;
+use Spyc;
+
+class Core_UrlHelperTest extends \PHPUnit_Framework_TestCase
{
/**
* Dataprovider for testIsUrl
@@ -176,13 +180,13 @@ class Core_UrlHelperTest extends PHPUnit_Framework_TestCase {
$this->assertEquals($expected, UrlHelper::getLossyUrl($input));
}
- +
private function includeDataFilesForSearchEngineTest()
{
include "DataFiles/SearchEngines.php";
include "DataFiles/Countries.php";
}
- +
/**
* @group Core
*/
diff --git a/tests/PHPUnit/Unit/UrlTest.php b/tests/PHPUnit/Unit/UrlTest.php index 3c2bafe73e..9ad2571be6 100644 --- a/tests/PHPUnit/Unit/UrlTest.php +++ b/tests/PHPUnit/Unit/UrlTest.php @@ -1,16 +1,20 @@ <?php -use Piwik\Config; -use Piwik\Url; - /** * Piwik - free/libre analytics platform * - * @backupGlobals enabled - * * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ -class UrlTest extends PHPUnit_Framework_TestCase + +namespace Piwik\Tests\Unit; + +use Piwik\Config; +use Piwik\Url; + +/** + * @backupGlobals enabled + */ +class UrlTest extends \PHPUnit_Framework_TestCase { /** * @group Core diff --git a/tests/lib/screenshot-testing/support/chai-extras.js b/tests/lib/screenshot-testing/support/chai-extras.js index 1a65b718fa..6b12de1998 100644 --- a/tests/lib/screenshot-testing/support/chai-extras.js +++ b/tests/lib/screenshot-testing/support/chai-extras.js @@ -139,7 +139,7 @@ function capture(screenName, compareAgainst, selector, pageSetupFn, done) { // if the files are not exact, perform a diff to check if they are truly different resemble("file://" + processedScreenshotPath).compareTo("file://" + expectedScreenshotPath).onComplete(function(data) { if (data.misMatchPercentage != 0) { - fail("Processed screenshot does not match expected for " + screenshotFileName + "."); + fail("Processed screenshot does not match expected for " + screenshotFileName + ". (mismatch = " + data.misMatchPercentage + ")"); return; } |