Merge "Add mobile target for mediawiki.confirmCloseWindow"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Fri, 27 Mar 2015 17:28:38 +0000 (17:28 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Fri, 27 Mar 2015 17:28:38 +0000 (17:28 +0000)
RELEASE-NOTES-1.25
includes/DefaultSettings.php
includes/MediaWiki.php
includes/WebResponse.php
includes/debug/logger/legacy/Logger.php
includes/debug/logger/monolog/Handler.php
includes/page/WikiPage.php
includes/profiler/Profiler.php
includes/profiler/ProfilerStub.php

index 6462767..b7a1a8e 100644 (file)
@@ -45,6 +45,8 @@ production.
 * The 'daemonized' flag must be set to true in $wgJobTypeConf for any redis
   job queues. This means that mediawiki/services/jobrunner service has to
   be installed and running for any such queues to work.
+* $wgAutopromoteOnce no longer supports the 'view' event. For keeping some
+  compatibility, any 'view' event triggers will still trigger on 'edit'.
 
 === New features in 1.25 ===
 * (T64861) Updated plural rules to CLDR 26. Includes incompatible changes
index 1df809e..5ab557e 100644 (file)
@@ -4863,7 +4863,6 @@ $wgAutopromote = array(
  * @endcode
  * Where event is either:
  *    - 'onEdit' (when user edits)
- *    - 'onView' (when user views the wiki)
  *
  * Criteria has the same format as $wgAutopromote
  *
@@ -4872,7 +4871,6 @@ $wgAutopromote = array(
  */
 $wgAutopromoteOnce = array(
        'onEdit' => array(),
-       'onView' => array()
 );
 
 /**
index 2644023..c086a39 100644 (file)
@@ -199,8 +199,6 @@ class MediaWiki {
                        throw new PermissionsError( 'read', $permErrors );
                }
 
-               $pageView = false; // was an article or special page viewed?
-
                // Interwiki redirects
                if ( $title->isExternal() ) {
                        $rdfrom = $request->getVal( 'rdfrom' );
@@ -263,7 +261,6 @@ class MediaWiki {
                        }
                // Special pages
                } elseif ( NS_SPECIAL == $title->getNamespace() ) {
-                       $pageView = true;
                        // Actions that need to be made when we have a special pages
                        SpecialPageFactory::executePath( $title, $this->context );
                } else {
@@ -271,7 +268,6 @@ class MediaWiki {
                        // may be a redirect to another article or URL.
                        $article = $this->initializeArticle();
                        if ( is_object( $article ) ) {
-                               $pageView = true;
                                $this->performAction( $article, $requestTitle );
                        } elseif ( is_string( $article ) ) {
                                $output->redirect( $article );
@@ -280,12 +276,6 @@ class MediaWiki {
                                        . " returned neither an object nor a URL" );
                        }
                }
-
-               if ( $pageView ) {
-                       // Promote user to any groups they meet the criteria for
-                       $user->addAutopromoteOnceGroups( 'onView' );
-               }
-
        }
 
        /**
index 83ac51a..ab34931 100644 (file)
@@ -60,7 +60,7 @@ class WebResponse {
         * @param int|null $expire Unix timestamp (in seconds) when the cookie should expire.
         *        0 (the default) causes it to expire $wgCookieExpiration seconds from now.
         *        null causes it to be a session cookie.
-        * @param array|null $options Assoc of additional cookie options:
+        * @param array $options Assoc of additional cookie options:
         *     prefix: string, name prefix ($wgCookiePrefix)
         *     domain: string, cookie domain ($wgCookieDomain)
         *     path: string, cookie path ($wgCookiePath)
@@ -72,7 +72,7 @@ class WebResponse {
         *   'prefix', 'domain', and 'secure'
         * @since 1.22 Replaced $prefix, $domain, and $forceSecure with $options
         */
-       public function setcookie( $name, $value, $expire = 0, $options = null ) {
+       public function setcookie( $name, $value, $expire = 0, $options = array() ) {
                global $wgCookiePath, $wgCookiePrefix, $wgCookieDomain;
                global $wgCookieSecure, $wgCookieExpiration, $wgCookieHttpOnly;
 
@@ -188,9 +188,9 @@ class FauxResponse extends WebResponse {
         * @param string $name The name of the cookie.
         * @param string $value The value to be stored in the cookie.
         * @param int|null $expire Ignored in this faux subclass.
-        * @param array|null $options Ignored in this faux subclass.
+        * @param array $options Ignored in this faux subclass.
         */
-       public function setcookie( $name, $value, $expire = 0, $options = null ) {
+       public function setcookie( $name, $value, $expire = 0, $options = array() ) {
                $this->cookies[$name] = $value;
        }
 
index c53aeaa..610635d 100644 (file)
@@ -290,6 +290,7 @@ class MWLoggerLegacyLogger extends AbstractLogger {
         *
         * @param string $message
         * @param array $context
+        * @return string Interpolated message
         */
        public static function interpolate( $message, array $context ) {
                if ( strpos( $message, '{' ) !== false ) {
index a872d84..9e7678d 100644 (file)
@@ -30,7 +30,8 @@
  * - HOST: IPv4, IPv6 or hostname
  * - PORT: server port
  * - PREFIX: optional (but recommended) prefix telling udp2log how to route
- * the log event
+ * the log event. The special prefix "{channel}" will use the log event's
+ * channel as the prefix value.
  *
  * When not targeting a udp2log stream this class will act as a drop-in
  * replacement for Monolog's StreamHandler.
@@ -194,7 +195,9 @@ class MWLoggerMonologHandler extends \Monolog\Handler\AbstractProcessingHandler
 
                        // Clean it up for the multiplexer
                        if ( $this->prefix !== '' ) {
-                               $text = preg_replace( '/^/m', "{$this->prefix} ", $text );
+                               $leader = ( $this->prefix === '{channel}' ) ?
+                                       $record['channel'] : $this->prefix;
+                               $text = preg_replace( '/^/m', "{$leader} ", $text );
 
                                // Limit to 64KB
                                if ( strlen( $text ) > 65506 ) {
index 2315dc7..0452c41 100644 (file)
@@ -1992,6 +1992,7 @@ class WikiPage implements Page, IDBAccessObject {
                // Promote user to any groups they meet the criteria for
                $dbw->onTransactionIdle( function () use ( $user ) {
                        $user->addAutopromoteOnceGroups( 'onEdit' );
+                       $user->addAutopromoteOnceGroups( 'onView' ); // b/c
                } );
 
                return $status;
index 69470fd..1c9824a 100644 (file)
@@ -134,7 +134,7 @@ abstract class Profiler {
        /**
         * @param ScopedCallback $section
         */
-       public function scopedProfileOut( ScopedCallback &$section ) {
+       public function scopedProfileOut( ScopedCallback &$section = null ) {
                $section = null;
        }
 
index 5580f94..1d04536 100644 (file)
@@ -28,7 +28,7 @@
  */
 class ProfilerStub extends Profiler {
        public function scopedProfileIn( $section ) {
-               return new ScopedCallback( null ); // no-op
+               return null; // no-op
        }
 
        public function getFunctionStats() {