Upgrade to 3.9.8

This commit is contained in:
Bastian Allgeier
2023-11-14 12:19:47 +01:00
parent 474ecd14c7
commit f96b96af76
53 changed files with 1383 additions and 943 deletions

View File

@@ -772,18 +772,28 @@ class Environment
/**
* Loads and returns options from environment-specific
* PHP files (by host name and server IP address)
* PHP files (by host name and server IP address or CLI)
*
* @param string $root Root directory to load configs from
*/
public function options(string $root): array
{
$configCli = [];
$configHost = [];
$configAddr = [];
$host = $this->host();
$addr = $this->ip();
// load the config for the cli
if ($this->cli() === true) {
$configCli = F::load(
file: $root . '/config.cli.php',
fallback: [],
allowOutput: false
);
}
// load the config for the host
if (empty($host) === false) {
$configHost = F::load(
@@ -802,7 +812,7 @@ class Environment
);
}
return array_replace_recursive($configHost, $configAddr);
return array_replace_recursive($configCli, $configHost, $configAddr);
}
/**

View File

@@ -60,6 +60,8 @@ class Remote
/**
* Constructor
*
* @throws \Exception when the curl request failed
*/
public function __construct(string $url, array $options = [])
{
@@ -120,6 +122,7 @@ class Remote
* Sets up all curl options and sends the request
*
* @return $this
* @throws \Exception when the curl request failed
*/
public function fetch(): static
{
@@ -258,6 +261,8 @@ class Remote
/**
* Static method to send a GET request
*
* @throws \Exception when the curl request failed
*/
public static function get(string $url, array $params = []): static
{
@@ -339,6 +344,8 @@ class Remote
/**
* Static method to init this class and send a request
*
* @throws \Exception when the curl request failed
*/
public static function request(string $url, array $params = []): static
{