From 3fe19974b4a9a24583f41852fcba42c386d900f3 Mon Sep 17 00:00:00 2001 From: diosmosis Date: Mon, 15 Dec 2014 17:07:05 -0800 Subject: Provide clearer URL error message in CronArchive. --- core/CronArchive.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'core/CronArchive.php') diff --git a/core/CronArchive.php b/core/CronArchive.php index 2a6d5be166..9cf56dbf8e 100644 --- a/core/CronArchive.php +++ b/core/CronArchive.php @@ -1006,7 +1006,7 @@ class CronArchive } if (!\Piwik\UrlHelper::isLookLikeUrl($piwikUrl)) { - $this->logFatalErrorUrlExpected(); + $this->logFatalErrorUrlExpected($piwikUrl); } // ensure there is a trailing slash @@ -1215,10 +1215,11 @@ class CronArchive return true; } - private function logFatalErrorUrlExpected() + private function logFatalErrorUrlExpected($piwikUrl = false) { - $this->logFatalError("./console core:archive expects the argument 'url' to be set to your Piwik URL, for example: --url=http://example.org/piwik/ " - . "\n--help for more information"); + $this->logFatalError("./console core:archive expects the argument 'url' to be set to your Piwik URL, for example: --url=http://example.org/piwik/" + . ($piwikUrl ? "\n '$piwikUrl' supplied" : "") + . "\nuse --help for more information"); } private function getVisitsLastPeriodFromApiResponse($stats) -- cgit v1.2.3