if (!$mask) {file_put_contents($pathname, $message . "\n", FILE_APPEND);
file_put_contents [internal], line ?? Cake\Log\Engine\FileLog::log() /var/www/vhosts/valpolicella.it/httpdocs/vendor/cakephp/cakephp/src/Log/Engine/FileLog.php, line 140 Cake\Log\Log::write() /var/www/vhosts/valpolicella.it/httpdocs/vendor/cakephp/cakephp/src/Log/Log.php, line 392 Cake\Log\Log::error() /var/www/vhosts/valpolicella.it/httpdocs/vendor/cakephp/cakephp/src/Log/Log.php, line 461 Cake\Error\ErrorLogger::logException() /var/www/vhosts/valpolicella.it/httpdocs/vendor/cakephp/cakephp/src/Error/ErrorLogger.php, line 99 Cake\Error\ExceptionTrap::logException() /var/www/vhosts/valpolicella.it/httpdocs/vendor/cakephp/cakephp/src/Error/ExceptionTrap.php, line 356 Cake\Error\Middleware\ErrorHandlerMiddleware::handleException() /var/www/vhosts/valpolicella.it/httpdocs/vendor/cakephp/cakephp/src/Error/Middleware/ErrorHandlerMiddleware.php, line 150 Cake\Error\Middleware\ErrorHandlerMiddleware::process() /var/www/vhosts/valpolicella.it/httpdocs/vendor/cakephp/cakephp/src/Error/Middleware/ErrorHandlerMiddleware.php, line 135 Cake\Http\Runner::handle() /var/www/vhosts/valpolicella.it/httpdocs/vendor/cakephp/cakephp/src/Http/Runner.php, line 73 Cake\Http\Runner::run() /var/www/vhosts/valpolicella.it/httpdocs/vendor/cakephp/cakephp/src/Http/Runner.php, line 58 Cake\Http\Server::run() /var/www/vhosts/valpolicella.it/httpdocs/vendor/cakephp/cakephp/src/Http/Server.php, line 90 [main] /var/www/vhosts/valpolicella.it/httpdocs/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/vhosts/valpolicella.it/httpdocs/vendor/cakephp/cakephp/src/Log/Engine/FileLog.php, line 140 Cake\Log\Log::write() /var/www/vhosts/valpolicella.it/httpdocs/vendor/cakephp/cakephp/src/Log/Log.php, line 392 Cake\Log\Log::error() /var/www/vhosts/valpolicella.it/httpdocs/vendor/cakephp/cakephp/src/Log/Log.php, line 461 Cake\Error\ErrorLogger::logException() /var/www/vhosts/valpolicella.it/httpdocs/vendor/cakephp/cakephp/src/Error/ErrorLogger.php, line 99 Cake\Error\ExceptionTrap::logException() /var/www/vhosts/valpolicella.it/httpdocs/vendor/cakephp/cakephp/src/Error/ExceptionTrap.php, line 356 Cake\Error\Middleware\ErrorHandlerMiddleware::handleException() /var/www/vhosts/valpolicella.it/httpdocs/vendor/cakephp/cakephp/src/Error/Middleware/ErrorHandlerMiddleware.php, line 150 Cake\Error\Middleware\ErrorHandlerMiddleware::process() /var/www/vhosts/valpolicella.it/httpdocs/vendor/cakephp/cakephp/src/Error/Middleware/ErrorHandlerMiddleware.php, line 135 Cake\Http\Runner::handle() /var/www/vhosts/valpolicella.it/httpdocs/vendor/cakephp/cakephp/src/Http/Runner.php, line 73 Cake\Http\Runner::run() /var/www/vhosts/valpolicella.it/httpdocs/vendor/cakephp/cakephp/src/Http/Runner.php, line 58 Cake\Http\Server::run() /var/www/vhosts/valpolicella.it/httpdocs/vendor/cakephp/cakephp/src/Http/Server.php, line 90 [main] /var/www/vhosts/valpolicella.it/httpdocs/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/vhosts/valpolicella.it/httpdocs/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php, line 71 Cake\Http\Server::emit() /var/www/vhosts/valpolicella.it/httpdocs/vendor/cakephp/cakephp/src/Http/Server.php, line 128 [main] /var/www/vhosts/valpolicella.it/httpdocs/webroot/index.php, line 40
$response->getStatusCode(),($reasonPhrase ? ' ' . $reasonPhrase : '')));
header [internal], line ?? Cake\Http\ResponseEmitter::emitStatusLine() /var/www/vhosts/valpolicella.it/httpdocs/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php, line 168 Cake\Http\ResponseEmitter::emit() /var/www/vhosts/valpolicella.it/httpdocs/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php, line 74 Cake\Http\Server::emit() /var/www/vhosts/valpolicella.it/httpdocs/vendor/cakephp/cakephp/src/Http/Server.php, line 128 [main] /var/www/vhosts/valpolicella.it/httpdocs/webroot/index.php, line 40
foreach ($values as $value) {header(sprintf('%s: %s',
header [internal], line ?? Cake\Http\ResponseEmitter::emitHeaders() /var/www/vhosts/valpolicella.it/httpdocs/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php, line 197 Cake\Http\ResponseEmitter::emit() /var/www/vhosts/valpolicella.it/httpdocs/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php, line 75 Cake\Http\Server::emit() /var/www/vhosts/valpolicella.it/httpdocs/vendor/cakephp/cakephp/src/Http/Server.php, line 128 [main] /var/www/vhosts/valpolicella.it/httpdocs/webroot/index.php, line 40
[$config['schema'], $name] = explode('.', $name); |
|
} |
|
$table = $this->_connection->getDriver()->newTableSchema($name); |
|
|
|
$this->_reflect('Column', $name, $config, $table); |
|
if (count($table->columns()) === 0) { |
|
throw new DatabaseException(sprintf('Cannot describe %s. It has 0 columns.', $name)); |
|
} |
|
|
return $cached; |
|
} |
|
} |
|
|
|
$table = $this->collection->describe($name, $options); |
|
$this->cacher->set($cacheKey, $table); |
|
|
|
return $table; |
|
} |
if ($this->_schema === null) { |
|
$this->_schema = $this->_initializeSchema( |
|
$this->getConnection() |
|
->getSchemaCollection() |
|
->describe($this->getTable()) |
|
); |
|
if (Configure::read('debug')) { |
|
$this->checkAliasLengths(); |
|
} |
*/ |
|
public function addDefaultTypes(Table $table) |
|
{ |
|
$alias = $table->getAlias(); |
|
$map = $table->getSchema()->typeMap(); |
|
$fields = []; |
|
foreach ($map as $f => $type) { |
|
$fields[$f] = $fields[$alias . '.' . $f] = $fields[$alias . '__' . $f] = $type; |
|
} |
parent::__construct($connection); |
|
$this->repository($table); |
|
|
|
if ($this->_repository !== null) { |
|
$this->addDefaultTypes($this->_repository); |
|
} |
|
} |
|
|
|
/** |
* @return \Cake\ORM\Query |
|
*/ |
|
public function query(): Query |
|
{ |
|
return new Query($this->getConnection(), $this); |
|
} |
|
|
|
/** |
|
* Creates a new Query::subquery() instance for a table. |
* @return \Cake\ORM\Query The query builder |
|
*/ |
|
public function find(string $type = 'all', array $options = []): Query |
|
{ |
|
return $this->callFinder($type, $this->query()->select(), $options); |
|
} |
|
|
|
/** |
|
* Returns the query as passed. |
if(ACTIVE_LANGUAGE != DEFAULT_LANGUAGE) { |
|
$request = urldecode(substr($request, 3)); |
|
} |
|
|
|
$sefUrl = $sefModel->find()->where(['rewritten' => $request, 'locale' => ACTIVE_LANGUAGE])->first(); |
|
|
|
if(!empty($sefUrl)){ |
|
|
|
if($sefUrl->code == 200) { |
// Only load routes if the router is empty |
|
if (!Router::routes()) { |
|
$return = require $this->configDir . 'routes.php'; |
|
if ($return instanceof Closure) { |
|
$return($routes); |
|
} |
|
} |
|
} |
|
|
*/ |
|
protected function prepareRouteCollection(): RouteCollection |
|
{ |
|
$builder = Router::createRouteBuilder('/'); |
|
$this->app->routes($builder); |
|
if ($this->app instanceof PluginApplicationInterface) { |
|
$this->app->pluginRoutes($builder); |
|
} |
|
|
); |
|
} |
|
} |
|
|
|
return $this->prepareRouteCollection(); |
|
} |
|
|
|
/** |
|
* Generate the route collection using the builder |
* @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); |
} |
|
|
|
// Calling $handler->handle() delegates control to the *next* middleware |
|
// In your application's queue. |
|
$response = $handler->handle($request); |
|
|
|
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); |
|
|
// Make sure the request looks like an asset. |
|
$targetName = $this->getName($config, $request->getUri()->getPath()); |
|
if (!$targetName) { |
|
return $handler->handle($request); |
|
} |
|
|
|
$queryParams = $request->getQueryParams(); |
|
if (isset($queryParams['theme'])) { |
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); |
$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()); |
|
|
$connection = $this->_driver->getConnection(); |
|
|
|
try { |
|
$connection->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, $this->_bufferResults); |
|
$result = $this->_statement->execute($params); |
|
} finally { |
|
$connection->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, true); |
|
} |
|
|
$statement = $this->prepare($sql); |
|
if (!empty($params)) { |
|
$statement->bind($params, $types); |
|
} |
|
$statement->execute(); |
|
|
|
return $statement; |
|
}); |
|
} |
{ |
|
$this->numRetries = 0; |
|
while (true) { |
|
try { |
|
return $action(); |
|
} catch (Exception $e) { |
|
if ( |
|
$this->numRetries < $this->maxRetries && |
|
$this->strategy->shouldRetry($e, $this->numRetries) |
} |
|
$statement->execute(); |
|
|
|
return $statement; |
|
}); |
|
} |
|
|
|
/** |
|
* Compiles a Query object into a SQL string according to the dialect for this |
if (empty($sql)) { |
|
return; |
|
} |
|
try { |
|
$statement = $this->_connection->execute($sql, $params); |
|
} catch (PDOException $e) { |
|
throw new DatabaseException($e->getMessage(), 500, $e); |
|
} |
|
/** @psalm-suppress PossiblyFalseIterator */ |
[$config['schema'], $name] = explode('.', $name); |
|
} |
|
$table = $this->_connection->getDriver()->newTableSchema($name); |
|
|
|
$this->_reflect('Column', $name, $config, $table); |
|
if (count($table->columns()) === 0) { |
|
throw new DatabaseException(sprintf('Cannot describe %s. It has 0 columns.', $name)); |
|
} |
|
|
return $cached; |
|
} |
|
} |
|
|
|
$table = $this->collection->describe($name, $options); |
|
$this->cacher->set($cacheKey, $table); |
|
|
|
return $table; |
|
} |
if ($this->_schema === null) { |
|
$this->_schema = $this->_initializeSchema( |
|
$this->getConnection() |
|
->getSchemaCollection() |
|
->describe($this->getTable()) |
|
); |
|
if (Configure::read('debug')) { |
|
$this->checkAliasLengths(); |
|
} |
*/ |
|
public function addDefaultTypes(Table $table) |
|
{ |
|
$alias = $table->getAlias(); |
|
$map = $table->getSchema()->typeMap(); |
|
$fields = []; |
|
foreach ($map as $f => $type) { |
|
$fields[$f] = $fields[$alias . '.' . $f] = $fields[$alias . '__' . $f] = $type; |
|
} |
parent::__construct($connection); |
|
$this->repository($table); |
|
|
|
if ($this->_repository !== null) { |
|
$this->addDefaultTypes($this->_repository); |
|
} |
|
} |
|
|
|
/** |
* @return \Cake\ORM\Query |
|
*/ |
|
public function query(): Query |
|
{ |
|
return new Query($this->getConnection(), $this); |
|
} |
|
|
|
/** |
|
* Creates a new Query::subquery() instance for a table. |
* @return \Cake\ORM\Query The query builder |
|
*/ |
|
public function find(string $type = 'all', array $options = []): Query |
|
{ |
|
return $this->callFinder($type, $this->query()->select(), $options); |
|
} |
|
|
|
/** |
|
* Returns the query as passed. |
if(ACTIVE_LANGUAGE != DEFAULT_LANGUAGE) { |
|
$request = urldecode(substr($request, 3)); |
|
} |
|
|
|
$sefUrl = $sefModel->find()->where(['rewritten' => $request, 'locale' => ACTIVE_LANGUAGE])->first(); |
|
|
|
if(!empty($sefUrl)){ |
|
|
|
if($sefUrl->code == 200) { |
// Only load routes if the router is empty |
|
if (!Router::routes()) { |
|
$return = require $this->configDir . 'routes.php'; |
|
if ($return instanceof Closure) { |
|
$return($routes); |
|
} |
|
} |
|
} |
|
|
*/ |
|
protected function prepareRouteCollection(): RouteCollection |
|
{ |
|
$builder = Router::createRouteBuilder('/'); |
|
$this->app->routes($builder); |
|
if ($this->app instanceof PluginApplicationInterface) { |
|
$this->app->pluginRoutes($builder); |
|
} |
|
|
); |
|
} |
|
} |
|
|
|
return $this->prepareRouteCollection(); |
|
} |
|
|
|
/** |
|
* Generate the route collection using the builder |
* @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); |
} |
|
|
|
// Calling $handler->handle() delegates control to the *next* middleware |
|
// In your application's queue. |
|
$response = $handler->handle($request); |
|
|
|
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); |
|
|
// Make sure the request looks like an asset. |
|
$targetName = $this->getName($config, $request->getUri()->getPath()); |
|
if (!$targetName) { |
|
return $handler->handle($request); |
|
} |
|
|
|
$queryParams = $request->getQueryParams(); |
|
if (isset($queryParams['theme'])) { |
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); |
$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