if (!session_start()) {throw new RuntimeException('Could not start the session');
/home/exas-newdev/htdocs/newdev.exas.gr/vendor/cakephp/cakephp/src/Http/Session.php /home/exas-newdev/htdocs/newdev.exas.gr/vendor/cakephp/cakephp/src/Http/Session.php, line 362 Cake\Http\Session->start() /home/exas-newdev/htdocs/newdev.exas.gr/plugins/Frontend/src/Controller/AppController.php, line 114 Frontend\Controller\AppController->_startSession() /home/exas-newdev/htdocs/newdev.exas.gr/plugins/Frontend/src/Controller/AppController.php, line 33 Frontend\Controller\AppController->initialize() /home/exas-newdev/htdocs/newdev.exas.gr/plugins/Frontend/src/Controller/SiteController.php, line 248 Frontend\Controller\SiteController->initialize() /home/exas-newdev/htdocs/newdev.exas.gr/vendor/cakephp/cakephp/src/Controller/Controller.php, line 242 Cake\Controller\Controller->__construct() [internal], line ?? ReflectionClass->newInstance() /home/exas-newdev/htdocs/newdev.exas.gr/vendor/cakephp/cakephp/src/Controller/ControllerFactory.php, line 88 Cake\Controller\ControllerFactory->create() /home/exas-newdev/htdocs/newdev.exas.gr/vendor/cakephp/cakephp/src/Http/BaseApplication.php, line 320 Cake\Http\BaseApplication->handle() /home/exas-newdev/htdocs/newdev.exas.gr/vendor/cakephp/cakephp/src/Http/Runner.php, line 86 Cake\Http\Runner->handle() /home/exas-newdev/htdocs/newdev.exas.gr/vendor/cakephp/cakephp/src/Http/Middleware/CsrfProtectionMiddleware.php, line 166 Cake\Http\Middleware\CsrfProtectionMiddleware->process() /home/exas-newdev/htdocs/newdev.exas.gr/vendor/cakephp/cakephp/src/Http/Runner.php, line 82 Cake\Http\Runner->handle() /home/exas-newdev/htdocs/newdev.exas.gr/vendor/cakephp/authentication/src/Middleware/AuthenticationMiddleware.php, line 145 Authentication\Middleware\AuthenticationMiddleware->process() /home/exas-newdev/htdocs/newdev.exas.gr/vendor/cakephp/cakephp/src/Http/Runner.php, line 82 Cake\Http\Runner->handle() /home/exas-newdev/htdocs/newdev.exas.gr/vendor/cakephp/cakephp/src/Http/Middleware/BodyParserMiddleware.php, line 157 Cake\Http\Middleware\BodyParserMiddleware->process() /home/exas-newdev/htdocs/newdev.exas.gr/vendor/cakephp/cakephp/src/Http/Runner.php, line 82 Cake\Http\Runner->handle() /home/exas-newdev/htdocs/newdev.exas.gr/vendor/cakephp/cakephp/src/Routing/Middleware/RoutingMiddleware.php, line 189 Cake\Routing\Middleware\RoutingMiddleware->process() /home/exas-newdev/htdocs/newdev.exas.gr/vendor/cakephp/cakephp/src/Http/Runner.php, line 82 Cake\Http\Runner->handle() /home/exas-newdev/htdocs/newdev.exas.gr/vendor/cakephp/cakephp/src/Routing/Middleware/AssetMiddleware.php, line 68 Cake\Routing\Middleware\AssetMiddleware->process() /home/exas-newdev/htdocs/newdev.exas.gr/vendor/cakephp/cakephp/src/Http/Runner.php, line 82 Cake\Http\Runner->handle() /home/exas-newdev/htdocs/newdev.exas.gr/vendor/cakephp/cakephp/src/Error/Middleware/ErrorHandlerMiddleware.php, line 149 Cake\Error\Middleware\ErrorHandlerMiddleware->process() /home/exas-newdev/htdocs/newdev.exas.gr/vendor/cakephp/cakephp/src/Http/Runner.php, line 82 Cake\Http\Runner->handle() /home/exas-newdev/htdocs/newdev.exas.gr/vendor/cakephp/debug_kit/src/Middleware/DebugKitMiddleware.php, line 60 DebugKit\Middleware\DebugKitMiddleware->process() /home/exas-newdev/htdocs/newdev.exas.gr/vendor/cakephp/cakephp/src/Http/Runner.php, line 82 Cake\Http\Runner->handle() /home/exas-newdev/htdocs/newdev.exas.gr/vendor/cakephp/cakephp/src/Http/Runner.php, line 67 Cake\Http\Runner->run() /home/exas-newdev/htdocs/newdev.exas.gr/vendor/cakephp/cakephp/src/Http/Server.php, line 99 Cake\Http\Server->run() /home/exas-newdev/htdocs/newdev.exas.gr/webroot/index.php, line 40 [main]
if (!session_start()) {throw new RuntimeException('Could not start the session');
/home/exas-newdev/htdocs/newdev.exas.gr/vendor/cakephp/cakephp/src/Http/Session.php /home/exas-newdev/htdocs/newdev.exas.gr/vendor/cakephp/cakephp/src/Http/Session.php, line 362 Cake\Http\Session->start() /home/exas-newdev/htdocs/newdev.exas.gr/plugins/Frontend/src/Controller/AppController.php, line 114 Frontend\Controller\AppController->_startSession() /home/exas-newdev/htdocs/newdev.exas.gr/plugins/Frontend/src/Controller/AppController.php, line 33 Frontend\Controller\AppController->initialize() /home/exas-newdev/htdocs/newdev.exas.gr/plugins/Frontend/src/Controller/SiteController.php, line 248 Frontend\Controller\SiteController->initialize() /home/exas-newdev/htdocs/newdev.exas.gr/vendor/cakephp/cakephp/src/Controller/Controller.php, line 242 Cake\Controller\Controller->__construct() [internal], line ?? ReflectionClass->newInstance() /home/exas-newdev/htdocs/newdev.exas.gr/vendor/cakephp/cakephp/src/Controller/ControllerFactory.php, line 88 Cake\Controller\ControllerFactory->create() /home/exas-newdev/htdocs/newdev.exas.gr/vendor/cakephp/cakephp/src/Http/BaseApplication.php, line 320 Cake\Http\BaseApplication->handle() /home/exas-newdev/htdocs/newdev.exas.gr/vendor/cakephp/cakephp/src/Http/Runner.php, line 86 Cake\Http\Runner->handle() /home/exas-newdev/htdocs/newdev.exas.gr/vendor/cakephp/cakephp/src/Http/Middleware/CsrfProtectionMiddleware.php, line 166 Cake\Http\Middleware\CsrfProtectionMiddleware->process() /home/exas-newdev/htdocs/newdev.exas.gr/vendor/cakephp/cakephp/src/Http/Runner.php, line 82 Cake\Http\Runner->handle() /home/exas-newdev/htdocs/newdev.exas.gr/vendor/cakephp/authentication/src/Middleware/AuthenticationMiddleware.php, line 145 Authentication\Middleware\AuthenticationMiddleware->process() /home/exas-newdev/htdocs/newdev.exas.gr/vendor/cakephp/cakephp/src/Http/Runner.php, line 82 Cake\Http\Runner->handle() /home/exas-newdev/htdocs/newdev.exas.gr/vendor/cakephp/cakephp/src/Http/Middleware/BodyParserMiddleware.php, line 157 Cake\Http\Middleware\BodyParserMiddleware->process() /home/exas-newdev/htdocs/newdev.exas.gr/vendor/cakephp/cakephp/src/Http/Runner.php, line 82 Cake\Http\Runner->handle() /home/exas-newdev/htdocs/newdev.exas.gr/vendor/cakephp/cakephp/src/Routing/Middleware/RoutingMiddleware.php, line 189 Cake\Routing\Middleware\RoutingMiddleware->process() /home/exas-newdev/htdocs/newdev.exas.gr/vendor/cakephp/cakephp/src/Http/Runner.php, line 82 Cake\Http\Runner->handle() /home/exas-newdev/htdocs/newdev.exas.gr/vendor/cakephp/cakephp/src/Routing/Middleware/AssetMiddleware.php, line 68 Cake\Routing\Middleware\AssetMiddleware->process() /home/exas-newdev/htdocs/newdev.exas.gr/vendor/cakephp/cakephp/src/Http/Runner.php, line 82 Cake\Http\Runner->handle() /home/exas-newdev/htdocs/newdev.exas.gr/vendor/cakephp/cakephp/src/Error/Middleware/ErrorHandlerMiddleware.php, line 149 Cake\Error\Middleware\ErrorHandlerMiddleware->process() /home/exas-newdev/htdocs/newdev.exas.gr/vendor/cakephp/cakephp/src/Http/Runner.php, line 82 Cake\Http\Runner->handle() /home/exas-newdev/htdocs/newdev.exas.gr/vendor/cakephp/debug_kit/src/Middleware/DebugKitMiddleware.php, line 60 DebugKit\Middleware\DebugKitMiddleware->process() /home/exas-newdev/htdocs/newdev.exas.gr/vendor/cakephp/cakephp/src/Http/Runner.php, line 82 Cake\Http\Runner->handle() /home/exas-newdev/htdocs/newdev.exas.gr/vendor/cakephp/cakephp/src/Http/Runner.php, line 67 Cake\Http\Runner->run() /home/exas-newdev/htdocs/newdev.exas.gr/vendor/cakephp/cakephp/src/Http/Server.php, line 99 Cake\Http\Server->run() /home/exas-newdev/htdocs/newdev.exas.gr/webroot/index.php, line 40 [main]
$message = "Unable to emit headers. Headers sent in file=$file line=$line";trigger_error($message, E_USER_WARNING);}
/home/exas-newdev/htdocs/newdev.exas.gr/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php /home/exas-newdev/htdocs/newdev.exas.gr/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php, line 71 Cake\Http\ResponseEmitter->emit() /home/exas-newdev/htdocs/newdev.exas.gr/vendor/cakephp/cakephp/src/Http/Server.php, line 137 Cake\Http\Server->emit() /home/exas-newdev/htdocs/newdev.exas.gr/webroot/index.php, line 40 [main]
$reasonPhrase = $response->getReasonPhrase();header(sprintf('HTTP/%s %d%s',
/home/exas-newdev/htdocs/newdev.exas.gr/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php /home/exas-newdev/htdocs/newdev.exas.gr/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php, line 164 Cake\Http\ResponseEmitter->emitStatusLine() /home/exas-newdev/htdocs/newdev.exas.gr/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php, line 74 Cake\Http\ResponseEmitter->emit() /home/exas-newdev/htdocs/newdev.exas.gr/vendor/cakephp/cakephp/src/Http/Server.php, line 137 Cake\Http\Server->emit() /home/exas-newdev/htdocs/newdev.exas.gr/webroot/index.php, line 40 [main]
foreach ($values as $value) {header(sprintf('%s: %s',
/home/exas-newdev/htdocs/newdev.exas.gr/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php /home/exas-newdev/htdocs/newdev.exas.gr/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php, line 197 Cake\Http\ResponseEmitter->emitHeaders() /home/exas-newdev/htdocs/newdev.exas.gr/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php, line 75 Cake\Http\ResponseEmitter->emit() /home/exas-newdev/htdocs/newdev.exas.gr/vendor/cakephp/cakephp/src/Http/Server.php, line 137 Cake\Http\Server->emit() /home/exas-newdev/htdocs/newdev.exas.gr/webroot/index.php, line 40 [main]
foreach ($values as $value) {header(sprintf('%s: %s',
/home/exas-newdev/htdocs/newdev.exas.gr/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php /home/exas-newdev/htdocs/newdev.exas.gr/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php, line 197 Cake\Http\ResponseEmitter->emitHeaders() /home/exas-newdev/htdocs/newdev.exas.gr/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php, line 75 Cake\Http\ResponseEmitter->emit() /home/exas-newdev/htdocs/newdev.exas.gr/vendor/cakephp/cakephp/src/Http/Server.php, line 137 Cake\Http\Server->emit() /home/exas-newdev/htdocs/newdev.exas.gr/webroot/index.php, line 40 [main]
return false; |
|
} |
|
|
|
if (!session_start()) { |
|
throw new RuntimeException('Could not start the session'); |
|
} |
|
|
|
$this->_started = true; |
|
|
|
|
protected function _startSession() |
|
{ |
|
if (!$this->request->getSession()->started()) { |
|
$this->request->getSession()->start(); |
|
} |
|
} |
|
|
|
protected function _setLocaleCookie() |
public function initialize(): void |
|
{ |
|
parent::initialize(); |
|
|
|
$this->_startSession(); |
|
|
|
$this->loadComponent('RequestHandler'); |
|
|
|
// for XML (e.g. sitemap) dont do anything |
} |
|
|
|
public function initialize(): void |
|
{ |
|
parent::initialize(); |
|
|
|
$this->_defaultAgent = Configure::read('centralAgent'); |
|
$this->_locales = new Locales(); |
|
$languageCookie = strtoupper($this->request->getCookie('cmslang', 'en')); |
if ($components !== null) { |
|
$this->components($components); |
|
} |
|
|
|
$this->initialize(); |
|
|
|
if (isset($this->components)) { |
|
triggerWarning( |
|
'Support for loading components using $components property is removed. ' . |
// The request is in the container by default. |
|
if ($this->container->has($className)) { |
|
$controller = $this->container->get($className); |
|
} else { |
|
$controller = $reflection->newInstance($request); |
|
} |
|
|
|
return $controller; |
|
} |
if (Router::getRequest() !== $request) { |
|
Router::setRequest($request); |
|
} |
|
|
|
$controller = $this->controllerFactory->create($request); |
|
|
|
// This is needed for auto-wiring. Should be removed in 5.x |
|
$container->add(ComponentRegistry::class, $controller->components()); |
|
|
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 ' |
if ($method === 'GET' && $cookieData === null) { |
|
$token = $this->createToken(); |
|
$request = $request->withAttribute('csrfToken', $this->saltToken($token)); |
|
/** @var mixed $response */ |
|
$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); |
$request = $request->withAttribute('authentication', $service); |
|
$request = $request->withAttribute('authenticationResult', $result); |
|
|
|
try { |
|
$response = $handler->handle($request); |
|
$authenticator = $service->getAuthenticationProvider(); |
|
|
|
if ($authenticator !== null && !$authenticator instanceof StatelessInterface) { |
|
$return = $service->persistIdentity($request, $response, $result->getData()); |
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); |
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); |
) { |
|
Router::setRequest($request); |
|
} |
|
|
|
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