/** * Shut down, close connections and destroy the cached instance. * */ static function destroyInstance() { if (self::$instance) { self::$instance->shutdown(); self::$instance->forEachLBCallMethod('closeAll'); self::$instance = null; } }
/** * Set the instance to be the given object * * @param LBFactory $instance */ static function setInstance($instance) { self::destroyInstance(); self::$instance = $instance; }