Beispiel #1
0
 public static function releaseInstance(ghoul $instance, $removeRef = false)
 {
     if ($instance === StaticInstance::$currentAdapter) {
         StaticInstance::$isBound = false;
         if ($removeRef) {
             StaticInstance::$currentAdapter = null;
         }
     }
 }
Beispiel #2
0
 public function execute($name, $args)
 {
     if (isset(self::$methodPool[$name]) && StaticInstance::isBound()) {
         if (self::$methodPool[$name]->supportsAdapter(StaticInstance::getCurrentInstance()->getAdapter())) {
             self::$methodPool[$name]->execute(StaticInstance::getCurrentInstance()->getAdapter(), $args);
         } else {
             throw new UnsupportedFunctionException();
         }
     } elseif (isset(self::$savedMethodPool[$name])) {
         //TODO call original
     } else {
         throw new UnknownMethodException();
     }
 }
Beispiel #3
0
 public static function resume()
 {
     StaticInstance::bindInstance(StaticInstance::getCurrentInstance());
 }