public static function releaseInstance(ghoul $instance, $removeRef = false) { if ($instance === StaticInstance::$currentAdapter) { StaticInstance::$isBound = false; if ($removeRef) { StaticInstance::$currentAdapter = null; } } }
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(); } }