Example #1
0
 /**
  * @return filter_manager the singleton instance.
  */
 public static function instance()
 {
     global $CFG;
     if (is_null(self::$singletoninstance)) {
         if (!empty($CFG->perfdebug)) {
             self::$singletoninstance = new performance_measuring_filter_manager();
         } else {
             self::$singletoninstance = new self();
         }
     }
     return self::$singletoninstance;
 }
 /**
  * Resets the caches, usually to be called between unit tests
  */
 public static function reset_caches()
 {
     if (self::$singletoninstance) {
         self::$singletoninstance->unload_all_filters();
     }
     self::$singletoninstance = null;
 }