set mediawiki version number
[lhc/web/wiklou.git] / includes / installer / Installer.php
index caf7b69..8140527 100644 (file)
@@ -339,7 +339,7 @@ abstract class Installer {
 
                // Load the installer's i18n file.
                $wgExtensionMessagesFiles['MediawikiInstaller'] =
-                       dirname( __FILE__ ) . '/Installer.i18n.php';
+                       __DIR__ . '/Installer.i18n.php';
 
                // Having a user with id = 0 safeguards us from DB access via User::loadOptions().
                $wgUser = User::newFromId( 0 );
@@ -935,7 +935,7 @@ abstract class Installer {
         */
        protected function envCheckPath() {
                global $IP;
-               $IP = dirname( dirname( dirname( __FILE__ ) ) );
+               $IP = dirname( dirname( __DIR__ ) );
                $this->setVar( 'IP', $IP );
 
                $this->showMessage( 'config-using-uri', $this->getVar( 'wgServer' ), $this->getVar( 'wgScriptPath' ) );
@@ -1594,13 +1594,16 @@ abstract class Installer {
                $status = Status::newGood();
                try {
                        $page = WikiPage::factory( Title::newMainPage() );
-                       $page->doEdit( wfMessage( 'mainpagetext' )->inContentLanguage()->text() . "\n\n" .
-                                       wfMessage( 'mainpagedocfooter' )->inContentLanguage()->text(),
-                                       '',
-                                       EDIT_NEW,
-                                       false,
-                                       User::newFromName( 'MediaWiki default' )
+                       $content = new WikitextContent (
+                               wfMessage( 'mainpagetext' )->inContentLanguage()->text() . "\n\n" .
+                               wfMessage( 'mainpagedocfooter' )->inContentLanguage()->text()
                        );
+
+                       $page->doEditContent( $content,
+                                                       '',
+                                                       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() );