docs(config): replace deprecated IConfig app/user value examples#14964
Open
skjnldsv wants to merge 2 commits into
Open
docs(config): replace deprecated IConfig app/user value examples#14964skjnldsv wants to merge 2 commits into
skjnldsv wants to merge 2 commits into
Conversation
Replaces IConfig::getAppValue/setAppValue with OCP\AppFramework\Services\IAppConfig (deprecated since NC29) and IConfig::getUserValue/setUserValue with OCP\Config\IUserConfig (deprecated since NC31). System values section unchanged — IConfig is still correct there. Fixes #12221 Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Remove duplicate /developer_manual/ prefix from :doc: paths — Sphinx source root for the developer manual is developer_manual/ itself, so the absolute paths must start with /digging_deeper/, not /developer_manual/digging_deeper/. Fixes CI warnings: WARNING: unknown document: '/developer_manual/digging_deeper/config/appconfig' WARNING: unknown document: '/developer_manual/digging_deeper/config/userconfig' Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Contributor
📖 Documentation Preview📄 1 changed documentation pageLast updated: Wed, 20 May 2026 09:58:02 GMT |
provokateurin
requested changes
May 21, 2026
| @@ -50,19 +25,15 @@ System values are saved in the :file:`config/config.php` and allow the app to mo | |||
| use OCP\IConfig; | |||
|
|
|||
| class AuthorService { | |||
Member
There was a problem hiding this comment.
This code example is very terrible, we should have something more meaningful here.
|
|
||
| System values are saved in the :file:`config/config.php` and allow the app to modify and read the global configuration. Please note that ``setSystemValue`` might throw a ``OCP\HintException`` when the config file is read-only. | ||
| System values are saved in :file:`config/config.php`. Inject ``\OCP\IConfig`` | ||
| and use the ``getSystemValue*`` / ``setSystemValue`` methods. |
Member
There was a problem hiding this comment.
This should mention all the getter methods for specific types. Even better only mentioned the typed methods.
Comment on lines
+45
to
+48
| .. note:: | ||
|
|
||
| Use ``getSystemValueBool()``, ``getSystemValueString()``, and ``getSystemValueInt()`` | ||
| for typed return values. |
Member
There was a problem hiding this comment.
And it should not be a note down here.
| use OCP\IConfig; | ||
| use OCP\AppFramework\Services\IAppConfig; | ||
|
|
||
| class AuthorService { |
Member
There was a problem hiding this comment.
This code example is better, maybe just copy this to the system config example above.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
☑️ Resolves
Summary
basics/storage/configuration.rstshowedIConfig::getAppValue/setAppValueandIConfig::getUserValue/setUserValueas the recommended approach. Both are deprecated.Changes:
OCP\AppFramework\Services\IAppConfig(deprecated since NC29). Added typed getter/setter example and cross-ref to the fullappconfig.rstreference.\OCP\Config\IUserConfig(deprecated since NC31). Added typed getter/setter example and cross-ref to the fulluserconfig.rstreference.IConfigis still the correct interface there.Needs backports to stable30 and stable29 per maintainer comment on the issue.
🖼️ Screenshots
✅ Checklist
codespellor similar and addressed any spelling issues