X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=doc%2FConfig.md;h=f2224f5de7f2d573791e32dc642c441b8376ce09;hb=0e5cb888881ee4187930de2dfab96ece55f1c0ea;hp=7ac3f7a02e69fc2645ea1c7dcd9e80007a99a985;hpb=5a93c3abfa1ca61f392fb073da1927845a2fed1d;p=friendica.git diff --git a/doc/Config.md b/doc/Config.md index 7ac3f7a02e..f2224f5de7 100644 --- a/doc/Config.md +++ b/doc/Config.md @@ -1,46 +1,63 @@ -Config values that can only be set in config/local.ini.php +Config values that can only be set in config/local.config.php ========================================================== * [Home](help) -Friendica's configuration is done in two places: in INI configuration files and in the `config` database table. +Friendica's configuration is done in two places: in PHP array configuration files and in the `config` database table. Database config values overwrite the same file config values. -# File configuration +## File configuration -The configuration format for file configuration is an INI string returned from a PHP file. -This prevents your webserver from displaying your private configuration it interprets the configuration files and displays nothing. +The configuration format for file configuration is an array returned from a PHP file. +This prevents your webserver from displaying your private configuration. It interprets the configuration files and displays nothing. A typical configuration file looks like this: ```php - [ + // Comment line + 'key' => 'value', + ], + 'section2' => [ + 'array' => ['value0', 'value1', 'value2'], + ], +]; +``` -; Comment line +### Configuration location -[section1] -key = value -empty_key = +The `config` directory holds key configuration files and can have different config files. +All of them have to end with `.config.php` and must not include `-sample` in their name. -[section2] -array[] = value0 -array[] = value1 -array[] = value2 +Some examples of common known configuration files: +- `local.config.php` holds the current node custom configuration. +- `addon.config.php` is optional and holds the custom configuration for specific addons. -INI; -// Keep this line -``` +Addons can define their own default configuration values in `addon/[addon]/config/[addon].config.php` which is loaded when the addon is activated. -## Configuration location +### Static Configuration location -All the configuration keys Friendica uses are listed with their default value if any in `config/defaults.ini.php`. -Addons can define their own default configuration values in `addon/[addon]/config/[addon].ini.php` which are loaded when the addon is activated. +The `static` directory holds the codebase default configurations files. +They must not be changed by users, because they can get changed from release to release. -### Migrating from .htconfig.php to config/local.ini.php +Currently, the following configurations are included: +- `defaults.config.php` holds the default values for all the configuration keys that can only be set in `local.config.php`. +- `settings.config.php` holds the default values for some configuration keys that are set through the admin settings page. + +#### Migrating from .htconfig.php to config/local.config.php The legacy `.htconfig.php` configuration file is still supported, but is deprecated and will be removed in a subsequent Friendica release. -The migration is pretty straightforward, just copy `config/local-sample.ini.php` to `config/local.ini.php`, add your configuration values to it according to the following conversion chart, then rename your `.htconfig.php` to check your node is working as expected before deleting it. +The migration is pretty straightforward: +If you had any addon-specific configuration in your `.htconfig.php`, just copy `config/addon-sample.config.php` to `config/addon.config.php` and move your configuration values. +Afterwards, copy `config/local-sample.config.php` to `config/local.config.php`, move the remaining configuration values to it according to the following conversion chart, then rename your `.htconfig.php` to check your node is working as expected before deleting it.