You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you want to inject your state on a general page. For example the initial state of the notifications app. The callback will be invoked if and only if a template is rendered.
179
180
180
181
You call both methods with the name of your app and a key. This is to scope
@@ -22,8 +45,8 @@ To ensure better stability of your code, config values are typed enforced.
22
45
Type is set only once, at creation in database, and cannot be changed.
23
46
24
47
.. note::
25
-
- Value stored before Nextcloud 29 are automatically typed as `mixed`. However, it is not possible to manually set a value as `mixed`.
26
-
- Value not set as `mixed` must be retrieved using the corresponding method.
48
+
- Value stored before Nextcloud 29 are automatically typed as `mixed`. However, it is not possible to manually set a value as `mixed`.
49
+
- Value not set as `mixed` must be retrieved using the corresponding method.
27
50
28
51
Values Sensitivity
29
52
^^^^^^^^^^^^^^^^^^
@@ -33,15 +56,15 @@ Configuration values set as `sensitive` are hidden from system reports and store
33
56
34
57
.. code-block:: php
35
58
36
-
setValueString(
37
-
'myapp',
38
-
'mykey',
39
-
'myvalue',
40
-
sensitive: true
41
-
);
59
+
setValueString(
60
+
'myapp',
61
+
'mykey',
62
+
'myvalue',
63
+
sensitive: true
64
+
);
42
65
43
66
.. note::
44
-
Once set as `sensitive`, it can only be reverted using ``updateSensitive()``
67
+
Once set as `sensitive`, it can only be reverted using ``updateSensitive()``
45
68
46
69
47
70
Lazy Loading
@@ -52,33 +75,33 @@ All `lazy` configuration values are loaded from the database once one is read.
52
75
53
76
.. code-block:: php
54
77
55
-
setValueString(
56
-
'myapp',
57
-
'mykey',
58
-
'myvalue',
59
-
lazy: true
60
-
);
78
+
setValueString(
79
+
'myapp',
80
+
'mykey',
81
+
'myvalue',
82
+
lazy: true
83
+
);
61
84
62
85
.. note::
63
-
- Flag as `lazy` as much 'large block of text' entries (json, key pairs, ...) as possible,
64
-
- flag as `lazy` entries that are needed on quiet endpoints,
65
-
- do **not** flag as `lazy` part of code that might be called during the global loading of the instance and its apps.
86
+
- Flag as `lazy` as much 'large block of text' entries (json, key pairs, ...) as possible,
87
+
- flag as `lazy` entries that are needed on quiet endpoints,
88
+
- do **not** flag as `lazy` part of code that might be called during the global loading of the instance and its apps.
66
89
67
90
68
91
Retrieving the configuration value will require to specify the fact that it is stored as `lazy`.
69
92
70
93
.. code-block:: php
71
94
72
-
getValueString(
73
-
'myapp',
74
-
'mykey',
75
-
'default',
76
-
lazy: true
77
-
);
95
+
getValueString(
96
+
'myapp',
97
+
'mykey',
98
+
'default',
99
+
lazy: true
100
+
);
78
101
79
102
.. note::
80
-
- Requesting with ``1azy: false`` will returns the default value if configuration value is stored as `lazy`.
81
-
- Requesting with ``lazy: true`` will returns the correct value even if configuration value is stored as `non-lazy (as there is a huge probability that the `non-lazy` value are already loaded)
103
+
- Requesting with ``1azy: false`` will returns the default value if configuration value is stored as `lazy`.
104
+
- Requesting with ``lazy: true`` will returns the correct value even if configuration value is stored as `non-lazy (as there is a huge probability that the `non-lazy` value are already loaded)
82
105
83
106
Consuming the AppConfig API
84
107
---------------------------
@@ -134,7 +157,7 @@ Managing config keys
134
157
* ``deleteApp(string $app)`` delete all config keys from an app (using app id)
135
158
136
159
.. note::
137
-
Some method allows ``$lazy`` to be ``null``, meaning that the search will be extended to all configuration values, `lazy` or not.
160
+
Some method allows ``$lazy`` to be ``null``, meaning that the search will be extended to all configuration values, `lazy` or not.
0 commit comments