mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-22 13:24:24 +02:00
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;
|
||||
|
||||
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();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user