r94399 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r94398‎ | r94399 | r94400 >
Date:00:10, 13 August 2011
Author:jeroendedauw
Status:deferred
Tags:lamecommitsummary 
Comment:
Modified paths:
  • /trunk/extensions/Maps/includes/Maps_Settings.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Maps/includes/Maps_Settings.php
@@ -85,13 +85,35 @@
8686
8787 }
8888
 89+/**
 90+ * Abstract static class for interaction with the settings of an extension.
 91+ * Settings can be specified in various groups, and obtained by merging these
 92+ * in a specific order. In most cases these will oly be the two default groups,
 93+ * which are "default" and "php". The former contains the settings and their
 94+ * default values while the later contains settings specified via PHP variables.
 95+ *
 96+ * The setting groups are populated the first time a setting value is requested.
 97+ * By default merged setting groups will be cached. This makes sense as in most
 98+ * cases, the only combination accessed will be ["default", "php"].
 99+ *
 100+ * Using this class one can access configuration without the use of globals and
 101+ * in a way that allows for changing how the configuration is obtained. For
 102+ * example, it's possible to obtain configuration via database instead of by
 103+ * PHP vars or add in a user-preferences setting group without making changes
 104+ * at any other place in the extension.
 105+ *
 106+ * @since ?
 107+ *
 108+ * @licence GNU GPL v3
 109+ * @author Jeroen De Dauw < jeroendedauw@gmail.com >
 110+ */
89111 abstract class ExtensionSettings {
90112
91113 /**
92114 * The different groups of settings.
93115 * array[ group name => array[ setting name => setting value ] ]
94116 *
95 - * @since 1.1
 117+ * @since ?
96118 * @var array
97119 */
98120 protected static $settings = false;
@@ -101,7 +123,7 @@
102124 * cache, which is created by joining the group names with a |.
103125 * array[ cache name => settings[] ]
104126 *
105 - * @since 1.1
 127+ * @since ?
106128 * @var array
107129 */
108130 protected static $mergedCaches = array();
@@ -109,7 +131,7 @@
110132 /**
111133 * Returns a name => value array with the default settings.
112134 *
113 - * @since 1.1
 135+ * @since ?
114136 *
115137 * @return array
116138 */
@@ -118,7 +140,7 @@
119141 /**
120142 * Initiate the settings list if not done already.
121143 *
122 - * @since 1.1
 144+ * @since ?
123145 *
124146 * @return boolean True if the settings where initiates in this call.
125147 */
@@ -162,7 +184,7 @@
163185 * Returns a name => value array with the default settings
164186 * specified using global PHP variables.
165187 *
166 - * @since 1.1
 188+ * @since ?
167189 *
168190 * @return array
169191 */
@@ -173,7 +195,7 @@
174196 /**
175197 * Returns all settings for a group.
176198 *
177 - * @since 1.1
 199+ * @since ?
178200 *
179201 * @param array|boolean $groups True to use all overrides, false for none, array for custom set or order.
180202 * @param boolean $cache Cache the merging of groups or not?
@@ -197,7 +219,7 @@
198220 /**
199221 * Returns the value of a single setting.
200222 *
201 - * @since 1.1
 223+ * @since ?
202224 *
203225 * @param string $settingName
204226 * @param array|boolean $groups
@@ -218,7 +240,7 @@
219241 /**
220242 * Returns if a single setting exists or not.
221243 *
222 - * @since 1.1
 244+ * @since ?
223245 *
224246 * @param string $settingName
225247 * @param array|boolean $groups
@@ -234,7 +256,7 @@
235257 /**
236258 * Set a sigle setting in the specified group.
237259 *
238 - * @since 1.1
 260+ * @since ?
239261 *
240262 * @param string $settingName
241263 * @param mixed $settingValue
@@ -259,7 +281,7 @@
260282 /**
261283 * Invalidate the cahces that contain data from the specified group.
262284 *
263 - * @since 1.1
 285+ * @since ?
264286 *
265287 * @param name $group
266288 */

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r94397some prototypical work on new setting handling for in 1.1jeroendedauw23:46, 12 August 2011
r94398fu r94397jeroendedauw23:59, 12 August 2011

Status & tagging log