if ($page != NULL) {
$this->getRubriquePrincipal($page);
$this->twig->addGlobal("page", $page);
$this->twig->addGlobal("fileAriane", array_reverse($this->fileAriane));
}else{
throw new NotFoundHttpException(null, null, 404);
}
}
}
/**
$this->twig->addGlobal("ecoCategs", $repoCategs->findByEcoCategories());
$this->twig->addGlobal("actualiteCategs", $actualiteCategsRepo->findByCategoriesActu(array('site_lang' => $this->langue, 'site_uid' => $site_id)));
$this->navigationLoaded = true;
}
//Cas d'une page interne (chargement de l'environnement d'une page pour un controller)
$this->setPageContext();
//display popup from everywhere
$this->displayPopup();
}
// } else {
// $this->LoadFrontRessources($this->params->get('SITE_ID')); //Site 1
// }
//FRONT ECOMMERCE
} else {
$this->LoadFrontRessourcesEcommerce($this->params->get('SITE_ID')); //Site 1
}
// manage the newsletter registration
if ($event->getRequest()->get("mailNL") && $event->getRequest()->get("accpetRecNL") == 1) {
$this->called = true;
$this->priority = $dispatcher->getListenerPriority($eventName, $this->listener);
$e = $this->stopwatch->start($this->name, 'event_listener');
($this->optimizedListener ?? $this->listener)($event, $eventName, $dispatcher);
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;
}
try {
$this->beforeDispatch($eventName, $event);
try {
$e = $this->stopwatch->start($eventName, 'section');
try {
$this->dispatcher->dispatch($event, $eventName);
} finally {
if ($e->isStarted()) {
$e->stop();
}
}
{
$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) {
$exception = $event->getThrowable();
$request = $this->duplicateRequest($exception, $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(), $e->getFile(), $e->getLine()));
$this->called = true;
$this->priority = $dispatcher->getListenerPriority($eventName, $this->listener);
$e = $this->stopwatch->start($this->name, 'event_listener');
($this->optimizedListener ?? $this->listener)($event, $eventName, $dispatcher);
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;
}
try {
$this->beforeDispatch($eventName, $event);
try {
$e = $this->stopwatch->start($eventName, 'section');
try {
$this->dispatcher->dispatch($event, $eventName);
} finally {
if ($e->isStarted()) {
$e->stop();
}
}
* @throws \Exception
*/
private function handleThrowable(\Throwable $e, Request $request, int $type): Response
{
$event = new ExceptionEvent($this, $request, $type, $e);
$this->dispatcher->dispatch($event, KernelEvents::EXCEPTION);
// a listener might have replaced the exception
$e = $event->getThrowable();
if (!$event->hasResponse()) {
{
if (!$request = $request ?: $this->requestStack->getMainRequest()) {
throw $exception;
}
$response = $this->handleThrowable($exception, $request, self::MAIN_REQUEST);
$response->sendHeaders();
$response->sendContent();
$this->terminate($request, $response);
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) {
return $exceptionHandler($exception);
}
$handlerException = $handlerException ?: $exception;
} catch (\Throwable $handlerException) {
}
if ($exception === $handlerException && null === $this->exceptionHandler) {
ClassNotFoundError
|
---|
Symfony\Component\ErrorHandler\Error\ClassNotFoundError: Attempted to load class "NotFoundHttpException" from namespace "App\EventListener". Did you forget a "use" statement for "Symfony\Component\HttpKernel\Exception\NotFoundHttpException"? at /home/otideap/www/sudcms/src/EventListener/BaseListener.php:568 at App\EventListener\BaseListener->setPageContext() (/home/otideap/www/sudcms/src/EventListener/BaseListener.php:423) at App\EventListener\BaseListener->LoadFrontRessourcesEcommerce(1) (/home/otideap/www/sudcms/src/EventListener/BaseListener.php:150) at App\EventListener\BaseListener->onKernelRequest(object(RequestEvent), 'kernel.request', object(TraceableEventDispatcher)) (/home/otideap/www/sudcms/vendor/symfony/event-dispatcher/Debug/WrappedListener.php:117) at Symfony\Component\EventDispatcher\Debug\WrappedListener->__invoke(object(RequestEvent), 'kernel.request', object(TraceableEventDispatcher)) (/home/otideap/www/sudcms/vendor/symfony/event-dispatcher/EventDispatcher.php:230) at Symfony\Component\EventDispatcher\EventDispatcher->callListeners(array(object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener)), 'kernel.request', object(RequestEvent)) (/home/otideap/www/sudcms/vendor/symfony/event-dispatcher/EventDispatcher.php:59) at Symfony\Component\EventDispatcher\EventDispatcher->dispatch(object(RequestEvent), 'kernel.request') (/home/otideap/www/sudcms/vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php:151) at Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher->dispatch(object(RequestEvent), 'kernel.request') (/home/otideap/www/sudcms/vendor/symfony/http-kernel/HttpKernel.php:132) at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 2) (/home/otideap/www/sudcms/vendor/symfony/http-kernel/HttpKernel.php:78) at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 2, false) (/home/otideap/www/sudcms/vendor/symfony/http-kernel/EventListener/ErrorListener.php:60) at Symfony\Component\HttpKernel\EventListener\ErrorListener->onKernelException(object(ExceptionEvent), 'kernel.exception', object(TraceableEventDispatcher)) (/home/otideap/www/sudcms/vendor/symfony/event-dispatcher/Debug/WrappedListener.php:117) at Symfony\Component\EventDispatcher\Debug\WrappedListener->__invoke(object(ExceptionEvent), 'kernel.exception', object(TraceableEventDispatcher)) (/home/otideap/www/sudcms/vendor/symfony/event-dispatcher/EventDispatcher.php:230) at Symfony\Component\EventDispatcher\EventDispatcher->callListeners(array(object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener), object(WrappedListener)), 'kernel.exception', object(ExceptionEvent)) (/home/otideap/www/sudcms/vendor/symfony/event-dispatcher/EventDispatcher.php:59) at Symfony\Component\EventDispatcher\EventDispatcher->dispatch(object(ExceptionEvent), 'kernel.exception') (/home/otideap/www/sudcms/vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php:151) at Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher->dispatch(object(ExceptionEvent), 'kernel.exception') (/home/otideap/www/sudcms/vendor/symfony/http-kernel/HttpKernel.php:217) at Symfony\Component\HttpKernel\HttpKernel->handleThrowable(object(ClassNotFoundError), object(Request), 1) (/home/otideap/www/sudcms/vendor/symfony/http-kernel/HttpKernel.php:110) at Symfony\Component\HttpKernel\HttpKernel->terminateWithException(object(ClassNotFoundError), object(Request)) (/home/otideap/www/sudcms/vendor/symfony/http-kernel/EventListener/DebugHandlersListener.php:129) at Symfony\Component\HttpKernel\EventListener\DebugHandlersListener::Symfony\Component\HttpKernel\EventListener\{closure}(object(ClassNotFoundError)) (/home/otideap/www/sudcms/vendor/symfony/error-handler/ErrorHandler.php:607) at Symfony\Component\ErrorHandler\ErrorHandler->handleException(object(ClassNotFoundError)) |