/** * Sets user-defined session storage functions * * Sets the user-defined session storage functions which are used * for storing and retrieving data associated with a session. * This is most useful when a storage method other than * those supplied by PHP sessions is preferred. * i.e. Storing the session data in a local database. * * @param string $container Name of the container (e.g. DB, MDB, ...). * @param array $container_options Options, most likely an array. * * @return void * @see session_set_save_handler() */ static function setContainer($container, $container_options = null) { $container_class = 'HTTP_Session2_Container_' . $container; $container_classfile = 'HTTP/Session2/Container/' . $container . '.php'; if (!class_exists($container_class)) { include_once $container_classfile; } if (!class_exists($container_class)) { throw new HTTP_Session2_Exception("Container class, {$container_class}, does not exist", self::ERR_UNKNOWN_CONTAINER); } self::$container = new $container_class($container_options); self::$container->set(); }