Url: Throw ProgrammingError when trying to use Url::from* on the CLI
refs #7051
This commit is contained in:
parent
e737d591e5
commit
d207dcbd03
|
@ -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();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue