Merge "resources: Add OOjs UI's Apex theme's files"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Sat, 23 May 2015 16:53:57 +0000 (16:53 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Sat, 23 May 2015 16:53:57 +0000 (16:53 +0000)
25 files changed:
RELEASE-NOTES-1.25
api.php
docs/hooks.txt
includes/FileDeleteForm.php
includes/Message.php
includes/PHPVersionCheck.php [new file with mode: 0644]
includes/PHPVersionError.php
includes/ProtectionForm.php
includes/RevisionList.php
includes/page/Article.php
includes/resourceloader/ResourceLoaderStartUpModule.php
includes/revisiondelete/RevDelList.php
includes/specials/SpecialBlock.php
includes/specials/SpecialRevisiondelete.php
includes/specials/SpecialStatistics.php
includes/specials/SpecialTags.php
includes/specials/SpecialUpload.php
includes/title/MediaWikiTitleCodec.php
index.php
languages/i18n/en.json
load.php
maintenance/Maintenance.php
maintenance/update.php
mw-config/index.php
resources/src/mediawiki.language/mediawiki.language.numbers.js

index f5cec54..e74f226 100644 (file)
@@ -193,6 +193,7 @@ production.
 * $wgUseTidy is now set when parserTests are run with the tidy option to match
   output on wiki.
 * (T37472) update.php will purge ResourceLoader cache unless --nopurge is passed to it.
+* (T72109) mediawiki.language should respect $wgTranslateNumerals in convertNumber().
 
 === Action API changes in 1.25 ===
 * (T67403) XML tag highlighting is now only performed for formats
diff --git a/api.php b/api.php
index 9721c4f..a9e5683 100644 (file)
--- a/api.php
+++ b/api.php
@@ -35,12 +35,10 @@ use MediaWiki\Logger\LegacyLogger;
 // So extensions (and other code) can check whether they're running in API mode
 define( 'MW_API', true );
 
-// Bail if PHP is too low
-if ( !function_exists( 'version_compare' ) || version_compare( PHP_VERSION, '5.3.3' ) < 0 ) {
-       // We need to use dirname( __FILE__ ) here cause __DIR__ is PHP5.3+
-       require dirname( __FILE__ ) . '/includes/PHPVersionError.php';
-       wfPHPVersionError( 'api.php' );
-}
+// Bail on old versions of PHP, or if composer has not been run yet to install
+// dependencies. Using dirname( __FILE__ ) here because __DIR__ is PHP5.3+.
+require_once dirname( __FILE__ ) . '/includes/PHPVersionCheck.php';
+wfEntryPointCheck( 'api.php' );
 
 require __DIR__ . '/includes/WebStart.php';
 
index f03e38d..a14199f 100644 (file)
@@ -2787,7 +2787,13 @@ $term: string of search term
 
 'SpecialStatsAddExtra': Add extra statistic at the end of Special:Statistics.
 &$extraStats: Array to save the new stats
-  ( $extraStats['<name of statistic>'] => <value>; )
+  ( $extraStats['<name of statistic>'] => <value>;
+    <value> can be an array with the keys "name" and "number":
+    "name" is the HTML to be displayed in the name column
+    "number" is the number to be displayed.
+    or, <value> can be the number to be displayed and <name> is the
+    message key to use in the name column,
+$context: IContextSource object
 
 'SpecialUploadComplete': Called after successfully uploading a file from
 Special:Upload.
index c1d14db..6d74af2 100644 (file)
@@ -296,7 +296,7 @@ class FileDeleteForm {
                        Xml::closeElement( 'form' );
 
                        if ( $wgUser->isAllowed( 'editinterface' ) ) {
-                               $title = Title::makeTitle( NS_MEDIAWIKI, 'Filedelete-reason-dropdown' );
+                               $title = wfMessage( 'filedelete-reason-dropdown' )->inContentLanguage()->getTitle();
                                $link = Linker::link(
                                        $title,
                                        wfMessage( 'filedelete-edit-reasonlist' )->escaped(),
index 4935e33..329d97a 100644 (file)
@@ -364,6 +364,31 @@ class Message implements MessageSpecifier {
                return new self( $keys );
        }
 
+       /**
+        * Get a title object for a mediawiki message, where it can be found in the mediawiki namespace.
+        * The title will be for the current language, if the message key is in
+        * $wgForceUIMsgAsContentMsg it will be append with the language code (except content
+        * language), because Message::inContentLanguage will also return in user language.
+        *
+        * @see $wgForceUIMsgAsContentMsg
+        * @return Title
+        * @since 1.26
+        */
+       public function getTitle() {
+               global $wgContLang, $wgForceUIMsgAsContentMsg;
+
+               $code = $this->language->getCode();
+               $title = $this->key;
+               if (
+                       $wgContLang->getCode() !== $code
+                       && in_array( $this->key, (array)$wgForceUIMsgAsContentMsg )
+               ) {
+                       $title .= '/' . $code;
+               }
+
+               return Title::makeTitle( NS_MEDIAWIKI, $wgContLang->ucfirst( strtr( $title, ' ', '_' ) ) );
+       }
+
        /**
         * Adds parameters to the parameter list of this message.
         *
diff --git a/includes/PHPVersionCheck.php b/includes/PHPVersionCheck.php
new file mode 100644 (file)
index 0000000..d11d021
--- /dev/null
@@ -0,0 +1,157 @@
+<?php
+/**
+ * Check PHP Version, as well as for composer dependencies in entry points,
+ * and display something vaguely comprehensible in the event of a totally
+ * unrecoverable error.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
+ */
+
+/**
+ * Check php version and that external dependencies are installed, and
+ * display an informative error if either condition is not satisfied.
+ */
+function wfEntryPointCheck( $entryPoint ) {
+       if ( !function_exists( 'version_compare' )
+               || version_compare( PHP_VERSION, '5.3.3' ) < 0
+               || !file_exists( dirname( __FILE__ ) . '/../vendor/autoload.php' )
+       ) {
+               wfPHPVersionError( $entryPoint );
+       }
+}
+
+/**
+ * Display something vaguely comprehensible in the event of a totally unrecoverable error.
+ * Does not assume access to *anything*; no globals, no autoloader, no database, no localisation.
+ * Safe for PHP4 (and putting this here means that WebStart.php and GlobalSettings.php
+ * no longer need to be).
+ *
+ * Calling this function kills execution immediately.
+ *
+ * @param string $type Which entry point we are protecting. One of:
+ *   - index.php
+ *   - load.php
+ *   - api.php
+ *   - mw-config/index.php
+ *   - cli
+ *
+ * @note Since we can't rely on anything, the minimum PHP versions and MW current
+ * version are hardcoded here
+ */
+function wfPHPVersionError( $type ) {
+       $mwVersion = '1.26';
+       $minimumVersionPHP = '5.3.3';
+
+       $phpVersion = PHP_VERSION;
+       $protocol = isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0';
+       $message = "MediaWiki $mwVersion requires at least "
+               . "PHP version $minimumVersionPHP, you are using PHP $phpVersion. Installing some "
+               . " external dependencies (e.g. via composer) is also required.";
+
+       if ( $type == 'cli' ) {
+               $finalOutput = "Error: You are missing some external dependencies or are using on older PHP version. \n"
+                       . "MediaWiki $mwVersion needs PHP $minimumVersionPHP or higher.\n\n"
+                       . "Check if you have a newer php executable with a different name, such as php5.\n\n"
+                       . "MediaWiki now also has some external dependencies that need to be installed\n"
+                       . "via composer or from a separate git repo. Please see\n"
+                       . "https://www.mediawiki.org/wiki/Download_from_Git#Fetch_external_libraries\n"
+                       . "for help on installing the required components.";
+       } elseif ( $type == 'index.php' || $type == 'mw-config/index.php' ) {
+               $pathinfo = pathinfo( $_SERVER['SCRIPT_NAME'] );
+               if ( $type == 'mw-config/index.php' ) {
+                       $dirname = dirname( $pathinfo['dirname'] );
+               } else {
+                       $dirname = $pathinfo['dirname'];
+               }
+               $encLogo = htmlspecialchars(
+                       str_replace( '//', '/', $dirname . '/' ) .
+                       'resources/assets/mediawiki.png'
+               );
+
+               header( "$protocol 500 MediaWiki configuration Error" );
+               header( 'Content-type: text/html; charset=UTF-8' );
+               // Don't cache error pages!  They cause no end of trouble...
+               header( 'Cache-control: none' );
+               header( 'Pragma: no-cache' );
+
+               $finalOutput = <<<HTML
+<!DOCTYPE html>
+<html lang="en" dir="ltr">
+       <head>
+               <meta charset="UTF-8" />
+               <title>MediaWiki {$mwVersion}</title>
+               <style media='screen'>
+                       body {
+                               color: #000;
+                               background-color: #fff;
+                               font-family: sans-serif;
+                               padding: 2em;
+                               text-align: center;
+                       }
+                       p, img, h1, h2 {
+                               text-align: left;
+                               margin: 0.5em 0 1em;
+                       }
+                       h1 {
+                               font-size: 120%;
+                       }
+                       h2 {
+                               font-size: 110%;
+                       }
+               </style>
+       </head>
+       <body>
+               <img src="{$encLogo}" alt='The MediaWiki logo' />
+               <h1>MediaWiki {$mwVersion} internal error</h1>
+               <div class='error'>
+               <p>
+                       {$message}
+               </p>
+               <h2>Supported PHP versions</h2>
+               <p>
+                       Please consider <a href="http://www.php.net/downloads.php">upgrading your copy of PHP</a>.
+                       PHP versions less than 5.3.0 are no longer supported by the PHP Group and will not receive
+                       security or bugfix updates.
+               </p>
+               <p>
+                       If for some reason you are unable to upgrade your PHP version, you will need to
+                       <a href="https://www.mediawiki.org/wiki/Download">download</a> an older version
+                       of MediaWiki from our website.  See our
+                       <a href="https://www.mediawiki.org/wiki/Compatibility#PHP">compatibility page</a>
+                       for details of which versions are compatible with prior versions of PHP.
+               </p>
+               <h2>External dependencies</h2>
+               <p>
+                       MediaWiki now also has some external dependencies that need to be installed via
+                       composer or from a separate git repo. Please see
+                       <a href="https://www.mediawiki.org/wiki/Download_from_Git#Fetch_external_libraries">mediawiki.org</a>
+                       for help on installing the required components.
+               </p>
+               </div>
+       </body>
+</html>
+HTML;
+       // Handle everything that's not index.php
+       } else {
+               // So nothing thinks this is JS or CSS
+               $finalOutput = ( $type == 'load.php' ) ? "/* $message */" : $message;
+               header( "$protocol 500 MediaWiki configuration Error" );
+       }
+       echo "$finalOutput\n";
+       die( 1 );
+}
index 3a2f9f8..007ea89 100644 (file)
@@ -1,6 +1,7 @@
 <?php
 /**
- * Display something vaguely comprehensible in the event of a totally unrecoverable error.
+ * Backwards compatibility. The PHP version error function is now
+ * included in PHPVersionCheck.php.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  * http://www.gnu.org/copyleft/gpl.html
  *
+ * @deprecated 1.25
  * @file
  */
-
-/**
- * Display something vaguely comprehensible in the event of a totally unrecoverable error.
- * Does not assume access to *anything*; no globals, no autoloader, no database, no localisation.
- * Safe for PHP4 (and putting this here means that WebStart.php and GlobalSettings.php
- * no longer need to be).
- *
- * Calling this function kills execution immediately.
- *
- * @param string $type Which entry point we are protecting. One of:
- *   - index.php
- *   - load.php
- *   - api.php
- *   - mw-config/index.php
- *   - cli
- *
- * @note Since we can't rely on anything, the minimum PHP versions and MW current
- * version are hardcoded here
- */
-function wfPHPVersionError( $type ) {
-       $mwVersion = '1.26';
-       $minimumVersionPHP = '5.3.3';
-
-       $phpVersion = PHP_VERSION;
-       $protocol = isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0';
-       $message = "MediaWiki $mwVersion requires at least "
-               . "PHP version $minimumVersionPHP, you are using PHP $phpVersion.";
-
-       if ( $type == 'cli' ) {
-               $finalOutput = "You are using PHP version $phpVersion "
-                       . "but MediaWiki $mwVersion needs PHP $minimumVersionPHP or higher. ABORTING.\n"
-                       . "Check if you have a newer php executable with a different name, such as php5.\n";
-       } elseif ( $type == 'index.php' || $type == 'mw-config/index.php' ) {
-               $pathinfo = pathinfo( $_SERVER['SCRIPT_NAME'] );
-               if ( $type == 'mw-config/index.php' ) {
-                       $dirname = dirname( $pathinfo['dirname'] );
-               } else {
-                       $dirname = $pathinfo['dirname'];
-               }
-               $encLogo = htmlspecialchars(
-                       str_replace( '//', '/', $dirname . '/' ) .
-                       'resources/assets/mediawiki.png'
-               );
-
-               header( "$protocol 500 MediaWiki configuration Error" );
-               header( 'Content-type: text/html; charset=UTF-8' );
-               // Don't cache error pages!  They cause no end of trouble...
-               header( 'Cache-control: none' );
-               header( 'Pragma: no-cache' );
-
-               $finalOutput = <<<HTML
-<!DOCTYPE html>
-<html lang="en" dir="ltr">
-       <head>
-               <meta charset="UTF-8" />
-               <title>MediaWiki {$mwVersion}</title>
-               <style media='screen'>
-                       body {
-                               color: #000;
-                               background-color: #fff;
-                               font-family: sans-serif;
-                               padding: 2em;
-                               text-align: center;
-                       }
-                       p, img, h1 {
-                               text-align: left;
-                               margin: 0.5em 0;
-                       }
-                       h1 {
-                               font-size: 120%;
-                       }
-               </style>
-       </head>
-       <body>
-               <img src="{$encLogo}" alt='The MediaWiki logo' />
-               <h1>MediaWiki {$mwVersion} internal error</h1>
-               <div class='error'>
-               <p>
-                       {$message}
-               </p>
-               <p>
-                       Please consider <a href="http://www.php.net/downloads.php">upgrading your copy of PHP</a>.
-                       PHP versions less than 5.3.0 are no longer supported by the PHP Group and will not receive
-                       security or bugfix updates.
-               </p>
-               <p>
-                       If for some reason you are unable to upgrade your PHP version, you will need to
-                       <a href="https://www.mediawiki.org/wiki/Download">download</a> an older version
-                       of MediaWiki from our website.  See our
-                       <a href="https://www.mediawiki.org/wiki/Compatibility#PHP">compatibility page</a>
-                       for details of which versions are compatible with prior versions of PHP.
-               </p>
-               </div>
-       </body>
-</html>
-HTML;
-       // Handle everything that's not index.php
-       } else {
-               // So nothing thinks this is JS or CSS
-               $finalOutput = ( $type == 'load.php' ) ? "/* $message */" : $message;
-               header( "$protocol 500 MediaWiki configuration Error" );
-       }
-       echo "$finalOutput\n";
-       die( 1 );
-}
+require_once dirname( __FILE__ ) . '/PHPVersionCheck.php';
index c546de7..69b64dd 100644 (file)
@@ -541,9 +541,8 @@ class ProtectionForm {
                $out .= Xml::closeElement( 'fieldset' );
 
                if ( $user->isAllowed( 'editinterface' ) ) {
-                       $title = Title::makeTitle( NS_MEDIAWIKI, 'Protect-dropdown' );
                        $link = Linker::link(
-                               $title,
+                               $context->msg( 'protect-dropdown' )->inContentLanguage()->getTitle(),
                                $context->msg( 'protect-edit-reasonlist' )->escaped(),
                                array(),
                                array( 'action' => 'edit' )
index 1cb43f7..e417473 100644 (file)
@@ -30,6 +30,7 @@ abstract class RevisionListBase extends ContextSource {
        /** @var array */
        protected $ids;
 
+       /** @var ResultWrapper|bool */
        protected $res;
 
        /** @var bool|object */
index f6074eb..48f3161 100644 (file)
@@ -1772,9 +1772,8 @@ class Article implements Page {
                        Xml::closeElement( 'form' );
 
                        if ( $user->isAllowed( 'editinterface' ) ) {
-                               $dropdownTitle = Title::makeTitle( NS_MEDIAWIKI, 'Deletereason-dropdown' );
                                $link = Linker::link(
-                                       $dropdownTitle,
+                                       $ctx->msg( 'deletereason-dropdown' )->inContentLanguage()->getTitle(),
                                        wfMessage( 'delete-edit-reasonlist' )->escaped(),
                                        array(),
                                        array( 'action' => 'edit' )
index 74164df..06054ee 100644 (file)
@@ -78,6 +78,7 @@ class ResourceLoaderStartUpModule extends ResourceLoaderModule {
                        'wgServerName' => $conf->get( 'ServerName' ),
                        'wgUserLanguage' => $context->getLanguage(),
                        'wgContentLanguage' => $wgContLang->getCode(),
+                       'wgTranslateNumerals' => $conf->get( 'TranslateNumerals' ),
                        'wgVersion' => $conf->get( 'Version' ),
                        'wgEnableAPI' => $conf->get( 'EnableAPI' ),
                        'wgEnableWriteAPI' => $conf->get( 'EnableWriteAPI' ),
index f16fd15..7a3ddfe 100644 (file)
@@ -92,7 +92,9 @@ abstract class RevDelList extends RevisionListBase {
                $this->res = false;
                $dbw = wfGetDB( DB_MASTER );
                $this->doQuery( $dbw );
+
                $dbw->startAtomic( __METHOD__ );
+
                $status = Status::newGood();
                $missing = array_flip( $this->ids );
                $this->clearFileOps();
index 323575a..752edc3 100644 (file)
@@ -395,7 +395,7 @@ class SpecialBlock extends FormSpecialPage {
                # Link to edit the block dropdown reasons, if applicable
                if ( $user->isAllowed( 'editinterface' ) ) {
                        $links[] = Linker::link(
-                               Title::makeTitle( NS_MEDIAWIKI, 'Ipbreason-dropdown' ),
+                               $this->msg( 'ipbreason-dropdown' )->inContentLanguage()->getTitle(),
                                $this->msg( 'ipb-edit-dropdown' )->escaped(),
                                array(),
                                array( 'action' => 'edit' )
index c044146..21867b5 100644 (file)
@@ -450,9 +450,8 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
                                Xml::closeElement( 'form' ) . "\n";
                        // Show link to edit the dropdown reasons
                        if ( $this->getUser()->isAllowed( 'editinterface' ) ) {
-                               $title = Title::makeTitle( NS_MEDIAWIKI, 'Revdelete-reason-dropdown' );
                                $link = Linker::link(
-                                       $title,
+                                       $this->msg( 'revdelete-reason-dropdown' )->inContentLanguage()->getTitle(),
                                        $this->msg( 'revdelete-edit-reasonlist' )->escaped(),
                                        array(),
                                        array( 'action' => 'edit' )
index 3e3a2ab..652ea82 100644 (file)
@@ -78,7 +78,7 @@ class SpecialStatistics extends SpecialPage {
 
                # Statistic - other
                $extraStats = array();
-               if ( Hooks::run( 'SpecialStatsAddExtra', array( &$extraStats ) ) ) {
+               if ( Hooks::run( 'SpecialStatsAddExtra', array( &$extraStats, $this->getContext() ) ) ) {
                        $text .= $this->getOtherStats( $extraStats );
                }
 
@@ -262,12 +262,17 @@ class SpecialStatistics extends SpecialPage {
 
                                // Collect all items that belong to the same header
                                foreach ( $items as $key => $value ) {
-                                       $name = $this->msg( $key )->parse();
-                                       $number = htmlspecialchars( $value );
+                                       if ( is_array( $value ) ) {
+                                               $name = $value['name'];
+                                               $number = $value['number'];
+                                       } else {
+                                               $name = $this->msg( $key )->parse();
+                                               $number = $value;
+                                       }
 
                                        $return .= $this->formatRow(
                                                $name,
-                                               $this->getLanguage()->formatNum( $number ),
+                                               $this->getLanguage()->formatNum( htmlspecialchars( $number ) ),
                                                array( 'class' => 'mw-statistics-hook', 'id' => 'mw-' . $key )
                                        );
                                }
index 0b8147e..64c2cf3 100644 (file)
@@ -160,7 +160,7 @@ class SpecialTags extends SpecialPage {
                if ( $user->isAllowed( 'editinterface' ) ) {
                        $disp .= ' ';
                        $editLink = Linker::link(
-                               Title::makeTitle( NS_MEDIAWIKI, "Tag-$tag" ),
+                               $this->msg( "tag-$tag" )->inContentLanguage()->getTitle(),
                                $this->msg( 'tags-edit' )->escaped()
                        );
                        $disp .= $this->msg( 'parentheses' )->rawParams( $editLink )->escaped();
@@ -172,7 +172,7 @@ class SpecialTags extends SpecialPage {
                if ( $user->isAllowed( 'editinterface' ) ) {
                        $desc .= ' ';
                        $editDescLink = Linker::link(
-                               Title::makeTitle( NS_MEDIAWIKI, "Tag-$tag-description" ),
+                               $this->msg( "tag-$tag-description" )->inContentLanguage()->getTitle(),
                                $this->msg( 'tags-edit' )->escaped()
                        );
                        $desc .= $this->msg( 'parentheses' )->rawParams( $editDescLink )->escaped();
index 2d8f978..1618527 100644 (file)
@@ -818,7 +818,7 @@ class UploadForm extends HTMLForm {
                # Add a link to edit MediaWik:Licenses
                if ( $this->getUser()->isAllowed( 'editinterface' ) ) {
                        $licensesLink = Linker::link(
-                               Title::makeTitle( NS_MEDIAWIKI, 'Licenses' ),
+                               $this->msg( 'licenses' )->inContentLanguage()->getTitle(),
                                $this->msg( 'licenses-edit' )->escaped(),
                                array(),
                                array( 'action' => 'edit' )
index 98cec59..01575ac 100644 (file)
@@ -358,7 +358,8 @@ class MediaWikiTitleCodec implements TitleFormatter, TitleParser {
                # to subpage syntax for long titles, e.g. [[Special:Block/Long name]]
                $maxLength = ( $parts['namespace'] != NS_SPECIAL ) ? 255 : 512;
                if ( strlen( $dbkey ) > $maxLength ) {
-                       throw new MalformedTitleException( 'title-invalid-too-long', $text, array( $maxLength ) );
+                       throw new MalformedTitleException( 'title-invalid-too-long', $text,
+                               array( Message::numParam( $maxLength ) ) );
                }
 
                # Normally, all wiki links are forced to have an initial capital letter so [[foo]]
index c32bd3a..67bd0c9 100644 (file)
--- a/index.php
+++ b/index.php
  * @file
  */
 
-# Bail on old versions of PHP.  Pretty much every other file in the codebase
-# has structures (try/catch, foo()->bar(), etc etc) which throw parse errors in
-# PHP 4. Setup.php and ObjectCache.php have structures invalid in PHP 5.0 and
-# 5.1, respectively.
-if ( !function_exists( 'version_compare' ) || version_compare( PHP_VERSION, '5.3.3' ) < 0 ) {
-       // We need to use dirname( __FILE__ ) here cause __DIR__ is PHP5.3+
-       require dirname( __FILE__ ) . '/includes/PHPVersionError.php';
-       wfPHPVersionError( 'index.php' );
-}
+// Bail on old versions of PHP, or if composer has not been run yet to install
+// dependencies. Using dirname( __FILE__ ) here because __DIR__ is PHP5.3+.
+require_once dirname( __FILE__ ) . '/includes/PHPVersionCheck.php';
+wfEntryPointCheck( 'index.php' );
 
 require __DIR__ . '/includes/WebStart.php';
 
index cc8c4c4..4647db2 100644 (file)
        "title-invalid-characters": "The requested page title contains invalid characters: \"$1\".",
        "title-invalid-relative": "Title has relative path. Relative page titles (./, ../) are invalid, because they will often be unreachable when handled by user's browser.",
        "title-invalid-magic-tilde": "The requested page title contains invalid magic tilde sequence (<nowiki>~~~</nowiki>).",
-       "title-invalid-too-long": "The requested page title is too long. It must be no longer than $1 bytes in UTF-8 encoding.",
+       "title-invalid-too-long": "The requested page title is too long. It must be no longer than $1 {{PLURAL:$1|byte|bytes}} in UTF-8 encoding.",
        "title-invalid-leading-colon": "The requested page title contains an invalid colon at the beginning.",
        "perfcached": "The following data is cached and may not be up to date. A maximum of {{PLURAL:$1|one result is|$1 results are}} available in the cache.",
        "perfcachedts": "The following data is cached, and was last updated $1. A maximum of {{PLURAL:$4|one result is|$4 results are}} available in the cache.",
index d77a689..0c7ea62 100644 (file)
--- a/load.php
+++ b/load.php
  * @author Trevor Parscal
  */
 
-// Bail if PHP is too low
-if ( !function_exists( 'version_compare' ) || version_compare( PHP_VERSION, '5.3.3' ) < 0 ) {
-       // We need to use dirname( __FILE__ ) here cause __DIR__ is PHP5.3+
-       require dirname( __FILE__ ) . '/includes/PHPVersionError.php';
-       wfPHPVersionError( 'load.php' );
-}
+// Bail on old versions of PHP, or if composer has not been run yet to install
+// dependencies. Using dirname( __FILE__ ) here because __DIR__ is PHP5.3+.
+require_once dirname( __FILE__ ) . '/includes/PHPVersionCheck.php';
+wfEntryPointCheck( 'load.php' );
 
 require __DIR__ . '/includes/WebStart.php';
 
index c97c6a3..e4ac467 100644 (file)
  * @defgroup Maintenance Maintenance
  */
 
-// Make sure we're on PHP5.3.3 or better
-if ( !function_exists( 'version_compare' ) || version_compare( PHP_VERSION, '5.3.3' ) < 0 ) {
-       // We need to use dirname( __FILE__ ) here cause __DIR__ is PHP5.3+
-       require_once dirname( __FILE__ ) . '/../includes/PHPVersionError.php';
-       wfPHPVersionError( 'cli' );
-}
+// Bail on old versions of PHP, or if composer has not been run yet to install
+// dependencies. Using dirname( __FILE__ ) here because __DIR__ is PHP5.3+.
+require_once dirname( __FILE__ ) . '/../includes/PHPVersionCheck.php';
+wfEntryPointCheck( 'cli' );
 
 /**
  * @defgroup MaintenanceArchive Maintenance archives
index b8af5e9..3bb722e 100755 (executable)
  * @ingroup Maintenance
  */
 
-if ( !function_exists( 'version_compare' ) || ( version_compare( PHP_VERSION, '5.3.3' ) < 0 ) ) {
-       require dirname( __FILE__ ) . '/../includes/PHPVersionError.php';
-       wfPHPVersionError( 'cli' );
-}
-
 $wgUseMasterForMaintenance = true;
 require_once __DIR__ . '/Maintenance.php';
 
index ed3e7f4..be811dc 100644 (file)
  * @file
  */
 
-// Bail if PHP is too low
-if ( !function_exists( 'version_compare' ) || version_compare( PHP_VERSION, '5.3.3' ) < 0 ) {
-       // We need to use dirname( __FILE__ ) here cause __DIR__ is PHP5.3+
-       require dirname( dirname( __FILE__ ) ) . '/includes/PHPVersionError.php';
-       wfPHPVersionError( 'mw-config/index.php' );
-}
+// Bail on old versions of PHP, or if composer has not been run yet to install
+// dependencies. Using dirname( __FILE__ ) here because __DIR__ is PHP5.3+.
+require_once dirname( __FILE__ ) . '/../includes/PHPVersionCheck.php';
+wfEntryPointCheck( 'mw-config/index.php' );
 
 define( 'MW_CONFIG_CALLBACK', 'Installer::overrideConfig' );
 define( 'MEDIAWIKI_INSTALL', true );
index c7f150f..3c13055 100644 (file)
                                transformTable = tmp;
                                numberString = String( num );
                        } else {
+                               // Ignore transform table if wgTranslateNumerals is false
+                               if ( !mw.config.get( 'wgTranslateNumerals' ) ) {
+                                       transformTable = [];
+                               }
                                numberString = mw.language.commafy( num, pattern );
                        }