mirror of
https://github.com/getgrav/grav.git
synced 2026-07-04 16:17:56 +02:00
Added variables $environment (string), $request (PSR-7 ServerRequestInterface|null) and $uri (PSR-7 Uri|null) to be used in setup.php
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
1. [](#new)
|
||||
* Added support for `multipart/form-data` content type in PUT and PATCH requests
|
||||
* Added support for object relationships
|
||||
* Added variables `$environment` (string), `$request` (PSR-7 ServerRequestInterface|null) and `$uri` (PSR-7 Uri|null) to be used in `setup.php`
|
||||
|
||||
# v1.7.34
|
||||
## 06/14/2022
|
||||
|
||||
@@ -182,13 +182,14 @@ class Setup extends Data
|
||||
// If no environment is set, make sure we get one (CLI or hostname).
|
||||
if (null === $environment) {
|
||||
if (defined('GRAV_CLI')) {
|
||||
$request = null;
|
||||
$uri = null;
|
||||
$environment = 'cli';
|
||||
} else {
|
||||
/** @var ServerRequestInterface $request */
|
||||
$request = $container['request'];
|
||||
$host = $request->getUri()->getHost();
|
||||
|
||||
$environment = Utils::substrToString($host, ':');
|
||||
$uri = $request->getUri();
|
||||
$environment = $uri->getHost();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user