MDL-35238 Add support for explicit singleton reset

This may be needed during PHPUnit testing.
This commit is contained in:
David Mudrák
2012-11-08 22:33:08 +01:00
parent 80e9ba96c7
commit dc11af1903
2 changed files with 14 additions and 0 deletions
+11
View File
@@ -1469,6 +1469,17 @@ class available_update_deployer {
return self::$singletoninstance;
}
/**
* Reset caches used by this script
*
* @param bool $phpunitreset is this called as a part of PHPUnit reset?
*/
public static function reset_caches($phpunitreset = false) {
if ($phpunitreset) {
self::$singletoninstance = null;
}
}
/**
* Is automatic deployment enabled?
*