Exceptions
Exceptions 2
Symfony\Component\HttpKernel\Exception\ BadRequestHttpException
private function handleRaw(Request $request, int $type = self::MASTER_REQUEST) {
$this->requestStack->push($request);
// request
$event = new GetResponseEvent($this, $request, $type);
$this->dispatcher->dispatch(KernelEvents::REQUEST, $event);
if ($event->hasResponse()) {
return $this->filterResponse($event->getResponse(), $request, $type);
}
*/
public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true) {
$request->headers->set('X-Php-Ob-Level', 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) {
Request::setTrustedHosts([$trustedHosts]);
}
$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
$request = Request::createFromGlobals();
$response = $kernel->handle($request);
// // LG 20220802 pour tests
// if (file_exists("/home/luc/partage_win10/Poubelle/")) {
// $jsonfile = "/home/luc/partage_win10/Poubelle/comparePasswords.txt";
// } else if (file_exists("/var/www/html/PAA/Recette/var/log/")) {
Symfony\Component\HttpFoundation\Exception\ SuspiciousOperationException
if (\in_array($method, ['GET', 'HEAD', 'POST', 'PUT', 'DELETE', 'CONNECT', 'OPTIONS', 'PATCH', 'PURGE', 'TRACE'], true)) {
return $this->method = $method;
}
if (!preg_match('/^[A-Z]++$/D', $method)) {
throw new SuspiciousOperationException(sprintf('Invalid method override "%s".', $method));
}
return $this->method = $method;
}
* @return $this
*/
public function fromRequest(Request $request) {
$this->setBaseUrl($request->getBaseUrl());
$this->setPathInfo($request->getPathInfo());
$this->setMethod($request->getMethod());
$this->setHost($request->getHost());
$this->setScheme($request->getScheme());
$this->setHttpPort($request->isSecure() ? $this->httpPort : $request->getPort());
$this->setHttpsPort($request->isSecure() ? $request->getPort() : $this->httpsPort);
$this->setQueryString($request->server->get('QUERY_STRING', ''));
private function handleRaw(Request $request, int $type = self::MASTER_REQUEST) {
$this->requestStack->push($request);
// request
$event = new GetResponseEvent($this, $request, $type);
$this->dispatcher->dispatch(KernelEvents::REQUEST, $event);
if ($event->hasResponse()) {
return $this->filterResponse($event->getResponse(), $request, $type);
}
*/
public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true) {
$request->headers->set('X-Php-Ob-Level', 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) {
Request::setTrustedHosts([$trustedHosts]);
}
$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
$request = Request::createFromGlobals();
$response = $kernel->handle($request);
// // LG 20220802 pour tests
// if (file_exists("/home/luc/partage_win10/Poubelle/")) {
// $jsonfile = "/home/luc/partage_win10/Poubelle/comparePasswords.txt";
// } else if (file_exists("/var/www/html/PAA/Recette/var/log/")) {
Stack Traces 2
[2/2] BadRequestHttpException |
---|
Symfony\Component\HttpKernel\Exception\BadRequestHttpException: Invalid method override "__CONSTRUCT". at vendor/symfony/http-kernel/EventListener/RouterListener.php:82 at Symfony\Component\HttpKernel\EventListener\RouterListener->setCurrentRequest() (vendor/symfony/http-kernel/EventListener/RouterListener.php:100) at Symfony\Component\HttpKernel\EventListener\RouterListener->onKernelRequest() (vendor/symfony/event-dispatcher/Debug/WrappedListener.php:108) at Symfony\Component\EventDispatcher\Debug\WrappedListener->__invoke() (vendor/symfony/event-dispatcher/EventDispatcher.php:203) at Symfony\Component\EventDispatcher\EventDispatcher->doDispatch() (vendor/symfony/event-dispatcher/EventDispatcher.php:43) at Symfony\Component\EventDispatcher\EventDispatcher->dispatch() (vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php:135) at Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher->dispatch() (vendor/symfony/http-kernel/HttpKernel.php:121) at Symfony\Component\HttpKernel\HttpKernel->handleRaw() (vendor/symfony/http-kernel/HttpKernel.php:65) at Symfony\Component\HttpKernel\HttpKernel->handle() (vendor/symfony/http-kernel/Kernel.php:190) at Symfony\Component\HttpKernel\Kernel->handle() (public/index.php:28) |
[1/2] SuspiciousOperationException |
---|
Symfony\Component\HttpFoundation\Exception\SuspiciousOperationException: Invalid method override "__CONSTRUCT". at vendor/symfony/http-foundation/Request.php:1190 at Symfony\Component\HttpFoundation\Request->getMethod() (vendor/symfony/routing/RequestContext.php:55) at Symfony\Component\Routing\RequestContext->fromRequest() (vendor/symfony/http-kernel/EventListener/RouterListener.php:80) at Symfony\Component\HttpKernel\EventListener\RouterListener->setCurrentRequest() (vendor/symfony/http-kernel/EventListener/RouterListener.php:100) at Symfony\Component\HttpKernel\EventListener\RouterListener->onKernelRequest() (vendor/symfony/event-dispatcher/Debug/WrappedListener.php:108) at Symfony\Component\EventDispatcher\Debug\WrappedListener->__invoke() (vendor/symfony/event-dispatcher/EventDispatcher.php:203) at Symfony\Component\EventDispatcher\EventDispatcher->doDispatch() (vendor/symfony/event-dispatcher/EventDispatcher.php:43) at Symfony\Component\EventDispatcher\EventDispatcher->dispatch() (vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php:135) at Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher->dispatch() (vendor/symfony/http-kernel/HttpKernel.php:121) at Symfony\Component\HttpKernel\HttpKernel->handleRaw() (vendor/symfony/http-kernel/HttpKernel.php:65) at Symfony\Component\HttpKernel\HttpKernel->handle() (vendor/symfony/http-kernel/Kernel.php:190) at Symfony\Component\HttpKernel\Kernel->handle() (public/index.php:28) |