mirror of
https://github.com/getgrav/grav.git
synced 2025-10-26 07:56:07 +01:00
Add overriding of setup.php config file, via constants (#1945)
I'm working on a custom install of Grav, where being able to dynamically swap setup files was required. I've modified the $file assignment to permit overriding it's value via a defined constant, "GRAV_SETUP_PATH". And I thought that might be useful to others, so I'm submitting a pull request.
This commit is contained in:
@@ -137,7 +137,8 @@ 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.
|
||||
$file = GRAV_ROOT . '/setup.php';
|
||||
// If "GRAVE_SETUP_PATH" has been defined, use it, otherwise use defaults.
|
||||
$file = defined('GRAV_SETUP_PATH') ? GRAV_SETUP_PATH : GRAV_ROOT . '/setup.php';
|
||||
$setup = is_file($file) ? (array) include $file : [];
|
||||
|
||||
// Add default streams defined in beginning of the class.
|
||||
|
||||
Reference in New Issue
Block a user