mirror of
https://github.com/getgrav/grav.git
synced 2026-07-06 10:29:30 +02:00
Added $grav->close() method to properly terminate the request with a response
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
* Deprecated `FlexDirectory::update()` and `FlexDirectory::remove()`
|
||||
* Added `FlexStorage::getMetaData()` to get updated object meta information for listed keys
|
||||
* Added `Language::getPageExtensions()` to get full list of supported page language extensions
|
||||
* Added `$grav->close()` method to properly terminate the request with a response
|
||||
1. [](#improved)
|
||||
* Better support for Symfony local server `symfony server:start`
|
||||
* Make `Route` objects immutable
|
||||
@@ -59,7 +60,6 @@
|
||||
* Added Twig profiling for Clockwork debugger
|
||||
* Updated Symfony Components to 4.3
|
||||
* Added support for Twig 2.11 (compatible with Twig 1.40+)
|
||||
* Added `$grav->exit()` method to properly terminate the request with a response
|
||||
* Optimization: Initialize debugbar only after the configuration has been loaded
|
||||
* Optimization: Combine some early Grav processors into a single one
|
||||
|
||||
|
||||
@@ -242,7 +242,7 @@ class Grav extends Container
|
||||
*
|
||||
* @param ResponseInterface $response
|
||||
*/
|
||||
public function exit(ResponseInterface $response): void
|
||||
public function close(ResponseInterface $response): void
|
||||
{
|
||||
// Make sure nothing extra gets written to the response.
|
||||
while (ob_get_level()) {
|
||||
@@ -267,6 +267,15 @@ class Grav extends Container
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ResponseInterface $response
|
||||
* @deprecated 1.7 Do not use
|
||||
*/
|
||||
public function exit(ResponseInterface $response): void
|
||||
{
|
||||
$this->close($response);
|
||||
}
|
||||
|
||||
/**
|
||||
* Terminates Grav request and redirects browser to another location.
|
||||
*
|
||||
@@ -306,7 +315,7 @@ class Grav extends Container
|
||||
|
||||
$response = new Response($code, ['Location' => $url]);
|
||||
|
||||
$this->exit($response);
|
||||
$this->close($response);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -217,7 +217,7 @@ class Themes extends Iterator
|
||||
} elseif (!$locator('theme://') && !defined('GRAV_CLI')) {
|
||||
$response = new Response(500, [], "Theme '$name' does not exist, unable to display page.");
|
||||
|
||||
$grav->exit($response);
|
||||
$grav->close($response);
|
||||
}
|
||||
|
||||
$this->config->set('theme', $config->get('themes.' . $name));
|
||||
|
||||
@@ -1115,7 +1115,7 @@ class TwigExtension extends AbstractExtension implements GlobalsInterface
|
||||
{
|
||||
$response = new Response($statusCode, ['location' => $url]);
|
||||
|
||||
$this->grav->exit($response);
|
||||
$this->grav->close($response);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user