if (!session_start()) {throw new CakeException('Could not start the session');
Cake\Error\ErrorTrap->handleError() [internal], line ?? /var/www/html/vendor/cakephp/cakephp/src/Http/Session.php /var/www/html/vendor/cakephp/cakephp/src/Http/Session.php, line 367 Cake\Http\Session->start() /var/www/html/vendor/cakephp/cakephp/src/Http/Session.php, line 512 Cake\Http\Session->write() /var/www/html/src/Middleware/LocaleMiddleware.php, line 29 App\Middleware\LocaleMiddleware->process() /var/www/html/vendor/cakephp/cakephp/src/Http/Runner.php, line 82 Cake\Http\Runner->handle() /var/www/html/vendor/cakephp/authorization/src/Middleware/AuthorizationMiddleware.php, line 136 Authorization\Middleware\AuthorizationMiddleware->process() /var/www/html/vendor/cakephp/cakephp/src/Http/Runner.php, line 82 Cake\Http\Runner->handle() /var/www/html/vendor/cakephp/authentication/src/Middleware/AuthenticationMiddleware.php, line 107 Authentication\Middleware\AuthenticationMiddleware->process() /var/www/html/vendor/cakephp/cakephp/src/Http/Runner.php, line 82 Cake\Http\Runner->handle() /var/www/html/vendor/cakephp/cakephp/src/Http/Middleware/BodyParserMiddleware.php, line 157 Cake\Http\Middleware\BodyParserMiddleware->process() /var/www/html/vendor/cakephp/cakephp/src/Http/Runner.php, line 82 Cake\Http\Runner->handle() /var/www/html/vendor/cakephp/cakephp/src/Routing/Middleware/RoutingMiddleware.php, line 118 Cake\Routing\Middleware\RoutingMiddleware->process() /var/www/html/vendor/cakephp/cakephp/src/Http/Runner.php, line 82 Cake\Http\Runner->handle() /var/www/html/vendor/cakephp/cakephp/src/Routing/Middleware/AssetMiddleware.php, line 69 Cake\Routing\Middleware\AssetMiddleware->process() /var/www/html/vendor/cakephp/cakephp/src/Http/Runner.php, line 82 Cake\Http\Runner->handle() /var/www/html/vendor/cakephp/cakephp/src/Error/Middleware/ErrorHandlerMiddleware.php, line 115 Cake\Error\Middleware\ErrorHandlerMiddleware->process() /var/www/html/vendor/cakephp/cakephp/src/Http/Runner.php, line 82 Cake\Http\Runner->handle() /var/www/html/vendor/cakephp/debug_kit/src/Middleware/DebugKitMiddleware.php, line 60 DebugKit\Middleware\DebugKitMiddleware->process() /var/www/html/vendor/cakephp/cakephp/src/Http/Runner.php, line 82 Cake\Http\Runner->handle() /var/www/html/vendor/cakephp/cakephp/src/Http/Runner.php, line 60 Cake\Http\Runner->run() /var/www/html/vendor/cakephp/cakephp/src/Http/Server.php, line 104 Cake\Http\Server->run() /var/www/html/webroot/index.php, line 37 [main]
if (!session_start()) {throw new CakeException('Could not start the session');
Cake\Error\ErrorTrap->handleError() [internal], line ?? /var/www/html/vendor/cakephp/cakephp/src/Http/Session.php /var/www/html/vendor/cakephp/cakephp/src/Http/Session.php, line 367 Cake\Http\Session->start() /var/www/html/vendor/cakephp/cakephp/src/Http/Session.php, line 512 Cake\Http\Session->write() /var/www/html/src/Middleware/LocaleMiddleware.php, line 29 App\Middleware\LocaleMiddleware->process() /var/www/html/vendor/cakephp/cakephp/src/Http/Runner.php, line 82 Cake\Http\Runner->handle() /var/www/html/vendor/cakephp/authorization/src/Middleware/AuthorizationMiddleware.php, line 136 Authorization\Middleware\AuthorizationMiddleware->process() /var/www/html/vendor/cakephp/cakephp/src/Http/Runner.php, line 82 Cake\Http\Runner->handle() /var/www/html/vendor/cakephp/authentication/src/Middleware/AuthenticationMiddleware.php, line 107 Authentication\Middleware\AuthenticationMiddleware->process() /var/www/html/vendor/cakephp/cakephp/src/Http/Runner.php, line 82 Cake\Http\Runner->handle() /var/www/html/vendor/cakephp/cakephp/src/Http/Middleware/BodyParserMiddleware.php, line 157 Cake\Http\Middleware\BodyParserMiddleware->process() /var/www/html/vendor/cakephp/cakephp/src/Http/Runner.php, line 82 Cake\Http\Runner->handle() /var/www/html/vendor/cakephp/cakephp/src/Routing/Middleware/RoutingMiddleware.php, line 118 Cake\Routing\Middleware\RoutingMiddleware->process() /var/www/html/vendor/cakephp/cakephp/src/Http/Runner.php, line 82 Cake\Http\Runner->handle() /var/www/html/vendor/cakephp/cakephp/src/Routing/Middleware/AssetMiddleware.php, line 69 Cake\Routing\Middleware\AssetMiddleware->process() /var/www/html/vendor/cakephp/cakephp/src/Http/Runner.php, line 82 Cake\Http\Runner->handle() /var/www/html/vendor/cakephp/cakephp/src/Error/Middleware/ErrorHandlerMiddleware.php, line 115 Cake\Error\Middleware\ErrorHandlerMiddleware->process() /var/www/html/vendor/cakephp/cakephp/src/Http/Runner.php, line 82 Cake\Http\Runner->handle() /var/www/html/vendor/cakephp/debug_kit/src/Middleware/DebugKitMiddleware.php, line 60 DebugKit\Middleware\DebugKitMiddleware->process() /var/www/html/vendor/cakephp/cakephp/src/Http/Runner.php, line 82 Cake\Http\Runner->handle() /var/www/html/vendor/cakephp/cakephp/src/Http/Runner.php, line 60 Cake\Http\Runner->run() /var/www/html/vendor/cakephp/cakephp/src/Http/Server.php, line 104 Cake\Http\Server->run() /var/www/html/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 ?? /var/www/html/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php /var/www/html/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php, line 65 Cake\Http\ResponseEmitter->emit() /var/www/html/vendor/cakephp/cakephp/src/Http/Server.php, line 148 Cake\Http\Server->emit() /var/www/html/webroot/index.php, line 37 [main]
$reasonPhrase = $response->getReasonPhrase();header(sprintf('HTTP/%s %d%s',
Cake\Error\ErrorTrap->handleError() [internal], line ?? /var/www/html/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php /var/www/html/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php, line 159 Cake\Http\ResponseEmitter->emitStatusLine() /var/www/html/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php, line 68 Cake\Http\ResponseEmitter->emit() /var/www/html/vendor/cakephp/cakephp/src/Http/Server.php, line 148 Cake\Http\Server->emit() /var/www/html/webroot/index.php, line 37 [main]
foreach ($values as $value) {header(sprintf('%s: %s',
Cake\Error\ErrorTrap->handleError() [internal], line ?? /var/www/html/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php /var/www/html/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php, line 192 Cake\Http\ResponseEmitter->emitHeaders() /var/www/html/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php, line 69 Cake\Http\ResponseEmitter->emit() /var/www/html/vendor/cakephp/cakephp/src/Http/Server.php, line 148 Cake\Http\Server->emit() /var/www/html/webroot/index.php, line 37 [main]
return false; |
|
} |
|
|
|
if (!session_start()) { |
|
throw new CakeException('Could not start the session'); |
|
} |
|
|
|
$this->_started = true; |
|
|
* @return void |
|
*/ |
|
public function write(array|string $name, mixed $value = null): void |
|
{ |
|
$started = $this->started() || $this->start(); |
|
if (!$started) { |
|
$message = 'Could not start the session'; |
|
if ($this->headerSentInfo !== null) { |
|
$message .= sprintf( |
// Configurar idioma |
|
I18n::setLocale($language); |
|
|
|
// Persistir en la sesión |
|
$session->write('Config.language', $language); |
|
|
|
// Continuar con la solicitud |
|
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); |
*/ |
|
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 (str_contains($url, '..') || !str_contains($url, '.')) { |
|
return $handler->handle($request); |
|
} |
|
|
|
if (str_contains($url, '/.')) { |
|
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, 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); |
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