Merge "The http-invalid-url message has a parameter, so send it"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Fri, 24 Jul 2015 18:10:15 +0000 (18:10 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Fri, 24 Jul 2015 18:10:15 +0000 (18:10 +0000)
14 files changed:
includes/OutputPage.php
includes/User.php
includes/debug/logger/LegacyLogger.php
includes/debug/logger/LegacySpi.php
includes/debug/logger/LoggerFactory.php
includes/debug/logger/MonologSpi.php
includes/debug/logger/NullSpi.php
includes/debug/logger/Spi.php
includes/debug/logger/monolog/LegacyFormatter.php
includes/htmlform/HTMLForm.php
includes/htmlform/HTMLUserTextField.php
includes/htmlform/OOUIHTMLForm.php
includes/htmlform/VFormHTMLForm.php
maintenance/parse.php

index 22c6890..a551fe1 100644 (file)
@@ -3433,11 +3433,11 @@ class OutputPage extends ContextSource {
                        $lang = $this->getTitle()->getPageLanguage();
                        if ( $lang->hasVariants() ) {
                                $variants = $lang->getVariants();
-                               foreach ( $variants as $_v ) {
-                                       $tags["variant-$_v"] = Html::element( 'link', array(
+                               foreach ( $variants as $variant ) {
+                                       $tags["variant-$variant"] = Html::element( 'link', array(
                                                'rel' => 'alternate',
-                                               'hreflang' => wfBCP47( $_v ),
-                                               'href' => $this->getTitle()->getLocalURL( array( 'variant' => $_v ) ) )
+                                               'hreflang' => wfBCP47( $variant ),
+                                               'href' => $this->getTitle()->getLocalURL( array( 'variant' => $variant ) ) )
                                        );
                                }
                                # x-default link per https://support.google.com/webmasters/answer/189077?hl=en
index 4c044bd..cefbe62 100644 (file)
@@ -3689,7 +3689,7 @@ class User implements IDBAccessObject {
                        $from = ( $this->queryFlagsUsed & self::READ_LATEST ) ? 'master' : 'slave';
                        throw new MWException(
                                "CAS update failed on user_touched for user ID '{$this->mId}' (read from $from);" .
-                               "the version of the user to be saved is older than the current version."
+                               " the version of the user to be saved is older than the current version."
                        );
                }
 
index 8010790..ea4e1b1 100644 (file)
@@ -40,7 +40,7 @@ use UDPTransport;
  * See documentation in DefaultSettings.php for detailed explanations of each
  * variable.
  *
- * @see \MediaWiki\Logger\LoggerFactory
+ * @see \\MediaWiki\\Logger\\LoggerFactory
  * @since 1.25
  * @author Bryan Davis <bd808@wikimedia.org>
  * @copyright © 2014 Bryan Davis and Wikimedia Foundation.
@@ -53,10 +53,10 @@ class LegacyLogger extends AbstractLogger {
        protected $channel;
 
        /**
-        * Convert Psr\Log\LogLevel constants into int for sane comparisons
+        * Convert Psr\\Log\\LogLevel constants into int for sane comparisons
         * These are the same values that Monlog uses
         *
-        * @var array
+        * @var array $levelMapping
         */
        protected static $levelMapping = array(
                LogLevel::DEBUG => 100,
@@ -100,7 +100,7 @@ class LegacyLogger extends AbstractLogger {
         *
         * @param string $channel
         * @param string $message
-        * @param string|int $level Psr\Log\LogEvent constant or Monlog level int
+        * @param string|int $level Psr\\Log\\LogEvent constant or Monlog level int
         * @param array $context
         * @return bool True if message should be sent to disk/network, false
         * otherwise
index 1bf39e4..6a7f1d0 100644 (file)
@@ -30,7 +30,7 @@ namespace MediaWiki\Logger;
  * );
  * @endcode
  *
- * @see \MediaWiki\Logger\LoggerFactory
+ * @see \\MediaWiki\\Logger\\LoggerFactory
  * @since 1.25
  * @author Bryan Davis <bd808@wikimedia.org>
  * @copyright © 2014 Bryan Davis and Wikimedia Foundation.
@@ -47,7 +47,7 @@ class LegacySpi implements Spi {
         * Get a logger instance.
         *
         * @param string $channel Logging channel
-        * @return \Psr\Log\LoggerInterface Logger instance
+        * @return \\Psr\\Log\\LoggerInterface Logger instance
         */
        public function getLogger( $channel ) {
                if ( !isset( $this->singletons[$channel] ) ) {
index f6699ec..0b6965f 100644 (file)
@@ -25,7 +25,7 @@ use ObjectFactory;
 /**
  * PSR-3 logger instance factory.
  *
- * Creation of \Psr\Log\LoggerInterface instances is managed via the
+ * Creation of \\Psr\\Log\\LoggerInterface instances is managed via the
  * LoggerFactory::getInstance() static method which in turn delegates to the
  * currently registered service provider.
  *
@@ -38,7 +38,7 @@ use ObjectFactory;
  * $wgMWLoggerDefaultSpi is expected to be an array usable by
  * ObjectFactory::getObjectFromSpec() to create a class.
  *
- * @see \MediaWiki\Logger\Spi
+ * @see \\MediaWiki\\Logger\\Spi
  * @since 1.25
  * @author Bryan Davis <bd808@wikimedia.org>
  * @copyright © 2014 Bryan Davis and Wikimedia Foundation.
@@ -53,10 +53,10 @@ class LoggerFactory {
 
 
        /**
-        * Register a service provider to create new \Psr\Log\LoggerInterface
+        * Register a service provider to create new \\Psr\\Log\\LoggerInterface
         * instances.
         *
-        * @param \MediaWiki\Logger\Spi $provider Provider to register
+        * @param \\MediaWiki\\Logger\\Spi $provider Provider to register
         */
        public static function registerProvider( Spi $provider ) {
                self::$spi = $provider;
@@ -71,7 +71,7 @@ class LoggerFactory {
         * Spi registration. $wgMWLoggerDefaultSpi is expected to be an
         * array usable by ObjectFactory::getObjectFromSpec() to create a class.
         *
-        * @return \MediaWiki\Logger\Spi
+        * @return \\MediaWiki\\Logger\\Spi
         * @see registerProvider()
         * @see ObjectFactory::getObjectFromSpec()
         */
@@ -91,7 +91,7 @@ class LoggerFactory {
         * Get a named logger instance from the currently configured logger factory.
         *
         * @param string $channel Logger channel (name)
-        * @return \Psr\Log\LoggerInterface
+        * @return \\Psr\\Log\\LoggerInterface
         */
        public static function getInstance( $channel ) {
                if ( !interface_exists( '\Psr\Log\LoggerInterface' ) ) {
index e32e0b2..7b54861 100644 (file)
@@ -30,7 +30,7 @@ use ObjectFactory;
  * Configured using an array of configuration data with the keys 'loggers',
  * 'processors', 'handlers' and 'formatters'.
  *
- * The ['loggers']['@default'] configuration will be used to create loggers
+ * The ['loggers']['\@default'] configuration will be used to create loggers
  * for any channel that isn't explicitly named in the 'loggers' configuration
  * section.
  *
@@ -176,7 +176,7 @@ class MonologSpi implements Spi {
         * name will return the cached instance.
         *
         * @param string $channel Logging channel
-        * @return \Psr\Log\LoggerInterface Logger instance
+        * @return \\Psr\\Log\\LoggerInterface Logger instance
         */
        public function getLogger( $channel ) {
                if ( !isset( $this->singletons['loggers'][$channel] ) ) {
@@ -198,7 +198,7 @@ class MonologSpi implements Spi {
         * Create a logger.
         * @param string $channel Logger channel
         * @param array $spec Configuration
-        * @return \Monolog\Logger
+        * @return \\Monolog\\Logger
         */
        protected function createLogger( $channel, $spec ) {
                $obj = new Logger( $channel );
@@ -236,7 +236,7 @@ class MonologSpi implements Spi {
        /**
         * Create or return cached handler.
         * @param string $name Processor name
-        * @return \Monolog\Handler\HandlerInterface
+        * @return \\Monolog\\Handler\\HandlerInterface
         */
        public function getHandler( $name ) {
                if ( !isset( $this->singletons['handlers'][$name] ) ) {
@@ -256,7 +256,7 @@ class MonologSpi implements Spi {
        /**
         * Create or return cached formatter.
         * @param string $name Formatter name
-        * @return \Monolog\Formatter\FormatterInterface
+        * @return \\Monolog\\Formatter\\FormatterInterface
         */
        public function getFormatter( $name ) {
                if ( !isset( $this->singletons['formatters'][$name] ) ) {
index a82d2c4..c9c7482 100644 (file)
@@ -23,7 +23,7 @@ namespace MediaWiki\Logger;
 use Psr\Log\NullLogger;
 
 /**
- * LoggerFactory service provider that creates \Psr\Log\NullLogger
+ * LoggerFactory service provider that creates \\Psr\\Log\\NullLogger
  * instances. A NullLogger silently discards all log events sent to it.
  *
  * Usage:
@@ -33,7 +33,7 @@ use Psr\Log\NullLogger;
  * );
  * @endcode
  *
- * @see \MediaWiki\Logger\LoggerFactory
+ * @see \\MediaWiki\\Logger\\LoggerFactory
  * @since 1.25
  * @author Bryan Davis <bd808@wikimedia.org>
  * @copyright © 2014 Bryan Davis and Wikimedia Foundation.
@@ -41,7 +41,7 @@ use Psr\Log\NullLogger;
 class NullSpi implements Spi {
 
        /**
-        * @var \Psr\Log\NullLogger $singleton
+        * @var \\Psr\\Log\\NullLogger $singleton
         */
        protected $singleton;
 
@@ -55,7 +55,7 @@ class NullSpi implements Spi {
         * Get a logger instance.
         *
         * @param string $channel Logging channel
-        * @return \Psr\Log\NullLogger Logger instance
+        * @return \\Psr\\Log\\NullLogger Logger instance
         */
        public function getLogger( $channel ) {
                return $this->singleton;
index 044789f..51818a3 100644 (file)
 namespace MediaWiki\Logger;
 
 /**
- * Service provider interface for \Psr\Log\LoggerInterface implementation
+ * Service provider interface for \\Psr\\Log\\LoggerInterface implementation
  * libraries.
  *
  * MediaWiki can be configured to use a class implementing this interface to
- * create new \Psr\Log\LoggerInterface instances via either the
+ * create new \\Psr\\Log\\LoggerInterface instances via either the
  * $wgMWLoggerDefaultSpi global variable or code that constructs an instance
  * and registers it via the LoggerFactory::registerProvider() static method.
  *
- * @see \MediaWiki\Logger\LoggerFactory
+ * @see \\MediaWiki\\Logger\\LoggerFactory
  * @since 1.25
  * @author Bryan Davis <bd808@wikimedia.org>
  * @copyright © 2014 Bryan Davis and Wikimedia Foundation.
@@ -40,7 +40,7 @@ interface Spi {
         * Get a logger instance.
         *
         * @param string $channel Logging channel
-        * @return \Psr\Log\LoggerInterface Logger instance
+        * @return \\Psr\\Log\\LoggerInterface Logger instance
         */
        public function getLogger( $channel );
 
index 9ec15cb..42e7cab 100644 (file)
@@ -26,12 +26,12 @@ use Monolog\Formatter\NormalizerFormatter;
 /**
  * Log message formatter that mimics the legacy log message formatting of
  * `wfDebug`, `wfDebugLog`, `wfLogDBError` and `wfErrorLog` global functions by
- * delegating the formatting to \MediaWiki\Logger\LegacyLogger.
+ * delegating the formatting to \\MediaWiki\\Logger\\LegacyLogger.
  *
  * @since 1.25
  * @author Bryan Davis <bd808@wikimedia.org>
  * @copyright © 2013 Bryan Davis and Wikimedia Foundation.
- * @see \MediaWiki\Logger\LegacyLogger
+ * @see \\MediaWiki\\Logger\\LegacyLogger
  */
 class LegacyFormatter extends NormalizerFormatter {
 
index 47200d9..48cc828 100644 (file)
@@ -167,7 +167,7 @@ class HTMLForm extends ContextSource {
        protected $mFieldTree;
        protected $mShowReset = false;
        protected $mShowSubmit = true;
-       protected $mSubmitFlag = 'constructive';
+       protected $mSubmitFlags = array( 'constructive', 'primary' );
 
        protected $mSubmitCallback;
        protected $mValidationErrorMessage;
@@ -975,7 +975,10 @@ class HTMLForm extends ContextSource {
                        $attribs['class'] = array( 'mw-htmlform-submit' );
 
                        if ( $useMediaWikiUIEverywhere ) {
-                               array_push( $attribs['class'], 'mw-ui-button', 'mw-ui-' . $this->mSubmitFlag );
+                               foreach ( $this->mSubmitFlags as $flag ) {
+                                       array_push( $attribs['class'], 'mw-ui-' . $flag );
+                               }
+                               array_push( $attribs['class'], 'mw-ui-button' );
                        }
 
                        $buttons .= Xml::submitButton( $this->getSubmitText(), $attribs ) . "\n";
@@ -1102,7 +1105,7 @@ class HTMLForm extends ContextSource {
         * @since 1.24
         */
        public function setSubmitDestructive() {
-               $this->mSubmitFlag = 'destructive';
+               $this->mSubmitFlags = array( 'destructive', 'primary' );
        }
 
        /**
@@ -1110,7 +1113,7 @@ class HTMLForm extends ContextSource {
         * @since 1.25
         */
        public function setSubmitProgressive() {
-               $this->mSubmitFlag = 'progressive';
+               $this->mSubmitFlags = array( 'progressive', 'primary' );
        }
 
        /**
index 9f7100f..949fefd 100644 (file)
@@ -28,7 +28,7 @@ class HTMLUserTextField extends HTMLTextField {
 
                if ( !$user ) {
                        return $this->msg( 'htmlform-user-not-valid', $value )->parse();
-               } else if ( $this->mParams['exists'] && $user->getId() === 0 ) {
+               } elseif ( $this->mParams['exists'] && $user->getId() === 0 ) {
                        return $this->msg( 'htmlform-user-not-exists', $user->getName() )->parse();
                }
 
index fe2f26e..eec13ee 100644 (file)
@@ -65,7 +65,7 @@ class OOUIHTMLForm extends HTMLForm {
                        $attribs['type'] = 'submit';
                        $attribs['label'] = $this->getSubmitText();
                        $attribs['value'] = $this->getSubmitText();
-                       $attribs['flags'] = array( $this->mSubmitFlag );
+                       $attribs['flags'] = $this->mSubmitFlags;
 
                        $buttons .= new OOUI\ButtonInputWidget( $attribs );
                }
index c544f16..3788379 100644 (file)
@@ -95,8 +95,10 @@ class VFormHTMLForm extends HTMLForm {
                        $attribs['class'] = array(
                                'mw-htmlform-submit',
                                'mw-ui-button mw-ui-big mw-ui-block',
-                               'mw-ui-' . $this->mSubmitFlag,
                        );
+                       foreach ( $this->mSubmitFlags as $flag ) {
+                               $attribs['class'][] = 'mw-ui-' . $flag;
+                       }
 
                        $buttons .= Xml::submitButton( $this->getSubmitText(), $attribs ) . "\n";
                }
index 7b05cb7..d655965 100644 (file)
@@ -89,11 +89,10 @@ class CLIParser extends Maintenance {
         * @return string Wikitext
         */
        protected function Wikitext() {
-
                $php_stdin = 'php://stdin';
                $input_file = $this->getArg( 0, $php_stdin );
 
-               if ( $input_file === $php_stdin ) {
+               if ( $input_file === $php_stdin && !$this->mQuiet ) {
                        $ctrl = wfIsWindows() ? 'CTRL+Z' : 'CTRL+D';
                        $this->error( basename( __FILE__ )
                                . ": warning: reading wikitext from STDIN. Press $ctrl to parse.\n" );