Shopware\Storefront\Controller\Exception\StorefrontException {#247 -statusCode: 500 -headers: [] #parameters: array:3 [ "message" => "An exception has been thrown during the rendering of a template ("Warning: is_dir(): open_basedir restriction in effect. File(/data/webs/thoeadmin/thoenes-solutions.com/staging/vendor/symfony/validator/Resources/translations) is not within the allowed path(s): (/var/customers/webs/thoeadmin:/var/customers/tmp/thoeadmin:/usr/share/php:/usr/share/php5:/tmp:/dev/urandom)") in "@Storefront/storefront/utilities/form-validation-config.html.twig" at line 2." "view" => "@Storefront/storefront/utilities/form-validation-config.html.twig" "parameters" => "{"headerParameters":[],"footerParameters":[],"themeIconConfig":{"thoenes":{"path":"app\/storefront\/src\/assets\/icon-pack\/thoenes","namespace":"WbnThemeThoenes"}},"stickyHeaderScrollPosition":140}" ] #statusCode: 500 #errorCode: "STOREFRONT__CAN_NOT_RENDER_VIEW" }
ErrorException {#9055 #severity: E_WARNING }
if (0 < $line) { $text .= ' at line '.$line; } if (!file_exists($file)) { return $text; } $link = $this->fileLinkFormat->format($file, $line);<?php if ($trace['file']) { ?> <?php $lineNumber = $trace['line'] ?: 1; $fileLink = $this->fileLinkFormat->format($trace['file'], $lineNumber); $filePath = strtr(strip_tags($this->formatFile($trace['file'], $lineNumber)), [' at line '.$lineNumber => '']); $filePathParts = explode(\DIRECTORY_SEPARATOR, $filePath); ?> <span class="block trace-file-path">in<a href="<?= $fileLink; ?>"> private function include(string $name, array $context = []): string { extract($context, \EXTR_SKIP); ob_start(); include is_file(\dirname(__DIR__).'/Resources/'.$name) ? \dirname(__DIR__).'/Resources/'.$name : $name; return trim(ob_get_clean()); } /** $displayCodeSnippet = $isFirstUserCode && !$isVendorTrace; if ($displayCodeSnippet) { $isFirstUserCode = false; } ?> <div class="trace-line <?= $isVendorTrace ? 'trace-from-vendor' : ''; ?>"><?= $this->include('views/trace.html.php', [ 'prefix' => $index, 'i' => $i, 'trace' => $trace, 'style' => $isVendorTrace ? 'compact' : ($displayCodeSnippet ? 'expanded' : ''), ]); ?> private function include(string $name, array $context = []): string { extract($context, \EXTR_SKIP); ob_start(); include is_file(\dirname(__DIR__).'/Resources/'.$name) ? \dirname(__DIR__).'/Resources/'.$name : $name; return trim(ob_get_clean()); } /** </h3><div class="tab-content"><?php foreach ($exceptionAsArray as $i => $e) { echo $this->include('views/traces.html.php', [ 'exception' => $e, 'index' => $i + 1, 'expand' => in_array($i, $exceptionWithUserCode, true) || ([] === $exceptionWithUserCode && 0 === $i), ]); } private function include(string $name, array $context = []): string { extract($context, \EXTR_SKIP); ob_start(); include is_file(\dirname(__DIR__).'/Resources/'.$name) ? \dirname(__DIR__).'/Resources/'.$name : $name; return trim(ob_get_clean()); } /**</div></div></header><?php } ?><?= $this->include('views/exception.html.php', $context); ?><script><?= $this->include('assets/js/exception.js'); ?> </script></body> private function include(string $name, array $context = []): string { extract($context, \EXTR_SKIP); ob_start(); include is_file(\dirname(__DIR__).'/Resources/'.$name) ? \dirname(__DIR__).'/Resources/'.$name : $name; return trim(ob_get_clean()); } /** ]); } $exceptionMessage = $this->escape($exception->getMessage()); return $this->include($debugTemplate, [ 'exception' => $exception, 'exceptionMessage' => $exceptionMessage, 'statusText' => $statusText, 'statusCode' => $statusCode, 'logger' => null !== $this->logger && class_exists(DebugLoggerConfigurator::class) ? DebugLoggerConfigurator::getDebugLogger($this->logger) : null, $headers['X-Debug-Exception-File'] = rawurlencode($exception->getFile()).':'.$exception->getLine(); } $exception = FlattenException::createWithDataRepresentation($exception, null, $headers); return $exception->setAsString($this->renderException($exception)); } /** * Gets the HTML content associated with the given exception. */ { $flattenException = FlattenException::createFromThrowable($exception); $debug = \is_bool($this->debug) ? $this->debug : ($this->debug)($flattenException); if ($debug || !$template = $this->findTemplate($flattenException->getStatusCode())) { return $this->fallbackErrorRenderer->render($exception); } return $flattenException->setAsString($this->twig->render($template, [ 'exception' => $flattenException, 'status_code' => $flattenException->getStatusCode(), */ protected static function getErrorController2Service($container) { $a = ($container->services['request_stack'] ??= new \Symfony\Component\HttpFoundation\RequestStack()); return $container->services['error_controller'] = new \Symfony\Component\HttpKernel\Controller\ErrorController(($container->services['http_kernel'] ?? self::getHttpKernelService($container)), 'error_controller', new \Symfony\Component\ErrorHandler\ErrorRenderer\SerializerErrorRenderer(($container->privates['serializer'] ?? self::getSerializerService($container)), \Symfony\Component\ErrorHandler\ErrorRenderer\SerializerErrorRenderer::getPreferredFormat($a), new class(fn () => \Symfony\Bundle\FrameworkBundle\ErrorHandler\ErrorRenderer\RuntimeModeErrorRendererSelector::select($container->getEnv('bool:default::key:web:default:kernel.runtime_mode:'), #[\Closure(name: 'twig.error_renderer.html', class: 'Symfony\\Bridge\\Twig\\ErrorRenderer\\TwigErrorRenderer')] fn () => ($container->privates['twig.error_renderer.html'] ?? self::getTwig_ErrorRenderer_HtmlService($container)), #[\Closure(name: 'error_handler.error_renderer.cli', class: 'Symfony\\Component\\ErrorHandler\\ErrorRenderer\\CliErrorRenderer')] fn () => ($container->privates['error_handler.error_renderer.cli'] ??= new \Symfony\Component\ErrorHandler\ErrorRenderer\CliErrorRenderer()))) extends \Symfony\Component\DependencyInjection\Argument\LazyClosure implements \Symfony\Component\ErrorHandler\ErrorRenderer\ErrorRendererInterface { public function render(\Throwable $exception): \Symfony\Component\ErrorHandler\Exception\FlattenException { return $this->service->render(...\func_get_args()); } }, \Symfony\Component\ErrorHandler\ErrorRenderer\HtmlErrorRenderer::isDebug($a, true))); } /** * Gets the public 'event_dispatcher' shared service. * $flattenException->setAsString($this->serializer->serialize($flattenException, $format, [ 'exception' => $exception, 'debug' => $debug, ])); } catch (NotEncodableValueException) { $flattenException = $this->fallbackErrorRenderer->render($exception); } return $flattenException->setHeaders($flattenException->getHeaders() + $headers); } ) { } public function __invoke(\Throwable $exception): Response { $exception = $this->errorRenderer->render($exception); return new Response($exception->getAsString(), $exception->getStatusCode(), $exception->getHeaders()); } public function preview(Request $request, int $code): Response $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, $event); $this->dispatcher->dispatch($event, KernelEvents::VIEW); $request->headers->set('X-Php-Ob-Level', (string) ob_get_level()); $this->requestStack->push($request); $response = null; try { return $response = $this->handleRaw($request, $type); } catch (\Throwable $e) { if ($e instanceof \Error && !$this->handleAllThrowables) { throw $e; } } public function handle(Request $request, int $type = HttpKernelInterface::MAIN_REQUEST, bool $catch = true): Response { if ($request->attributes->get('exception') !== null) { return parent::handle($request, $type, $catch); } if (!$request->attributes->has('sw-skip-transformer')) { try { $request = $this->requestTransformer->transform($request); } $request = $this->duplicateRequest($throwable, $event->getRequest()); try { $response = $event->getKernel()->handle($request, HttpKernelInterface::SUB_REQUEST, false); } catch (\Exception $e) { $f = FlattenException::createFromThrowable($e); $this->logException($e, \sprintf('Exception thrown when handling an exception (%s: %s at %s line %s)', $f->getClass(), $f->getMessage(), basename($e->getFile()), $e->getLine())); $this->priority ??= $dispatcher->getListenerPriority($eventName, $this->listener); $e = $this->stopwatch->start($this->name, 'event_listener'); try { ($this->optimizedListener ?? $this->listener)($event, $eventName, $dispatcher); } finally { if ($e->isStarted()) { $e->stop(); } } foreach ($listeners as $listener) { if ($stoppable && $event->isPropagationStopped()) { break; } $listener($event, $eventName, $this); } } /** * Sorts the internal list of listeners for the given event by priority. } else { $listeners = $this->getListeners($eventName); } if ($listeners) { $this->callListeners($listeners, $eventName, $event); } return $event; } * * @return TEvent */ public function dispatch(object $event, ?string $eventName = null): object { $event = $this->dispatcher->dispatch($event, $eventName); if (!$event instanceof FlowEventAware) { return $event; } ) { } public function dispatch(object $event, ?string $eventName = null): object { $event = $this->dispatcher->dispatch($event, $eventName); if (!HookableEventFactory::isHookable($event)) { return $event; } } $this->dispatch($nested, $name); } } return $this->dispatcher->dispatch($event, $eventName); } /** * @param callable $listener can not use native type declaration @see https://github.com/symfony/symfony/issues/42283 */ try { $this->beforeDispatch($eventName, $event); try { $e = $this->stopwatch->start($eventName, 'section'); try { $this->dispatcher->dispatch($event, $eventName); } finally { if ($e->isStarted()) { $e->stop(); } } * Handles a throwable by trying to convert it to a Response. */ private function handleThrowable(\Throwable $e, Request $request, int $type): Response { $event = new ExceptionEvent($this, $request, $type, $e, isKernelTerminating: $this->terminating); $this->dispatcher->dispatch($event, KernelEvents::EXCEPTION); // a listener might have replaced the exception $e = $event->getThrowable(); if (!$event->hasResponse()) { $this->finishRequest($request, $type); throw $e; } return $response = $this->handleThrowable($e, $request, $type); } finally { $this->requestStack->pop(); if ($response instanceof StreamedResponse && $callback = $response->getCallback()) { $requestStack = $this->requestStack; $this->dispatcher->dispatch($event); return $event->getResponse(); } return parent::handle($request, $type, $catch); }} if (!IpUtils::checkIp('127.0.0.1', $trustedProxies)) { Request::setTrustedProxies(array_merge($trustedProxies, ['127.0.0.1']), Request::getTrustedHeaderSet()); } try { return $kernel->handle($request, $type, $catch); } finally { // restore global state Request::setTrustedProxies($trustedProxies, $trustedHeaderSet); } } protected function forward(Request $request, bool $catch = false, ?Response $entry = null): Response { $this->surrogate?->addSurrogateCapability($request); // always a "master" request (as the real master request can be in cache) $response = SubRequestHandler::handle($this->kernel, $request, HttpKernelInterface::MAIN_REQUEST, $catch); $this->forwardedRequest = $request; /* * Support stale-if-error given on Responses or as a config option. * RFC 7234 summarizes in Section 4.2.4 (but also mentions with the individual // avoid that the backend sends no content $subRequest->headers->remove('If-Modified-Since'); $subRequest->headers->remove('If-None-Match'); $response = $this->forward($subRequest, $catch); if ($response->isCacheable()) { $this->store($request, $response); } } if (null === $entry) { $this->record($request, 'miss'); return $this->fetch($request, $catch); } if (!$this->isFreshEnough($request, $entry)) { $this->record($request, 'stale'); $response = $this->fetch($request, $catch); } else { $response = null; do { try { $response = $this->lookup($request, $catch); } catch (CacheWasLockedException) { } } while (null === $response); } // only handle main request inside http cache, because ESI tags are also interpreted as main request. // sub requests are requests, which are forwarded to the kernel inside the php stack // https://github.com/symfony/symfony/issues/51648#issuecomment-1717846894 if ($type === HttpKernelInterface::MAIN_REQUEST) { $response = parent::handle($request, $type, $catch); } elseif ($request->attributes->has('_sw_esi')) { $response = parent::handle($request, $type, $catch); } else { $response = $this->getKernel()->handle($request, $type, $catch); } public function handle(Request $request, int $type = HttpKernelInterface::MAIN_REQUEST, bool $catch = true): Response { $this->boot(); return $this->getHttpKernel()->handle($request, $type, $catch); } public function boot(): void { if (!$this->booted) { ) { } public function run(): int { $response = $this->kernel->handle($this->request); $response->send(false); if (\function_exists('fastcgi_finish_request') && !$this->debug) { fastcgi_finish_request();$app = $app(...$args);exit( $runtime ->getRunner($app) ->run());use Shopware\Core\Installer\InstallerKernel;use Shopware\Core\Framework\Adapter\Kernel\KernelFactory;$_SERVER['SCRIPT_FILENAME'] = __FILE__;require_once __DIR__ . '/../vendor/autoload_runtime.php';if (!file_exists(__DIR__ . '/../.env') && !file_exists(__DIR__ . '/../.env.dist') && !file_exists(__DIR__ . '/../.env.local.php')) { $_SERVER['APP_RUNTIME_OPTIONS']['disable_dotenv'] = true;}ErrorException {#9521 #severity: E_WARNING }
if (0 < $line) { $text .= ' at line '.$line; } if (!file_exists($file)) { return $text; } $link = $this->fileLinkFormat->format($file, $line);<?php if ($trace['file']) { ?> <?php $lineNumber = $trace['line'] ?: 1; $fileLink = $this->fileLinkFormat->format($trace['file'], $lineNumber); $filePath = strtr(strip_tags($this->formatFile($trace['file'], $lineNumber)), [' at line '.$lineNumber => '']); $filePathParts = explode(\DIRECTORY_SEPARATOR, $filePath); ?> <span class="block trace-file-path">in<a href="<?= $fileLink; ?>"> private function include(string $name, array $context = []): string { extract($context, \EXTR_SKIP); ob_start(); include is_file(\dirname(__DIR__).'/Resources/'.$name) ? \dirname(__DIR__).'/Resources/'.$name : $name; return trim(ob_get_clean()); } /** $displayCodeSnippet = $isFirstUserCode && !$isVendorTrace; if ($displayCodeSnippet) { $isFirstUserCode = false; } ?> <div class="trace-line <?= $isVendorTrace ? 'trace-from-vendor' : ''; ?>"><?= $this->include('views/trace.html.php', [ 'prefix' => $index, 'i' => $i, 'trace' => $trace, 'style' => $isVendorTrace ? 'compact' : ($displayCodeSnippet ? 'expanded' : ''), ]); ?> private function include(string $name, array $context = []): string { extract($context, \EXTR_SKIP); ob_start(); include is_file(\dirname(__DIR__).'/Resources/'.$name) ? \dirname(__DIR__).'/Resources/'.$name : $name; return trim(ob_get_clean()); } /** </h3><div class="tab-content"><?php foreach ($exceptionAsArray as $i => $e) { echo $this->include('views/traces.html.php', [ 'exception' => $e, 'index' => $i + 1, 'expand' => in_array($i, $exceptionWithUserCode, true) || ([] === $exceptionWithUserCode && 0 === $i), ]); } private function include(string $name, array $context = []): string { extract($context, \EXTR_SKIP); ob_start(); include is_file(\dirname(__DIR__).'/Resources/'.$name) ? \dirname(__DIR__).'/Resources/'.$name : $name; return trim(ob_get_clean()); } /**</div></div></header><?php } ?><?= $this->include('views/exception.html.php', $context); ?><script><?= $this->include('assets/js/exception.js'); ?> </script></body> private function include(string $name, array $context = []): string { extract($context, \EXTR_SKIP); ob_start(); include is_file(\dirname(__DIR__).'/Resources/'.$name) ? \dirname(__DIR__).'/Resources/'.$name : $name; return trim(ob_get_clean()); } /** ]); } $exceptionMessage = $this->escape($exception->getMessage()); return $this->include($debugTemplate, [ 'exception' => $exception, 'exceptionMessage' => $exceptionMessage, 'statusText' => $statusText, 'statusCode' => $statusCode, 'logger' => null !== $this->logger && class_exists(DebugLoggerConfigurator::class) ? DebugLoggerConfigurator::getDebugLogger($this->logger) : null, $headers['X-Debug-Exception-File'] = rawurlencode($exception->getFile()).':'.$exception->getLine(); } $exception = FlattenException::createWithDataRepresentation($exception, null, $headers); return $exception->setAsString($this->renderException($exception)); } /** * Gets the HTML content associated with the given exception. */ { $flattenException = FlattenException::createFromThrowable($exception); $debug = \is_bool($this->debug) ? $this->debug : ($this->debug)($flattenException); if ($debug || !$template = $this->findTemplate($flattenException->getStatusCode())) { return $this->fallbackErrorRenderer->render($exception); } return $flattenException->setAsString($this->twig->render($template, [ 'exception' => $flattenException, 'status_code' => $flattenException->getStatusCode(), */ protected static function getErrorController2Service($container) { $a = ($container->services['request_stack'] ??= new \Symfony\Component\HttpFoundation\RequestStack()); return $container->services['error_controller'] = new \Symfony\Component\HttpKernel\Controller\ErrorController(($container->services['http_kernel'] ?? self::getHttpKernelService($container)), 'error_controller', new \Symfony\Component\ErrorHandler\ErrorRenderer\SerializerErrorRenderer(($container->privates['serializer'] ?? self::getSerializerService($container)), \Symfony\Component\ErrorHandler\ErrorRenderer\SerializerErrorRenderer::getPreferredFormat($a), new class(fn () => \Symfony\Bundle\FrameworkBundle\ErrorHandler\ErrorRenderer\RuntimeModeErrorRendererSelector::select($container->getEnv('bool:default::key:web:default:kernel.runtime_mode:'), #[\Closure(name: 'twig.error_renderer.html', class: 'Symfony\\Bridge\\Twig\\ErrorRenderer\\TwigErrorRenderer')] fn () => ($container->privates['twig.error_renderer.html'] ?? self::getTwig_ErrorRenderer_HtmlService($container)), #[\Closure(name: 'error_handler.error_renderer.cli', class: 'Symfony\\Component\\ErrorHandler\\ErrorRenderer\\CliErrorRenderer')] fn () => ($container->privates['error_handler.error_renderer.cli'] ??= new \Symfony\Component\ErrorHandler\ErrorRenderer\CliErrorRenderer()))) extends \Symfony\Component\DependencyInjection\Argument\LazyClosure implements \Symfony\Component\ErrorHandler\ErrorRenderer\ErrorRendererInterface { public function render(\Throwable $exception): \Symfony\Component\ErrorHandler\Exception\FlattenException { return $this->service->render(...\func_get_args()); } }, \Symfony\Component\ErrorHandler\ErrorRenderer\HtmlErrorRenderer::isDebug($a, true))); } /** * Gets the public 'event_dispatcher' shared service. * $flattenException->setAsString($this->serializer->serialize($flattenException, $format, [ 'exception' => $exception, 'debug' => $debug, ])); } catch (NotEncodableValueException) { $flattenException = $this->fallbackErrorRenderer->render($exception); } return $flattenException->setHeaders($flattenException->getHeaders() + $headers); } ) { } public function __invoke(\Throwable $exception): Response { $exception = $this->errorRenderer->render($exception); return new Response($exception->getAsString(), $exception->getStatusCode(), $exception->getHeaders()); } public function preview(Request $request, int $code): Response $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, $event); $this->dispatcher->dispatch($event, KernelEvents::VIEW); $request->headers->set('X-Php-Ob-Level', (string) ob_get_level()); $this->requestStack->push($request); $response = null; try { return $response = $this->handleRaw($request, $type); } catch (\Throwable $e) { if ($e instanceof \Error && !$this->handleAllThrowables) { throw $e; } } public function handle(Request $request, int $type = HttpKernelInterface::MAIN_REQUEST, bool $catch = true): Response { if ($request->attributes->get('exception') !== null) { return parent::handle($request, $type, $catch); } if (!$request->attributes->has('sw-skip-transformer')) { try { $request = $this->requestTransformer->transform($request); } $request = $this->duplicateRequest($throwable, $event->getRequest()); try { $response = $event->getKernel()->handle($request, HttpKernelInterface::SUB_REQUEST, false); } catch (\Exception $e) { $f = FlattenException::createFromThrowable($e); $this->logException($e, \sprintf('Exception thrown when handling an exception (%s: %s at %s line %s)', $f->getClass(), $f->getMessage(), basename($e->getFile()), $e->getLine())); $this->priority ??= $dispatcher->getListenerPriority($eventName, $this->listener); $e = $this->stopwatch->start($this->name, 'event_listener'); try { ($this->optimizedListener ?? $this->listener)($event, $eventName, $dispatcher); } finally { if ($e->isStarted()) { $e->stop(); } } foreach ($listeners as $listener) { if ($stoppable && $event->isPropagationStopped()) { break; } $listener($event, $eventName, $this); } } /** * Sorts the internal list of listeners for the given event by priority. } else { $listeners = $this->getListeners($eventName); } if ($listeners) { $this->callListeners($listeners, $eventName, $event); } return $event; } * * @return TEvent */ public function dispatch(object $event, ?string $eventName = null): object { $event = $this->dispatcher->dispatch($event, $eventName); if (!$event instanceof FlowEventAware) { return $event; } ) { } public function dispatch(object $event, ?string $eventName = null): object { $event = $this->dispatcher->dispatch($event, $eventName); if (!HookableEventFactory::isHookable($event)) { return $event; } } $this->dispatch($nested, $name); } } return $this->dispatcher->dispatch($event, $eventName); } /** * @param callable $listener can not use native type declaration @see https://github.com/symfony/symfony/issues/42283 */ try { $this->beforeDispatch($eventName, $event); try { $e = $this->stopwatch->start($eventName, 'section'); try { $this->dispatcher->dispatch($event, $eventName); } finally { if ($e->isStarted()) { $e->stop(); } } * Handles a throwable by trying to convert it to a Response. */ private function handleThrowable(\Throwable $e, Request $request, int $type): Response { $event = new ExceptionEvent($this, $request, $type, $e, isKernelTerminating: $this->terminating); $this->dispatcher->dispatch($event, KernelEvents::EXCEPTION); // a listener might have replaced the exception $e = $event->getThrowable(); if (!$event->hasResponse()) { if ($pop = $request !== $this->requestStack->getMainRequest()) { $this->requestStack->push($request); } try { $response = $this->handleThrowable($exception, $request, self::MAIN_REQUEST); } finally { if ($pop) { $this->requestStack->pop(); } } if ($hasRun) { throw $e; } $hasRun = true; $kernel->terminateWithException($e, $request); }; } } elseif ($event instanceof ConsoleEvent && $app = $event->getCommand()->getApplication()) { $output = $event->getOutput(); if ($output instanceof ConsoleOutputInterface) { $this->exceptionHandler = null; } try { if (null !== $exceptionHandler) { $exceptionHandler($exception); return; } $handlerException ??= $exception; } catch (\Throwable $handlerException) { if (0 < $line) { $text .= ' at line '.$line; } if (!file_exists($file)) { return $text; } $link = $this->fileLinkFormat->format($file, $line);<?php if ($trace['file']) { ?> <?php $lineNumber = $trace['line'] ?: 1; $fileLink = $this->fileLinkFormat->format($trace['file'], $lineNumber); $filePath = strtr(strip_tags($this->formatFile($trace['file'], $lineNumber)), [' at line '.$lineNumber => '']); $filePathParts = explode(\DIRECTORY_SEPARATOR, $filePath); ?> <span class="block trace-file-path">in<a href="<?= $fileLink; ?>"> private function include(string $name, array $context = []): string { extract($context, \EXTR_SKIP); ob_start(); include is_file(\dirname(__DIR__).'/Resources/'.$name) ? \dirname(__DIR__).'/Resources/'.$name : $name; return trim(ob_get_clean()); } /** $displayCodeSnippet = $isFirstUserCode && !$isVendorTrace; if ($displayCodeSnippet) { $isFirstUserCode = false; } ?> <div class="trace-line <?= $isVendorTrace ? 'trace-from-vendor' : ''; ?>"><?= $this->include('views/trace.html.php', [ 'prefix' => $index, 'i' => $i, 'trace' => $trace, 'style' => $isVendorTrace ? 'compact' : ($displayCodeSnippet ? 'expanded' : ''), ]); ?> private function include(string $name, array $context = []): string { extract($context, \EXTR_SKIP); ob_start(); include is_file(\dirname(__DIR__).'/Resources/'.$name) ? \dirname(__DIR__).'/Resources/'.$name : $name; return trim(ob_get_clean()); } /** </h3><div class="tab-content"><?php foreach ($exceptionAsArray as $i => $e) { echo $this->include('views/traces.html.php', [ 'exception' => $e, 'index' => $i + 1, 'expand' => in_array($i, $exceptionWithUserCode, true) || ([] === $exceptionWithUserCode && 0 === $i), ]); } private function include(string $name, array $context = []): string { extract($context, \EXTR_SKIP); ob_start(); include is_file(\dirname(__DIR__).'/Resources/'.$name) ? \dirname(__DIR__).'/Resources/'.$name : $name; return trim(ob_get_clean()); } /**</div></div></header><?php } ?><?= $this->include('views/exception.html.php', $context); ?><script><?= $this->include('assets/js/exception.js'); ?> </script></body> private function include(string $name, array $context = []): string { extract($context, \EXTR_SKIP); ob_start(); include is_file(\dirname(__DIR__).'/Resources/'.$name) ? \dirname(__DIR__).'/Resources/'.$name : $name; return trim(ob_get_clean()); } /** ]); } $exceptionMessage = $this->escape($exception->getMessage()); return $this->include($debugTemplate, [ 'exception' => $exception, 'exceptionMessage' => $exceptionMessage, 'statusText' => $statusText, 'statusCode' => $statusCode, 'logger' => null !== $this->logger && class_exists(DebugLoggerConfigurator::class) ? DebugLoggerConfigurator::getDebugLogger($this->logger) : null, $headers['X-Debug-Exception-File'] = rawurlencode($exception->getFile()).':'.$exception->getLine(); } $exception = FlattenException::createWithDataRepresentation($exception, null, $headers); return $exception->setAsString($this->renderException($exception)); } /** * Gets the HTML content associated with the given exception. */ { $flattenException = FlattenException::createFromThrowable($exception); $debug = \is_bool($this->debug) ? $this->debug : ($this->debug)($flattenException); if ($debug || !$template = $this->findTemplate($flattenException->getStatusCode())) { return $this->fallbackErrorRenderer->render($exception); } return $flattenException->setAsString($this->twig->render($template, [ 'exception' => $flattenException, 'status_code' => $flattenException->getStatusCode(), */ protected static function getErrorController2Service($container) { $a = ($container->services['request_stack'] ??= new \Symfony\Component\HttpFoundation\RequestStack()); return $container->services['error_controller'] = new \Symfony\Component\HttpKernel\Controller\ErrorController(($container->services['http_kernel'] ?? self::getHttpKernelService($container)), 'error_controller', new \Symfony\Component\ErrorHandler\ErrorRenderer\SerializerErrorRenderer(($container->privates['serializer'] ?? self::getSerializerService($container)), \Symfony\Component\ErrorHandler\ErrorRenderer\SerializerErrorRenderer::getPreferredFormat($a), new class(fn () => \Symfony\Bundle\FrameworkBundle\ErrorHandler\ErrorRenderer\RuntimeModeErrorRendererSelector::select($container->getEnv('bool:default::key:web:default:kernel.runtime_mode:'), #[\Closure(name: 'twig.error_renderer.html', class: 'Symfony\\Bridge\\Twig\\ErrorRenderer\\TwigErrorRenderer')] fn () => ($container->privates['twig.error_renderer.html'] ?? self::getTwig_ErrorRenderer_HtmlService($container)), #[\Closure(name: 'error_handler.error_renderer.cli', class: 'Symfony\\Component\\ErrorHandler\\ErrorRenderer\\CliErrorRenderer')] fn () => ($container->privates['error_handler.error_renderer.cli'] ??= new \Symfony\Component\ErrorHandler\ErrorRenderer\CliErrorRenderer()))) extends \Symfony\Component\DependencyInjection\Argument\LazyClosure implements \Symfony\Component\ErrorHandler\ErrorRenderer\ErrorRendererInterface { public function render(\Throwable $exception): \Symfony\Component\ErrorHandler\Exception\FlattenException { return $this->service->render(...\func_get_args()); } }, \Symfony\Component\ErrorHandler\ErrorRenderer\HtmlErrorRenderer::isDebug($a, true))); } /** * Gets the public 'event_dispatcher' shared service. * $flattenException->setAsString($this->serializer->serialize($flattenException, $format, [ 'exception' => $exception, 'debug' => $debug, ])); } catch (NotEncodableValueException) { $flattenException = $this->fallbackErrorRenderer->render($exception); } return $flattenException->setHeaders($flattenException->getHeaders() + $headers); } ) { } public function __invoke(\Throwable $exception): Response { $exception = $this->errorRenderer->render($exception); return new Response($exception->getAsString(), $exception->getStatusCode(), $exception->getHeaders()); } public function preview(Request $request, int $code): Response $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, $event); $this->dispatcher->dispatch($event, KernelEvents::VIEW); $request->headers->set('X-Php-Ob-Level', (string) ob_get_level()); $this->requestStack->push($request); $response = null; try { return $response = $this->handleRaw($request, $type); } catch (\Throwable $e) { if ($e instanceof \Error && !$this->handleAllThrowables) { throw $e; } } public function handle(Request $request, int $type = HttpKernelInterface::MAIN_REQUEST, bool $catch = true): Response { if ($request->attributes->get('exception') !== null) { return parent::handle($request, $type, $catch); } if (!$request->attributes->has('sw-skip-transformer')) { try { $request = $this->requestTransformer->transform($request); } $request = $this->duplicateRequest($throwable, $event->getRequest()); try { $response = $event->getKernel()->handle($request, HttpKernelInterface::SUB_REQUEST, false); } catch (\Exception $e) { $f = FlattenException::createFromThrowable($e); $this->logException($e, \sprintf('Exception thrown when handling an exception (%s: %s at %s line %s)', $f->getClass(), $f->getMessage(), basename($e->getFile()), $e->getLine())); $this->priority ??= $dispatcher->getListenerPriority($eventName, $this->listener); $e = $this->stopwatch->start($this->name, 'event_listener'); try { ($this->optimizedListener ?? $this->listener)($event, $eventName, $dispatcher); } finally { if ($e->isStarted()) { $e->stop(); } } foreach ($listeners as $listener) { if ($stoppable && $event->isPropagationStopped()) { break; } $listener($event, $eventName, $this); } } /** * Sorts the internal list of listeners for the given event by priority. } else { $listeners = $this->getListeners($eventName); } if ($listeners) { $this->callListeners($listeners, $eventName, $event); } return $event; } * * @return TEvent */ public function dispatch(object $event, ?string $eventName = null): object { $event = $this->dispatcher->dispatch($event, $eventName); if (!$event instanceof FlowEventAware) { return $event; } ) { } public function dispatch(object $event, ?string $eventName = null): object { $event = $this->dispatcher->dispatch($event, $eventName); if (!HookableEventFactory::isHookable($event)) { return $event; } } $this->dispatch($nested, $name); } } return $this->dispatcher->dispatch($event, $eventName); } /** * @param callable $listener can not use native type declaration @see https://github.com/symfony/symfony/issues/42283 */ try { $this->beforeDispatch($eventName, $event); try { $e = $this->stopwatch->start($eventName, 'section'); try { $this->dispatcher->dispatch($event, $eventName); } finally { if ($e->isStarted()) { $e->stop(); } } * Handles a throwable by trying to convert it to a Response. */ private function handleThrowable(\Throwable $e, Request $request, int $type): Response { $event = new ExceptionEvent($this, $request, $type, $e, isKernelTerminating: $this->terminating); $this->dispatcher->dispatch($event, KernelEvents::EXCEPTION); // a listener might have replaced the exception $e = $event->getThrowable(); if (!$event->hasResponse()) { $this->finishRequest($request, $type); throw $e; } return $response = $this->handleThrowable($e, $request, $type); } finally { $this->requestStack->pop(); if ($response instanceof StreamedResponse && $callback = $response->getCallback()) { $requestStack = $this->requestStack; $this->dispatcher->dispatch($event); return $event->getResponse(); } return parent::handle($request, $type, $catch); }} if (!IpUtils::checkIp('127.0.0.1', $trustedProxies)) { Request::setTrustedProxies(array_merge($trustedProxies, ['127.0.0.1']), Request::getTrustedHeaderSet()); } try { return $kernel->handle($request, $type, $catch); } finally { // restore global state Request::setTrustedProxies($trustedProxies, $trustedHeaderSet); } } protected function forward(Request $request, bool $catch = false, ?Response $entry = null): Response { $this->surrogate?->addSurrogateCapability($request); // always a "master" request (as the real master request can be in cache) $response = SubRequestHandler::handle($this->kernel, $request, HttpKernelInterface::MAIN_REQUEST, $catch); $this->forwardedRequest = $request; /* * Support stale-if-error given on Responses or as a config option. * RFC 7234 summarizes in Section 4.2.4 (but also mentions with the individual // avoid that the backend sends no content $subRequest->headers->remove('If-Modified-Since'); $subRequest->headers->remove('If-None-Match'); $response = $this->forward($subRequest, $catch); if ($response->isCacheable()) { $this->store($request, $response); } } if (null === $entry) { $this->record($request, 'miss'); return $this->fetch($request, $catch); } if (!$this->isFreshEnough($request, $entry)) { $this->record($request, 'stale'); $response = $this->fetch($request, $catch); } else { $response = null; do { try { $response = $this->lookup($request, $catch); } catch (CacheWasLockedException) { } } while (null === $response); } // only handle main request inside http cache, because ESI tags are also interpreted as main request. // sub requests are requests, which are forwarded to the kernel inside the php stack // https://github.com/symfony/symfony/issues/51648#issuecomment-1717846894 if ($type === HttpKernelInterface::MAIN_REQUEST) { $response = parent::handle($request, $type, $catch); } elseif ($request->attributes->has('_sw_esi')) { $response = parent::handle($request, $type, $catch); } else { $response = $this->getKernel()->handle($request, $type, $catch); } public function handle(Request $request, int $type = HttpKernelInterface::MAIN_REQUEST, bool $catch = true): Response { $this->boot(); return $this->getHttpKernel()->handle($request, $type, $catch); } public function boot(): void { if (!$this->booted) { ) { } public function run(): int { $response = $this->kernel->handle($this->request); $response->send(false); if (\function_exists('fastcgi_finish_request') && !$this->debug) { fastcgi_finish_request();$app = $app(...$args);exit( $runtime ->getRunner($app) ->run());use Shopware\Core\Installer\InstallerKernel;use Shopware\Core\Framework\Adapter\Kernel\KernelFactory;$_SERVER['SCRIPT_FILENAME'] = __FILE__;require_once __DIR__ . '/../vendor/autoload_runtime.php';if (!file_exists(__DIR__ . '/../.env') && !file_exists(__DIR__ . '/../.env.dist') && !file_exists(__DIR__ . '/../.env.local.php')) { $_SERVER['APP_RUNTIME_OPTIONS']['disable_dotenv'] = true;}