Merge "Remove static object cache to avoid cross wiki related issue"

This commit is contained in:
jenkins-bot 2013-04-19 21:55:37 +00:00 committed by Gerrit Code Review
commit 724470ce02
2 changed files with 3 additions and 13 deletions

View file

@ -7,8 +7,6 @@
*/
abstract class MWEchoBackend {
private static $cache = array();
/**
* Factory to initialize a backend class
* @param $backend string
@ -24,11 +22,7 @@ abstract class MWEchoBackend {
throw new MWException( "$backend backend is not supported" );
}
if ( !isset( self::$cache[$backend] ) ) {
self::$cache[$backend] = new $className();
}
return self::$cache[$backend];
return new $className();
}
/**

View file

@ -68,7 +68,7 @@ abstract class MWEchoEmailBundler {
$className = 'MW' . $wgEchoBackendName . 'EchoEmailBundler';
if ( !class_exists( $className ) ) {
throw new MWException( "$wgEchoBackendName email batch is not supported!" );
throw new MWException( "$wgEchoBackendName email bundler is not supported!" );
}
return $className;
@ -131,11 +131,7 @@ abstract class MWEchoEmailBundler {
return $this->emailInterval + 600;
}
static $now;
if ( !$now ) {
$now = wfTimestamp( TS_UNIX );
}
$now = wfTimestamp( TS_UNIX );
return $now - wfTimestamp( TS_UNIX, $this->timestamp );
}