Exemplo n.º 1
0
 /**
  * Helper method to initialize a session, based on Cake core settings.
  *
  * @access private
  */
 function __initSession()
 {
     parent::__initSession();
     if (Configure::read('Session.model') === null) {
         trigger_error(__("You must set the Configure::write('Session.model') in core.php to use model storage"), E_USER_WARNING);
         exit;
     }
     if (Configure::read('Session.save') == 'model' && !$this->initialized) {
         if (Configure::read('Session.model') !== null && is_null($this->SessionInstance)) {
             $this->SessionInstance =& ClassRegistry::init(Configure::read('Session.model'));
         }
         session_set_save_handler(array($this, '__modelOpen'), array($this, '__modelClose'), array($this, '__modelRead'), array($this, '__modelWrite'), array($this, '__modelDestroy'), array($this, '__modelGc'));
         $this->initialized = true;
     }
 }