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

refs #7051
This commit is contained in:
Johannes Meyer 2016-10-28 11:47:45 +02:00
parent e737d591e5
commit d207dcbd03
1 changed files with 3 additions and 2 deletions

View File

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