Bsitu has uploaded a new change for review.
https://gerrit.wikimedia.org/r/59984
Change subject: Remove static object cache to avoid cross wiki related issue
......................................................................
Remove static object cache to avoid cross wiki related issue
Some script like job runners are running against multiple wikis, caching the
object would make later wikis use the incorrect object, it's global variable
anyway, there is no need to cache it
Change-Id: I427a5cefbd607aaf897dfa07087e381faffea495
---
M includes/EchoBackend.php
M includes/EmailBundler.php
2 files changed, 2 insertions(+), 8 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Echo
refs/changes/84/59984/1
diff --git a/includes/EchoBackend.php b/includes/EchoBackend.php
index 2ee2ba1..d1d2123 100644
--- a/includes/EchoBackend.php
+++ b/includes/EchoBackend.php
@@ -7,8 +7,6 @@
*/
abstract class MWEchoBackend {
- private static $cache = array();
-
/**
* Factory to initialize a backend class
* @param $backend string
@@ -24,11 +22,7 @@
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();
}
/**
diff --git a/includes/EmailBundler.php b/includes/EmailBundler.php
index 3fa5f01..2725702 100644
--- a/includes/EmailBundler.php
+++ b/includes/EmailBundler.php
@@ -68,7 +68,7 @@
$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;
--
To view, visit https://gerrit.wikimedia.org/r/59984
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I427a5cefbd607aaf897dfa07087e381faffea495
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: master
Gerrit-Owner: Bsitu <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits