* 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
* @endcode
* Where event is either:
* - 'onEdit' (when user edits)
- * - 'onView' (when user views the wiki)
*
* Criteria has the same format as $wgAutopromote
*
*/
$wgAutopromoteOnce = array(
'onEdit' => array(),
- 'onView' => array()
);
/**
throw new PermissionsError( 'read', $permErrors );
}
- $pageView = false; // was an article or special page viewed?
-
// Interwiki redirects
if ( $title->isExternal() ) {
$rdfrom = $request->getVal( 'rdfrom' );
}
// 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 {
// 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 );
. " returned neither an object nor a URL" );
}
}
-
- if ( $pageView ) {
- // Promote user to any groups they meet the criteria for
- $user->addAutopromoteOnceGroups( 'onView' );
- }
-
}
/**
* @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)
* '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;
* @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;
}
*
* @param string $message
* @param array $context
+ * @return string Interpolated message
*/
public static function interpolate( $message, array $context ) {
if ( strpos( $message, '{' ) !== false ) {
* - 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.
// 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 ) {
// 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;
/**
* @param ScopedCallback $section
*/
- public function scopedProfileOut( ScopedCallback &$section ) {
+ public function scopedProfileOut( ScopedCallback &$section = null ) {
$section = null;
}
*/
class ProfilerStub extends Profiler {
public function scopedProfileIn( $section ) {
- return new ScopedCallback( null ); // no-op
+ return null; // no-op
}
public function getFunctionStats() {