r72342 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r72341‎ | r72342 | r72343 >
Date:01:06, 4 September 2010
Author:mah
Status:ok
Tags:
Comment:
w/s changes
Modified paths:
  • /trunk/phase3/includes/Exception.php (modified) (history)
  • /trunk/phase3/includes/HttpFunctions.php (modified) (history)
  • /trunk/phase3/includes/Skin.php (modified) (history)
  • /trunk/phase3/includes/db/Database.php (modified) (history)
  • /trunk/phase3/includes/filerepo/LocalFile.php (modified) (history)
  • /trunk/phase3/includes/installer/CliInstaller.php (modified) (history)
  • /trunk/phase3/maintenance/parserTests.inc (modified) (history)
  • /trunk/phase3/maintenance/tests/LanguageConverterTest.php (modified) (history)
  • /trunk/phase3/maintenance/tests/UploadFromUrlTestSuite.php (modified) (history)
  • /trunk/phase3/maintenance/tests/selenium/Selenium.php (modified) (history)
  • /trunk/phase3/maintenance/tests/selenium/SeleniumTestSuite.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/parserTests.inc
@@ -657,7 +657,7 @@
658658 $db->query( "DROP TABLE IF EXISTS $newTableName" );
659659 } elseif ( in_array( $wgDBtype, array( 'postgres', 'oracle' ) ) ) {
660660 /* DROPs wouldn't work due to Foreign Key Constraints (bug 14990, r58669)
661 - * Use "DROP TABLE IF EXISTS $newTableName CASCADE" for postgres? That
 661+ * Use "DROP TABLE IF EXISTS $newTableName CASCADE" for postgres? That
662662 * syntax would also work for mysql.
663663 */
664664 } elseif ( $db->tableExists( $tbl ) ) {
Index: trunk/phase3/maintenance/tests/UploadFromUrlTestSuite.php
@@ -13,11 +13,11 @@
1414
1515 function setUp() {
1616 global $wgParser, $wgParserConf, $IP, $messageMemc, $wgMemc, $wgDeferredUpdateList,
17 - $wgUser, $wgLang, $wgOut, $wgRequest, $wgStyleDirectory, $wgEnableParserCache,
18 - $wgMessageCache, $wgUseDatabaseMessages, $wgMsgCacheExpiry, $parserMemc,
19 - $wgNamespaceAliases, $wgNamespaceProtection, $wgLocalFileRepo,
20 - $wgThumbnailScriptPath, $wgScriptPath,
21 - $wgArticlePath, $wgStyleSheetPath, $wgScript, $wgStylePath;
 17+ $wgUser, $wgLang, $wgOut, $wgRequest, $wgStyleDirectory, $wgEnableParserCache,
 18+ $wgMessageCache, $wgUseDatabaseMessages, $wgMsgCacheExpiry, $parserMemc,
 19+ $wgNamespaceAliases, $wgNamespaceProtection, $wgLocalFileRepo,
 20+ $wgThumbnailScriptPath, $wgScriptPath,
 21+ $wgArticlePath, $wgStyleSheetPath, $wgScript, $wgStylePath;
2222
2323 $wgScript = '/index.php';
2424 $wgScriptPath = '/';
@@ -163,10 +163,10 @@
164164 return $dir;
165165 }
166166
167 - public static function suite()
168 - {
169 - return new UploadFromUrlTestSuite( 'UploadFromUrlTest' );
170 - }
 167+ public static function suite()
 168+ {
 169+ return new UploadFromUrlTestSuite( 'UploadFromUrlTest' );
 170+ }
171171
172172 }
173173
Index: trunk/phase3/maintenance/tests/LanguageConverterTest.php
@@ -93,7 +93,7 @@
9494 $wgUser = User::newFromId( "admin" );
9595 $wgUser->setId( 1 );
9696 $wgUser->setOption( 'variant', 'tg-latn' ); // The user's data is ignored
97 - // because the variant is set in the URL.
 97+ // because the variant is set in the URL.
9898 $this->assertEquals( 'tg', $this->lc->getPreferredVariant( true, false ) );
9999 $this->assertEquals( 'tg', $this->lc->getPreferredVariant( true, true ) );
100100 }
Index: trunk/phase3/maintenance/tests/selenium/SeleniumTestSuite.php
@@ -15,7 +15,7 @@
1616 if ( $this->isSetUp ) {
1717 return;
1818 }
19 - $this->isSetUp = true;
 19+ $this->isSetUp = true;
2020 $this->selenium = Selenium::getInstance();
2121 $this->selenium->start();
2222 $this->login();
Index: trunk/phase3/maintenance/tests/selenium/Selenium.php
@@ -81,7 +81,7 @@
8282 if ( $value != true ) {
8383 throw new Testing_Selenium_Exception( "Login Failed" );
8484 }
85 -
 85+
8686 }
8787
8888 public static function getInstance() {
@@ -107,7 +107,7 @@
108108 public function log( $message ) {
109109 $this->logger->write( $message );
110110 }
111 -
 111+
112112 public function setUrl( $url ) {
113113 self::$url = $url;
114114 }
Index: trunk/phase3/includes/db/Database.php
@@ -186,7 +186,7 @@
187187
188188 /**
189189 * Returns true if this database requires that SELECT DISTINCT queries require that all
190 - ORDER BY expressions occur in the SELECT list per the SQL92 standard
 190+ ORDER BY expressions occur in the SELECT list per the SQL92 standard
191191 */
192192 function standardSelectDistinct() {
193193 return true;
@@ -2030,7 +2030,7 @@
20312031 * @return Database replication lag in seconds
20322032 */
20332033 function getLag() {
2034 - return $this->mFakeSlaveLag;
 2034+ return $this->mFakeSlaveLag;
20352035 }
20362036
20372037 /**
@@ -2096,7 +2096,7 @@
20972097 throw $e;
20982098 }
20992099 }
2100 -
 2100+
21012101 fclose( $fp );
21022102 return $error;
21032103 }
@@ -2554,16 +2554,16 @@
25552555 <small>$outofdate</small></div>
25562556 <!-- SiteSearch Google -->
25572557 <form method="get" action="http://www.google.com/search" id="googlesearch">
2558 - <input type="hidden" name="domains" value="$wgServer" />
2559 - <input type="hidden" name="num" value="50" />
2560 - <input type="hidden" name="ie" value="$wgInputEncoding" />
2561 - <input type="hidden" name="oe" value="$wgInputEncoding" />
 2558+ <input type="hidden" name="domains" value="$wgServer" />
 2559+ <input type="hidden" name="num" value="50" />
 2560+ <input type="hidden" name="ie" value="$wgInputEncoding" />
 2561+ <input type="hidden" name="oe" value="$wgInputEncoding" />
25622562
2563 - <input type="text" name="q" size="31" maxlength="255" value="$search" />
2564 - <input type="submit" name="btnG" value="$googlesearch" />
 2563+ <input type="text" name="q" size="31" maxlength="255" value="$search" />
 2564+ <input type="submit" name="btnG" value="$googlesearch" />
25652565 <div>
2566 - <input type="radio" name="sitesearch" id="gwiki" value="$wgServer" checked="checked" /><label for="gwiki">$wgSitename</label>
2567 - <input type="radio" name="sitesearch" id="gWWW" value="" /><label for="gWWW">WWW</label>
 2566+ <input type="radio" name="sitesearch" id="gwiki" value="$wgServer" checked="checked" /><label for="gwiki">$wgSitename</label>
 2567+ <input type="radio" name="sitesearch" id="gWWW" value="" /><label for="gWWW">WWW</label>
25682568 </div>
25692569 </form>
25702570 <!-- SiteSearch Google -->
Index: trunk/phase3/includes/filerepo/LocalFile.php
@@ -73,7 +73,7 @@
7474 $file->loadFromRow( $row );
7575 return $file;
7676 }
77 -
 77+
7878 /**
7979 * Create a LocalFile from a SHA-1 key
8080 * Do not call this except from inside a repo class.
@@ -91,7 +91,7 @@
9292 return false;
9393 }
9494 }
95 -
 95+
9696 /**
9797 * Fields in the image table
9898 */
@@ -130,7 +130,7 @@
131131 }
132132
133133 /**
134 - * Get the memcached key for the main data for this file, or false if
 134+ * Get the memcached key for the main data for this file, or false if
135135 * there is no access to the shared cache.
136136 */
137137 function getCacheKey() {
@@ -655,7 +655,7 @@
656656 $opts['ORDER BY'] = "oi_timestamp $order";
657657 $opts['USE INDEX'] = array( 'oldimage' => 'oi_name_timestamp' );
658658
659 - wfRunHooks( 'LocalFile::getHistory', array( &$this, &$tables, &$fields,
 659+ wfRunHooks( 'LocalFile::getHistory', array( &$this, &$tables, &$fields,
660660 &$conds, &$opts, &$join_conds ) );
661661
662662 $res = $dbr->select( $tables, $fields, $conds, __METHOD__, $opts, $join_conds );
@@ -792,7 +792,7 @@
793793 {
794794 if( is_null( $user ) ) {
795795 global $wgUser;
796 - $user = $wgUser;
 796+ $user = $wgUser;
797797 }
798798
799799 $dbw = $this->repo->getMasterDB();
@@ -914,7 +914,7 @@
915915 $nullRevision = Revision::newNullRevision( $dbw, $descTitle->getArticleId(),
916916 $log->getRcComment(), false );
917917 $nullRevision->insertOn( $dbw );
918 -
 918+
919919 wfRunHooks( 'NewRevisionFromEditComplete', array( $article, $nullRevision, $latest, $user ) );
920920 $article->updateRevisionOn( $dbw, $nullRevision );
921921
@@ -1023,7 +1023,7 @@
10241024 // Purge the new image
10251025 $this->purgeEverything();
10261026 }
1027 -
 1027+
10281028 return $status;
10291029 }
10301030
@@ -1870,7 +1870,7 @@
18711871 $dbw = $this->db;
18721872
18731873 // Update current image
1874 - $dbw->update(
 1874+ $dbw->update(
18751875 'image',
18761876 array( 'img_name' => $this->newName ),
18771877 array( 'img_name' => $this->oldName ),
@@ -1902,7 +1902,7 @@
19031903
19041904 /**
19051905 * Generate triplets for FSRepo::storeBatch().
1906 - */
 1906+ */
19071907 function getMoveTriplets() {
19081908 $moves = array_merge( array( $this->cur ), $this->olds );
19091909 $triplets = array(); // The format is: (srcUrl, destZone, destUrl)
@@ -1917,7 +1917,7 @@
19181918
19191919 /**
19201920 * Removes non-existent files from move batch.
1921 - */
 1921+ */
19221922 function removeNonexistentFiles( $triplets ) {
19231923 $files = array();
19241924 foreach( $triplets as $file )
Index: trunk/phase3/includes/installer/CliInstaller.php
@@ -35,7 +35,7 @@
3636
3737 /**
3838 * Constructor.
39 - *
 39+ *
4040 * @param $siteName
4141 * @param $admin
4242 * @param $option Array
@@ -59,7 +59,7 @@
6060 }
6161
6262 $this->setVar( 'wgSitename', $siteName );
63 -
 63+
6464 if ( $admin ) {
6565 $this->setVar( '_AdminName', $admin );
6666 }
@@ -96,7 +96,7 @@
9797
9898 public function endStage( $step, $status ) {
9999 $warnings = $status->getWarningsArray();
100 -
 100+
101101 if ( !$status->isOk() ) {
102102 $this->showStatusMessage( $status );
103103 echo "\n";
@@ -107,7 +107,7 @@
108108 wfMsg( 'word-separator' ) );
109109 }
110110 }
111 -
 111+
112112 $this->showMessage( wfMsg( 'config-install-step-done' ) ."\n");
113113 }
114114
Index: trunk/phase3/includes/HttpFunctions.php
@@ -26,7 +26,7 @@
2727 * - sslVerifyCert (curl only) Verify SSL certificate
2828 * - caInfo (curl only) Provide CA information
2929 * - maxRedirects Maximum number of redirects to follow (defaults to 5)
30 - * - followRedirects Whether to follow redirects (defaults to false).
 30+ * - followRedirects Whether to follow redirects (defaults to false).
3131 * Note: this should only be used when the target URL is trusted,
3232 * to avoid attacks on intranet services accessible by HTTP.
3333 * @return Mixed: (bool)false on failure or a string on success
@@ -222,7 +222,7 @@
223223
224224 /**
225225 * Set the parameters of the request
226 -
 226+
227227 * @param $args Array
228228 * @todo overload the args param
229229 */
@@ -502,7 +502,7 @@
503503 }
504504
505505 /**
506 - * Returns true if the backend can follow redirects. Overridden by the
 506+ * Returns true if the backend can follow redirects. Overridden by the
507507 * child classes.
508508 */
509509 public function canFollowRedirects() {
@@ -767,7 +767,7 @@
768768 if ( isset( $this->sslVerifyHost ) ) {
769769 $this->curlOptions[CURLOPT_SSL_VERIFYHOST] = $this->sslVerifyHost;
770770 }
771 -
 771+
772772 if ( isset( $this->sslVerifyCert ) ) {
773773 $this->curlOptions[CURLOPT_SSL_VERIFYPEER] = $this->sslVerifyCert;
774774 }
@@ -800,7 +800,7 @@
801801 if ( ! @curl_setopt( $curlHandle, CURLOPT_FOLLOWLOCATION, true ) ) {
802802 wfDebug( __METHOD__.": Couldn't set CURLOPT_FOLLOWLOCATION. " .
803803 "Probably safe_mode or open_basedir is set.\n");
804 - // Continue the processing. If it were in curl_setopt_array,
 804+ // Continue the processing. If it were in curl_setopt_array,
805805 // processing would have halted on its entry
806806 }
807807 }
Index: trunk/phase3/includes/Skin.php
@@ -664,10 +664,10 @@
665665
666666 wfProfileOut( __METHOD__ );
667667 }
668 -
 668+
669669 /**
670670 * Get the query to generate a dynamic stylesheet
671 - *
 671+ *
672672 * @return array
673673 */
674674 public static function getDynamicStylesheetQuery() {
@@ -2140,14 +2140,14 @@
21412141 * Currently only used for MediaWiki:Sidebar (but may be used by Extensions)
21422142 *
21432143 * This is just a wrapper around addToSidebarPlain() for backwards compatibility
2144 - *
 2144+ *
21452145 * @param &$bar array
21462146 * @param $message String
21472147 */
21482148 function addToSidebar( &$bar, $message ) {
21492149 $this->addToSidebarPlain( $bar, wfMsgForContent( $message ) );
21502150 }
2151 -
 2151+
21522152 /**
21532153 * Add content from plain text
21542154 * @since 1.17
@@ -2205,12 +2205,12 @@
22062206 );
22072207 } else if ( (substr($line, 0, 2) == '{{') && (substr($line, -2) == '}}') ) {
22082208 global $wgParser, $wgTitle;
2209 -
 2209+
22102210 $line = substr($line, 2, strlen($line) - 4 );
2211 -
 2211+
22122212 if (is_null($wgParser->mOptions))
22132213 $wgParser->mOptions = new ParserOptions();
2214 -
 2214+
22152215 $wgParser->mOptions->setEditSection(false);
22162216 $wikiBar[$heading] = $wgParser->parse( wfMsgForContentNoTrans( $line ) , $wgTitle, $wgParser->mOptions )->getText();
22172217 } else {
@@ -2218,10 +2218,10 @@
22192219 }
22202220 }
22212221 }
2222 -
 2222+
22232223 if ( count($wikiBar) > 0 )
22242224 $bar = array_merge($bar, $wikiBar);
2225 -
 2225+
22262226 return $bar;
22272227 }
22282228
Index: trunk/phase3/includes/Exception.php
@@ -229,7 +229,7 @@
230230 function htmlFooter() {
231231 return "</body></html>";
232232 }
233 -
 233+
234234 /**
235235 * headers handled by subclass?
236236 */

Follow-up revisions

RevisionCommit summaryAuthorDate
r72375More whitespace updates for files touched in r72342:...siebrand13:48, 4 September 2010

Status & tagging log