/** * getInstance() - Enfore the Singleton of the core. * * @param boolean $instanceMustExist - OPTIONAL prevents Zend_Session_Core from auto-starting itself, if needed * @throws Zend_Session_Exception * @return Zend_Session_Core */ public static function getInstance($instanceMustExist = false) { if (self::$_instance === null) { if ($instanceMustExist === true) { throw new Zend_Session_Exception('A valid session must exist before calling getInstance() in this manner.'); } self::$_instance = true; // allow creation of the instance by the constructor self::$_instance = new self(); } if (self::$_readable === false) { throw new Zend_Session_Exception(self::_THROW_NOT_READABLE_MSG); } return self::$_instance; }
/** * RemoveInstance() - Remove the instance. * * @return void */ public static function removeInstance() { self::$_instance = null; return; }
/** * getInstance() - Enfore the Singleton of the core. * * @param boolean $instanceMustExist - OPTIONAL prevents Zend_Session_Core from auto-starting itself, if needed * @throws Zend_Session_Exception * @return Zend_Session_Core */ public static function getInstance($instanceMustExist = false) { if (self::$_instance === null) { if ($instanceMustExist === true) { throw Zend::exception('Zend_Session_Exception', __CLASS__ . '::getInstance() A valid session must exist before calling getInstance() in this manner.'); } self::$_instance = true; // allow creation of the instance by the constructor self::$_instance = new self(); } if (self::$_readable === false) { throw Zend::exception('Zend_Session_Exception', __CLASS__ . '::getInstance() Zend_Session_Core is currently marked as read-only.'); } return self::$_instance; }