if (!$mask) {file_put_contents($pathname, $message . "\n", FILE_APPEND);
file_put_contents [internal], line ?? Cake\Log\Engine\FileLog::log() /var/www/proveedores.tms.grucas.com/vendor/cakephp/cakephp/src/Log/Engine/FileLog.php, line 140 Cake\Log\Log::write() /var/www/proveedores.tms.grucas.com/vendor/cakephp/cakephp/src/Log/Log.php, line 392 Cake\Log\Log::warning() /var/www/proveedores.tms.grucas.com/vendor/cakephp/cakephp/src/Log/Log.php, line 477 DebugKit\ToolbarService::isSuspiciouslyProduction() /var/www/proveedores.tms.grucas.com/vendor/cakephp/debug_kit/src/ToolbarService.php, line 170 DebugKit\ToolbarService::isEnabled() /var/www/proveedores.tms.grucas.com/vendor/cakephp/debug_kit/src/ToolbarService.php, line 107 DebugKit\Plugin::bootstrap() /var/www/proveedores.tms.grucas.com/vendor/cakephp/debug_kit/src/Plugin.php, line 50 Cake\Http\BaseApplication::pluginBootstrap() /var/www/proveedores.tms.grucas.com/vendor/cakephp/cakephp/src/Http/BaseApplication.php, line 182 Cake\Http\Server::bootstrap() /var/www/proveedores.tms.grucas.com/vendor/cakephp/cakephp/src/Http/Server.php, line 111 Cake\Http\Server::run() /var/www/proveedores.tms.grucas.com/vendor/cakephp/cakephp/src/Http/Server.php, line 79 [main] /var/www/proveedores.tms.grucas.com/webroot/index.php, line 40
if (!$mask) {file_put_contents($pathname, $message . "\n", FILE_APPEND);
file_put_contents [internal], line ?? Cake\Log\Engine\FileLog::log() /var/www/proveedores.tms.grucas.com/vendor/cakephp/cakephp/src/Log/Engine/FileLog.php, line 140 Cake\Log\Log::write() /var/www/proveedores.tms.grucas.com/vendor/cakephp/cakephp/src/Log/Log.php, line 392 Cake\Log\Log::error() /var/www/proveedores.tms.grucas.com/vendor/cakephp/cakephp/src/Log/Log.php, line 461 Cake\Error\ErrorLogger::logException() /var/www/proveedores.tms.grucas.com/vendor/cakephp/cakephp/src/Error/ErrorLogger.php, line 99 Cake\Error\ExceptionTrap::logException() /var/www/proveedores.tms.grucas.com/vendor/cakephp/cakephp/src/Error/ExceptionTrap.php, line 357 Cake\Error\Middleware\ErrorHandlerMiddleware::handleException() /var/www/proveedores.tms.grucas.com/vendor/cakephp/cakephp/src/Error/Middleware/ErrorHandlerMiddleware.php, line 150 Cake\Error\Middleware\ErrorHandlerMiddleware::process() /var/www/proveedores.tms.grucas.com/vendor/cakephp/cakephp/src/Error/Middleware/ErrorHandlerMiddleware.php, line 135 Cake\Http\Runner::handle() /var/www/proveedores.tms.grucas.com/vendor/cakephp/cakephp/src/Http/Runner.php, line 82 Cake\Http\Runner::run() /var/www/proveedores.tms.grucas.com/vendor/cakephp/cakephp/src/Http/Runner.php, line 67 Cake\Http\Server::run() /var/www/proveedores.tms.grucas.com/vendor/cakephp/cakephp/src/Http/Server.php, line 90 [main] /var/www/proveedores.tms.grucas.com/webroot/index.php, line 40
$message = "Unable to emit headers. Headers sent in file=$file line=$line";trigger_error($message, E_USER_WARNING);}
Cake\Http\ResponseEmitter::emit() /var/www/proveedores.tms.grucas.com/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php, line 71 Cake\Http\Server::emit() /var/www/proveedores.tms.grucas.com/vendor/cakephp/cakephp/src/Http/Server.php, line 128 [main] /var/www/proveedores.tms.grucas.com/webroot/index.php, line 40
$reasonPhrase = $response->getReasonPhrase();header(sprintf('HTTP/%s %d%s',
header [internal], line ?? Cake\Http\ResponseEmitter::emitStatusLine() /var/www/proveedores.tms.grucas.com/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php, line 164 Cake\Http\ResponseEmitter::emit() /var/www/proveedores.tms.grucas.com/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php, line 74 Cake\Http\Server::emit() /var/www/proveedores.tms.grucas.com/vendor/cakephp/cakephp/src/Http/Server.php, line 128 [main] /var/www/proveedores.tms.grucas.com/webroot/index.php, line 40
foreach ($values as $value) {header(sprintf('%s: %s',
header [internal], line ?? Cake\Http\ResponseEmitter::emitHeaders() /var/www/proveedores.tms.grucas.com/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php, line 197 Cake\Http\ResponseEmitter::emit() /var/www/proveedores.tms.grucas.com/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php, line 75 Cake\Http\Server::emit() /var/www/proveedores.tms.grucas.com/vendor/cakephp/cakephp/src/Http/Server.php, line 128 [main] /var/www/proveedores.tms.grucas.com/webroot/index.php, line 40
Connection to Postgres could not be established: SQLSTATE[08006] [7] connection to server at "localhost" (::1), port 5432 failed: FATAL: could not write init file
} else { |
|
$dsn = "pgsql:dbname={$config['database']}"; |
|
} |
|
|
|
$this->_connect($dsn, $config); |
|
$this->_connection = $connection = $this->getConnection(); |
|
if (!empty($config['encoding'])) { |
|
$this->setEncoding($config['encoding']); |
|
} |
* @param \Cake\Database\DriverInterface $driver The driver to use. |
|
*/ |
|
public function __construct(DriverInterface $driver) |
|
{ |
|
$driver->connect(); |
|
$this->_driver = $driver; |
|
} |
|
|
|
/** |
*/ |
|
public function schemaDialect(): SchemaDialect |
|
{ |
|
if ($this->_schemaDialect === null) { |
|
$this->_schemaDialect = new PostgresSchemaDialect($this); |
|
} |
|
|
|
return $this->_schemaDialect; |
|
} |
*/ |
|
public function __construct(Connection $connection) |
|
{ |
|
$this->_connection = $connection; |
|
$this->_dialect = $connection->getDriver()->schemaDialect(); |
|
} |
|
|
|
/** |
|
* Get the list of tables, excluding any views, available in the current connection. |
} |
|
|
|
if (!empty($this->_config['cacheMetadata'])) { |
|
return $this->_schemaCollection = new CachedCollection( |
|
new SchemaCollection($this), |
|
empty($this->_config['cacheKeyPrefix']) ? $this->configName() : $this->_config['cacheKeyPrefix'], |
|
$this->getCacher() |
|
); |
|
} |
{ |
|
if ($this->_schema === null) { |
|
$this->_schema = $this->_initializeSchema( |
|
$this->getConnection() |
|
->getSchemaCollection() |
|
->describe($this->getTable()) |
|
); |
|
if (Configure::read('debug')) { |
|
$this->checkAliasLengths(); |
if (!$table) { |
|
return null; |
|
} |
|
|
|
return $table->getSchema()->baseColumnType(array_pop($parts)); |
|
} |
|
|
|
/** |
|
* Get an associative array of other attributes for a field name. |
return 'select'; |
|
} |
|
|
|
$type = 'text'; |
|
$internalType = $context->type($fieldName); |
|
$map = $this->_config['typeMap']; |
|
if ($internalType !== null && isset($map[$internalType])) { |
|
$type = $map[$internalType]; |
|
} |
{ |
|
$needsMagicType = false; |
|
if (empty($options['type'])) { |
|
$needsMagicType = true; |
|
$options['type'] = $this->_inputType($fieldName, $options); |
|
} |
|
|
|
return $this->_magicOptions($fieldName, $options, $needsMagicType); |
|
} |
'templates' => [], |
|
'templateVars' => [], |
|
'labelOptions' => true, |
|
]; |
|
$options = $this->_parseOptions($fieldName, $options); |
|
$options += ['id' => $this->_domId($fieldName)]; |
|
|
|
$templater = $this->templater(); |
|
$newTemplates = $options['templates']; |
|
|
<h5 class="fw-normal mb-3 pb-3" style="letter-spacing: 1px;">Iniciar sesión en su cuenta</h5> |
|
|
|
<div class="form-outline mb-4"> |
|
<?= $this->Form->control('login', ['class' => 'form-control', 'required' => true, 'placeholder' => 'Nombre de usuario']) ?> |
|
</div> |
|
|
|
<div class="row"> |
|
<div class="col-10"> |
ob_start(); |
|
|
|
try { |
|
// Avoiding $templateFile here due to collision with extract() vars. |
|
include func_get_arg(0); |
|
} catch (Throwable $exception) { |
|
while (ob_get_level() > $bufferLevel) { |
|
ob_end_clean(); |
|
} |
$initialBlocks = count($this->Blocks->unclosed()); |
|
|
|
$this->dispatchEvent('View.beforeRenderFile', [$templateFile]); |
|
|
|
$content = $this->_evaluate($templateFile, $data); |
|
|
|
$afterEvent = $this->dispatchEvent('View.afterRenderFile', [$templateFile, $content]); |
|
if ($afterEvent->getResult() !== null) { |
|
$content = $afterEvent->getResult(); |
|
|
$templateFileName = $this->_getTemplateFileName($template); |
|
$this->_currentType = static::TYPE_TEMPLATE; |
|
$this->dispatchEvent('View.beforeRender', [$templateFileName]); |
|
$this->Blocks->set('content', $this->_render($templateFileName)); |
|
$this->dispatchEvent('View.afterRender', [$templateFileName]); |
|
|
|
if ($this->autoLayout) { |
|
if (empty($this->layout)) { |
} |
|
$viewClass = $this->chooseViewClass(); |
|
$view = $this->createView($viewClass); |
|
|
|
$contents = $view->render(); |
|
$response = $view->getResponse()->withStringBody($contents); |
|
|
|
return $this->setResponse($response)->response; |
|
} |
getTypeName($result) |
|
)); |
|
} |
|
if ($result === null && $this->isAutoRenderEnabled()) { |
|
$result = $this->render(); |
|
} |
|
if ($result) { |
|
$this->response = $result; |
|
} |
$args = $this->getActionArgs( |
|
$action, |
|
array_values((array)$controller->getRequest()->getParam('pass')) |
|
); |
|
$controller->invokeAction($action, $args); |
|
|
|
$result = $controller->shutdownProcess(); |
|
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); |
|
} |
|
|
|
return new Response([ |
|
'body' => 'Middleware queue was exhausted without returning a response ' |
$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); |
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); |
*/ |
|
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); |
) { |
|
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()); |
|
|
*/ |
|
protected function _connect(string $dsn, array $config): bool |
|
{ |
|
$action = function () use ($dsn, $config) { |
|
$this->setConnection(new PDO( |
|
$dsn, |
|
$config['username'] ?: null, |
|
$config['password'] ?: null, |
|
$config['flags'] |
{ |
|
$this->numRetries = 0; |
|
while (true) { |
|
try { |
|
return $action(); |
|
} catch (Exception $e) { |
|
if ( |
|
$this->numRetries < $this->maxRetries && |
|
$this->strategy->shouldRetry($e, $this->numRetries) |
}; |
|
|
|
$retry = new CommandRetry(new ErrorCodeWaitStrategy(static::RETRY_ERROR_CODES, 5), 4); |
|
try { |
|
$retry->run($action); |
|
} catch (PDOException $e) { |
|
throw new MissingConnectionException( |
|
[ |
|
'driver' => App::shortName(static::class, 'Database/Driver'), |
} else { |
|
$dsn = "pgsql:dbname={$config['database']}"; |
|
} |
|
|
|
$this->_connect($dsn, $config); |
|
$this->_connection = $connection = $this->getConnection(); |
|
if (!empty($config['encoding'])) { |
|
$this->setEncoding($config['encoding']); |
|
} |
* @param \Cake\Database\DriverInterface $driver The driver to use. |
|
*/ |
|
public function __construct(DriverInterface $driver) |
|
{ |
|
$driver->connect(); |
|
$this->_driver = $driver; |
|
} |
|
|
|
/** |
*/ |
|
public function schemaDialect(): SchemaDialect |
|
{ |
|
if ($this->_schemaDialect === null) { |
|
$this->_schemaDialect = new PostgresSchemaDialect($this); |
|
} |
|
|
|
return $this->_schemaDialect; |
|
} |
*/ |
|
public function __construct(Connection $connection) |
|
{ |
|
$this->_connection = $connection; |
|
$this->_dialect = $connection->getDriver()->schemaDialect(); |
|
} |
|
|
|
/** |
|
* Get the list of tables, excluding any views, available in the current connection. |
} |
|
|
|
if (!empty($this->_config['cacheMetadata'])) { |
|
return $this->_schemaCollection = new CachedCollection( |
|
new SchemaCollection($this), |
|
empty($this->_config['cacheKeyPrefix']) ? $this->configName() : $this->_config['cacheKeyPrefix'], |
|
$this->getCacher() |
|
); |
|
} |
{ |
|
if ($this->_schema === null) { |
|
$this->_schema = $this->_initializeSchema( |
|
$this->getConnection() |
|
->getSchemaCollection() |
|
->describe($this->getTable()) |
|
); |
|
if (Configure::read('debug')) { |
|
$this->checkAliasLengths(); |
if (!$table) { |
|
return null; |
|
} |
|
|
|
return $table->getSchema()->baseColumnType(array_pop($parts)); |
|
} |
|
|
|
/** |
|
* Get an associative array of other attributes for a field name. |
return 'select'; |
|
} |
|
|
|
$type = 'text'; |
|
$internalType = $context->type($fieldName); |
|
$map = $this->_config['typeMap']; |
|
if ($internalType !== null && isset($map[$internalType])) { |
|
$type = $map[$internalType]; |
|
} |
{ |
|
$needsMagicType = false; |
|
if (empty($options['type'])) { |
|
$needsMagicType = true; |
|
$options['type'] = $this->_inputType($fieldName, $options); |
|
} |
|
|
|
return $this->_magicOptions($fieldName, $options, $needsMagicType); |
|
} |
'templates' => [], |
|
'templateVars' => [], |
|
'labelOptions' => true, |
|
]; |
|
$options = $this->_parseOptions($fieldName, $options); |
|
$options += ['id' => $this->_domId($fieldName)]; |
|
|
|
$templater = $this->templater(); |
|
$newTemplates = $options['templates']; |
|
|
<h5 class="fw-normal mb-3 pb-3" style="letter-spacing: 1px;">Iniciar sesión en su cuenta</h5> |
|
|
|
<div class="form-outline mb-4"> |
|
<?= $this->Form->control('login', ['class' => 'form-control', 'required' => true, 'placeholder' => 'Nombre de usuario']) ?> |
|
</div> |
|
|
|
<div class="row"> |
|
<div class="col-10"> |
ob_start(); |
|
|
|
try { |
|
// Avoiding $templateFile here due to collision with extract() vars. |
|
include func_get_arg(0); |
|
} catch (Throwable $exception) { |
|
while (ob_get_level() > $bufferLevel) { |
|
ob_end_clean(); |
|
} |
$initialBlocks = count($this->Blocks->unclosed()); |
|
|
|
$this->dispatchEvent('View.beforeRenderFile', [$templateFile]); |
|
|
|
$content = $this->_evaluate($templateFile, $data); |
|
|
|
$afterEvent = $this->dispatchEvent('View.afterRenderFile', [$templateFile, $content]); |
|
if ($afterEvent->getResult() !== null) { |
|
$content = $afterEvent->getResult(); |
|
|
$templateFileName = $this->_getTemplateFileName($template); |
|
$this->_currentType = static::TYPE_TEMPLATE; |
|
$this->dispatchEvent('View.beforeRender', [$templateFileName]); |
|
$this->Blocks->set('content', $this->_render($templateFileName)); |
|
$this->dispatchEvent('View.afterRender', [$templateFileName]); |
|
|
|
if ($this->autoLayout) { |
|
if (empty($this->layout)) { |
} |
|
$viewClass = $this->chooseViewClass(); |
|
$view = $this->createView($viewClass); |
|
|
|
$contents = $view->render(); |
|
$response = $view->getResponse()->withStringBody($contents); |
|
|
|
return $this->setResponse($response)->response; |
|
} |
getTypeName($result) |
|
)); |
|
} |
|
if ($result === null && $this->isAutoRenderEnabled()) { |
|
$result = $this->render(); |
|
} |
|
if ($result) { |
|
$this->response = $result; |
|
} |
$args = $this->getActionArgs( |
|
$action, |
|
array_values((array)$controller->getRequest()->getParam('pass')) |
|
); |
|
$controller->invokeAction($action, $args); |
|
|
|
$result = $controller->shutdownProcess(); |
|
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); |
|
} |
|
|
|
return new Response([ |
|
'body' => 'Middleware queue was exhausted without returning a response ' |
$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); |
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); |
*/ |
|
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); |
) { |
|
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/missing_connection.php