update patch 1
This commit is contained in:
@@ -40,10 +40,12 @@ class ConfigDataCollector extends DataCollector implements LateDataCollectorInte
|
||||
$eom = \DateTimeImmutable::createFromFormat('d/m/Y', '01/'.Kernel::END_OF_MAINTENANCE);
|
||||
$eol = \DateTimeImmutable::createFromFormat('d/m/Y', '01/'.Kernel::END_OF_LIFE);
|
||||
|
||||
$xdebugMode = getenv('XDEBUG_MODE') ?: \ini_get('xdebug.mode');
|
||||
|
||||
$this->data = [
|
||||
'token' => $response->headers->get('X-Debug-Token'),
|
||||
'symfony_version' => Kernel::VERSION,
|
||||
'symfony_minor_version' => sprintf('%s.%s', Kernel::MAJOR_VERSION, Kernel::MINOR_VERSION),
|
||||
'symfony_minor_version' => \sprintf('%s.%s', Kernel::MAJOR_VERSION, Kernel::MINOR_VERSION),
|
||||
'symfony_lts' => 4 === Kernel::MINOR_VERSION,
|
||||
'symfony_state' => $this->determineSymfonyState(),
|
||||
'symfony_eom' => $eom->format('F Y'),
|
||||
@@ -55,8 +57,11 @@ class ConfigDataCollector extends DataCollector implements LateDataCollectorInte
|
||||
'php_intl_locale' => class_exists(\Locale::class, false) && \Locale::getDefault() ? \Locale::getDefault() : 'n/a',
|
||||
'php_timezone' => date_default_timezone_get(),
|
||||
'xdebug_enabled' => \extension_loaded('xdebug'),
|
||||
'xdebug_status' => \extension_loaded('xdebug') ? ($xdebugMode && $xdebugMode !== 'off' ? 'Enabled (' . $xdebugMode . ')' : 'Not enabled') : 'Not installed',
|
||||
'apcu_enabled' => \extension_loaded('apcu') && filter_var(\ini_get('apc.enabled'), \FILTER_VALIDATE_BOOL),
|
||||
'apcu_status' => \extension_loaded('apcu') ? (filter_var(\ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? 'Enabled' : 'Not enabled') : 'Not installed',
|
||||
'zend_opcache_enabled' => \extension_loaded('Zend OPcache') && filter_var(\ini_get('opcache.enable'), \FILTER_VALIDATE_BOOL),
|
||||
'zend_opcache_status' => \extension_loaded('Zend OPcache') ? (filter_var(\ini_get('opcache.enable'), FILTER_VALIDATE_BOOLEAN) ? 'Enabled' : 'Not enabled') : 'Not installed',
|
||||
'bundles' => [],
|
||||
'sapi_name' => \PHP_SAPI,
|
||||
];
|
||||
@@ -192,6 +197,11 @@ class ConfigDataCollector extends DataCollector implements LateDataCollectorInte
|
||||
return $this->data['xdebug_enabled'];
|
||||
}
|
||||
|
||||
public function getXdebugStatus(): string
|
||||
{
|
||||
return $this->data['xdebug_status'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the function xdebug_info is available.
|
||||
*/
|
||||
@@ -208,6 +218,11 @@ class ConfigDataCollector extends DataCollector implements LateDataCollectorInte
|
||||
return $this->data['apcu_enabled'];
|
||||
}
|
||||
|
||||
public function getApcuStatus(): string
|
||||
{
|
||||
return $this->data['apcu_status'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if Zend OPcache is enabled.
|
||||
*/
|
||||
@@ -216,6 +231,11 @@ class ConfigDataCollector extends DataCollector implements LateDataCollectorInte
|
||||
return $this->data['zend_opcache_enabled'];
|
||||
}
|
||||
|
||||
public function getZendOpcacheStatus(): string
|
||||
{
|
||||
return $this->data['zend_opcache_status'];
|
||||
}
|
||||
|
||||
public function getBundles(): array|Data
|
||||
{
|
||||
return $this->data['bundles'];
|
||||
|
||||
@@ -57,7 +57,7 @@ abstract class DataCollector implements DataCollectorInterface
|
||||
*/
|
||||
protected function getCasters(): array
|
||||
{
|
||||
$casters = [
|
||||
return [
|
||||
'*' => function ($v, array $a, Stub $s, $isNested) {
|
||||
if (!$v instanceof Stub) {
|
||||
$b = $a;
|
||||
@@ -82,8 +82,6 @@ abstract class DataCollector implements DataCollectorInterface
|
||||
return $a;
|
||||
},
|
||||
] + ReflectionCaster::UNSET_CLOSURE_FILE_INFO;
|
||||
|
||||
return $casters;
|
||||
}
|
||||
|
||||
public function __sleep(): array
|
||||
|
||||
@@ -121,12 +121,12 @@ class DumpDataCollector extends DataCollector implements DataDumperInterface
|
||||
) {
|
||||
if ($response->headers->has('Content-Type') && str_contains($response->headers->get('Content-Type') ?? '', 'html')) {
|
||||
$dumper = new HtmlDumper('php://output', $this->charset);
|
||||
$dumper->setDisplayOptions(['fileLinkFormat' => $this->fileLinkFormat]);
|
||||
} else {
|
||||
$dumper = new CliDumper('php://output', $this->charset);
|
||||
$dumper->setDisplayOptions(['fileLinkFormat' => $this->fileLinkFormat]);
|
||||
}
|
||||
|
||||
$dumper->setDisplayOptions(['fileLinkFormat' => $this->fileLinkFormat]);
|
||||
|
||||
foreach ($this->data as $dump) {
|
||||
$this->doDump($dumper, $dump['data'], $dump['name'], $dump['file'], $dump['line'], $dump['label'] ?? '');
|
||||
}
|
||||
@@ -196,7 +196,7 @@ class DumpDataCollector extends DataCollector implements DataDumperInterface
|
||||
$dumper = new HtmlDumper($data, $this->charset);
|
||||
$dumper->setDisplayOptions(['fileLinkFormat' => $this->fileLinkFormat]);
|
||||
} else {
|
||||
throw new \InvalidArgumentException(sprintf('Invalid dump format: "%s".', $format));
|
||||
throw new \InvalidArgumentException(\sprintf('Invalid dump format: "%s".', $format));
|
||||
}
|
||||
$dumps = [];
|
||||
|
||||
@@ -235,12 +235,12 @@ class DumpDataCollector extends DataCollector implements DataDumperInterface
|
||||
|
||||
if ($this->webMode) {
|
||||
$dumper = new HtmlDumper('php://output', $this->charset);
|
||||
$dumper->setDisplayOptions(['fileLinkFormat' => $this->fileLinkFormat]);
|
||||
} else {
|
||||
$dumper = new CliDumper('php://output', $this->charset);
|
||||
$dumper->setDisplayOptions(['fileLinkFormat' => $this->fileLinkFormat]);
|
||||
}
|
||||
|
||||
$dumper->setDisplayOptions(['fileLinkFormat' => $this->fileLinkFormat]);
|
||||
|
||||
foreach ($this->data as $i => $dump) {
|
||||
$this->data[$i] = null;
|
||||
$this->doDump($dumper, $dump['data'], $dump['name'], $dump['file'], $dump['line'], $dump['label'] ?? '');
|
||||
@@ -263,9 +263,9 @@ class DumpDataCollector extends DataCollector implements DataDumperInterface
|
||||
$f = strip_tags($this->style('', $file));
|
||||
$name = strip_tags($this->style('', $name));
|
||||
if ($fmt && $link = \is_string($fmt) ? strtr($fmt, ['%f' => $file, '%l' => $line]) : $fmt->format($file, $line)) {
|
||||
$name = sprintf('<a href="%s" title="%s">'.$s.'</a>', strip_tags($this->style('', $link)), $f, $name);
|
||||
$name = \sprintf('<a href="%s" title="%s">'.$s.'</a>', strip_tags($this->style('', $link)), $f, $name);
|
||||
} else {
|
||||
$name = sprintf('<abbr title="%s">'.$s.'</abbr>', $f, $name);
|
||||
$name = \sprintf('<abbr title="%s">'.$s.'</abbr>', $f, $name);
|
||||
}
|
||||
} else {
|
||||
$name = $this->style('meta', $name);
|
||||
|
||||
@@ -191,7 +191,7 @@ class LoggerDataCollector extends DataCollector implements LateDataCollectorInte
|
||||
$log['priorityName'] = 'DEBUG';
|
||||
$log['channel'] = null;
|
||||
$log['scream'] = false;
|
||||
unset($log['type'], $log['file'], $log['line'], $log['trace'], $log['trace'], $log['count']);
|
||||
unset($log['type'], $log['file'], $log['line'], $log['trace'], $log['count']);
|
||||
$logs[] = $log;
|
||||
}
|
||||
|
||||
|
||||
@@ -415,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,
|
||||
|
||||
Reference in New Issue
Block a user