fseek($file, 0, \SEEK_END);
$result = [];
while (\count($result) < $limit && $line = $this->readLineFromFile($file)) {
$values = str_getcsv($line);
[$csvToken, $csvIp, $csvMethod, $csvUrl, $csvTime, $csvParent, $csvStatusCode] = $values;
$csvTime = (int) $csvTime;
if ($ip && !str_contains($csvIp, $ip) || $url && !str_contains($csvUrl, $url) || $method && !str_contains($csvMethod, $method) || $statusCode && !str_contains($csvStatusCode, $statusCode)) {
continue;
}
*
* @see https://php.net/datetime.formats for the supported date/time formats
*/
public function find(?string $ip, ?string $url, ?string $limit, ?string $method, ?string $start, ?string $end, string $statusCode = null)
{
return $this->storage->find($ip, $url, $limit, $method, $this->getTimestamp($start), $this->getTimestamp($end), $statusCode);
}
/**
* Collects data for the given Response.
*
return $this->renderWithCspNonces($request, '@WebProfiler/Profiler/results.html.twig', [
'request' => $request,
'token' => $token,
'profile' => $profile,
'tokens' => $this->profiler->find($ip, $url, $limit, $method, $start, $end, $statusCode),
'ip' => $ip,
'method' => $method,
'status_code' => $statusCode,
'url' => $url,
'start' => $start,
$this->dispatcher->dispatch($event, KernelEvents::CONTROLLER_ARGUMENTS);
$controller = $event->getController();
$arguments = $event->getArguments();
// call controller
$response = $controller(...$arguments);
// view
if (!$response instanceof Response) {
$event = new ViewEvent($this, $request, $type, $response);
$this->dispatcher->dispatch($event, KernelEvents::VIEW);
public function handle(Request $request, int $type = HttpKernelInterface::MAIN_REQUEST, bool $catch = true)
{
$request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
try {
return $this->handleRaw($request, $type);
} catch (\Exception $e) {
if ($e instanceof RequestExceptionInterface) {
$e = new BadRequestHttpException($e->getMessage(), $e);
}
if (false === $catch) {
$this->boot();
++$this->requestStackSize;
$this->resetServices = true;
try {
return $this->getHttpKernel()->handle($request, $type, $catch);
} finally {
--$this->requestStackSize;
}
}
$this->request = $request;
}
public function run(): int
{
$response = $this->kernel->handle($this->request);
$response->send();
if ($this->kernel instanceof TerminableInterface) {
$this->kernel->terminate($this->request, $response);
}
$app = $app(...$args);
exit(
$runtime
->getRunner($app)
->run()
);
<?php
use App\Kernel;
require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
date_default_timezone_set('Africa/Tunis');
return function (array $context) {
return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
};
ErrorException
|
---|
ErrorException: Warning: Undefined array key 4 at vendor/symfony/http-kernel/Profiler/FileProfilerStorage.php:64 at Symfony\Component\HttpKernel\Profiler\FileProfilerStorage->find('172.19.0.1', null, 10, null, null, null, null) (vendor/symfony/http-kernel/Profiler/Profiler.php:129) at Symfony\Component\HttpKernel\Profiler\Profiler->find('172.19.0.1', null, '10', null, null, null, null) (vendor/symfony/web-profiler-bundle/Controller/ProfilerController.php:245) at Symfony\Bundle\WebProfilerBundle\Controller\ProfilerController->searchResultsAction(object(Request), '5ce6f5') (vendor/symfony/http-kernel/HttpKernel.php:152) at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1) (vendor/symfony/http-kernel/HttpKernel.php:74) at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true) (vendor/symfony/http-kernel/Kernel.php:202) at Symfony\Component\HttpKernel\Kernel->handle(object(Request)) (vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php:35) at Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner->run() (vendor/autoload_runtime.php:35) at require_once('/home/wwwroot/sf4/vendor/autoload_runtime.php') (public/index.php:5) |