mirror of
https://github.com/linuxserver/Heimdall.git
synced 2025-12-17 04:13:46 +09:00
Updates to vendors etc
This commit is contained in:
@@ -36,12 +36,11 @@ class RequestDataCollector extends DataCollector implements EventSubscriberInter
|
||||
*/
|
||||
private \SplObjectStorage $controllers;
|
||||
private array $sessionUsages = [];
|
||||
private ?RequestStack $requestStack;
|
||||
|
||||
public function __construct(?RequestStack $requestStack = null)
|
||||
{
|
||||
public function __construct(
|
||||
private ?RequestStack $requestStack = null,
|
||||
) {
|
||||
$this->controllers = new \SplObjectStorage();
|
||||
$this->requestStack = $requestStack;
|
||||
}
|
||||
|
||||
public function collect(Request $request, Response $response, ?\Throwable $exception = null): void
|
||||
@@ -63,7 +62,7 @@ class RequestDataCollector extends DataCollector implements EventSubscriberInter
|
||||
$sessionMetadata = [];
|
||||
$sessionAttributes = [];
|
||||
$flashes = [];
|
||||
if ($request->hasSession()) {
|
||||
if (!$request->attributes->getBoolean('_stateless') && $request->hasSession()) {
|
||||
$session = $request->getSession();
|
||||
if ($session->isStarted()) {
|
||||
$sessionMetadata['Created'] = date(\DATE_RFC822, $session->getMetadataBag()->getCreated());
|
||||
@@ -195,74 +194,47 @@ class RequestDataCollector extends DataCollector implements EventSubscriberInter
|
||||
return $this->data['path_info'];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return ParameterBag
|
||||
*/
|
||||
public function getRequestRequest()
|
||||
public function getRequestRequest(): ParameterBag
|
||||
{
|
||||
return new ParameterBag($this->data['request_request']->getValue());
|
||||
}
|
||||
|
||||
/**
|
||||
* @return ParameterBag
|
||||
*/
|
||||
public function getRequestQuery()
|
||||
public function getRequestQuery(): ParameterBag
|
||||
{
|
||||
return new ParameterBag($this->data['request_query']->getValue());
|
||||
}
|
||||
|
||||
/**
|
||||
* @return ParameterBag
|
||||
*/
|
||||
public function getRequestFiles()
|
||||
public function getRequestFiles(): ParameterBag
|
||||
{
|
||||
return new ParameterBag($this->data['request_files']->getValue());
|
||||
}
|
||||
|
||||
/**
|
||||
* @return ParameterBag
|
||||
*/
|
||||
public function getRequestHeaders()
|
||||
public function getRequestHeaders(): ParameterBag
|
||||
{
|
||||
return new ParameterBag($this->data['request_headers']->getValue());
|
||||
}
|
||||
|
||||
/**
|
||||
* @return ParameterBag
|
||||
*/
|
||||
public function getRequestServer(bool $raw = false)
|
||||
public function getRequestServer(bool $raw = false): ParameterBag
|
||||
{
|
||||
return new ParameterBag($this->data['request_server']->getValue($raw));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return ParameterBag
|
||||
*/
|
||||
public function getRequestCookies(bool $raw = false)
|
||||
public function getRequestCookies(bool $raw = false): ParameterBag
|
||||
{
|
||||
return new ParameterBag($this->data['request_cookies']->getValue($raw));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return ParameterBag
|
||||
*/
|
||||
public function getRequestAttributes()
|
||||
public function getRequestAttributes(): ParameterBag
|
||||
{
|
||||
return new ParameterBag($this->data['request_attributes']->getValue());
|
||||
}
|
||||
|
||||
/**
|
||||
* @return ParameterBag
|
||||
*/
|
||||
public function getResponseHeaders()
|
||||
public function getResponseHeaders(): ParameterBag
|
||||
{
|
||||
return new ParameterBag($this->data['response_headers']->getValue());
|
||||
}
|
||||
|
||||
/**
|
||||
* @return ParameterBag
|
||||
*/
|
||||
public function getResponseCookies()
|
||||
public function getResponseCookies(): ParameterBag
|
||||
{
|
||||
return new ParameterBag($this->data['response_cookies']->getValue());
|
||||
}
|
||||
@@ -300,18 +272,12 @@ class RequestDataCollector extends DataCollector implements EventSubscriberInter
|
||||
return $this->data['content'];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function isJsonRequest()
|
||||
public function isJsonRequest(): bool
|
||||
{
|
||||
return 1 === preg_match('{^application/(?:\w+\++)*json$}i', $this->data['request_headers']['content-type']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getPrettyJson()
|
||||
public function getPrettyJson(): ?string
|
||||
{
|
||||
$decoded = json_decode($this->getContent());
|
||||
|
||||
@@ -343,10 +309,7 @@ class RequestDataCollector extends DataCollector implements EventSubscriberInter
|
||||
return $this->data['locale'];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return ParameterBag
|
||||
*/
|
||||
public function getDotenvVars()
|
||||
public function getDotenvVars(): ParameterBag
|
||||
{
|
||||
return new ParameterBag($this->data['dotenv_vars']->getValue());
|
||||
}
|
||||
@@ -452,7 +415,7 @@ class RequestDataCollector extends DataCollector implements EventSubscriberInter
|
||||
array_splice($trace, 0, $traceEndIndex);
|
||||
|
||||
// Merge identical backtraces generated by internal call reports
|
||||
$name = sprintf('%s:%s', $trace[1]['class'] ?? $trace[0]['file'], $trace[0]['line']);
|
||||
$name = \sprintf('%s:%s', $trace[1]['class'] ?? $trace[0]['file'], $trace[0]['line']);
|
||||
if (!\array_key_exists($name, $this->sessionUsages)) {
|
||||
$this->sessionUsages[$name] = [
|
||||
'name' => $name,
|
||||
@@ -505,12 +468,12 @@ class RequestDataCollector extends DataCollector implements EventSubscriberInter
|
||||
'line' => $r->getStartLine(),
|
||||
];
|
||||
|
||||
if (str_contains($r->name, '{closure}')) {
|
||||
if ($r->isAnonymous()) {
|
||||
return $controller;
|
||||
}
|
||||
$controller['method'] = $r->name;
|
||||
|
||||
if ($class = \PHP_VERSION_ID >= 80111 ? $r->getClosureCalledClass() : $r->getClosureScopeClass()) {
|
||||
if ($class = $r->getClosureCalledClass()) {
|
||||
$controller['class'] = $class->name;
|
||||
} else {
|
||||
return $r->name;
|
||||
|
||||
Reference in New Issue
Block a user