Ejemplo n.º 1
0
 public static function Factory(&$source, $conf_file = NULL, $conf_section = NULL, $strict = TRUE)
 {
     if (!is_array($source)) {
         user_error('$source ' . $source . ' is not an array', E_USER_NOTICE);
     }
     $cage = new Inspekt_Cage_Session();
     $cage->_setSource($source);
     $cage->_parseAndApplyAutoFilters($conf_file);
     if (ini_get('session.use_cookies') || ini_get('session.use_only_cookies')) {
         if (isset($_COOKIE) && isset($_COOKIE[session_name()])) {
             session_id($_COOKIE[session_name()]);
         } elseif ($cookie = Inspekt::makeSessionCage()) {
             session_id($cookie->getAlnum(session_name()));
         }
     } else {
         // we're using session ids passed via GET
         if (isset($_GET) && isset($_GET[session_name()])) {
             session_id($_GET[session_name()]);
         } elseif ($cookie = Inspekt::makeSessionCage()) {
             session_id($cookie->getAlnum(session_name()));
         }
     }
     if ($strict) {
         $source = NULL;
     }
     return $cage;
     register_shutdown_function();
     register_shutdown_function(array($this, '_repopulateSession'));
 }
Ejemplo n.º 2
0
 /**
  * Returns the $_SESSION data wrapped in an Inspekt_Cage object
  *
  * This utilizes a singleton pattern to get around scoping issues
  *
  * @param string  $config_file
  * @param boolean $strict whether or not to nullify the superglobal array
  * @return Inspekt_Cage
  * @static
  * @deprecated
  */
 public static function makeSessionCage($config_file = NULL, $strict = TRUE)
 {
     trigger_error('makeSessionCage is disabled in this version', E_USER_ERROR);
     /**
      * @staticvar $_instance
      */
     static $_instance;
     if (!isset($_SESSION)) {
         return NULL;
     }
     if (!isset($_instance)) {
         $_instance = Inspekt_Cage_Session::Factory($_SESSION, $config_file, '_SESSION', $strict);
     }
     $GLOBALS['HTTP_SESSION_VARS'] = NULL;
     return $_instance;
 }
Ejemplo n.º 3
0
    /**
     * Returns the $_SESSION data wrapped in an Inspekt_Cage object
     *
     * This utilizes a singleton pattern to get around scoping issues
     *
     * @param string  $config_file
     * @param boolean $strict whether or not to nullify the superglobal array
     * @return Inspekt_Cage
     * @deprecated
     */
    static public function makeSessionCage($config_file = null, $strict = true)
    {
        Inspekt_Error::raiseError('makeSessionCage is disabled in this version', E_USER_ERROR);

        /**
         * @staticvar $_instance
         */
        static $_instance;

        if (!isset($_SESSION)) {
            return null;
        }

        if (!isset($_instance)) {
            $_instance = Inspekt_Cage_Session::Factory($_SESSION, $config_file, '_SESSION', $strict);
        }
        $GLOBALS['HTTP_SESSION_VARS'] = null;
        return $_instance;
    }