r88536 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r88535‎ | r88536 | r88537 >
Date:19:35, 21 May 2011
Author:reedy
Status:ok
Tags:
Comment:
Fix function level comments that start with /* not /**
Modified paths:
  • /trunk/phase3/includes/Article.php (modified) (history)
  • /trunk/phase3/includes/ChangesFeed.php (modified) (history)
  • /trunk/phase3/includes/ConfEditor.php (modified) (history)
  • /trunk/phase3/includes/EditPage.php (modified) (history)
  • /trunk/phase3/includes/MimeMagic.php (modified) (history)
  • /trunk/phase3/includes/Title.php (modified) (history)
  • /trunk/phase3/includes/db/DatabaseSqlite.php (modified) (history)
  • /trunk/phase3/includes/db/LBFactory.php (modified) (history)
  • /trunk/phase3/includes/filerepo/File.php (modified) (history)
  • /trunk/phase3/includes/filerepo/FileRepo.php (modified) (history)
  • /trunk/phase3/includes/filerepo/ForeignAPIRepo.php (modified) (history)
  • /trunk/phase3/includes/installer/SqliteInstaller.php (modified) (history)
  • /trunk/phase3/includes/media/BMP.php (modified) (history)
  • /trunk/phase3/includes/media/Generic.php (modified) (history)
  • /trunk/phase3/includes/media/SVG.php (modified) (history)
  • /trunk/phase3/includes/media/SVGMetadataExtractor.php (modified) (history)
  • /trunk/phase3/includes/media/XMP.php (modified) (history)
  • /trunk/phase3/includes/objectcache/BagOStuff.php (modified) (history)
  • /trunk/phase3/includes/parser/CoreParserFunctions.php (modified) (history)
  • /trunk/phase3/includes/search/SearchPostgres.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/search/SearchPostgres.php
@@ -67,11 +67,10 @@
6868 return new PostgresSearchResultSet( $resultSet, $this->searchTerms );
6969 }
7070
71 -
72 - /*
 71+ /**
7372 * Transform the user's search string into a better form for tsearch2
7473 * Returns an SQL fragment consisting of quoted text to search for.
75 - */
 74+ */
7675 function parseQuery( $term ) {
7776
7877 wfDebug( "parseQuery received: $term \n" );
Index: trunk/phase3/includes/Article.php
@@ -2703,7 +2703,7 @@
27042704 }
27052705
27062706
2707 - /*
 2707+ /**
27082708 * UI entry point for page deletion
27092709 */
27102710 public function delete() {
Index: trunk/phase3/includes/MimeMagic.php
@@ -157,11 +157,11 @@
158158 private static $extensionLoaded = false;
159159
160160 /** Initializes the MimeMagic object. This is called by MimeMagic::singleton().
161 - *
162 - * This constructor parses the mime.types and mime.info files and build internal mappings.
163 - */
 161+ *
 162+ * This constructor parses the mime.types and mime.info files and build internal mappings.
 163+ */
164164 function __construct() {
165 - /*
 165+ /**
166166 * --- load mime.types ---
167167 */
168168
@@ -244,9 +244,9 @@
245245 }
246246 }
247247
248 - /*
249 - * --- load mime.info ---
250 - */
 248+ /**
 249+ * --- load mime.info ---
 250+ */
251251
252252 global $wgMimeInfoFile;
253253 if ( $wgMimeInfoFile == 'includes/mime.info' ) {
@@ -628,7 +628,7 @@
629629 return "image/webp";
630630 }
631631
632 - /*
 632+ /**
633633 * Look for PHP. Check for this before HTML/XML... Warning: this is a
634634 * heuristic, and won't match a file with a lot of non-PHP before. It
635635 * will also match text files which could be PHP. :)
@@ -652,7 +652,7 @@
653653 return 'application/x-php';
654654 }
655655
656 - /*
 656+ /**
657657 * look for XML formats (XHTML and SVG)
658658 */
659659 $xml = new XmlTypeCheck( $file );
@@ -665,7 +665,7 @@
666666 }
667667 }
668668
669 - /*
 669+ /**
670670 * look for shell scripts
671671 */
672672 $script_type = null;
Index: trunk/phase3/includes/objectcache/BagOStuff.php
@@ -64,7 +64,7 @@
6565 */
6666 abstract public function set( $key, $value, $exptime = 0 );
6767
68 - /*
 68+ /**
6969 * Delete an item.
7070 * @param $key string
7171 * @param $time int Amount of time to delay the operation (mostly memcached-specific)
Index: trunk/phase3/includes/parser/CoreParserFunctions.php
@@ -442,10 +442,11 @@
443443 return '';
444444 return wfUrlencode( $t->getSubjectNsText() );
445445 }
446 - /*
 446+
 447+ /**
447448 * Functions to get and normalize pagenames, corresponding to the magic words
448449 * of the same names
449 - */
 450+ */
450451 static function pagename( $parser, $title = null ) {
451452 $t = Title::newFromText( $title );
452453 if ( is_null( $t ) )
Index: trunk/phase3/includes/db/LBFactory.php
@@ -80,7 +80,7 @@
8181 */
8282 abstract function getMainLB( $wiki = false );
8383
84 - /*
 84+ /**
8585 * Create a new load balancer for external storage. The resulting object will be
8686 * untracked, not chronology-protected, and the caller is responsible for
8787 * cleaning it up.
@@ -90,7 +90,7 @@
9191 */
9292 abstract function newExternalLB( $cluster, $wiki = false );
9393
94 - /*
 94+ /**
9595 * Get a cached (tracked) load balancer for external storage
9696 *
9797 * @param $cluster String: external storage cluster, or false for core
Index: trunk/phase3/includes/db/DatabaseSqlite.php
@@ -620,7 +620,7 @@
621621 return $s;
622622 }
623623
624 - /*
 624+ /**
625625 * Build a concatenation list to feed into a SQL query
626626 *
627627 * @return string
Index: trunk/phase3/includes/filerepo/FileRepo.php
@@ -150,7 +150,7 @@
151151 return false;
152152 }
153153
154 - /*
 154+ /**
155155 * Find many files at once.
156156 * @param $items An array of titles, or an array of findFile() options with
157157 * the "title" option giving the title. Example:
Index: trunk/phase3/includes/filerepo/ForeignAPIRepo.php
@@ -216,7 +216,7 @@
217217 }
218218 }
219219
220 - /*
 220+ /**
221221 * Return the imageurl from cache if possible
222222 *
223223 * If the url has been requested today, get it from cache
Index: trunk/phase3/includes/filerepo/File.php
@@ -930,6 +930,7 @@
931931 function getRepoName() {
932932 return $this->repo ? $this->repo->getName() : 'unknown';
933933 }
 934+
934935 /*
935936 * Returns the repository
936937 */
Index: trunk/phase3/includes/EditPage.php
@@ -287,7 +287,7 @@
288288 return '';
289289 }
290290
291 - /*
 291+ /**
292292 * Check if a page was deleted while the user was editing it, before submit.
293293 * Note that we rely on the logging table, which hasn't been always there,
294294 * but that doesn't matter, because this only applies to brand new
@@ -1882,7 +1882,7 @@
18831883 $wgOut->addHTML( "</div><!-- editButtons -->\n</div><!-- editOptions -->\n" );
18841884 }
18851885
1886 - /*
 1886+ /**
18871887 * Show an edit conflict. textbox1 is already shown in showEditForm().
18881888 * If you want to use another entry point to this function, be careful.
18891889 */
Index: trunk/phase3/includes/ChangesFeed.php
@@ -61,11 +61,11 @@
6262
6363 FeedUtils::checkPurge( $timekey, $key );
6464
65 - /*
66 - * Bumping around loading up diffs can be pretty slow, so where
67 - * possible we want to cache the feed output so the next visitor
68 - * gets it quick too.
69 - */
 65+ /**
 66+ * Bumping around loading up diffs can be pretty slow, so where
 67+ * possible we want to cache the feed output so the next visitor
 68+ * gets it quick too.
 69+ */
7070 $cachedFeed = $this->loadFromCache( $lastmod, $timekey, $key );
7171 if( is_string( $cachedFeed ) ) {
7272 wfDebug( "RC: Outputting cached feed\n" );
@@ -110,12 +110,12 @@
111111 $feedLastmod = $messageMemc->get( $timekey );
112112
113113 if( ( $wgFeedCacheTimeout > 0 ) && $feedLastmod ) {
114 - /*
115 - * If the cached feed was rendered very recently, we may
116 - * go ahead and use it even if there have been edits made
117 - * since it was rendered. This keeps a swarm of requests
118 - * from being too bad on a super-frequently edited wiki.
119 - */
 114+ /**
 115+ * If the cached feed was rendered very recently, we may
 116+ * go ahead and use it even if there have been edits made
 117+ * since it was rendered. This keeps a swarm of requests
 118+ * from being too bad on a super-frequently edited wiki.
 119+ */
120120
121121 $feedAge = time() - wfTimestamp( TS_UNIX, $feedLastmod );
122122 $feedLastmodUnix = wfTimestamp( TS_UNIX, $feedLastmod );
Index: trunk/phase3/includes/installer/SqliteInstaller.php
@@ -45,7 +45,7 @@
4646 $this->getTextBox( 'wgDBname', 'config-db-name', array(), $this->parent->getHelpBox( 'config-sqlite-name-help' ) );
4747 }
4848
49 - /*
 49+ /**
5050 * Safe wrapper for PHP's realpath() that fails gracefully if it's unable to canonicalize the path.
5151 */
5252 private static function realpath( $path ) {
Index: trunk/phase3/includes/media/SVGMetadataExtractor.php
@@ -83,14 +83,14 @@
8484 wfRestoreWarnings();
8585 }
8686
87 - /*
 87+ /**
8888 * @return Array with the known metadata
8989 */
9090 public function getMetadata() {
9191 return $this->metadata;
9292 }
9393
94 - /*
 94+ /**
9595 * Read the SVG
9696 */
9797 public function read() {
@@ -142,7 +142,7 @@
143143 return true;
144144 }
145145
146 - /*
 146+ /**
147147 * Read a textelement from an element
148148 *
149149 * @param String $name of the element that we are reading from
@@ -179,7 +179,7 @@
180180 $this->reader->next();
181181 }
182182
183 - /*
 183+ /**
184184 * Filter all children, looking for animate elements
185185 *
186186 * @param String $name of the element that we are reading from
@@ -238,7 +238,7 @@
239239 wfDebug( "SVGReader WARN: $data\n" );
240240 }
241241
242 - /*
 242+ /**
243243 * Parse the attributes of an SVG element
244244 *
245245 * The parser has to be in the start element of <svg>
Index: trunk/phase3/includes/media/SVG.php
@@ -105,7 +105,7 @@
106106 }
107107 }
108108
109 - /*
 109+ /**
110110 * Transform an SVG file to PNG
111111 * This function can be called outside of thumbnail contexts
112112 * @param string $srcPath
Index: trunk/phase3/includes/media/XMP.php
@@ -40,7 +40,7 @@
4141
4242 protected $items;
4343
44 - /*
 44+ /**
4545 * These are various mode constants.
4646 * they are used to figure out what to do
4747 * with an element when its encountered.
Index: trunk/phase3/includes/media/Generic.php
@@ -48,7 +48,7 @@
4949 */
5050 abstract function getParamMap();
5151
52 - /*
 52+ /**
5353 * Validate a thumbnail parameter at parse time.
5454 * Return true to accept the parameter, and false to reject it.
5555 * If you return false, the parser will do something quiet and forgiving.
Index: trunk/phase3/includes/media/BMP.php
@@ -23,7 +23,7 @@
2424 return array( 'png', 'image/png' );
2525 }
2626
27 - /*
 27+ /**
2828 * Get width and height from the bmp header.
2929 */
3030 function getImageSize( $image, $filename ) {
Index: trunk/phase3/includes/Title.php
@@ -1770,7 +1770,7 @@
17711771 # Not a public wiki, so no shortcut
17721772 $useShortcut = false;
17731773 } elseif ( !empty( $wgRevokePermissions ) ) {
1774 - /*
 1774+ /**
17751775 * Iterate through each group with permissions being revoked (key not included since we don't care
17761776 * what the group name is), then check if the read permission is being revoked. If it is, then
17771777 * we don't use the shortcut below since the user might not be able to read, even though anon
Index: trunk/phase3/includes/ConfEditor.php
@@ -472,7 +472,7 @@
473473 return $extraPath;
474474 }
475475
476 - /*
 476+ /**
477477 * Find the path name of first element in the array.
478478 * If the array is empty, this will return the \@extra interstitial element.
479479 * If the specified path is not found or is not an array, it will return false.

Status & tagging log