}
$animal = $this->entityManager->getRepository(Animal::class)->findOneBy($criteria);
if (empty($animal)) {
throw new Exception('Zwierzak '.$id.' nie istnieje');
}
return $animal;
}
}
#[Route('/adopciak/{id}/{name}', name: 'base_front_animal_single')]
public function singleAction($id, AnimalService $animalService, ManagerRegistry $doctrine)
{
$animal = $animalService->getSingleAnimal($id, false);
$similarAnimals = $animalService->getSimilarAnimals($animal);
$notes = $doctrine->getRepository(BlogNote::class)->findBy(['animal' => $animal, 'isPublished' => true]);
// $poll = $doctrine->getRepository(AnimalPoll::class)->findBy(
$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);
try {
return $this->handleRaw($request, $type);
} catch (\Throwable $e) {
if ($e instanceof \Error && !$this->handleAllThrowables) {
throw $e;
}
$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;
use Symfony\Component\HttpFoundation\Request;
require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
return function (array $context) {
$request = Request::createFromGlobals();
if($request->getClientIp() == "95.217.17.2") {
No log messages
Exception
|
---|
Exception: Zwierzak 60 nie istnieje at src/Service/AnimalService.php:564 at App\Service\AnimalService->getSingleAnimal() (src/Controller/Front/AnimalController.php:235) at App\Controller\Front\AnimalController->singleAction() (vendor/symfony/http-kernel/HttpKernel.php:163) at Symfony\Component\HttpKernel\HttpKernel->handleRaw() (vendor/symfony/http-kernel/HttpKernel.php:74) at Symfony\Component\HttpKernel\HttpKernel->handle() (vendor/symfony/http-kernel/Kernel.php:184) at Symfony\Component\HttpKernel\Kernel->handle() (vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php:35) at Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner->run() (vendor/autoload_runtime.php:29) at require_once('/home/adopt/web/adopciaki.pl/public_html/vendor/autoload_runtime.php') (public/index.php:6) |