if ($referer = $request->headers->get('referer')) {
$message .= sprintf(' (from "%s")', $referer);
}
throw new NotFoundHttpException($message, $e);
} catch (MethodNotAllowedException $e) {
$message = sprintf('No route found for "%s %s": Method Not Allowed (Allow: %s)', $request->getMethod(), $request->getUriForPath($request->getPathInfo()), implode(', ', $e->getAllowedMethods()));
throw new MethodNotAllowedHttpException($e->getAllowedMethods(), $message, $e);
}
$request = $event->getRequest();
// This call is required in all cases, because the default router needs our webspace information
// Would be nice to also only call this if the _requestAnalyzer attribute is set, but it's set on the next line
$this->requestAnalyzer->analyze($request);
$this->baseRouteListener->onKernelRequest($event);
if (false !== $request->attributes->getBoolean(static::REQUEST_ANALYZER, true)) {
$this->requestAnalyzer->validate($request);
}
}
$closure = static function (...$args) use (&$listener, &$closure) {
if ($listener[0] instanceof \Closure) {
$listener[0] = $listener[0]();
$listener[1] = $listener[1] ?? '__invoke';
}
($closure = \Closure::fromCallable($listener))(...$args);
};
} else {
$closure = $listener instanceof \Closure || $listener instanceof WrappedListener ? $listener : \Closure::fromCallable($listener);
}
}
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;
}
{
$this->requestStack->push($request);
// request
$event = new RequestEvent($this, $request, $type);
$this->dispatcher->dispatch($event, KernelEvents::REQUEST);
if ($event->hasResponse()) {
return $this->filterResponse($event->getResponse(), $request, $type);
}
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;
}
}
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);
}
}
if ($this->surrogate) {
$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);
/*
* 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
* Cache-Control directives) that
protected function forward(Request $request, bool $catch = false, Response $entry = null)
{
$this->getKernel()->boot();
$this->getKernel()->getContainer()->set('cache', $this);
return parent::forward($request, $catch, $entry);
}
/**
* Returns an array of options to customize the Cache configuration.
*
// 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);
}
*
* {@inheritdoc}
*/
public function fetch(Request $request, $catch = false)
{
return parent::fetch($request, $catch);
}
/**
* @return StoreInterface
*/
}
if (null === $entry) {
$this->record($request, 'miss');
return $this->fetch($request, $catch);
}
if (!$this->isFreshEnough($request, $entry)) {
$this->record($request, 'stale');
reload the cache by fetching a fresh response and caching it (if possible).
*/
$this->record($request, 'reload');
$response = $this->fetch($request, $catch);
} else {
$response = $this->lookup($request, $catch);
}
$this->restoreResponseBody($request, $response);
if (HttpKernelInterface::MAIN_REQUEST === $type) {
if ($response = $this->dispatch(Events::PRE_HANDLE, $request, null, $type)) {
return $this->dispatch(Events::POST_HANDLE, $request, $response, $type);
}
$response = parent::handle($request, $type, $catch);
return $this->dispatch(Events::POST_HANDLE, $request, $response, $type);
}
/**
// When using the HttpCache, you need to call the method in your front controller
// instead of relying on the configuration parameter
// https://symfony.com/doc/3.4/reference/configuration/framework.html#http-method-override
Request::enableHttpMethodParameterOverride();
$request = Request::createFromGlobals();
$response = $kernel->handle($request);
$response->send();
$kernel->terminate($request, $response);
$info = $request
? "this request\n$request"
: "url '$pathinfo'";
throw $methodNotAllowed ?: new ResourceNotFoundException("None of the routers in the chain matched $info");
}
/**
* {@inheritdoc}
*
*
* Loops through all routes and tries to match the passed request.
*/
public function matchRequest(Request $request)
{
return $this->doMatch($request->getPathInfo(), $request);
}
/**
* Loops through all routers and tries to match the passed request or url.
*
// add attributes based on the request (routing)
try {
// matching a request is more powerful than matching a URL path + context, so try that first
if ($this->matcher instanceof RequestMatcherInterface) {
$parameters = $this->matcher->matchRequest($request);
} else {
$parameters = $this->matcher->match($request->getPathInfo());
}
if (null !== $this->logger) {
$request = $event->getRequest();
// This call is required in all cases, because the default router needs our webspace information
// Would be nice to also only call this if the _requestAnalyzer attribute is set, but it's set on the next line
$this->requestAnalyzer->analyze($request);
$this->baseRouteListener->onKernelRequest($event);
if (false !== $request->attributes->getBoolean(static::REQUEST_ANALYZER, true)) {
$this->requestAnalyzer->validate($request);
}
}
$closure = static function (...$args) use (&$listener, &$closure) {
if ($listener[0] instanceof \Closure) {
$listener[0] = $listener[0]();
$listener[1] = $listener[1] ?? '__invoke';
}
($closure = \Closure::fromCallable($listener))(...$args);
};
} else {
$closure = $listener instanceof \Closure || $listener instanceof WrappedListener ? $listener : \Closure::fromCallable($listener);
}
}
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;
}
{
$this->requestStack->push($request);
// request
$event = new RequestEvent($this, $request, $type);
$this->dispatcher->dispatch($event, KernelEvents::REQUEST);
if ($event->hasResponse()) {
return $this->filterResponse($event->getResponse(), $request, $type);
}
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;
}
}
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);
}
}
if ($this->surrogate) {
$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);
/*
* 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
* Cache-Control directives) that
protected function forward(Request $request, bool $catch = false, Response $entry = null)
{
$this->getKernel()->boot();
$this->getKernel()->getContainer()->set('cache', $this);
return parent::forward($request, $catch, $entry);
}
/**
* Returns an array of options to customize the Cache configuration.
*
// 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);
}
*
* {@inheritdoc}
*/
public function fetch(Request $request, $catch = false)
{
return parent::fetch($request, $catch);
}
/**
* @return StoreInterface
*/
}
if (null === $entry) {
$this->record($request, 'miss');
return $this->fetch($request, $catch);
}
if (!$this->isFreshEnough($request, $entry)) {
$this->record($request, 'stale');
reload the cache by fetching a fresh response and caching it (if possible).
*/
$this->record($request, 'reload');
$response = $this->fetch($request, $catch);
} else {
$response = $this->lookup($request, $catch);
}
$this->restoreResponseBody($request, $response);
if (HttpKernelInterface::MAIN_REQUEST === $type) {
if ($response = $this->dispatch(Events::PRE_HANDLE, $request, null, $type)) {
return $this->dispatch(Events::POST_HANDLE, $request, $response, $type);
}
$response = parent::handle($request, $type, $catch);
return $this->dispatch(Events::POST_HANDLE, $request, $response, $type);
}
/**
// When using the HttpCache, you need to call the method in your front controller
// instead of relying on the configuration parameter
// https://symfony.com/doc/3.4/reference/configuration/framework.html#http-method-override
Request::enableHttpMethodParameterOverride();
$request = Request::createFromGlobals();
$response = $kernel->handle($request);
$response->send();
$kernel->terminate($request, $response);
No log messages
[2/2]
NotFoundHttpException
|
---|
Symfony\Component\HttpKernel\Exception\NotFoundHttpException: No route found for "GET http://www.hairharmony.de/2014/08/wir-bilden-aus-und-suchen-auszubildende-fuer-alle-filialen-berlin/" at vendor/symfony/http-kernel/EventListener/RouterListener.php:135 at Symfony\Component\HttpKernel\EventListener\RouterListener->onKernelRequest(object(RequestEvent)) (vendor/sulu/sulu/src/Sulu/Bundle/WebsiteBundle/EventListener/RouterListener.php:57) at Sulu\Bundle\WebsiteBundle\EventListener\RouterListener->onKernelRequest(object(RequestEvent), 'kernel.request', object(EventDispatcher)) (vendor/symfony/event-dispatcher/EventDispatcher.php:270) at Symfony\Component\EventDispatcher\EventDispatcher::Symfony\Component\EventDispatcher\{closure}(object(RequestEvent), 'kernel.request', object(EventDispatcher)) (vendor/symfony/event-dispatcher/EventDispatcher.php:230) at Symfony\Component\EventDispatcher\EventDispatcher->callListeners(array(object(Closure), object(Closure), object(Closure), object(Closure), object(Closure), object(Closure), object(Closure), object(Closure), object(Closure), object(Closure), object(Closure), object(Closure), object(Closure), object(Closure), object(Closure)), 'kernel.request', object(RequestEvent)) (vendor/symfony/event-dispatcher/EventDispatcher.php:59) at Symfony\Component\EventDispatcher\EventDispatcher->dispatch(object(RequestEvent), 'kernel.request') (vendor/symfony/http-kernel/HttpKernel.php:128) 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), 1, true) (vendor/symfony/http-kernel/HttpCache/SubRequestHandler.php:86) at Symfony\Component\HttpKernel\HttpCache\SubRequestHandler::handle(object(Kernel), object(Request), 1, true) (vendor/symfony/http-kernel/HttpCache/HttpCache.php:479) at Symfony\Component\HttpKernel\HttpCache\HttpCache->forward(object(Request), true, null) (vendor/symfony/framework-bundle/HttpCache/HttpCache.php:73) at Symfony\Bundle\FrameworkBundle\HttpCache\HttpCache->forward(object(Request), true) (vendor/symfony/http-kernel/HttpCache/HttpCache.php:452) at Symfony\Component\HttpKernel\HttpCache\HttpCache->fetch(object(Request), true) (vendor/sulu/sulu/src/Sulu/Bundle/HttpCacheBundle/Cache/SuluHttpCache.php:85) at Sulu\Bundle\HttpCacheBundle\Cache\SuluHttpCache->fetch(object(Request), true) (vendor/symfony/http-kernel/HttpCache/HttpCache.php:346) at Symfony\Component\HttpKernel\HttpCache\HttpCache->lookup(object(Request), true) (vendor/symfony/http-kernel/HttpCache/HttpCache.php:224) at Symfony\Component\HttpKernel\HttpCache\HttpCache->handle(object(Request), 1, true) (vendor/friendsofsymfony/http-cache/src/SymfonyCache/EventDispatchingHttpCache.php:98) at Sulu\Bundle\HttpCacheBundle\Cache\SuluHttpCache->handle(object(Request)) (public/index.php:66) |
[1/2]
ResourceNotFoundException
|
---|
Symfony\Component\Routing\Exception\ResourceNotFoundException: None of the routers in the chain matched this request GET /2014/08/wir-bilden-aus-und-suchen-auszubildende-fuer-alle-filialen-berlin/ HTTP/1.1 Accept: */* Connection: close Content-Length: 0 Forwarded: for="34.237.75.165";host="www.hairharmony.de";proto=http Host: www.hairharmony.de Surrogate-Capability: symfony="ESI/1.0" User-Agent: claudebot X-Forwarded-For: 34.237.75.165 X-Php-Ob-Level: 0 X-Sulu-Segment: at vendor/symfony-cmf/routing/src/ChainRouter.php:210 at Symfony\Cmf\Component\Routing\ChainRouter->doMatch('/2014/08/wir-bilden-aus-und-suchen-auszubildende-fuer-alle-filialen-berlin/', object(Request)) (vendor/symfony-cmf/routing/src/ChainRouter.php:158) at Symfony\Cmf\Component\Routing\ChainRouter->matchRequest(object(Request)) (vendor/symfony/http-kernel/EventListener/RouterListener.php:111) at Symfony\Component\HttpKernel\EventListener\RouterListener->onKernelRequest(object(RequestEvent)) (vendor/sulu/sulu/src/Sulu/Bundle/WebsiteBundle/EventListener/RouterListener.php:57) at Sulu\Bundle\WebsiteBundle\EventListener\RouterListener->onKernelRequest(object(RequestEvent), 'kernel.request', object(EventDispatcher)) (vendor/symfony/event-dispatcher/EventDispatcher.php:270) at Symfony\Component\EventDispatcher\EventDispatcher::Symfony\Component\EventDispatcher\{closure}(object(RequestEvent), 'kernel.request', object(EventDispatcher)) (vendor/symfony/event-dispatcher/EventDispatcher.php:230) at Symfony\Component\EventDispatcher\EventDispatcher->callListeners(array(object(Closure), object(Closure), object(Closure), object(Closure), object(Closure), object(Closure), object(Closure), object(Closure), object(Closure), object(Closure), object(Closure), object(Closure), object(Closure), object(Closure), object(Closure)), 'kernel.request', object(RequestEvent)) (vendor/symfony/event-dispatcher/EventDispatcher.php:59) at Symfony\Component\EventDispatcher\EventDispatcher->dispatch(object(RequestEvent), 'kernel.request') (vendor/symfony/http-kernel/HttpKernel.php:128) 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), 1, true) (vendor/symfony/http-kernel/HttpCache/SubRequestHandler.php:86) at Symfony\Component\HttpKernel\HttpCache\SubRequestHandler::handle(object(Kernel), object(Request), 1, true) (vendor/symfony/http-kernel/HttpCache/HttpCache.php:479) at Symfony\Component\HttpKernel\HttpCache\HttpCache->forward(object(Request), true, null) (vendor/symfony/framework-bundle/HttpCache/HttpCache.php:73) at Symfony\Bundle\FrameworkBundle\HttpCache\HttpCache->forward(object(Request), true) (vendor/symfony/http-kernel/HttpCache/HttpCache.php:452) at Symfony\Component\HttpKernel\HttpCache\HttpCache->fetch(object(Request), true) (vendor/sulu/sulu/src/Sulu/Bundle/HttpCacheBundle/Cache/SuluHttpCache.php:85) at Sulu\Bundle\HttpCacheBundle\Cache\SuluHttpCache->fetch(object(Request), true) (vendor/symfony/http-kernel/HttpCache/HttpCache.php:346) at Symfony\Component\HttpKernel\HttpCache\HttpCache->lookup(object(Request), true) (vendor/symfony/http-kernel/HttpCache/HttpCache.php:224) at Symfony\Component\HttpKernel\HttpCache\HttpCache->handle(object(Request), 1, true) (vendor/friendsofsymfony/http-cache/src/SymfonyCache/EventDispatchingHttpCache.php:98) at Sulu\Bundle\HttpCacheBundle\Cache\SuluHttpCache->handle(object(Request)) (public/index.php:66) |