diff options
-rw-r--r-- | CHANGELOG.md | 1 | ||||
-rw-r--r-- | core/CliMulti.php | 4 | ||||
-rw-r--r-- | core/CliMulti/RequestCommand.php | 3 | ||||
-rw-r--r-- | core/Console.php | 31 | ||||
-rw-r--r-- | core/CronArchive.php | 3 | ||||
-rw-r--r-- | misc/cron/updatetoken.php | 2 | ||||
-rw-r--r-- | plugins/CoreUpdater/Controller.php | 2 | ||||
-rw-r--r-- | plugins/CoreUpdater/tests/UI/expected-screenshots/CoreUpdaterDb_main_instance.png | 4 | ||||
-rw-r--r-- | plugins/TestRunner/Commands/TestsRun.php | 5 | ||||
-rw-r--r-- | plugins/TestRunner/Commands/TestsRunUI.php | 7 | ||||
-rw-r--r-- | plugins/TestRunner/Commands/TestsSetupFixture.php | 2 | ||||
-rw-r--r-- | tests/PHPUnit/Unit/ConsoleTest.php | 2 |
12 files changed, 43 insertions, 23 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 8ba835492d..79fec53175 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ The Product Changelog at **[matomo.org/changelog](https://matomo.org/changelog)* * Changed some menu items to use translation keys instead (see [PR #12885](https://github.com/matomo-org/matomo/pull/12885)). * The methods `assertResponseCode()` and `assertHttpResponseText()` in `Piwik\Tests\Framework\TestCase\SystemTestCase` have been deprecated and will be removed in Matomo 4.0. Please use `Piwik\Http` instead. * The classes `PHPUnit\Framework\Constraint\HttpResponseText` and `PHPUnit\Framework\Constraint\ResponseCode` have been deprecated and will be removed in Matomo 4.0. Please use `Piwik\Http` instead. +* The console option `--piwik-domain` has been deprecated and will be removed in Matomo 4.0. Use `--matomo-domain` instead * Social networks are now detected as new referrer type (ID=7), which allows improved reports and better segmentation ## Matomo 3.5.1 diff --git a/core/CliMulti.php b/core/CliMulti.php index 7901a6c8ca..7e8b731f24 100644 --- a/core/CliMulti.php +++ b/core/CliMulti.php @@ -167,7 +167,7 @@ class CliMulti $query = escapeshellarg($query); } - return sprintf('%s %s %s/console climulti:request -q --piwik-domain=%s %s %s > %s 2>&1 &', + return sprintf('%s %s %s/console climulti:request -q --matomo-domain=%s %s %s > %s 2>&1 &', $bin, $this->phpCliOptions, PIWIK_INCLUDE_PATH, $hostname, $superuserCommand, $query, $outputFile); } @@ -300,7 +300,7 @@ class CliMulti $posStart = strpos($commandToCheck, 'console climulti'); $posPid = strpos($commandToCheck, '&pid='); // the pid is random each time so we need to ignore it. $shortendCommand = substr($commandToCheck, $posStart, $posPid - $posStart); - // equals eg console climulti:request -q --piwik-domain= --superuser module=API&method=API.get&idSite=1&period=month&date=2018-04-08,2018-04-30&format=php&trigger=archivephp + // equals eg console climulti:request -q --matomo-domain= --superuser module=API&method=API.get&idSite=1&period=month&date=2018-04-08,2018-04-30&format=php&trigger=archivephp $shortendCommand = preg_replace("/([&])date=.*?(&|$)/", "", $shortendCommand); $currentlyRunningJobs = preg_replace("/([&])date=.*?(&|$)/", "", $currentlyRunningJobs); diff --git a/core/CliMulti/RequestCommand.php b/core/CliMulti/RequestCommand.php index aae19727fb..386edef31d 100644 --- a/core/CliMulti/RequestCommand.php +++ b/core/CliMulti/RequestCommand.php @@ -95,7 +95,8 @@ class RequestCommand extends ConsoleCommand { $_GET = array(); - $hostname = $input->getOption('piwik-domain'); + // @todo remove piwik-domain fallback in Matomo 4 + $hostname = $input->getOption('matomo-domain') ?: $input->getOption('piwik-domain'); Url::setHost($hostname); $query = $input->getArgument('url-query'); diff --git a/core/Console.php b/core/Console.php index 49fefa6099..a5d5773009 100644 --- a/core/Console.php +++ b/core/Console.php @@ -31,11 +31,11 @@ class Console extends Application { $this->setServerArgsIfPhpCgi(); - parent::__construct('Piwik', Version::VERSION); + parent::__construct('Matomo', Version::VERSION); $this->environment = $environment; - $option = new InputOption('piwik-domain', + $option = new InputOption('matomo-domain', null, InputOption::VALUE_OPTIONAL, 'Matomo URL (protocol and domain) eg. "http://matomo.example.org"' @@ -43,6 +43,15 @@ class Console extends Application $this->getDefinition()->addOption($option); + // @todo Remove this alias in Matomo 4.0 + $option = new InputOption('piwik-domain', + null, + InputOption::VALUE_OPTIONAL, + '[DEPRECATED] Matomo URL (protocol and domain) eg. "http://matomo.example.org"' + ); + + $this->getDefinition()->addOption($option); + $option = new InputOption('xhprof', null, InputOption::VALUE_NONE, @@ -58,7 +67,7 @@ class Console extends Application Profiler::setupProfilerXHProf(true, true); } - $this->initPiwikHost($input); + $this->initMatomoHost($input); $this->initEnvironment($output); $this->initLoggerOutput($output); @@ -157,16 +166,20 @@ class Console extends Application return Common::isPhpCliMode() && !Common::isPhpCgiType(); } - protected function initPiwikHost(InputInterface $input) + protected function initMatomoHost(InputInterface $input) { - $piwikHostname = $input->getParameterOption('--piwik-domain'); + $matomoHostname = $input->getParameterOption('--matomo-domain'); + + if (empty($matomoHostname)) { + $matomoHostname = $input->getParameterOption('--piwik-domain'); + } - if (empty($piwikHostname)) { - $piwikHostname = $input->getParameterOption('--url'); + if (empty($matomoHostname)) { + $matomoHostname = $input->getParameterOption('--url'); } - $piwikHostname = UrlHelper::getHostFromUrl($piwikHostname); - Url::setHost($piwikHostname); + $matomoHostname = UrlHelper::getHostFromUrl($matomoHostname); + Url::setHost($matomoHostname); } protected function initEnvironment(OutputInterface $output) diff --git a/core/CronArchive.php b/core/CronArchive.php index 03d245e2d0..2a0661ffc7 100644 --- a/core/CronArchive.php +++ b/core/CronArchive.php @@ -385,6 +385,9 @@ class CronArchive foreach ($processes as $process) { if (strpos($process, 'console core:archive') !== false && (!$instanceId + || strpos($process, '--matomo-domain=' . $instanceId) !== false + || strpos($process, '--matomo-domain="' . $instanceId . '"') !== false + || strpos($process, '--matomo-domain=\'' . $instanceId . "'") !== false || strpos($process, '--piwik-domain=' . $instanceId) !== false || strpos($process, '--piwik-domain="' . $instanceId . '"') !== false || strpos($process, '--piwik-domain=\'' . $instanceId . "'") !== false)) { diff --git a/misc/cron/updatetoken.php b/misc/cron/updatetoken.php index 71f2ba03c3..9a91443a10 100644 --- a/misc/cron/updatetoken.php +++ b/misc/cron/updatetoken.php @@ -43,7 +43,7 @@ if ($testmode) { function getPiwikDomain() { foreach($_SERVER['argv'] as $param) { - $pattern = '--piwik-domain='; + $pattern = '--matomo-domain='; if(false !== strpos($param, $pattern)) { return substr($param, strlen($pattern)); } diff --git a/plugins/CoreUpdater/Controller.php b/plugins/CoreUpdater/Controller.php index 0bfd15cd9b..db9739e319 100644 --- a/plugins/CoreUpdater/Controller.php +++ b/plugins/CoreUpdater/Controller.php @@ -282,7 +282,7 @@ class Controller extends \Piwik\Plugin\Controller $instanceId = SettingsPiwik::getPiwikInstanceId(); if ($instanceId) { - $view->commandUpgradePiwik .= ' --piwik-domain="' . $instanceId . '"'; + $view->commandUpgradePiwik .= ' --matomo-domain="' . $instanceId . '"'; } $pluginNamesToUpdate = array(); diff --git a/plugins/CoreUpdater/tests/UI/expected-screenshots/CoreUpdaterDb_main_instance.png b/plugins/CoreUpdater/tests/UI/expected-screenshots/CoreUpdaterDb_main_instance.png index cce429a7af..9f757b0620 100644 --- a/plugins/CoreUpdater/tests/UI/expected-screenshots/CoreUpdaterDb_main_instance.png +++ b/plugins/CoreUpdater/tests/UI/expected-screenshots/CoreUpdaterDb_main_instance.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4efe2adfb1ef239484205308d1fe18d49ff197a9c7d0ea5cb70806d08107abf2 -size 293857 +oid sha256:efd0871c06b75dd8f1725d01fe30db6780e4c7a84d927cc49353052ec9da2953 +size 293349 diff --git a/plugins/TestRunner/Commands/TestsRun.php b/plugins/TestRunner/Commands/TestsRun.php index b024930eb6..76dd65583a 100644 --- a/plugins/TestRunner/Commands/TestsRun.php +++ b/plugins/TestRunner/Commands/TestsRun.php @@ -41,7 +41,8 @@ class TestsRun extends ConsoleCommand $options = $input->getOption('options'); $groups = $input->getOption('group'); $magics = $input->getArgument('variables'); - $piwikDomain = $input->getOption('piwik-domain'); + // @todo remove piwik-domain fallback in Matomo 4 + $matomoDomain = $input->getOption('matomo-domain') ?: $input->getOption('piwik-domain'); $groups = $this->getGroupsFromString($groups); @@ -114,7 +115,7 @@ class TestsRun extends ConsoleCommand } } - $this->executeTests($piwikDomain, $suite, $testFile, $groups, $options, $command, $output); + $this->executeTests($matomoDomain, $suite, $testFile, $groups, $options, $command, $output); return $this->returnVar; } diff --git a/plugins/TestRunner/Commands/TestsRunUI.php b/plugins/TestRunner/Commands/TestsRunUI.php index 69b512b8aa..3c6fc15aa5 100644 --- a/plugins/TestRunner/Commands/TestsRunUI.php +++ b/plugins/TestRunner/Commands/TestsRunUI.php @@ -56,7 +56,8 @@ class TestsRunUI extends ConsoleCommand $storeInUiTestsRepo = $input->getOption('store-in-ui-tests-repo'); $screenshotRepo = $input->getOption('screenshot-repo'); $debug = $input->getOption('debug'); - $piwikDomain = $input->getOption('piwik-domain'); + // @todo remove piwik-domain fallback in Matomo 4 + $matomoDomain = $input->getOption('matomo-domain') ?: $input->getOption('piwik-domain'); if (!$skipDeleteAssets) { AssetManager::getInstance()->removeMergedAssets(); @@ -67,8 +68,8 @@ class TestsRunUI extends ConsoleCommand $options = array(); $phantomJsOptions = array(); - if ($piwikDomain) { - $options[] = "--piwik-domain=$piwikDomain"; + if ($matomoDomain) { + $options[] = "--matomo-domain=$matomoDomain"; } if ($persistFixtureData) { diff --git a/plugins/TestRunner/Commands/TestsSetupFixture.php b/plugins/TestRunner/Commands/TestsSetupFixture.php index 1d8c4cd186..ae2554d52b 100644 --- a/plugins/TestRunner/Commands/TestsSetupFixture.php +++ b/plugins/TestRunner/Commands/TestsSetupFixture.php @@ -78,7 +78,7 @@ class TestsSetupFixture extends ConsoleCommand $this->addOption('sqldump', null, InputOption::VALUE_REQUIRED, "Creates an SQL dump after setting up the fixture and outputs the dump to the file specified by this option."); $this->addOption('save-config', null, InputOption::VALUE_NONE, - "Saves the current configuration file as a config for a new Piwik domain. For example save-config --piwik-domain=mytest.localhost.com will create " + "Saves the current configuration file as a config for a new Piwik domain. For example save-config --matomo-domain=mytest.localhost.com will create " . "a mytest.config.ini.php file in the config/ directory. Using /etc/hosts you can redirect to 127.0.0.1 and use the saved " . "config."); $this->addOption('set-phantomjs-symlinks', null, InputOption::VALUE_NONE, diff --git a/tests/PHPUnit/Unit/ConsoleTest.php b/tests/PHPUnit/Unit/ConsoleTest.php index f13f825f32..9d46ffc828 100644 --- a/tests/PHPUnit/Unit/ConsoleTest.php +++ b/tests/PHPUnit/Unit/ConsoleTest.php @@ -19,7 +19,7 @@ class ConsoleTest extends \PHPUnit_Framework_TestCase { $console = new Console(); - $this->assertEquals('Piwik', $console->getName()); + $this->assertEquals('Matomo', $console->getName()); $this->assertEquals(Version::VERSION, $console->getVersion()); } } |