mirror of
https://github.com/linuxserver/Heimdall.git
synced 2025-12-03 05:29:53 +09:00
Dependency updates and update version number
This commit is contained in:
@@ -13,6 +13,8 @@ namespace Symfony\Component\HttpKernel\Debug;
|
||||
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\RequestStack;
|
||||
use Symfony\Component\Routing\Exception\ExceptionInterface;
|
||||
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
|
||||
|
||||
/**
|
||||
* Formats debug file links.
|
||||
@@ -26,6 +28,9 @@ class FileLinkFormatter implements \Serializable
|
||||
private $baseDir;
|
||||
private $urlFormat;
|
||||
|
||||
/**
|
||||
* @param string|\Closure $urlFormat the URL format, or a closure that returns it on-demand
|
||||
*/
|
||||
public function __construct($fileLinkFormat = null, RequestStack $requestStack = null, $baseDir = null, $urlFormat = null)
|
||||
{
|
||||
$fileLinkFormat = $fileLinkFormat ?: ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format');
|
||||
@@ -70,6 +75,18 @@ class FileLinkFormatter implements \Serializable
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
public static function generateUrlFormat(UrlGeneratorInterface $router, $routeName, $queryString)
|
||||
{
|
||||
try {
|
||||
return $router->generate($routeName).$queryString;
|
||||
} catch (ExceptionInterface $e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private function getFileLinkFormat()
|
||||
{
|
||||
if ($this->fileLinkFormat) {
|
||||
@@ -78,6 +95,10 @@ class FileLinkFormatter implements \Serializable
|
||||
if ($this->requestStack && $this->baseDir && $this->urlFormat) {
|
||||
$request = $this->requestStack->getMasterRequest();
|
||||
if ($request instanceof Request) {
|
||||
if ($this->urlFormat instanceof \Closure && !$this->urlFormat = \call_user_func($this->urlFormat)) {
|
||||
return;
|
||||
}
|
||||
|
||||
return array(
|
||||
$request->getSchemeAndHttpHost().$request->getBaseUrl().$this->urlFormat,
|
||||
$this->baseDir.DIRECTORY_SEPARATOR, '',
|
||||
|
||||
Reference in New Issue
Block a user