Merge "Kill $wgArticle"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Sat, 2 Nov 2013 02:50:30 +0000 (02:50 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Sat, 2 Nov 2013 02:50:30 +0000 (02:50 +0000)
composer-example.json [new file with mode: 0644]
composer.json [deleted file]
includes/Exception.php
languages/Names.php
tests/phpunit/includes/MWExceptionHandlerTest.php

diff --git a/composer-example.json b/composer-example.json
new file mode 100644 (file)
index 0000000..6c4d37f
--- /dev/null
@@ -0,0 +1,11 @@
+{
+       "require": {
+               "php": ">=5.3.2"
+       },
+       "suggest": {
+               "ext-fileinfo": "*",
+               "ext-mbstring": "*",
+               "ext-wikidiff2": "*",
+               "ext-apc": "*"
+       }
+}
diff --git a/composer.json b/composer.json
deleted file mode 100644 (file)
index ded3365..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-{
-       "name": "mediawiki/core",
-       "description": "Free software wiki application developed by the Wikimedia Foundation and others",
-       "keywords": ["mediawiki", "wiki"],
-       "homepage": "https://www.mediawiki.org/",
-       "authors": [
-               {
-                       "name": "MediaWiki Community",
-                       "homepage": "https://www.mediawiki.org/wiki/Special:Version/Credits"
-               }
-       ],
-       "license": "GPL-2.0",
-       "support": {
-               "issues": "https://bugzilla.wikimedia.org/",
-               "irc": "irc://irc.freenode.net/mediawiki",
-               "wiki": "https://www.mediawiki.org/"
-       },
-       "require": {
-               "php": ">=5.3.2"
-       },
-       "require-dev": {
-               "phpunit/phpunit": "*"
-       },
-       "suggest": {
-               "ext-fileinfo": "*",
-               "ext-mbstring": "*",
-               "ext-wikidiff2": "*",
-               "ext-apc": "*"
-       }
-}
index 9623a84..ac98564 100644 (file)
@@ -140,7 +140,7 @@ class MWException extends Exception {
                global $wgShowExceptionDetails;
 
                if ( $wgShowExceptionDetails ) {
-                       return '<p>' . nl2br( htmlspecialchars( $this->getMessage() ) ) .
+                       return '<p>' . nl2br( htmlspecialchars( MWExceptionHandler::getLogMessage( $this ) ) ) .
                                '</p><p>Backtrace:</p><p>' . nl2br( htmlspecialchars( MWExceptionHandler::getRedactedTraceAsString( $this ) ) ) .
                                "</p>\n";
                } else {
@@ -165,7 +165,7 @@ class MWException extends Exception {
                global $wgShowExceptionDetails;
 
                if ( $wgShowExceptionDetails ) {
-                       return $this->getMessage() .
+                       return MWExceptionHandler::getLogMessage( $this ) .
                                "\nBacktrace:\n" . MWExceptionHandler::getRedactedTraceAsString( $this ) . "\n";
                } else {
                        return "Set \$wgShowExceptionDetails = true; " .
@@ -641,8 +641,7 @@ class MWExceptionHandler {
                                get_class( $e ) . "\"";
 
                        if ( $wgShowExceptionDetails ) {
-                               $message .= "\nexception '" . get_class( $e ) . "' in " .
-                                       $e->getFile() . ":" . $e->getLine() . "\nStack trace:\n" .
+                               $message .= "\n" . MWExceptionHandler::getLogMessage( $e ) . "\nBacktrace:\n" .
                                        self::getRedactedTraceAsString( $e ) . "\n";
                        }
 
index 929c513..3848a0b 100644 (file)
        'crh' => 'qırımtatarca',   # Crimean Tatar (multiple scripts - defaults to Latin)
        'crh-latn' => "qırımtatarca (Latin)\xE2\x80\x8E",       # Crimean Tatar (Latin)
        'crh-cyrl' => "къырымтатарджа (Кирилл)\xE2\x80\x8E",       # Crimean Tatar (Cyrillic)
-       'cs' => 'česky',       # Czech
+       'cs' => 'čeština',    # Czech
        'csb' => 'kaszëbsczi', # Cassubian
        'cu' => 'словѣ́ньскъ / ⰔⰎⰑⰂⰡⰐⰠⰔⰍⰟ',      # Old Church Slavonic (ancient language)
        'cv' => 'Чӑвашла',       # Chuvash
index 987dfa8..aebd65f 100644 (file)
@@ -14,10 +14,11 @@ class MWExceptionHandlerTest extends MediaWikiTestCase {
         * @covers MWExceptionHandler::getRedactedTrace
         */
        function testGetRedactedTrace() {
+               $refvar = 'value';
                try {
                        $array = array( 'a', 'b' );
                        $object = new StdClass();
-                       self::helperThrowAnException( $array, $object );
+                       self::helperThrowAnException( $array, $object, $refvar );
                } catch (Exception $e) {
                }
 
@@ -58,16 +59,18 @@ class MWExceptionHandlerTest extends MediaWikiTestCase {
                                $this->assertNotInternalType( 'object', $arg);
                        }
                }
+
+               $this->assertEquals( 'value', $refvar, 'Ensuring reference variable wasn\'t changed' );
        }
 
        /**
         * Helper function for testExpandArgumentsInCall
         *
-        * Pass it an object and an array :-)
+        * Pass it an object and an array, and something by reference :-)
         *
         * @throws Exception
         */
-       protected static function helperThrowAnException( $a, $b ) {
+       protected static function helperThrowAnException( $a, $b, &$c ) {
                throw new Exception();
        }
 }