r79909 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r79908‎ | r79909 | r79910 >
Date:18:31, 9 January 2011
Author:nikerabbit
Status:ok
Tags:
Comment:
Partial revert of r79903, unstubbing needs localisation cache which might need database
Modified paths:
  • /trunk/phase3/includes/Exception.php (modified) (history)
  • /trunk/phase3/includes/db/Database.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/db/Database.php
@@ -2845,7 +2845,7 @@
28462846
28472847 $header = "$wgSitename has a problem";
28482848
2849 - if ( is_object( $wgLang ) ) {
 2849+ if ( $wgLang instanceof Language ) {
28502850 $header = htmlspecialchars( $wgLang->getMessage( 'dberr-header' ) );
28512851 }
28522852
@@ -2859,7 +2859,7 @@
28602860 $again = 'Try waiting a few minutes and reloading.';
28612861 $info = '(Can\'t contact the database server: $1)';
28622862
2863 - if ( is_object( $wgLang ) ) {
 2863+ if ( $wgLang instanceof Language ) {
28642864 $sorry = htmlspecialchars( $wgLang->getMessage( 'dberr-problems' ) );
28652865 $again = htmlspecialchars( $wgLang->getMessage( 'dberr-again' ) );
28662866 $info = htmlspecialchars( $wgLang->getMessage( 'dberr-info' ) );
@@ -2896,7 +2896,7 @@
28972897 $cachederror = "This is a cached copy of the requested page, and may not be up to date. ";
28982898
28992899 # Localize it if possible...
2900 - if ( is_object( $wgLang ) ) {
 2900+ if ( $wgLang instanceof Language ) {
29012901 $cachederror = htmlspecialchars( $wgLang->getMessage( 'dberr-cachederror' ) );
29022902 }
29032903
@@ -2921,7 +2921,7 @@
29222922 $outofdate = "Note that their indexes of our content may be out of date.";
29232923 $googlesearch = "Search";
29242924
2925 - if ( is_object( $wgLang ) ) {
 2925+ if ( $wgLang instanceof Language ) {
29262926 $usegoogle = htmlspecialchars( $wgLang->getMessage( 'dberr-usegoogle' ) );
29272927 $outofdate = htmlspecialchars( $wgLang->getMessage( 'dberr-outofdate' ) );
29282928 $googlesearch = htmlspecialchars( $wgLang->getMessage( 'searchbutton' ) );
@@ -2963,7 +2963,7 @@
29642964
29652965 $mainpage = 'Main Page';
29662966
2967 - if ( is_object( $wgLang ) ) {
 2967+ if ( $wgLang instanceof Language ) {
29682968 $mainpage = htmlspecialchars( $wgLang->getMessage( 'mainpage' ) );
29692969 }
29702970
Index: trunk/phase3/includes/Exception.php
@@ -39,7 +39,7 @@
4040 }
4141 }
4242
43 - return is_object( $wgLang );
 43+ return $wgLang instanceof Language;
4444 }
4545
4646 /**
@@ -243,7 +243,7 @@
244244 $dir = 'ltr';
245245 $code = 'en';
246246
247 - if ( $this->useMessageCache() ) {
 247+ if ( $wgLang instanceof Language ) {
248248 $left = $wgLang->alignStart();
249249 $right = $wgLang->alignEnd();
250250 $dir = $wgLang->getDir();

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r79903Follow-up r79880: check if $wgLang can be used....nikerabbit17:08, 9 January 2011

Status & tagging log