Index: trunk/phase3/includes/MessageBlobStore.php |
— | — | @@ -29,8 +29,11 @@ |
30 | 30 | * consistuent messages or the resource itself is changed. |
31 | 31 | */ |
32 | 32 | class MessageBlobStore { |
| 33 | + |
33 | 34 | /** |
34 | 35 | * Get the message blobs for a set of modules |
| 36 | + * |
| 37 | + * @param $resourceLoader ResourceLoader object |
35 | 38 | * @param $modules array Array of module objects keyed by module name |
36 | 39 | * @param $lang string Language code |
37 | 40 | * @return array An array mapping module names to message blobs |
— | — | @@ -61,8 +64,10 @@ |
62 | 65 | * Generate and insert a new message blob. If the blob was already |
63 | 66 | * present, it is not regenerated; instead, the preexisting blob |
64 | 67 | * is fetched and returned. |
65 | | - * @param $module string Module name |
66 | | - * @param $lang string Language code |
| 68 | + * |
| 69 | + * @param $name String: module name |
| 70 | + * @param $module ResourceLoaderModule object |
| 71 | + * @param $lang String: language code |
67 | 72 | * @return mixed Message blob or false if the module has no messages |
68 | 73 | */ |
69 | 74 | public static function insertMessageBlob( $name, ResourceLoaderModule $module, $lang ) { |
— | — | @@ -113,9 +118,11 @@ |
114 | 119 | |
115 | 120 | /** |
116 | 121 | * Update all message blobs for a given module. |
117 | | - * @param $module string Module name |
118 | | - * @param $lang string Language code (optional) |
119 | | - * @return mixed If $lang is set, the new message blob for that language is |
| 122 | + * |
| 123 | + * @param $name String: module name |
| 124 | + * @param $module ResourceLoaderModule object |
| 125 | + * @param $lang String: language code (optional) |
| 126 | + * @return Mixed: if $lang is set, the new message blob for that language is |
120 | 127 | * returned if present. Otherwise, null is returned. |
121 | 128 | */ |
122 | 129 | public static function updateModule( $name, ResourceLoaderModule $module, $lang = null ) { |
— | — | @@ -190,7 +197,8 @@ |
191 | 198 | |
192 | 199 | /** |
193 | 200 | * Update a single message in all message blobs it occurs in. |
194 | | - * @param $key string Message key |
| 201 | + * |
| 202 | + * @param $key String: message key |
195 | 203 | */ |
196 | 204 | public static function updateMessage( $key ) { |
197 | 205 | $dbw = wfGetDB( DB_MASTER ); |
— | — | @@ -241,9 +249,10 @@ |
242 | 250 | |
243 | 251 | /** |
244 | 252 | * Create an update queue for updateMessage() |
245 | | - * @param $key string Message key |
246 | | - * @param $prevUpdates array Updates queue to refresh or null to build a fresh update queue |
247 | | - * @return array Updates queue |
| 253 | + * |
| 254 | + * @param $key String: message key |
| 255 | + * @param $prevUpdates Array: updates queue to refresh or null to build a fresh update queue |
| 256 | + * @return Array: updates queue |
248 | 257 | */ |
249 | 258 | private static function getUpdatesForMessage( $key, $prevUpdates = null ) { |
250 | 259 | $dbw = wfGetDB( DB_MASTER ); |
— | — | @@ -291,9 +300,10 @@ |
292 | 301 | |
293 | 302 | /** |
294 | 303 | * Reencode a message blob with the updated value for a message |
295 | | - * @param $blob string Message blob (JSON object) |
296 | | - * @param $key string Message key |
297 | | - * @param $lang string Language code |
| 304 | + * |
| 305 | + * @param $blob String: message blob (JSON object) |
| 306 | + * @param $key String: message key |
| 307 | + * @param $lang String: language code |
298 | 308 | * @return Message blob with $key replaced with its new value |
299 | 309 | */ |
300 | 310 | private static function reencodeBlob( $blob, $key, $lang ) { |
— | — | @@ -306,8 +316,10 @@ |
307 | 317 | /** |
308 | 318 | * Get the message blobs for a set of modules from the database. |
309 | 319 | * Modules whose blobs are not in the database are silently dropped. |
310 | | - * @param $modules array Array of module names |
311 | | - * @param $lang string Language code |
| 320 | + * |
| 321 | + * @param $resourceLoader ResourceLoader object |
| 322 | + * @param $modules Array of module names |
| 323 | + * @param $lang String: language code |
312 | 324 | * @return array Array mapping module names to blobs |
313 | 325 | */ |
314 | 326 | private static function getFromDB( ResourceLoader $resourceLoader, $modules, $lang ) { |
— | — | @@ -341,9 +353,10 @@ |
342 | 354 | |
343 | 355 | /** |
344 | 356 | * Generate the message blob for a given module in a given language. |
345 | | - * @param $module string Module name |
346 | | - * @param $lang string Language code |
347 | | - * @return string JSON object |
| 357 | + * |
| 358 | + * @param $module ResourceLoaderModule object |
| 359 | + * @param $lang String: language code |
| 360 | + * @return String: JSON object |
348 | 361 | */ |
349 | 362 | private static function generateMessageBlob( ResourceLoaderModule $module, $lang ) { |
350 | 363 | $messages = array(); |