$parts = explode('\\', static::class);
trigger_error(
sprintf(
/cakemodule/vendor/cakephp/cakephp/src/Controller/Controller.php /cakemodule/vendor/cakephp/cakephp/src/Controller/Controller.php, line 311 Cake\Controller\Controller->__get() /cakemodule/src/Controller/Admin/FeaturesController.php, line 37 App\Controller\Admin\FeaturesController->beforeFilter() /cakemodule/vendor/cakephp/cakephp/src/Event/EventManager.php, line 329 Cake\Event\EventManager->_callListener() /cakemodule/vendor/cakephp/cakephp/src/Event/EventManager.php, line 307 Cake\Event\EventManager->dispatch() /cakemodule/vendor/cakephp/cakephp/src/Event/EventDispatcherTrait.php, line 88 Cake\Controller\Controller->dispatchEvent() /cakemodule/vendor/cakephp/cakephp/src/Controller/Controller.php, line 597 Cake\Controller\Controller->startupProcess() /cakemodule/vendor/cakephp/cakephp/src/Controller/ControllerFactory.php, line 129 Cake\Controller\ControllerFactory->handle() /cakemodule/vendor/cakephp/cakephp/src/Controller/ControllerFactory.php, line 114 Cake\Controller\ControllerFactory->invoke() /cakemodule/vendor/cakephp/cakephp/src/Http/BaseApplication.php, line 332 Cake\Http\BaseApplication->handle() /cakemodule/vendor/cakephp/cakephp/src/Http/Runner.php, line 86 Cake\Http\Runner->handle() /cakemodule/vendor/cakephp/cakephp/src/Http/Middleware/CsrfProtectionMiddleware.php, line 159 Cake\Http\Middleware\CsrfProtectionMiddleware->process() /cakemodule/vendor/cakephp/cakephp/src/Http/Runner.php, line 82 Cake\Http\Runner->handle() /cakemodule/vendor/cakephp/authentication/src/Middleware/AuthenticationMiddleware.php, line 87 Authentication\Middleware\AuthenticationMiddleware->process() /cakemodule/vendor/cakephp/cakephp/src/Http/Runner.php, line 82 Cake\Http\Runner->handle() /cakemodule/vendor/cakephp/cakephp/src/Http/Middleware/BodyParserMiddleware.php, line 157 Cake\Http\Middleware\BodyParserMiddleware->process() /cakemodule/vendor/cakephp/cakephp/src/Http/Runner.php, line 82 Cake\Http\Runner->handle() /cakemodule/vendor/cakephp/cakephp/src/Routing/Middleware/RoutingMiddleware.php, line 118 Cake\Routing\Middleware\RoutingMiddleware->process() /cakemodule/vendor/cakephp/cakephp/src/Http/Runner.php, line 82 Cake\Http\Runner->handle() /cakemodule/vendor/cakephp/cakephp/src/Routing/Middleware/AssetMiddleware.php, line 69 Cake\Routing\Middleware\AssetMiddleware->process() /cakemodule/vendor/cakephp/cakephp/src/Http/Runner.php, line 82 Cake\Http\Runner->handle() /cakemodule/vendor/cakephp/cakephp/src/Error/Middleware/ErrorHandlerMiddleware.php, line 115 Cake\Error\Middleware\ErrorHandlerMiddleware->process() /cakemodule/vendor/cakephp/cakephp/src/Http/Runner.php, line 82 Cake\Http\Runner->handle() /cakemodule/vendor/cakephp/debug_kit/src/Middleware/DebugKitMiddleware.php, line 60 DebugKit\Middleware\DebugKitMiddleware->process() /cakemodule/vendor/cakephp/cakephp/src/Http/Runner.php, line 82 Cake\Http\Runner->handle() /cakemodule/vendor/cakephp/cakephp/src/Http/Runner.php, line 67 Cake\Http\Runner->run() /cakemodule/vendor/cakephp/cakephp/src/Http/Server.php, line 103 Cake\Http\Server->run() /cakemodule/webroot/index.php, line 37 [main]
$message = "Unable to emit headers. Headers sent in file=$file line=$line";
trigger_error($message, E_USER_WARNING);
}
/cakemodule/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php /cakemodule/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php, line 65 Cake\Http\ResponseEmitter->emit() /cakemodule/vendor/cakephp/cakephp/src/Http/Server.php, line 139 Cake\Http\Server->emit() /cakemodule/webroot/index.php, line 37 [main]
$reasonPhrase = $response->getReasonPhrase();
header(sprintf(
'HTTP/%s %d%s',
/cakemodule/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php /cakemodule/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php, line 159 Cake\Http\ResponseEmitter->emitStatusLine() /cakemodule/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php, line 68 Cake\Http\ResponseEmitter->emit() /cakemodule/vendor/cakephp/cakephp/src/Http/Server.php, line 139 Cake\Http\Server->emit() /cakemodule/webroot/index.php, line 37 [main]
foreach ($values as $value) {
header(sprintf(
'%s: %s',
/cakemodule/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php /cakemodule/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php, line 192 Cake\Http\ResponseEmitter->emitHeaders() /cakemodule/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php, line 69 Cake\Http\ResponseEmitter->emit() /cakemodule/vendor/cakephp/cakephp/src/Http/Server.php, line 139 Cake\Http\Server->emit() /cakemodule/webroot/index.php, line 37 [main]
foreach ($values as $value) {
header(sprintf(
'%s: %s',
/cakemodule/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php /cakemodule/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php, line 192 Cake\Http\ResponseEmitter->emitHeaders() /cakemodule/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php, line 69 Cake\Http\ResponseEmitter->emit() /cakemodule/vendor/cakephp/cakephp/src/Http/Server.php, line 139 Cake\Http\Server->emit() /cakemodule/webroot/index.php, line 37 [main]
} |
|
public function beforeFilter(\Cake\Event\EventInterface $event) |
|
{ |
|
parent::beforeFilter($event); |
|
$this->FormProtection->setConfig('unlockedActions', ['index']); // 無効にしたいアクション名をセット |
|
$this->Authentication->addUnauthenticatedActions(['index','create']); |
|
} |
|
|
|
|
* @return mixed The result of the $listener function. |
|
*/ |
|
protected function _callListener(callable $listener, EventInterface $event): mixed |
|
{ |
|
return $listener($event, ...array_values($event->getData())); |
|
} |
|
|
|
/** |
|
* @inheritDoc |
foreach ($listeners as $listener) { |
|
if ($event->isStopped()) { |
|
break; |
|
} |
|
$result = $this->_callListener($listener['callable'], $event); |
|
if ($result === false) { |
|
$event->stopPropagation(); |
|
} |
|
if ($result !== null) { |
$subject ??= $this; |
|
|
|
/** @var \Cake\Event\EventInterface<TSubject> $event Coerce for psalm/phpstan */ |
|
$event = new $this->_eventClass($name, $subject, $data); |
|
$this->getEventManager()->dispatch($event); |
|
|
|
return $event; |
|
} |
|
} |
* @return \Psr\Http\Message\ResponseInterface|null |
|
*/ |
|
public function startupProcess(): ?ResponseInterface |
|
{ |
|
$result = $this->dispatchEvent('Controller.initialize')->getResult(); |
|
if ($result instanceof ResponseInterface) { |
|
return $result; |
|
} |
|
|
assert($request instanceof ServerRequest); |
|
$controller = $this->controller; |
|
$controller->setRequest($request); |
|
|
|
$result = $controller->startupProcess(); |
|
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 ' |
|
|
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); |
$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, $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