if (!session_start()) {throw new RuntimeException('Could not start the session');
DebugKit\Plugin::DebugKit\{closure}() /home/appunte/public_html/vendor/cakephp/debug_kit/src/Plugin.php, line 123
session_start [internal], line ??
Cake\Http\Session::start() /home/appunte/public_html/vendor/cakephp/cakephp/src/Http/Session.php, line 355
Cake\Http\Session::write() /home/appunte/public_html/vendor/cakephp/cakephp/src/Http/Session.php, line 501
Cake\Http\FlashMessage::set() /home/appunte/public_html/vendor/cakephp/cakephp/src/Http/FlashMessage.php, line 122
Cake\Controller\Component\FlashComponent::set() /home/appunte/public_html/vendor/cakephp/cakephp/src/Controller/Component/FlashComponent.php, line 76
Cake\Controller\Component\AuthComponent::flash() /home/appunte/public_html/vendor/cakephp/cakephp/src/Controller/Component/AuthComponent.php, line 955
Cake\Controller\Component\AuthComponent::_unauthenticated() /home/appunte/public_html/vendor/cakephp/cakephp/src/Controller/Component/AuthComponent.php, line 363
Cake\Controller\Component\AuthComponent::authCheck() /home/appunte/public_html/vendor/cakephp/cakephp/src/Controller/Component/AuthComponent.php, line 287
Cake\Controller\Component\AuthComponent::startup() /home/appunte/public_html/vendor/cakephp/cakephp/src/Controller/Component/AuthComponent.php, line 247
Cake\Event\EventManager::_callListener() /home/appunte/public_html/vendor/cakephp/cakephp/src/Event/EventManager.php, line 317
Cake\Event\EventManager::dispatch() /home/appunte/public_html/vendor/cakephp/cakephp/src/Event/EventManager.php, line 294
Cake\Controller\Controller::dispatchEvent() /home/appunte/public_html/vendor/cakephp/cakephp/src/Event/EventDispatcherTrait.php, line 92
Cake\Controller\Controller::startupProcess() /home/appunte/public_html/vendor/cakephp/cakephp/src/Controller/Controller.php, line 648
Cake\Controller\ControllerFactory::handle() /home/appunte/public_html/vendor/cakephp/cakephp/src/Controller/ControllerFactory.php, line 129
Cake\Controller\ControllerFactory::invoke() /home/appunte/public_html/vendor/cakephp/cakephp/src/Controller/ControllerFactory.php, line 114
Cake\Http\BaseApplication::handle() /home/appunte/public_html/vendor/cakephp/cakephp/src/Http/BaseApplication.php, line 320
Cake\Http\Runner::handle() /home/appunte/public_html/vendor/cakephp/cakephp/src/Http/Runner.php, line 77
Cake\Http\Middleware\BodyParserMiddleware::process() /home/appunte/public_html/vendor/cakephp/cakephp/src/Http/Middleware/BodyParserMiddleware.php, line 157
Cake\Http\Runner::handle() /home/appunte/public_html/vendor/cakephp/cakephp/src/Http/Runner.php, line 73
Cake\Routing\Middleware\RoutingMiddleware::process() /home/appunte/public_html/vendor/cakephp/cakephp/src/Routing/Middleware/RoutingMiddleware.php, line 186
Cake\Http\Runner::handle() /home/appunte/public_html/vendor/cakephp/cakephp/src/Http/Runner.php, line 73
Cake\Routing\Middleware\AssetMiddleware::process() /home/appunte/public_html/vendor/cakephp/cakephp/src/Routing/Middleware/AssetMiddleware.php, line 68
Cake\Http\Runner::handle() /home/appunte/public_html/vendor/cakephp/cakephp/src/Http/Runner.php, line 73
Cake\Error\Middleware\ErrorHandlerMiddleware::process() /home/appunte/public_html/vendor/cakephp/cakephp/src/Error/Middleware/ErrorHandlerMiddleware.php, line 131
Cake\Http\Runner::handle() /home/appunte/public_html/vendor/cakephp/cakephp/src/Http/Runner.php, line 73
DebugKit\Middleware\DebugKitMiddleware::process() /home/appunte/public_html/vendor/cakephp/debug_kit/src/Middleware/DebugKitMiddleware.php, line 60
Cake\Http\Runner::handle() /home/appunte/public_html/vendor/cakephp/cakephp/src/Http/Runner.php, line 73
Cake\Http\Runner::run() /home/appunte/public_html/vendor/cakephp/cakephp/src/Http/Runner.php, line 58
Cake\Http\Server::run() /home/appunte/public_html/vendor/cakephp/cakephp/src/Http/Server.php, line 90
[main] /home/appunte/public_html/webroot/index.php, line 40
if (!session_start()) {throw new RuntimeException('Could not start the session');
DebugKit\Plugin::DebugKit\{closure}() /home/appunte/public_html/vendor/cakephp/debug_kit/src/Plugin.php, line 123
session_start [internal], line ??
Cake\Http\Session::start() /home/appunte/public_html/vendor/cakephp/cakephp/src/Http/Session.php, line 355
Cake\Http\Session::write() /home/appunte/public_html/vendor/cakephp/cakephp/src/Http/Session.php, line 501
Cake\Http\FlashMessage::set() /home/appunte/public_html/vendor/cakephp/cakephp/src/Http/FlashMessage.php, line 122
Cake\Controller\Component\FlashComponent::set() /home/appunte/public_html/vendor/cakephp/cakephp/src/Controller/Component/FlashComponent.php, line 76
Cake\Controller\Component\AuthComponent::flash() /home/appunte/public_html/vendor/cakephp/cakephp/src/Controller/Component/AuthComponent.php, line 955
Cake\Controller\Component\AuthComponent::_unauthenticated() /home/appunte/public_html/vendor/cakephp/cakephp/src/Controller/Component/AuthComponent.php, line 363
Cake\Controller\Component\AuthComponent::authCheck() /home/appunte/public_html/vendor/cakephp/cakephp/src/Controller/Component/AuthComponent.php, line 287
Cake\Controller\Component\AuthComponent::startup() /home/appunte/public_html/vendor/cakephp/cakephp/src/Controller/Component/AuthComponent.php, line 247
Cake\Event\EventManager::_callListener() /home/appunte/public_html/vendor/cakephp/cakephp/src/Event/EventManager.php, line 317
Cake\Event\EventManager::dispatch() /home/appunte/public_html/vendor/cakephp/cakephp/src/Event/EventManager.php, line 294
Cake\Controller\Controller::dispatchEvent() /home/appunte/public_html/vendor/cakephp/cakephp/src/Event/EventDispatcherTrait.php, line 92
Cake\Controller\Controller::startupProcess() /home/appunte/public_html/vendor/cakephp/cakephp/src/Controller/Controller.php, line 648
Cake\Controller\ControllerFactory::handle() /home/appunte/public_html/vendor/cakephp/cakephp/src/Controller/ControllerFactory.php, line 129
Cake\Controller\ControllerFactory::invoke() /home/appunte/public_html/vendor/cakephp/cakephp/src/Controller/ControllerFactory.php, line 114
Cake\Http\BaseApplication::handle() /home/appunte/public_html/vendor/cakephp/cakephp/src/Http/BaseApplication.php, line 320
Cake\Http\Runner::handle() /home/appunte/public_html/vendor/cakephp/cakephp/src/Http/Runner.php, line 77
Cake\Http\Middleware\BodyParserMiddleware::process() /home/appunte/public_html/vendor/cakephp/cakephp/src/Http/Middleware/BodyParserMiddleware.php, line 157
Cake\Http\Runner::handle() /home/appunte/public_html/vendor/cakephp/cakephp/src/Http/Runner.php, line 73
Cake\Routing\Middleware\RoutingMiddleware::process() /home/appunte/public_html/vendor/cakephp/cakephp/src/Routing/Middleware/RoutingMiddleware.php, line 186
Cake\Http\Runner::handle() /home/appunte/public_html/vendor/cakephp/cakephp/src/Http/Runner.php, line 73
Cake\Routing\Middleware\AssetMiddleware::process() /home/appunte/public_html/vendor/cakephp/cakephp/src/Routing/Middleware/AssetMiddleware.php, line 68
Cake\Http\Runner::handle() /home/appunte/public_html/vendor/cakephp/cakephp/src/Http/Runner.php, line 73
Cake\Error\Middleware\ErrorHandlerMiddleware::process() /home/appunte/public_html/vendor/cakephp/cakephp/src/Error/Middleware/ErrorHandlerMiddleware.php, line 131
Cake\Http\Runner::handle() /home/appunte/public_html/vendor/cakephp/cakephp/src/Http/Runner.php, line 73
DebugKit\Middleware\DebugKitMiddleware::process() /home/appunte/public_html/vendor/cakephp/debug_kit/src/Middleware/DebugKitMiddleware.php, line 60
Cake\Http\Runner::handle() /home/appunte/public_html/vendor/cakephp/cakephp/src/Http/Runner.php, line 73
Cake\Http\Runner::run() /home/appunte/public_html/vendor/cakephp/cakephp/src/Http/Runner.php, line 58
Cake\Http\Server::run() /home/appunte/public_html/vendor/cakephp/cakephp/src/Http/Server.php, line 90
[main] /home/appunte/public_html/webroot/index.php, line 40
$message = "Unable to emit headers. Headers sent in file=$file line=$line";trigger_error($message, E_USER_WARNING);}
DebugKit\Plugin::DebugKit\{closure}() /home/appunte/public_html/vendor/cakephp/debug_kit/src/Plugin.php, line 123
Cake\Http\ResponseEmitter::emit() /home/appunte/public_html/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php, line 71
Cake\Http\Server::emit() /home/appunte/public_html/vendor/cakephp/cakephp/src/Http/Server.php, line 128
[main] /home/appunte/public_html/webroot/index.php, line 40
$response->getStatusCode(),($reasonPhrase ? ' ' . $reasonPhrase : '')));
DebugKit\Plugin::DebugKit\{closure}() /home/appunte/public_html/vendor/cakephp/debug_kit/src/Plugin.php, line 123
header [internal], line ??
Cake\Http\ResponseEmitter::emitStatusLine() /home/appunte/public_html/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php, line 168
Cake\Http\ResponseEmitter::emit() /home/appunte/public_html/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php, line 74
Cake\Http\Server::emit() /home/appunte/public_html/vendor/cakephp/cakephp/src/Http/Server.php, line 128
[main] /home/appunte/public_html/webroot/index.php, line 40
foreach ($values as $value) {header(sprintf('%s: %s',
DebugKit\Plugin::DebugKit\{closure}() /home/appunte/public_html/vendor/cakephp/debug_kit/src/Plugin.php, line 123
header [internal], line ??
Cake\Http\ResponseEmitter::emitHeaders() /home/appunte/public_html/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php, line 197
Cake\Http\ResponseEmitter::emit() /home/appunte/public_html/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php, line 75
Cake\Http\Server::emit() /home/appunte/public_html/vendor/cakephp/cakephp/src/Http/Server.php, line 128
[main] /home/appunte/public_html/webroot/index.php, line 40
return false; |
|
} |
|
|
|
if (!session_start()) { |
|
throw new RuntimeException('Could not start the session'); |
|
} |
|
|
|
$this->_started = true; |
|
|
*/ |
|
public function write($name, $value = null): void |
|
{ |
|
if (!$this->started()) { |
|
$this->start(); |
|
} |
|
|
|
if (!is_array($name)) { |
|
$name = [$name => $value]; |
'element' => $options['element'], |
|
'params' => $options['params'], |
|
]; |
|
|
|
$this->session->write('Flash.' . $options['key'], $messages); |
|
} |
|
|
|
/** |
|
* Set an exception's message as flash message. |
{ |
|
if ($message instanceof Throwable) { |
|
$this->flash()->setExceptionMessage($message, $options); |
|
} else { |
|
$this->flash()->set($message, $options); |
|
} |
|
} |
|
|
|
/** |
if ($message === false) { |
|
return; |
|
} |
|
|
|
$this->Flash->set($message, $this->_config['flash']); |
|
} |
|
|
|
/** |
|
* If login was called during this request and the user was successfully |
return $result instanceof Response ? $result : null; |
|
} |
|
|
|
if (!$controller->getRequest()->is('ajax')) { |
|
$this->flash($this->_config['authError']); |
|
|
|
return $controller->redirect($this->_loginActionRedirectUrl()); |
|
} |
|
|
if (!$this->_getUser()) { |
|
if ($isLoginAction) { |
|
return null; |
|
} |
|
$result = $this->_unauthenticated($controller); |
|
if ($result instanceof Response) { |
|
$event->stopPropagation(); |
|
} |
|
|
* @return \Cake\Http\Response|null |
|
*/ |
|
public function startup(EventInterface $event): ?Response |
|
{ |
|
return $this->authCheck($event); |
|
} |
|
|
|
/** |
|
* Main execution method, handles initial authentication check and redirection |
protected function _callListener(callable $listener, EventInterface $event) |
|
{ |
|
$data = (array)$event->getData(); |
|
|
|
return $listener($event, ...array_values($data)); |
|
} |
|
|
|
/** |
|
* @inheritDoc |
foreach ($listeners as $listener) { |
|
if ($event->isStopped()) { |
|
break; |
|
} |
|
$result = $this->_callListener($listener['callable'], $event); |
|
if ($result === false) { |
|
$event->stopPropagation(); |
|
} |
|
if ($result !== null) { |
} |
|
|
|
/** @var \Cake\Event\EventInterface $event */ |
|
$event = new $this->_eventClass($name, $subject, $data); |
|
$this->getEventManager()->dispatch($event); |
|
|
|
return $event; |
|
} |
|
} |
$event = $this->dispatchEvent('Controller.initialize'); |
|
if ($event->getResult() instanceof ResponseInterface) { |
|
return $event->getResult(); |
|
} |
|
$event = $this->dispatchEvent('Controller.startup'); |
|
if ($event->getResult() instanceof ResponseInterface) { |
|
return $event->getResult(); |
|
} |
|
|
$controller = $this->controller; |
|
/** @psalm-suppress ArgumentTypeCoercion */ |
|
$controller->setRequest($request); |
|
|
|
$result = $controller->startupProcess(); |
|
if ($result instanceof ResponseInterface) { |
|
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); |
|
} |
|
|
|
$response = new Response([ |
|
'body' => 'Middleware queue was exhausted without returning a response ' |
*/ |
|
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); |
|
} |
|
|
|
$middleware = new MiddlewareQueue($matching); |
|
$runner = new Runner(); |
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 |
|
{ |
|
$url = $request->getUri()->getPath(); |
|
if (strpos($url, '..') !== false || strpos($url, '.') === false) { |
|
return $handler->handle($request); |
|
} |
|
|
|
if (strpos($url, '/.') !== false) { |
|
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); |
*/ |
|
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()); |
|
|
If you want to customize this error message, create templates/Error/error500.php