mirror of
https://github.com/friendica/friendica
synced 2025-04-25 02:30:11 +00:00
Dynamic config loading
- Move settings, defaults and dbstructure to directory 'static' - Dynamic loading of config files (after the static loading) - Filter out '-sample.config.php' and '-sample.ini.php' files - Remove unnecessary ConfigFileManager - Move ConfigFileLoader to Utils - Add tests for multi-loading for INI, config and sample-filtering
This commit is contained in:
parent
966043712f
commit
92fb0a82ca
25 changed files with 325 additions and 161 deletions
|
@ -96,7 +96,7 @@ class DBStructure
|
|||
* Loads the database structure definition from the config/dbstructure.config.php file.
|
||||
* On first pass, defines DB_UPDATE_VERSION constant.
|
||||
*
|
||||
* @see config/dbstructure.config.php
|
||||
* @see static/dbstructure.config.php
|
||||
* @param boolean $with_addons_structure Whether to tack on addons additional tables
|
||||
* @param string $basePath The base path of this application
|
||||
* @return array
|
||||
|
@ -106,16 +106,16 @@ class DBStructure
|
|||
{
|
||||
if (!self::$definition) {
|
||||
|
||||
$filename = $basePath . '/config/dbstructure.config.php';
|
||||
$filename = $basePath . '/static/dbstructure.config.php';
|
||||
|
||||
if (!is_readable($filename)) {
|
||||
throw new Exception('Missing database structure config file config/dbstructure.config.php');
|
||||
throw new Exception('Missing database structure config file static/dbstructure.config.php');
|
||||
}
|
||||
|
||||
$definition = require $filename;
|
||||
|
||||
if (!$definition) {
|
||||
throw new Exception('Corrupted database structure config file config/dbstructure.config.php');
|
||||
throw new Exception('Corrupted database structure config file static/dbstructure.config.php');
|
||||
}
|
||||
|
||||
self::$definition = $definition;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue