Skip to content

Commit c416992

Browse files
Merge pull request #13238 from nextcloud/feat/devmanual/system-config-key-conventions
feat(devmanual): add section about system config key conventions
2 parents c616986 + 8f01d5c commit c416992

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

developer_manual/basics/storage/configuration.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,22 @@ System values are saved in the :file:`config/config.php` and allow the app to mo
7373
7474
.. note:: It's also possible to use ``getSystemValueBool``, ``getSystemValueString``, ``getSystemValueInt`` to get type hinted return values.
7575

76+
Naming conventions
77+
~~~~~~~~~~~~~~~~~~
78+
79+
For consistency there are conventions for config keys:
80+
81+
* System config keys should only contain lower case letters, numbers and ``_``. This ensures that they can be used as environment variables.
82+
* Keys can be scoped to subsystems like ``<subsystem>_<key>``. This makes it easier to group related configuration.
83+
84+
Here are some examples:
85+
86+
1. ``files_external_allow_create_new_local``
87+
2. ``filesystem_cache_readonly``
88+
3. ``log_rotate_size``
89+
4. ``mail_smtpname``
90+
5. ``session_lifetime``
91+
7692
App values
7793
----------
7894

0 commit comments

Comments
 (0)