Skip to content
Snippets Groups Projects
Commit 8db76ef7 authored by Byron Marohn's avatar Byron Marohn
Browse files

Merge pull request #2147 from eMerzh/split_config

[OC6] Allow to load splited config files
parents be47f770 d5da94ac
No related branches found
No related tags found
No related merge requests found
......@@ -130,14 +130,24 @@ class OC_Config{
return true;
}
if( !file_exists( OC::$SERVERROOT."/config/config.php" )) {
return false;
}
// read all file in config dir ending by config.php
$config_files = glob( OC::$SERVERROOT."/config/*.config.php");
//Filter only regular files
$config_files = array_filter($config_files, 'is_file');
//Sort array naturally :
natsort($config_files);
// Add default config
array_unshift($config_files,OC::$SERVERROOT."/config/config.php");
// Include the file, save the data from $CONFIG
include OC::$SERVERROOT."/config/config.php";
if( isset( $CONFIG ) && is_array( $CONFIG )) {
self::$cache = $CONFIG;
//Include file and merge config
foreach($config_files as $file){
include $file;
if( isset( $CONFIG ) && is_array( $CONFIG )) {
self::$cache = array_merge(self::$cache, $CONFIG);
}
}
// We cached everything
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment