r75088 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r75087‎ | r75088 | r75089 >
Date:14:58, 20 October 2010
Author:catrope
Status:ok
Tags:
Comment:
Some comment fixes: be consistent between # and //, fix grammar, remove information about internals from Doxygen comment (those are about what the function does, not how). Also make $modules argument to makeModuleResponse() default to array() instead of null
Modified paths:
  • /trunk/phase3/includes/resourceloader/ResourceLoader.php (modified) (history)
  • /trunk/phase3/includes/resourceloader/ResourceLoaderContext.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/resourceloader/ResourceLoader.php
@@ -43,11 +43,9 @@
4444 * This method grabs modules dependencies from the database and updates modules objects.
4545 *
4646 * This is not inside the module code because it's so much more performant to request all of the information at once
47 - * than it is to have each module requests it's own information. This sacrifice of modularity yields a profound
 47+ * than it is to have each module requests its own information. This sacrifice of modularity yields a profound
4848 * performance improvement.
4949 *
50 - * A first pass calculates dependent file modified times, a second one calculates message blob modified times.
51 - *
5250 * @param {array} $modules List of module names to preload information for
5351 * @param {ResourceLoaderContext} $context Context to load the information within
5452 */
@@ -66,7 +64,7 @@
6765 ), __METHOD__
6866 );
6967
70 - // Set modules dependecies
 68+ // Set modules' dependecies
7169 $modulesWithDeps = array();
7270 foreach ( $res as $row ) {
7371 $this->modules[$row->md_module]->setFileDependencies( $skin,
@@ -108,12 +106,12 @@
109107 /**
110108 * Runs JavaScript or CSS data through a filter, caching the filtered result for future calls.
111109 *
112 - * Availables filters are:
 110+ * Available filters are:
113111 * - minify-js \see JSMin::minify
114112 * - minify-css \see CSSMin::minify
115113 * - flip-css \see CSSJanus::transform
116114 *
117 - * If data is empty, only whitespace or the filter was unknown, data is returned unmodified.
 115+ * If $data is empty, only contains whitespace or the filter was unknown, $data is returned unmodified.
118116 *
119117 * @param {string} $filter Name of filter to run
120118 * @param {string} $data Text to filter, such as JavaScript or CSS text
@@ -327,10 +325,10 @@
328326 *
329327 * @param {ResourceLoaderContext} $context Context in which to generate a response
330328 * @param {array} $modules List of module objects keyed by module name
331 - * @param {array} $missing List of unavailables modules (optional)
 329+ * @param {array} $missing List of unavailable modules (optional)
332330 * @return {string} Response data
333331 */
334 - public function makeModuleResponse( ResourceLoaderContext $context, array $modules, $missing = null ) {
 332+ public function makeModuleResponse( ResourceLoaderContext $context, array $modules, $missing = array() ) {
335333 // Pre-fetch blobs
336334 $blobs = $context->shouldIncludeMessages() ?
337335 MessageBlobStore::get( $this, $modules, $context->getLanguage() ) : array();
Index: trunk/phase3/includes/resourceloader/ResourceLoaderContext.php
@@ -51,10 +51,10 @@
5252 $this->request = $request;
5353
5454 // Interpret request
55 - # list of modules
 55+ // List of modules
5656 $modules = $request->getVal( 'modules' );
5757 $this->modules = $modules ? explode( '|', $modules ) : array();
58 - # various parameters
 58+ // Various parameters
5959 $this->language = $request->getVal( 'lang' );
6060 $this->direction = $request->getVal( 'dir' );
6161 $this->skin = $request->getVal( 'skin' );

Status & tagging log