Exemplo n.º 1
0
 /**
  * start() - Start the session.
  *
  * @throws Zend_Session_Exception
  * @return void
  */
 public static function start()
 {
     // make sure our default options (at the least) have been set
     if (!self::$_defaultOptionsSet) {
         self::setOptions();
     }
     if (headers_sent($filename, $linenum)) {
         throw new Zend_Session_Exception("You must call " . __CLASS__ . '::' . __FUNCTION__ . "() before any output has been sent to the browser; output started in {$filename}/{$linenum}");
     }
     if (self::$_sessionStarted) {
         throw new Zend_Session_Exception('start() can only be called once.');
     }
     // See http://www.php.net/manual/en/ref.session.php for explanation
     if (defined('SID')) {
         throw new Zend_Session_Exception('session has already been started by session.auto-start or session_start()');
     }
     session_start();
     self::$_readable = true;
     self::$_writable = true;
     self::$_sessionStarted = true;
     if (self::$_regenerateIdState === -1) {
         self::regenerateId();
     }
     // run validators if they exist
     if (isset($_SESSION['__ZF']['VALID'])) {
         self::_processValidators();
     }
     self::_processStartupMetadataGlobal();
 }