$this->_init = false;trigger_error(sprintf('%s is not writable',
/var/www/html/vendor/cakephp/cakephp/src/Cache/Engine/FileEngine.php /var/www/html/vendor/cakephp/cakephp/src/Cache/Engine/FileEngine.php, line 430
Cake\Cache\Engine\FileEngine->_active() /var/www/html/vendor/cakephp/cakephp/src/Cache/Engine/FileEngine.php, line 102
Cake\Cache\Engine\FileEngine->init() /var/www/html/vendor/cakephp/cakephp/src/Cache/CacheRegistry.php, line 88
Cake\Cache\CacheRegistry->_create() /var/www/html/vendor/cakephp/cakephp/src/Core/ObjectRegistry.php, line 111
Cake\Core\ObjectRegistry->load() /var/www/html/vendor/cakephp/cakephp/src/Cache/Cache.php, line 160
Cake\Cache\Cache::_buildEngine() /var/www/html/vendor/cakephp/cakephp/src/Cache/Cache.php, line 235
Cake\Cache\Cache::pool() /var/www/html/vendor/cakephp/cakephp/src/Cache/Cache.php, line 333
Cake\Cache\Cache::read() /var/www/html/vendor/cakephp/cakephp/src/Cache/Cache.php, line 587
Cake\Cache\Cache::remember() /var/www/html/vendor/cakephp/cakephp/src/Routing/Middleware/RoutingMiddleware.php, line 110
Cake\Routing\Middleware\RoutingMiddleware->buildRouteCollection() /var/www/html/vendor/cakephp/cakephp/src/Routing/Middleware/RoutingMiddleware.php, line 97
Cake\Routing\Middleware\RoutingMiddleware->loadRoutes() /var/www/html/vendor/cakephp/cakephp/src/Routing/Middleware/RoutingMiddleware.php, line 157
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 68
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 149
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/cakephp/src/Http/Middleware/DoublePassDecoratorMiddleware.php, line 83
Cake\Http\Middleware\DoublePassDecoratorMiddleware->Cake\Http\Middleware\{closure}() /var/www/html/src/Routing/Middleware/CustomHeadersMiddleware.php, line 106
App\Routing\Middleware\CustomHeadersMiddleware->__invoke() /var/www/html/vendor/cakephp/cakephp/src/Http/Middleware/DoublePassDecoratorMiddleware.php, line 79
Cake\Http\Middleware\DoublePassDecoratorMiddleware->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/SecurityHeadersMiddleware.php, line 255
Cake\Http\Middleware\SecurityHeadersMiddleware->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 67
Cake\Http\Runner->run() /var/www/html/vendor/cakephp/cakephp/src/Http/Server.php, line 99
Cake\Http\Server->run() /var/www/html/webroot/index.php, line 40
[main]
if (!$mask) {file_put_contents($pathname, $message . "\n", FILE_APPEND);
/var/www/html/vendor/cakephp/cakephp/src/Log/Engine/FileLog.php /var/www/html/vendor/cakephp/cakephp/src/Log/Engine/FileLog.php, line 142
Cake\Log\Engine\FileLog->log() /var/www/html/vendor/cakephp/cakephp/src/Log/Log.php, line 392
Cake\Log\Log::write() /var/www/html/vendor/cakephp/cakephp/src/Log/Log.php, line 461
Cake\Log\Log::error() /var/www/html/vendor/cakephp/cakephp/src/Error/ErrorLogger.php, line 99
Cake\Error\ErrorLogger->logException() /var/www/html/vendor/cakephp/cakephp/src/Error/ExceptionTrap.php, line 367
Cake\Error\ExceptionTrap->logException() /var/www/html/vendor/cakephp/cakephp/src/Error/Middleware/ErrorHandlerMiddleware.php, line 171
Cake\Error\Middleware\ErrorHandlerMiddleware->handleException() /var/www/html/vendor/cakephp/cakephp/src/Error/Middleware/ErrorHandlerMiddleware.php, line 153
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/cakephp/src/Http/Middleware/DoublePassDecoratorMiddleware.php, line 83
Cake\Http\Middleware\DoublePassDecoratorMiddleware->Cake\Http\Middleware\{closure}() /var/www/html/src/Routing/Middleware/CustomHeadersMiddleware.php, line 106
App\Routing\Middleware\CustomHeadersMiddleware->__invoke() /var/www/html/vendor/cakephp/cakephp/src/Http/Middleware/DoublePassDecoratorMiddleware.php, line 79
Cake\Http\Middleware\DoublePassDecoratorMiddleware->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/SecurityHeadersMiddleware.php, line 255
Cake\Http\Middleware\SecurityHeadersMiddleware->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 67
Cake\Http\Runner->run() /var/www/html/vendor/cakephp/cakephp/src/Http/Server.php, line 99
Cake\Http\Server->run() /var/www/html/webroot/index.php, line 40
[main]
$message = "Unable to emit headers. Headers sent in file=$file line=$line";trigger_error($message, E_USER_WARNING);}
/var/www/html/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php /var/www/html/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php, line 71 Cake\Http\ResponseEmitter->emit() /var/www/html/vendor/cakephp/cakephp/src/Http/Server.php, line 137 Cake\Http\Server->emit() /var/www/html/webroot/index.php, line 40 [main]
$reasonPhrase = $response->getReasonPhrase();header(sprintf('HTTP/%s %d%s',
/var/www/html/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php /var/www/html/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php, line 164 Cake\Http\ResponseEmitter->emitStatusLine() /var/www/html/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php, line 74 Cake\Http\ResponseEmitter->emit() /var/www/html/vendor/cakephp/cakephp/src/Http/Server.php, line 137 Cake\Http\Server->emit() /var/www/html/webroot/index.php, line 40 [main]
foreach ($values as $value) {header(sprintf('%s: %s',
/var/www/html/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php /var/www/html/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php, line 197 Cake\Http\ResponseEmitter->emitHeaders() /var/www/html/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php, line 75 Cake\Http\ResponseEmitter->emit() /var/www/html/vendor/cakephp/cakephp/src/Http/Server.php, line 137 Cake\Http\Server->emit() /var/www/html/webroot/index.php, line 40 [main]
foreach ($values as $value) {header(sprintf('%s: %s',
/var/www/html/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php /var/www/html/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php, line 197 Cake\Http\ResponseEmitter->emitHeaders() /var/www/html/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php, line 75 Cake\Http\ResponseEmitter->emit() /var/www/html/vendor/cakephp/cakephp/src/Http/Server.php, line 137 Cake\Http\Server->emit() /var/www/html/webroot/index.php, line 40 [main]
foreach ($values as $value) {header(sprintf('%s: %s',
/var/www/html/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php /var/www/html/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php, line 197 Cake\Http\ResponseEmitter->emitHeaders() /var/www/html/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php, line 75 Cake\Http\ResponseEmitter->emit() /var/www/html/vendor/cakephp/cakephp/src/Http/Server.php, line 137 Cake\Http\Server->emit() /var/www/html/webroot/index.php, line 40 [main]
foreach ($values as $value) {header(sprintf('%s: %s',
/var/www/html/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php /var/www/html/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php, line 197 Cake\Http\ResponseEmitter->emitHeaders() /var/www/html/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php, line 75 Cake\Http\ResponseEmitter->emit() /var/www/html/vendor/cakephp/cakephp/src/Http/Server.php, line 137 Cake\Http\Server->emit() /var/www/html/webroot/index.php, line 40 [main]
foreach ($values as $value) {header(sprintf('%s: %s',
/var/www/html/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php /var/www/html/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php, line 197 Cake\Http\ResponseEmitter->emitHeaders() /var/www/html/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php, line 75 Cake\Http\ResponseEmitter->emit() /var/www/html/vendor/cakephp/cakephp/src/Http/Server.php, line 137 Cake\Http\Server->emit() /var/www/html/webroot/index.php, line 40 [main]
foreach ($values as $value) {header(sprintf('%s: %s',
/var/www/html/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php /var/www/html/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php, line 197 Cake\Http\ResponseEmitter->emitHeaders() /var/www/html/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php, line 75 Cake\Http\ResponseEmitter->emit() /var/www/html/vendor/cakephp/cakephp/src/Http/Server.php, line 137 Cake\Http\Server->emit() /var/www/html/webroot/index.php, line 40 [main]
foreach ($values as $value) {header(sprintf('%s: %s',
/var/www/html/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php /var/www/html/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php, line 197 Cake\Http\ResponseEmitter->emitHeaders() /var/www/html/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php, line 75 Cake\Http\ResponseEmitter->emit() /var/www/html/vendor/cakephp/cakephp/src/Http/Server.php, line 137 Cake\Http\Server->emit() /var/www/html/webroot/index.php, line 40 [main]
foreach ($values as $value) {header(sprintf('%s: %s',
/var/www/html/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php /var/www/html/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php, line 197 Cake\Http\ResponseEmitter->emitHeaders() /var/www/html/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php, line 75 Cake\Http\ResponseEmitter->emit() /var/www/html/vendor/cakephp/cakephp/src/Http/Server.php, line 137 Cake\Http\Server->emit() /var/www/html/webroot/index.php, line 40 [main]
foreach ($values as $value) {header(sprintf('%s: %s',
/var/www/html/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php /var/www/html/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php, line 197 Cake\Http\ResponseEmitter->emitHeaders() /var/www/html/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php, line 75 Cake\Http\ResponseEmitter->emit() /var/www/html/vendor/cakephp/cakephp/src/Http/Server.php, line 137 Cake\Http\Server->emit() /var/www/html/webroot/index.php, line 40 [main]
}, $this->cacheConfig); |
|
} catch (InvalidArgumentException $e) { |
|
throw $e; |
|
} catch (Exception $e) { |
|
throw new FailedRouteCacheException( |
|
'Unable to cache route collection. Cached routes must be serializable. Check for route-specific |
|
middleware or other unserializable settings in your routes. The original exception message can |
|
show what type of object failed to serialize.', |
|
null, |
* @return void |
|
*/ |
|
protected function loadRoutes(): void |
|
{ |
|
$routeCollection = $this->buildRouteCollection(); |
|
Router::setRouteCollection($routeCollection); |
|
} |
|
|
|
/** |
* @return \Psr\Http\Message\ResponseInterface A response. |
|
*/ |
|
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface |
|
{ |
|
$this->loadRoutes(); |
|
try { |
|
Router::setRequest($request); |
|
$params = (array)$request->getAttribute('params', []); |
|
$middleware = []; |
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); |
return ($this->callable)( |
|
$request, |
|
new Response(), |
|
function ($request, $res) use ($handler) { |
|
return $handler->handle($request); |
|
} |
|
); |
|
} |
|
|
* @return \Psr\Http\Message\ResponseInterface A response |
|
*/ |
|
public function __invoke(ServerRequestInterface $request, ResponseInterface $response, $next) |
|
{ |
|
$response = $next($request, $response); |
|
foreach ($this->headers as $header => $value) { |
|
$response = $response->withHeader($header, $value); |
|
} |
|
|
* @return \Psr\Http\Message\ResponseInterface |
|
*/ |
|
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface |
|
{ |
|
return ($this->callable)( |
|
$request, |
|
new Response(), |
|
function ($request, $res) use ($handler) { |
|
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); |
* @return \Psr\Http\Message\ResponseInterface A response. |
|
*/ |
|
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface |
|
{ |
|
$response = $handler->handle($request); |
|
foreach ($this->headers as $header => $value) { |
|
$response = $response->withHeader($header, $value); |
|
} |
|
|
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()); |
|
|
|
|
$backend = static::pool($config); |
|
$success = $backend->set($key, $value); |
|
if ($success === false && $value !== '') { |
|
throw new CacheWriteException(sprintf( |
|
"%s cache was unable to write '%s' to %s cache", |
|
$config, |
|
$key, |
|
get_class($backend) |
if ($existing !== null) { |
|
return $existing; |
|
} |
|
$results = $callable(); |
|
self::write($key, $results, $config); |
|
|
|
return $results; |
|
} |
|
|
protected function buildRouteCollection(): RouteCollection |
|
{ |
|
if (Cache::enabled() && $this->cacheConfig !== null) { |
|
try { |
|
return Cache::remember(static::ROUTE_COLLECTION_CACHE_KEY, function () { |
|
return $this->prepareRouteCollection(); |
|
}, $this->cacheConfig); |
|
} catch (InvalidArgumentException $e) { |
|
throw $e; |
If you want to customize this error message, create templates/Error/error500.ctp