LIMIT 1") |
|
->fetchAll('assoc'); |
|
|
|
if (empty($contactOpportunity)) { |
|
throw new Exception('Cannot find contact opportunity'); |
|
} |
|
$parameters['specialSectionId'] = $contactOpportunity[0]['special_section_id']; |
|
|
|
break; |
} |
|
|
|
$parameters['originalType'] = $parameters['type']; |
|
$parameters['originalId'] = $parameters['id']; |
|
$parameters['specialSectionId'] = $this->getSpecialSectionId($parameters); |
|
|
|
// if this product isn't customizable, just show the SS product |
|
if (!$this->isCustomizable($parameters)) { |
|
switch ($parameters['type']) { |
unset($parameters['settings']['width'], $parameters['size'], $parameters['overrideType']); |
|
$image = $this->Products->highImage($parameters, $ssId); |
|
$image = $image['Image']['path']; |
|
} else { |
|
$image = $this->Products->image($parameters); |
|
} |
|
} catch (Exception $e) { |
|
return $this->error('500', $e->getMessage()); |
|
} |
// This image is getting resized and used inside another image - caching is causing problems (wrong size or resolution until a force happens) |
|
// @TODO: check if it is really necessary |
|
$this->params['force'] = '1'; |
|
|
|
$imagePath = $this->image($type, $id.'-'.$this->passwordCheck($id, $productId), $productId, 'large.jpg', null, 1); |
|
$image = imagecreatefromjpeg($imagePath); |
|
$width = imagesx($image); |
|
$height = imagesy($image); |
|
|
* @throws \UnexpectedValueException If return value of action is not `null` or `ResponseInterface` instance.
|
|
*/
|
|
public function invokeAction(Closure $action, array $args): void
|
|
{
|
|
$result = $action(...$args);
|
|
if ($result !== null && !$result instanceof ResponseInterface) {
|
|
throw new UnexpectedValueException(sprintf(
|
|
'Controller actions can only return ResponseInterface instance or null. '
|
|
. 'Got %s instead.',
|
} |
|
|
|
$action = $controller->getAction(); |
|
$args = array_values($controller->getRequest()->getParam('pass')); |
|
$controller->invokeAction($action, $args); |
|
|
|
$result = $controller->shutdownProcess(); |
|
if ($result instanceof ResponseInterface) { |
|
return $result; |
} |
|
|
|
$controller = $this->controllerFactory->create($request); |
|
|
|
return $this->controllerFactory->invoke($controller); |
|
} |
|
} |
|
|
return $middleware->process($request, $this); |
|
} |
|
|
|
if ($this->fallbackHandler) { |
|
return $this->fallbackHandler->handle($request); |
|
} |
|
|
|
$response = new Response([ |
|
'body' => 'Middleware queue was exhausted without returning a response ' |
return $middleware->process($request, $this); |
|
} |
|
|
|
if ($this->fallbackHandler) { |
|
return $this->fallbackHandler->handle($request); |
|
} |
|
|
|
$response = new Response([ |
|
'body' => 'Middleware queue was exhausted without returning a response ' |
$token = $this->createToken();
|
|
$request = $request->withAttribute('csrfToken', $token);
|
|
/** @var mixed $response */
|
|
// _d('147');
|
|
$response = $handler->handle($request);
|
|
// _d('149');
|
|
// _dd($this->_addTokenCookie($token, $request, $response));
|
|
return $this->_addTokenCookie($token, $request, $response);
|
|
}
|
if ($this->queue->valid()) { |
|
$middleware = $this->queue->current(); |
|
$this->queue->next(); |
|
|
|
return $middleware->process($request, $this); |
|
} |
|
|
|
if ($this->fallbackHandler) { |
|
return $this->fallbackHandler->handle($request); |
$this->queue = $queue; |
|
$this->queue->rewind(); |
|
$this->fallbackHandler = $fallbackHandler; |
|
|
|
return $this->handle($request); |
|
} |
|
|
|
/** |
|
* Handle incoming server request and return a response. |
|
|
$middleware = new MiddlewareQueue($matching); |
|
$runner = new Runner(); |
|
|
|
return $runner->run($middleware, $request, $handler); |
|
} |
|
} |
|
|
if ($this->queue->valid()) { |
|
$middleware = $this->queue->current(); |
|
$this->queue->next(); |
|
|
|
return $middleware->process($request, $this); |
|
} |
|
|
|
if ($this->fallbackHandler) { |
|
return $this->fallbackHandler->handle($request); |
} |
|
|
|
$assetFile = $this->_getAssetFile($url); |
|
if ($assetFile === null || !file_exists($assetFile)) { |
|
return $handler->handle($request); |
|
} |
|
|
|
$file = new SplFileInfo($assetFile); |
|
$modifiedTime = $file->getMTime(); |
if ($this->queue->valid()) { |
|
$middleware = $this->queue->current(); |
|
$this->queue->next(); |
|
|
|
return $middleware->process($request, $this); |
|
} |
|
|
|
if ($this->fallbackHandler) { |
|
return $this->fallbackHandler->handle($request); |
*/ |
|
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface |
|
{ |
|
try { |
|
return $handler->handle($request); |
|
} catch (RedirectException $exception) { |
|
return $this->handleRedirect($exception); |
|
} catch (Throwable $exception) { |
|
return $this->handleException($exception, $request); |
if ($this->queue->valid()) { |
|
$middleware = $this->queue->current(); |
|
$this->queue->next(); |
|
|
|
return $middleware->process($request, $this); |
|
} |
|
|
|
if ($this->fallbackHandler) { |
|
return $this->fallbackHandler->handle($request); |
if ($this->service->isEnabled()) { |
|
$this->service->loadPanels(); |
|
$this->service->initializePanels(); |
|
} |
|
$response = $handler->handle($request); |
|
|
|
if (!$this->service->isEnabled()) { |
|
return $response; |
|
} |
if ($this->queue->valid()) { |
|
$middleware = $this->queue->current(); |
|
$this->queue->next(); |
|
|
|
return $middleware->process($request, $this); |
|
} |
|
|
|
if ($this->fallbackHandler) { |
|
return $this->fallbackHandler->handle($request); |
$this->queue = $queue; |
|
$this->queue->rewind(); |
|
$this->fallbackHandler = $fallbackHandler; |
|
|
|
return $this->handle($request); |
|
} |
|
|
|
/** |
|
* Handle incoming server request and return a response. |
} |
|
|
|
$this->dispatchEvent('Server.buildMiddleware', ['middleware' => $middleware]); |
|
|
|
$response = $this->runner->run($middleware, $request, $this->app); |
|
|
|
if ($request instanceof ServerRequest) { |
|
$request->getSession()->close(); |
|
} |
// Bind your application to the server. |
|
$server = new Server(new Application(dirname(__DIR__) . '/config')); |
|
|
|
// Run the request/response through the application and emit the response. |
|
$server->emit($server->run()); |
|
|
Some of the Table objects in your application were created by instantiating "Cake\ORM\Table" instead of any other specific subclass.
This could be the cause for this exception. Auto-Tables are created for you under the following circumstances:
Please try correcting the issue for the following table aliases:
If you want to customize this error message, create templates/Error/error500.php