$sections = $this->Pages->find('children', for: $pageData->id)->find('threaded')
Cake\Error\ErrorTrap->handleError() /data/web/virtuals/346431/virtual/www/src/Controller/PagesController.php, line 99 App\Controller\PagesController->display() /data/web/virtuals/346431/virtual/www/vendor/cakephp/cakephp/src/Controller/Controller.php, line 503 Cake\Controller\Controller->invokeAction() /data/web/virtuals/346431/virtual/www/vendor/cakephp/cakephp/src/Controller/ControllerFactory.php, line 166 Cake\Controller\ControllerFactory->handle() /data/web/virtuals/346431/virtual/www/vendor/cakephp/cakephp/src/Controller/ControllerFactory.php, line 141 Cake\Controller\ControllerFactory->invoke() /data/web/virtuals/346431/virtual/www/vendor/cakephp/cakephp/src/Http/BaseApplication.php, line 362 Cake\Http\BaseApplication->handle() /data/web/virtuals/346431/virtual/www/vendor/cakephp/cakephp/src/Http/Runner.php, line 86 Cake\Http\Runner->handle() /data/web/virtuals/346431/virtual/www/vendor/cakephp/authorization/src/Middleware/RequestAuthorizationMiddleware.php, line 110 Authorization\Middleware\RequestAuthorizationMiddleware->process() /data/web/virtuals/346431/virtual/www/vendor/cakephp/cakephp/src/Http/Runner.php, line 82 Cake\Http\Runner->handle() /data/web/virtuals/346431/virtual/www/vendor/cakephp/authorization/src/Middleware/AuthorizationMiddleware.php, line 136 Authorization\Middleware\AuthorizationMiddleware->process() /data/web/virtuals/346431/virtual/www/vendor/cakephp/cakephp/src/Http/Runner.php, line 82 Cake\Http\Runner->handle() /data/web/virtuals/346431/virtual/www/vendor/cakephp/authentication/src/Middleware/AuthenticationMiddleware.php, line 107 Authentication\Middleware\AuthenticationMiddleware->process() /data/web/virtuals/346431/virtual/www/vendor/cakephp/cakephp/src/Http/Runner.php, line 82 Cake\Http\Runner->handle() /data/web/virtuals/346431/virtual/www/vendor/cakedc/users/src/Middleware/SocialEmailMiddleware.php, line 34 CakeDC\Users\Middleware\SocialEmailMiddleware->process() /data/web/virtuals/346431/virtual/www/vendor/cakephp/cakephp/src/Http/Runner.php, line 82 Cake\Http\Runner->handle() /data/web/virtuals/346431/virtual/www/vendor/cakedc/users/src/Middleware/SocialAuthMiddleware.php, line 121 CakeDC\Users\Middleware\SocialAuthMiddleware->process() /data/web/virtuals/346431/virtual/www/vendor/cakephp/cakephp/src/Http/Runner.php, line 82 Cake\Http\Runner->handle() /data/web/virtuals/346431/virtual/www/vendor/cakephp/cakephp/src/Http/Middleware/HttpsEnforcerMiddleware.php, line 95 Cake\Http\Middleware\HttpsEnforcerMiddleware->process() /data/web/virtuals/346431/virtual/www/vendor/cakephp/cakephp/src/Http/Runner.php, line 82 Cake\Http\Runner->handle() /data/web/virtuals/346431/virtual/www/vendor/cakephp/cakephp/src/Http/Middleware/HttpsEnforcerMiddleware.php, line 95 Cake\Http\Middleware\HttpsEnforcerMiddleware->process() /data/web/virtuals/346431/virtual/www/vendor/cakephp/cakephp/src/Http/Runner.php, line 82 Cake\Http\Runner->handle() /data/web/virtuals/346431/virtual/www/vendor/cakephp/cakephp/src/Http/Middleware/CsrfProtectionMiddleware.php, line 159 Cake\Http\Middleware\CsrfProtectionMiddleware->process() /data/web/virtuals/346431/virtual/www/vendor/cakephp/cakephp/src/Http/Runner.php, line 82 Cake\Http\Runner->handle() /data/web/virtuals/346431/virtual/www/vendor/cakephp/cakephp/src/Http/Middleware/BodyParserMiddleware.php, line 157 Cake\Http\Middleware\BodyParserMiddleware->process() /data/web/virtuals/346431/virtual/www/vendor/cakephp/cakephp/src/Http/Runner.php, line 82 Cake\Http\Runner->handle() /data/web/virtuals/346431/virtual/www/vendor/cakephp/cakephp/src/Routing/Middleware/RoutingMiddleware.php, line 118 Cake\Routing\Middleware\RoutingMiddleware->process() /data/web/virtuals/346431/virtual/www/vendor/cakephp/cakephp/src/Http/Runner.php, line 82 Cake\Http\Runner->handle() /data/web/virtuals/346431/virtual/www/vendor/cakephp/cakephp/src/Routing/Middleware/AssetMiddleware.php, line 78 Cake\Routing\Middleware\AssetMiddleware->process() /data/web/virtuals/346431/virtual/www/vendor/cakephp/cakephp/src/Http/Runner.php, line 82 Cake\Http\Runner->handle() /data/web/virtuals/346431/virtual/www/vendor/cakephp/cakephp/src/Error/Middleware/ErrorHandlerMiddleware.php, line 115 Cake\Error\Middleware\ErrorHandlerMiddleware->process() /data/web/virtuals/346431/virtual/www/vendor/cakephp/cakephp/src/Http/Runner.php, line 82 Cake\Http\Runner->handle() /data/web/virtuals/346431/virtual/www/vendor/cakephp/cakephp/src/Http/Runner.php, line 60 Cake\Http\Runner->run() /data/web/virtuals/346431/virtual/www/vendor/cakephp/cakephp/src/Http/Server.php, line 104 Cake\Http\Server->run() /data/web/virtuals/346431/virtual/www/webroot/index.php, line 37 [main]
$message = "Unable to emit headers. Headers sent in file={$file} line={$line}";trigger_error($message, E_USER_WARNING);}
Cake\Error\ErrorTrap->handleError() [internal], line ?? /data/web/virtuals/346431/virtual/www/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php /data/web/virtuals/346431/virtual/www/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php, line 65 Cake\Http\ResponseEmitter->emit() /data/web/virtuals/346431/virtual/www/vendor/cakephp/cakephp/src/Http/Server.php, line 148 Cake\Http\Server->emit() /data/web/virtuals/346431/virtual/www/webroot/index.php, line 37 [main]
$reasonPhrase = $response->getReasonPhrase();header(sprintf('HTTP/%s %d%s',
Cake\Error\ErrorTrap->handleError() [internal], line ?? /data/web/virtuals/346431/virtual/www/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php /data/web/virtuals/346431/virtual/www/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php, line 159 Cake\Http\ResponseEmitter->emitStatusLine() /data/web/virtuals/346431/virtual/www/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php, line 68 Cake\Http\ResponseEmitter->emit() /data/web/virtuals/346431/virtual/www/vendor/cakephp/cakephp/src/Http/Server.php, line 148 Cake\Http\Server->emit() /data/web/virtuals/346431/virtual/www/webroot/index.php, line 37 [main]
foreach ($values as $value) {header(sprintf('%s: %s',
Cake\Error\ErrorTrap->handleError() [internal], line ?? /data/web/virtuals/346431/virtual/www/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php /data/web/virtuals/346431/virtual/www/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php, line 192 Cake\Http\ResponseEmitter->emitHeaders() /data/web/virtuals/346431/virtual/www/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php, line 69 Cake\Http\ResponseEmitter->emit() /data/web/virtuals/346431/virtual/www/vendor/cakephp/cakephp/src/Http/Server.php, line 148 Cake\Http\Server->emit() /data/web/virtuals/346431/virtual/www/webroot/index.php, line 37 [main]
* @param bool $direct Whether to return only the direct (true) or all children (false). |
|
* @return \Cake\ORM\Query\SelectQuery |
|
* @throws \InvalidArgumentException When the 'for' key is not passed in $options |
|
*/ |
|
public function findChildren(SelectQuery $query, int|string $for, bool $direct = false): SelectQuery |
|
{ |
|
$config = $this->getConfig(); |
|
[$parent, $left, $right] = array_map( |
|
function ($field) { |
} |
|
} |
|
} |
|
|
|
return $callable($query, ...$args); |
|
} |
|
|
|
/** |
|
* Provides the dynamic findBy and findAllBy methods. |
if ($this->hasFinder($type) && $this->has($this->_finderMap[$type][0])) { |
|
[$behavior, $callMethod] = $this->_finderMap[$type]; |
|
$callable = $this->_loaded[$behavior]->$callMethod(...); |
|
|
|
return $this->_table->invokeFinder($callable, $query, $args); |
|
} |
|
|
|
throw new BadMethodCallException( |
|
sprintf('Cannot call finder `%s`, it does not belong to any attached behavior.', $type), |
return $this->invokeFinder($this->{$finder}(...), $query, $args); |
|
} |
|
|
|
if ($this->_behaviors->hasFinder($type)) { |
|
return $this->_behaviors->callFinder($type, $query, ...$args); |
|
} |
|
|
|
throw new BadMethodCallException(sprintf( |
|
'Unknown finder method `%s` on `%s`.', |
* @return \Cake\ORM\Query\SelectQuery The query builder |
|
*/ |
|
public function find(string $type = 'all', mixed ...$args): SelectQuery |
|
{ |
|
return $this->callFinder($type, $this->selectQuery(), ...$args); |
|
} |
|
|
|
/** |
|
* Returns the query as passed. |
->where(['slug' => $page]) |
|
// ->contain(['ChildPages']) |
|
->first(); |
|
|
|
$sections = $this->Pages->find('children', for: $pageData->id) |
|
->find('threaded') |
|
->orderAsc('lft') |
|
->toArray(); |
|
} |
* @return void |
|
*/ |
|
public function invokeAction(Closure $action, array $args): void |
|
{ |
|
$result = $action(...$args); |
|
if ($result !== null) { |
|
assert( |
|
$result instanceof Response, |
|
sprintf( |
$args = $this->getActionArgs( |
|
$action, |
|
array_values((array)$controller->getRequest()->getParam('pass')), |
|
); |
|
$controller->invokeAction($action, $args); |
|
|
|
$result = $controller->shutdownProcess(); |
|
if ($result !== null) { |
|
return $result; |
|
|
return $runner->run($middlewareQueue, $controller->getRequest(), $this); |
|
} |
|
|
|
return $this->handle($controller->getRequest()); |
|
} |
|
|
|
/** |
|
* Invoke the action. |
} |
|
|
|
$controller = $this->controllerFactory->create($request); |
|
|
|
return $this->controllerFactory->invoke($controller); |
|
} |
|
} |
|
|
return $middleware->process($request, $this); |
|
} |
|
|
|
if ($this->fallbackHandler) { |
|
return $this->fallbackHandler->handle($request); |
|
} |
|
|
|
return new Response([ |
|
'body' => 'Middleware queue was exhausted without returning a response ' |
} catch (Exception $exception) { |
|
return $this->handleException($exception, $request, $this->getConfig('unauthorizedHandler')); |
|
} |
|
|
|
return $handler->handle($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); |
$request = $request->withAttribute($attribute, $identity); |
|
} |
|
|
|
try { |
|
$response = $handler->handle($request); |
|
|
|
if ($this->getConfig('requireAuthorizationCheck') && !$service->authorizationChecked()) { |
|
throw new AuthorizationRequiredException(['url' => $request->getRequestTarget()]); |
|
} |
if ($this->queue->valid()) { |
|
$middleware = $this->queue->current(); |
|
$this->queue->next(); |
|
|
|
return $middleware->process($request, $this); |
|
} |
|
|
|
if ($this->fallbackHandler) { |
|
return $this->fallbackHandler->handle($request); |
$request = $request->withAttribute('authentication', $service); |
|
$request = $request->withAttribute('authenticationResult', $result); |
|
|
|
try { |
|
$response = $handler->handle($request); |
|
$authenticator = $service->getAuthenticationProvider(); |
|
|
|
if ($authenticator !== null && !$authenticator instanceof StatelessInterface) { |
|
/** |
if ($this->queue->valid()) { |
|
$middleware = $this->queue->current(); |
|
$this->queue->next(); |
|
|
|
return $middleware->process($request, $this); |
|
} |
|
|
|
if ($this->fallbackHandler) { |
|
return $this->fallbackHandler->handle($request); |
$session = $request->getAttribute('session'); |
|
if (!(new UsersUrl())->checkActionOnRequest('socialEmail', $request)) { |
|
$session->delete(Configure::read('Users.Key.Session.social')); |
|
|
|
return $handler->handle($request); |
|
} |
|
|
|
if (!$session->check(Configure::read('Users.Key.Session.social'))) { |
|
throw new NotFoundException(); |
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 |
|
{ |
|
if (!(new UsersUrl())->checkActionOnRequest('socialLogin', $request)) { |
|
return $handler->handle($request); |
|
} |
|
|
|
$service = (new ServiceFactory())->createFromRequest($request); |
|
if (!$service->isGetUserStep($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); |
$request->getUri()->getScheme() === 'https' |
|
|| ($this->config['disableOnDebug'] |
|
&& Configure::read('debug')) |
|
) { |
|
$response = $handler->handle($request); |
|
if ($this->config['hsts']) { |
|
return $this->addHsts($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); |
$request->getUri()->getScheme() === 'https' |
|
|| ($this->config['disableOnDebug'] |
|
&& Configure::read('debug')) |
|
) { |
|
$response = $handler->handle($request); |
|
if ($this->config['hsts']) { |
|
return $this->addHsts($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); |
|
|
if ($method === 'GET' && $cookieData === null) { |
|
$token = $this->createToken(); |
|
$request = $request->withAttribute('csrfToken', $this->saltToken($token)); |
|
$response = $handler->handle($request); |
|
|
|
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); |
*/ |
|
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface |
|
{ |
|
if (!in_array($request->getMethod(), $this->methods, true)) { |
|
return $handler->handle($request); |
|
} |
|
[$type] = explode(';', $request->getHeaderLine('Content-Type')); |
|
$type = strtolower($type); |
|
if (!isset($this->parsers[$type])) { |
if ($this->queue->valid()) { |
|
$middleware = $this->queue->current(); |
|
$this->queue->next(); |
|
|
|
return $middleware->process($request, $this); |
|
} |
|
|
|
if ($this->fallbackHandler) { |
|
return $this->fallbackHandler->handle($request); |
); |
|
} |
|
$matching = Router::getRouteCollection()->getMiddleware($middleware); |
|
if (!$matching) { |
|
return $handler->handle($request); |
|
} |
|
|
|
$container = $this->app instanceof ContainerApplicationInterface |
|
? $this->app->getContainer() |
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 || !is_file($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, Router::getRequest() ?? $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); |
$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()); |
|
|
If you want to customize this error message, create templates/Error/error500.php