mirror of
https://github.com/getgrav/grav.git
synced 2026-05-07 03:27:08 +02:00
Added support for setting GRAV_SETUP_PATH by using environment variable
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
* Updated unit tests to use codeception 4.1
|
||||
1. [](#improved)
|
||||
* Improved `bin/grav install` command
|
||||
* Added support for setting `GRAV_SETUP_PATH` by using environment variable
|
||||
1. [](#bugfix)
|
||||
* Fixed potential error when upgrading Grav
|
||||
* Fixed broken list in `bin/gpm index` [#3092](https://github.com/getgrav/grav/issues/3092)
|
||||
|
||||
@@ -182,7 +182,10 @@ class Setup extends Data
|
||||
// Pre-load setup.php which contains our initial configuration.
|
||||
// Configuration may contain dynamic parts, which is why we need to always load it.
|
||||
// If "GRAV_SETUP_PATH" has been defined, use it, otherwise use defaults.
|
||||
$file = defined('GRAV_SETUP_PATH') ? GRAV_SETUP_PATH : GRAV_ROOT . '/setup.php';
|
||||
$file = getenv('GRAV_SETUP_PATH') ?: (defined('GRAV_SETUP_PATH') ? GRAV_SETUP_PATH : 'setup.php');
|
||||
if (!str_starts_with($file, '/')) {
|
||||
$file = GRAV_ROOT . '/' . $file;
|
||||
}
|
||||
$setup = is_file($file) ? (array) include $file : [];
|
||||
|
||||
// Add default streams defined in beginning of the class.
|
||||
|
||||
Reference in New Issue
Block a user