|
|
|
@ -58,6 +58,18 @@ if (!empty($flashBag->keys())) { |
|
|
|
|
$response = $kernel->handle($request, HttpKernelInterface::MAIN_REQUEST, false); |
|
|
|
|
$context = Container::getRouter()->getContext(); |
|
|
|
|
|
|
|
|
|
$isCli = 'cli' === php_sapi_name(); |
|
|
|
|
$baseUrl = null; |
|
|
|
|
if ($isCli) { |
|
|
|
|
$cliOptions = getopt('', ['url:']); |
|
|
|
|
if (!empty($cliOptions['url'])) { |
|
|
|
|
$baseUrl = $cliOptions['url']; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if ($isCli && $baseUrl) { |
|
|
|
|
$context->setBaseUrl($baseUrl); |
|
|
|
|
} else { |
|
|
|
|
$pos = strpos($currentBaseUrl, 'main'); |
|
|
|
|
$posPlugin = strpos($currentBaseUrl, 'plugin'); |
|
|
|
|
$posCertificate = strpos($currentBaseUrl, 'certificate'); |
|
|
|
@ -76,6 +88,7 @@ if (false !== $pos) { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$context->setBaseUrl($newBaseUrl); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
// Load legacy configuration.php |
|
|
|
|