} catch (NotLoadableException $exception) {
if (null !== $this->dataManager->getDefaultImageUrl($filter)) {
return new RedirectResponse($this->dataManager->getDefaultImageUrl($filter));
}
throw new NotFoundHttpException(sprintf('Source image for path "%s" could not be found', $path), $exception);
} catch (NonExistingFilterException $exception) {
throw new NotFoundHttpException(sprintf('Requested non-existing filter "%s"', $filter), $exception);
} catch (RuntimeException $exception) {
throw new \RuntimeException(vsprintf('Unable to create image for path "%s" and filter "%s". Message was "%s"', [
$hash ? sprintf('%s/%s', $hash, $path) : $path,
public function filterAction(Request $request, $path, $filter)
{
$path = PathHelper::urlPathToFilePath($path);
$resolver = $request->get('resolver');
return $this->createRedirectResponse(function () use ($path, $filter, $resolver) {
return $this->filterService->getUrlOfFilteredImage($path, $filter, $resolver);
}, $path, $filter);
}
/**
$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);
$this->dispatcher->dispatch($event, KernelEvents::VIEW);
public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $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) {
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::MASTER_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
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::MASTER_REQUEST === $type) {
/**
* {@inheritdoc}
*/
public function find($path)
{
$path = $this->locator->locate($path);
$mimeType = $this->mimeTypeGuesser instanceof DeprecatedMimeTypeGuesserInterface ? $this->mimeTypeGuesser->guess($path) : $this->mimeTypeGuesser->guessMimeType($path);
$extension = $this->getExtension($mimeType);
return new FileBinary($path, $mimeType, $extension);
}
{
$path = PathHelper::urlPathToFilePath($path);
$resolver = $request->get('resolver');
return $this->createRedirectResponse(function () use ($path, $filter, $resolver) {
return $this->filterService->getUrlOfFilteredImage($path, $filter, $resolver);
}, $path, $filter);
}
/**
* This action applies a given filter -merged with additional runtime filters- to a given image, saves the image and
}
private function createRedirectResponse(\Closure $url, string $path, string $filter, ?string $hash = null): RedirectResponse
{
try {
return new RedirectResponse($url(), $this->controllerConfig->getRedirectResponseCode());
} catch (NotLoadableException $exception) {
if (null !== $this->dataManager->getDefaultImageUrl($filter)) {
return new RedirectResponse($this->dataManager->getDefaultImageUrl($filter));
}
public function filterAction(Request $request, $path, $filter)
{
$path = PathHelper::urlPathToFilePath($path);
$resolver = $request->get('resolver');
return $this->createRedirectResponse(function () use ($path, $filter, $resolver) {
return $this->filterService->getUrlOfFilteredImage($path, $filter, $resolver);
}, $path, $filter);
}
/**
$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);
$this->dispatcher->dispatch($event, KernelEvents::VIEW);
public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $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) {
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::MASTER_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
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::MASTER_REQUEST === $type) {
No log messages
[2/2] NotFoundHttpException |
---|
Symfony\Component\HttpKernel\Exception\NotFoundHttpException: Source image for path "4e/80/dca4b2832c71197854b81ea4328b.jpeg" could not be found at vendor/liip/imagine-bundle/Controller/ImagineController.php:147 at Liip\ImagineBundle\Controller\ImagineController->createRedirectResponse(object(Closure), '4e/80/dca4b2832c71197854b81ea4328b.jpeg', 'sylius_shop_product_original') (vendor/liip/imagine-bundle/Controller/ImagineController.php:91) at Liip\ImagineBundle\Controller\ImagineController->filterAction(object(Request), '4e/80/dca4b2832c71197854b81ea4328b.jpeg', 'sylius_shop_product_original') (vendor/symfony/http-kernel/HttpKernel.php:158) at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1) (vendor/symfony/http-kernel/HttpKernel.php:80) at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true) (vendor/symfony/http-kernel/Kernel.php:201) at Symfony\Component\HttpKernel\Kernel->handle(object(Request), 1, true) (vendor/symfony/http-kernel/HttpCache/SubRequestHandler.php:85) at Symfony\Component\HttpKernel\HttpCache\SubRequestHandler::handle(object(AppKernel), object(Request), 1, true) (vendor/symfony/http-kernel/HttpCache/HttpCache.php:477) at Symfony\Component\HttpKernel\HttpCache\HttpCache->forward(object(Request), true, null) (vendor/symfony/framework-bundle/HttpCache/HttpCache.php:62) at Symfony\Bundle\FrameworkBundle\HttpCache\HttpCache->forward(object(Request), true) (vendor/symfony/http-kernel/HttpCache/HttpCache.php:450) at Symfony\Component\HttpKernel\HttpCache\HttpCache->fetch(object(Request), true) (vendor/symfony/http-kernel/HttpCache/HttpCache.php:344) at Symfony\Component\HttpKernel\HttpCache\HttpCache->lookup(object(Request), true) (vendor/symfony/http-kernel/HttpCache/HttpCache.php:222) at Symfony\Component\HttpKernel\HttpCache\HttpCache->handle(object(Request)) (web/app.php:28) |
[1/2] NotLoadableException |
---|
Liip\ImagineBundle\Exception\Binary\Loader\NotLoadableException: Source image not resolvable "4e/80/dca4b2832c71197854b81ea4328b.jpeg" in root path(s) "/chroot/home/a324711f/ae27f2d71d.nxcli.io/production/web/media/image" at vendor/liip/imagine-bundle/Binary/Locator/FileSystemLocator.php:52 at Liip\ImagineBundle\Binary\Locator\FileSystemLocator->locate('4e/80/dca4b2832c71197854b81ea4328b.jpeg') (vendor/liip/imagine-bundle/Binary/Loader/FileSystemLoader.php:75) at Liip\ImagineBundle\Binary\Loader\FileSystemLoader->find('4e/80/dca4b2832c71197854b81ea4328b.jpeg') (vendor/liip/imagine-bundle/Imagine/Data/DataManager.php:136) at Liip\ImagineBundle\Imagine\Data\DataManager->find('sylius_shop_product_original', '4e/80/dca4b2832c71197854b81ea4328b.jpeg') (vendor/liip/imagine-bundle/Service/FilterService.php:145) at Liip\ImagineBundle\Service\FilterService->createFilteredBinary('4e/80/dca4b2832c71197854b81ea4328b.jpeg', 'sylius_shop_product_original') (vendor/liip/imagine-bundle/Service/FilterService.php:89) at Liip\ImagineBundle\Service\FilterService->getUrlOfFilteredImage('4e/80/dca4b2832c71197854b81ea4328b.jpeg', 'sylius_shop_product_original', null) (vendor/liip/imagine-bundle/Controller/ImagineController.php:92) at Liip\ImagineBundle\Controller\ImagineController->Liip\ImagineBundle\Controller\{closure}() (vendor/liip/imagine-bundle/Controller/ImagineController.php:141) at Liip\ImagineBundle\Controller\ImagineController->createRedirectResponse(object(Closure), '4e/80/dca4b2832c71197854b81ea4328b.jpeg', 'sylius_shop_product_original') (vendor/liip/imagine-bundle/Controller/ImagineController.php:91) at Liip\ImagineBundle\Controller\ImagineController->filterAction(object(Request), '4e/80/dca4b2832c71197854b81ea4328b.jpeg', 'sylius_shop_product_original') (vendor/symfony/http-kernel/HttpKernel.php:158) at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1) (vendor/symfony/http-kernel/HttpKernel.php:80) at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true) (vendor/symfony/http-kernel/Kernel.php:201) at Symfony\Component\HttpKernel\Kernel->handle(object(Request), 1, true) (vendor/symfony/http-kernel/HttpCache/SubRequestHandler.php:85) at Symfony\Component\HttpKernel\HttpCache\SubRequestHandler::handle(object(AppKernel), object(Request), 1, true) (vendor/symfony/http-kernel/HttpCache/HttpCache.php:477) at Symfony\Component\HttpKernel\HttpCache\HttpCache->forward(object(Request), true, null) (vendor/symfony/framework-bundle/HttpCache/HttpCache.php:62) at Symfony\Bundle\FrameworkBundle\HttpCache\HttpCache->forward(object(Request), true) (vendor/symfony/http-kernel/HttpCache/HttpCache.php:450) at Symfony\Component\HttpKernel\HttpCache\HttpCache->fetch(object(Request), true) (vendor/symfony/http-kernel/HttpCache/HttpCache.php:344) at Symfony\Component\HttpKernel\HttpCache\HttpCache->lookup(object(Request), true) (vendor/symfony/http-kernel/HttpCache/HttpCache.php:222) at Symfony\Component\HttpKernel\HttpCache\HttpCache->handle(object(Request)) (web/app.php:28) |