[icinga-checkins] icinga.org: icingaweb2/feature/announce-banner-11198: Url: Throw ProgrammingError when trying to use Url::from* on the CLI

git at icinga.org git at icinga.org
Fri Oct 28 17:48:31 CEST 2016


Module: icingaweb2
Branch: feature/announce-banner-11198
Commit: d207dcbd03bb70d885127c085f025e4e7bfef2fa
URL:    https://git.icinga.org/?p=icingaweb2.git;a=commit;h=d207dcbd03bb70d885127c085f025e4e7bfef2fa

Author: Johannes Meyer <johannes.meyer at netways.de>
Date:   Fri Oct 28 11:47:45 2016 +0200

Url: Throw ProgrammingError when trying to use Url::from* on the CLI

refs #7051

---

 library/Icinga/Web/Url.php |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/library/Icinga/Web/Url.php b/library/Icinga/Web/Url.php
index d2cbf1d..8ad89af 100644
--- a/library/Icinga/Web/Url.php
+++ b/library/Icinga/Web/Url.php
@@ -4,7 +4,6 @@
 namespace Icinga\Web;
 
 use Icinga\Application\Icinga;
-use Icinga\Cli\FakeRequest;
 use Icinga\Exception\ProgrammingError;
 use Icinga\Data\Filter\Filter;
 
@@ -139,7 +138,9 @@ class Url
     {
         $app = Icinga::app();
         if ($app->isCli()) {
-            return new FakeRequest();
+            throw new ProgrammingError(
+                'Url::fromRequest and Url::fromPath are currently not supported for CLI operations'
+            );
         } else {
             return $app->getRequest();
         }



More information about the icinga-checkins mailing list