icingaweb2-module-businessp.../library/Businessprocess/Web/FakeRequest.php
2016-11-26 21:18:18 +01:00

26 lines
558 B
PHP

<?php
namespace Icinga\Module\Businessprocess\Web;
use Icinga\Exception\ProgrammingError;
use Icinga\Web\Request;
class FakeRequest extends Request
{
/** @var string */
private static $baseUrl;
public static function setConfiguredBaseUrl($url)
{
self::$baseUrl = $url;
}
public function getBaseUrl($raw = false)
{
if (self::$baseUrl === null) {
throw new ProgrammingError('Cannot determine base URL on CLI if not configured');
} else {
return self::$baseUrl;
}
}
}