r46760 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r46759‎ | r46760 | r46761 >
Date:12:08, 3 February 2009
Author:ialex
Status:deferred
Tags:
Comment:
Removed messages used for errors when loading Farmer, wfMsgHtml() and related stuff cannot be called at this time since this used when executing LocalSettings.php
Modified paths:
  • /trunk/extensions/Farmer/Farmer.i18n.php (modified) (history)
  • /trunk/extensions/Farmer/MediaWikiFarmer.php (modified) (history)
  • /trunk/extensions/Farmer/MediaWikiFarmer_Wiki.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Farmer/Farmer.i18n.php
@@ -127,13 +127,7 @@
128128 'farmer-extensions-register-name' => 'Name',
129129 'farmer-extensions-register-includefile' => 'Include file',
130130 'farmer-error-exists' => 'Cannot create wiki. It already exists: $1',
131 - 'farmer-error-nodirconfig' => 'configDirectory not found:',
132 - 'farmer-error-defnotset' => 'Default wiki must be set',
133 - 'farmer-error-mapnotfound' => 'Function to map wiki name in farm not found:',
134 - 'farmer-error-nofileconfwrite' => 'MediaWikiFarmer could not write the default wiki configuration file.',
135 - 'farmer-error-funcnotcall' => 'Could not call function:',
136131 'farmer-error-noextwrite' => 'Unable to write out extension file:',
137 - 'farmer-error-wikicorrupt' => 'Stored wiki is corrupt',
138132 );
139133
140134 /** Message documentation (Message documentation)
Index: trunk/extensions/Farmer/MediaWikiFarmer.php
@@ -106,7 +106,7 @@
107107 }
108108
109109 if( !is_dir( $this->_configDirectory ) ){
110 - throw new MWException( wfMsgHtml( 'farmer-error-nodirconfig' ) . wfMsgHtml( 'word-separator' ) . $this->_configDirectory );
 110+ throw new MWException( 'configDirectory not found: ' . $this->_configDirectory );
111111 } else {
112112 if ( !is_dir( $this->_configDirectory . '/wikis/' ) ){
113113 mkdir( $this->_configDirectory . '/wikis' );
@@ -132,7 +132,7 @@
133133 */
134134 public function run() {
135135 if( !$this->_defaultWiki ) {
136 - throw new MWException( wfMsgHtml( 'farmer-error-defnotset' ) );
 136+ throw new MWException( 'Default wiki must be set' );
137137 }
138138
139139 // first we try to find the wiki name that was accessed by calling the appropriate function
@@ -153,7 +153,7 @@
154154 return $this->_doWiki( $wiki );
155155
156156 } else {
157 - throw new MWException( wfMsgHtml('farmer-error-mapnotfound') . wfMsgHtml( 'word-separator' ) . print_r( $this->_matchFunction, true ) );
 157+ throw new MWException( 'Function to map wiki name in farm not found: ' . print_r( $this->_matchFunction, true ) );
158158 }
159159 }
160160
@@ -177,7 +177,7 @@
178178 $wiki->save();
179179
180180 if( !$wiki->exists() ){
181 - throw new MWException( wfMsgHtml( 'farmer-error-nofileconfwrite' ) );
 181+ throw new MWException( 'MediaWikiFarmer could not write the default wiki configuration file.' );
182182 } else {
183183 $this->updateFarmList();
184184 $wiki->initialize();
@@ -189,7 +189,7 @@
190190 if( is_callable( $this->_onUnknownWikiFunction ) ){
191191 call_user_func( $this->_onUnknownWikiFunction, $this, $wiki );
192192 } else {
193 - throw new MWException( wfMsgHtml( 'farmer-error-funcnotcall' ) . wfMsgHtml( 'word-separator' ) . print_r( $this->_onUnknownFunction, true ) );
 193+ throw new MWException( 'Could not call function: ' . print_r( $this->_onUnknownFunction, true ) );
194194 }
195195 }
196196 } else {
Index: trunk/extensions/Farmer/MediaWikiFarmer_Wiki.php
@@ -73,7 +73,7 @@
7474 if( $obj instanceof MediaWikiFarmer_Wiki ){
7575 return $obj;
7676 } else {
77 - throw new MWException( wfMsgHtml( 'farmer-error-wikicorrupt' ) );
 77+ throw new MWException( 'Stored wiki is corrupt.' );
7878 }
7979 } else {
8080 return new MediaWikiFarmer_Wiki( $wiki, $variables );

Status & tagging log