Esempio n. 1
0
 public static function Init()
 {
     if (CSecuritySessionVirtual::isStorageEnabled()) {
         if (!CSecuritySessionVirtual::init()) {
             self::triggerFatalError("Failed to initialize Virtual session handler");
         }
         //may return false with session.auto_start is set to On
         if (session_set_save_handler(array("CSecuritySessionVirtual", "open"), array("CSecuritySessionVirtual", "close"), array("CSecuritySessionVirtual", "read"), array("CSecuritySessionVirtual", "write"), array("CSecuritySessionVirtual", "destroy"), array("CSecuritySessionVirtual", "gc"))) {
             register_shutdown_function("session_write_close");
         }
     } elseif (CSecuritySessionMC::isStorageEnabled()) {
         if (!CSecuritySessionMC::Init()) {
             self::triggerFatalError("Failed to initialize Memcache session handler");
         }
         //may return false with session.auto_start is set to On
         if (session_set_save_handler(array("CSecuritySessionMC", "open"), array("CSecuritySessionMC", "close"), array("CSecuritySessionMC", "read"), array("CSecuritySessionMC", "write"), array("CSecuritySessionMC", "destroy"), array("CSecuritySessionMC", "gc"))) {
             register_shutdown_function("session_write_close");
         }
     } else {
         if (!CSecuritySessionDB::Init()) {
             self::triggerFatalError("Failed to initialize DB session handler");
         }
         //may return false with session.auto_start is set to On
         if (session_set_save_handler(array("CSecuritySessionDB", "open"), array("CSecuritySessionDB", "close"), array("CSecuritySessionDB", "read"), array("CSecuritySessionDB", "write"), array("CSecuritySessionDB", "destroy"), array("CSecuritySessionDB", "gc"))) {
             register_shutdown_function("session_write_close");
         }
     }
 }
Esempio n. 2
0
 public static function Init()
 {
     if (CSecuritySessionVirtual::isStorageEnabled()) {
         static::registerHandler('CSecuritySessionVirtual');
     } elseif (CSecuritySessionMC::isStorageEnabled()) {
         static::registerHandler('CSecuritySessionMC');
     } else {
         static::registerHandler('CSecuritySessionDB');
     }
 }