Fixed Fatal error: Uncaught TypeError: array_replace_recursive(): Argument #1 ($array) must be of type array, null given in /var/ncc/packages/net.nosial.configlib=1.0.2/src/ConfigLib/Configuration.php:331
This commit is contained in:
parent
4cffe41bf0
commit
01e9502179
3 changed files with 17 additions and 4 deletions
|
@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
|
|||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [1.0.3] - 2023-07-13
|
||||
|
||||
### Fixed
|
||||
* Fixed `Fatal error: Uncaught TypeError: array_replace_recursive(): Argument #1 ($array) must be of type array, null given in /var/ncc/packages/net.nosial.configlib=1.0.2/src/ConfigLib/Configuration.php:331`
|
||||
|
||||
## [1.0.2] - 2023-07-11
|
||||
|
||||
### Fixed
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
"company": "Nosial",
|
||||
"copyright": "Copyright (c) 2022-2023 Nosial",
|
||||
"description": "ConfigLib is a library for reading and writing configuration files via the NCC Runtime API",
|
||||
"version": "1.0.1",
|
||||
"version": "1.0.2",
|
||||
"uuid": "9347259e-8e4d-11ed-85a7-fd07cf28ef35"
|
||||
},
|
||||
"build": {
|
||||
|
|
|
@ -328,15 +328,23 @@
|
|||
return;
|
||||
}
|
||||
|
||||
$fs = new Filesystem();
|
||||
|
||||
// If the configuration file is a YAML file, import it instead
|
||||
if(str_ends_with($this->path, '.yaml') || str_ends_with($this->path, '.yml'))
|
||||
{
|
||||
$this->import($this->path);
|
||||
|
||||
if(!$fs->exists($this->path))
|
||||
{
|
||||
throw new RuntimeException(sprintf('Unable to import configuration file "%s" from environment, file does not exist', $path));
|
||||
}
|
||||
|
||||
$yaml = file_get_contents($this->path);
|
||||
$this->configuration = Yaml::parse($yaml);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$fs = new Filesystem();
|
||||
|
||||
if (!$fs->exists($this->path))
|
||||
{
|
||||
return;
|
||||
|
|
Loading…
Add table
Reference in a new issue