Merge "Replace deprecated wfMsg* calls with Message class calls."
authorIAlex <ialex.wiki@gmail.com>
Wed, 22 Aug 2012 18:37:29 +0000 (18:37 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 22 Aug 2012 18:37:29 +0000 (18:37 +0000)
1  2 
includes/installer/Installer.php

@@@ -308,7 -308,7 +308,7 @@@ abstract class Installer 
  
        /**
         * UI interface for displaying a short message
-        * The parameters are like parameters to wfMsg().
+        * The parameters are like parameters to wfMessage().
         * The messages will be in wikitext format, which will be converted to an
         * output format such as HTML or text before being sent to the user.
         * @param $msg
                $allNames = array();
  
                foreach ( self::getDBTypes() as $name ) {
-                       $allNames[] = wfMsg( "config-type-$name" );
+                       $allNames[] = wfMessage( "config-type-$name" )->text();
                }
  
                // cache initially available databases to make sure that everything will be displayed correctly
  
        /**
         * Environment check for the PCRE module.
 +       *
 +       * @note If this check were to fail, the parser would
 +       *   probably throw an exception before the result
 +       *   of this check is shown to the user.
         * @return bool
         */
        protected function envCheckPCRE() {
                }
                wfSuppressWarnings();
                $regexd = preg_replace( '/[\x{0430}-\x{04FF}]/iu', '', '-АБВГД-' );
 +              // Need to check for \p support too, as PCRE can be compiled
 +              // with utf8 support, but not unicode property support.
 +              // check that \p{Zs} (space separators) matches
 +              // U+3000 (Ideographic space)
 +              $regexprop = preg_replace( '/\p{Zs}/u', '', "-\xE3\x80\x80-" );
                wfRestoreWarnings();
 -              if ( $regexd != '--' ) {
 +              if ( $regexd != '--' || $regexprop != '--' ) {
                        $this->showError( 'config-pcre-no-utf8' );
                        return false;
                }
                $status = Status::newGood();
                try {
                        $page = WikiPage::factory( Title::newMainPage() );
-                       $page->doEdit( wfMsgForContent( 'mainpagetext' ) . "\n\n" .
-                                                       wfMsgForContent( 'mainpagedocfooter' ),
-                                                       '',
-                                                       EDIT_NEW,
-                                                       false,
-                                                       User::newFromName( 'MediaWiki default' ) );
+                       $page->doEdit( wfMessage( 'mainpagetext' )->inContentLanguage()->text() . "\n\n" .
+                                       wfMessage( 'mainpagedocfooter' )->inContentLanguage()->text(),
+                                       '',
+                                       EDIT_NEW,
+                                       false,
+                                       User::newFromName( 'MediaWiki default' )
+                       );
                } catch (MWException $e) {
                        //using raw, because $wgShowExceptionDetails can not be set yet
                        $status->fatal( 'config-install-mainpage-failed', $e->getMessage() );