Date: 05/29/01
- Next message: max: "[phplib-dev] cvs commit"
- Previous message: Maxim Derkachev: "Re[2]: [phplib-dev] cvs commit"
- Next in thread: max: "[phplib-dev] cvs commit"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
From: uw
Date: Tue May 29 17:15:30 2001
Modified files:
php-lib/php/session/session4.inc
php-lib/php/session/session4_custom.inc
Log message:
>:) let's unify the code. Code is untested. Work continues tomorrow, need a
cleaned up version myself urgently.
Index: php-lib/php/session/session4.inc
diff -u php-lib/php/session/session4.inc:1.5 php-lib/php/session/session4.inc:1.6
--- php-lib/php/session/session4.inc:1.5 Tue May 29 13:30:31 2001
+++ php-lib/php/session/session4.inc Tue May 29 17:14:58 2001
@@ -1,130 +1,193 @@
<?php
/**
- * Session Management for PHP4
- *
- * Copyright (c) 1998,1999 NetUSE GmbH
- * Boris Erdmann, Kristian Koehntopp
- *
- * Copyright (c) 2000 Teodor Cimpoesu <teo <email protected>>
- *
- * $Id: session4.inc,v 1.5 2001/05/29 11:30:31 uw Exp $
- *
- */
-
-/*-DEVELS-NOTE
- * Request for further comments on the phplib-dev
- *
- * RFC - marks function which I don't think I understood them quite well
- * or I propose to be pruned/changed
- * OB - proposed as being obsolete. Most of then `helper' function for
- * printing for which there is already the `<?=' hack.
- *
- * I also sow some watchers on this file. Hey there!
- *
- * o What do you think, should we have class members for session name
- * and ID, or to fetch them using session_*() funcs?
- * o Should we add a constructor to call session->start() and fill this
- * properties?
- * o What about the other session_* functions. Should we extend this
- * API to include such functionalties like cookie params and save handlers
- * or should we think another session class?
- *
- *-END-NOTE
- */
-
-/**
- * Session class.
- *
- * Implemented API:
- *
- * bool start()
- * string name ()
- * string id ($sid = '')
- * bool register ($var_names)
- * bool is_registered ($var_name)
- * bool unregister ($var_names)
- * string get_id ($sid = '')
- * bool put_id ()
- * bool delete ()
- * string url ($url)
- * void purl ($url)
- * string self_url ($url)
- * string pself_url ($url)
- * string get_hidden_session ()
- * void hidden_session ()
- * string get_hidden_id ()
- * void hidden_id ()
- * string add_query ($qs = '',$qarray)
- * void padd_query ($qarray)
- * string serialize ()
- * bool deserialize ()
- * void reimport_get_vars ()
- * void reimport_post_vars ()
- * void reimport_cookie_vars ()
- * void reimport_any_vars ($arrayname)
- */
-class Session {
-
- var $auto_init = null; ## Name of the autoinit-File, if any.
- var $secure_auto_init = 1; ## Set to 0 only, if all pages call
- var $in = false; ## Marker: Did we already include the autoinit file?
+* PHPLib Sessions using PHP 4 built-in Session Support.
+*
+* WARNING: code is untested!
+*
+* <email protected> 1998,1999 NetUSE AG, Boris Erdmann, Kristian Koehntopp
+* 2000 Teodor Cimpoesu <teo <email protected>>
+* <email protected> Teodor Cimpoesu <teo <email protected>>, Ulf Wendel <uw <email protected>>
+* <email protected> $Id: session4.inc,v 1.6 2001/05/29 15:14:58 uw Exp $
+* <email protected> public
+* <email protected> PHPLib
+*/
+class Session4 {
+
+ /**
+ * Name of an optional autoinit-file
+ *
+ * <email protected> string
+ */
+ var $auto_init = "";
+
+
+ /**
+ * Set to false only, if all pages call
+
+ * <email protected> boolean
+ */
+ var $secure_auto_init = true;
+
/**
- * Start a new session or recovers from an existing session
- */
+ * Marker: Did we already include the autoinit file?
+ *
+ * <email protected> boolean
+ */
+ var $in = false;
+
+
+ /**
+ * Current session id.
+ *
+ * <email protected> string
+ * <email protected> id(), Session()
+ */
+ var $id = "";
+
+
+ /**
+ * [Current] Session name.
+ *
+ * <email protected> string
+ * <email protected> name(), Session()
+ */
+ var $name = "";
+
+
+ /**
+ * Was the PHP compiled using --enable-trans-sid?
+ *
+ * PHP 4 can automatically rewrite all URLs to append the session ID
+ * as a get parameter if you enable the feature. If you've done so,
+ * the old session3.inc method url() is no more needed, but as your
+ * application might still call it you can disable it by setting this
+ * flag to false.
+ *
+ * <email protected> boolean
+ */
+ var $trans_id_enabled = true;
+
+
+ /**
+ * Sets the session name before the session starts.
+ *
+ * Make sure that all derived classes call the constructor
+ *
+ * <email protected> name()
+ */
+ function Session() {
+ $this->name($this->name);
+ } // end constructor
+
+
+ /**
+ * Start a new session or recovers from an existing session
+ *
+ * <email protected> boolean session_start() return value
+ * <email protected> public
+ */
function start() {
- return <email protected>();
- }
+
+ $ok = session_start();
+ $this->id = session_id();
+
+ return $ok;
+ } // end func start
+
/**
- * returns the variable name (cookie or GET/POST variable)
- *
- * <email protected> current session name, most likely php.ini->session.name
- */
- function name () {
- return session_name ();
- }
+ * Sets or returns the name of the current session
+ *
+ * <email protected> string If given, sets the session name
+ * <email protected> string session_name() return value
+ * <email protected> public
+ */
+ function name($name = '') {
+
+ if ($name = (string)$name) {
+
+ $this->name = $name;
+ $ok = session_name($name);
+
+ } else {
+
+ $ok = session_name();
+
+ }
+
+ return $ok;
+ } // end func name
+
/**
- * returns the session id for the current session. If id is
- * specified, it will replace the current session id
- *
- * <email protected> $sid (optional) if given, sets the new session id
- * <email protected> current session id
- */
- function id ($sid = '') {
- return ($sid != '' ? session_id($sid) : session_id());
- }
-
- /**
- * register the variable(s) that should become persistent
- *
- * <email protected> $var_names a string/array with variable name(s)
- * e.g. "foo"/"foo,bar,baz"/{"foo","bar","baz"}
- * <email protected> false if registration failed, true on success.
- */
- function register ($var_names) {
- return session_register (explode (',', $var_names));
- }
+ * Returns the session id for the current session.
+ *
+ * If id is specified, it will replace the current session id.
+ *
+ * <email protected> string If given, sets the new session id
+ * <email protected> string current session id
+ * <email protected> public
+ */
+ function id($sid = '') {
+
+ if ($sid = (string)$sid)) {
+
+ $this->id = $sid;
+ $ok = session_id($sid);
+
+ } else {
+
+ $ok = session_id();
+
+ }
+
+ return $ok;
+ } // end func id
+
+
+ /**
+ * <email protected> id()
+ * <email protected> $Id: session4.inc,v 1.6 2001/05/29 15:14:58 uw Exp $
+ * <email protected> public
+ */
+ function get_id($sid = '') {
+ return $this->id($sid);
+ } // end func get_id
+
+ /**
+ * Register the variable(s) that should become persistent.
+ *
+ * <email protected> mixed String with the name of one or more variables seperated by comma
+ * or a list of variables names: "foo"/"foo,bar,baz"/{"foo","bar","baz"}
+ * <email protected> boolean false if registration failed, true on success.
+ * <email protected> public
+ */
+ function register ($var_names) {
+ return session_register(explode (',', $var_names));
+ } // end func register
/**
- * see if a variable is registered in the current session
- *
- * <email protected> $var_name a string with the variable name
- * <email protected> false if variable not registered true on success.
- */
+ * see if a variable is registered in the current session
+ *
+ * <email protected> $var_name a string with the variable name
+ * <email protected> false if variable not registered true on success.
+ * <email protected> public
+ */
function is_registered ($var_name) {
- return session_is_registered ($var_name);
- }
+ return session_is_registered($var_name);
+ } // end func is_registered
+
/**
- * recall the session registration for named variable(s)
- *
- * <email protected> $var_names a string with the variable names to be removed
- * from the session
- * <email protected> false if any error, true on success.
- */
+ * Recall the session registration for named variable(s)
+ *
+ * <email protected> mixed String with the name of one or more variables seperated by comma
+ * or a list of variables names: "foo"/"foo,bar,baz"/{"foo","bar","baz"}
+ * <email protected> boolean false if any error, true on success.
+ * <email protected> public
+ */
function unregister ($var_names) {
$ok = true;
@@ -133,112 +196,185 @@
}
return $ok;
- }
+ } // end func unregister
- /* OB: compatibility func. Misleading, `get' with param actually `set's */
- function get_id($sid = '') {
- $this->id ($sid);
- }
-
+
/**
- * delete the cookie holding the session id
- * XXX:RFC is this really needed? can we prune this function?
- * the only reason to keep it is if one wants to also
- * unset the cookie when session_destroy()ing,which PHP
- * doesn't seem to do (looking @ the session.c:940)
- */
+ * Delete the cookie holding the session id.
+ *
+ * RFC: is this really needed? can we prune this function?
+ * the only reason to keep it is if one wants to also
+ * unset the cookie when session_destroy()ing,which PHP
+ * doesn't seem to do (looking @ the session.c:940)
+ * uw: yes we should keep it to remain the same interface, but deprec.
+ *
+ * <email protected> $Id: session4.inc,v 1.6 2001/05/29 15:14:58 uw Exp $
+ * <email protected> public
+ * <email protected> $HTTP_COOKIE_VARS
+ */
function put_id() {
-
+ global $HTTP_COOKIE_VARS;
+
if (get_cfg_var ('session.use_cookies') == 1) {
$cookie_params = session_get_cookie_params();
- setCookie (session_name(), '',0, $cookie_params['path'], $cookie_params['domain']);
+ setCookie($this->name, '', 0, $cookie_params['path'], $cookie_params['domain']);
+ $HTTP_COOKIE_VARS[$this->name] = "";
}
- return true;
- }
+ } // end func put_id
/**
- * delete the current session destroying all registered data
- *
- */
+ * Delete the current session destroying all registered data.
+ *
+ * Note that it does more but the PHP 4 session_destroy it also
+ * throws away a cookie is there's one.
+ *
+ * <email protected> boolean session_destroy return value
+ * <email protected> public
+ */
function delete () {
- return (session_destroy() && $this->put_id());
- }
+
+ $this->put_id();
+
+ return session_destroy();
+ } // end func delete
+
/**
- * Helper function: returns $url concatenated with the current session id
- * Hint: now PHP has --enable-trans-sid for this
- *
- * <email protected> $url URL to which the session id wioll be appended
- * <email protected> rewritten url with session id included
- */
+ * Helper function: returns $url concatenated with the current session id
+ *
+ * Don't use this function any more. Please use the PHP 4 build in
+ * URL rewriting feature. This function is here only for compatibility reasons.
+ *
+ * <email protected> $url URL to which the session id will be appended
+ * <email protected> string rewritten url with session id included
+ * <email protected> $trans_id_enabled
+ * <email protected> $HTTP_COOKIE_VARS
+ * <email protected> $Id: session4.inc,v 1.6 2001/05/29 15:14:58 uw Exp $
+ * <email protected> public
+ */
function url ($url) {
-
+ global $HTTP_COOKIE_VARS;
+
+ if ($this->trans_sid_enabled)
+ return $url;
+
+ $url = preg_replace("[&?]+$", "", $url);
+ if (strstr($url, $this->name))
+ return $url;
+
+ if (!$HTTP_COOKIE_VARS[$this->name]) {
+ $url .= ( strpos($url, "?") != false ? "&" : "?" ) . urlencode($this->name) . "=" . $this->id;
+ }
+
+ return $url;
+ /*
+ Maxim, can you merge it? You're code looks more
+ sophisticated. I'll also vote for you on the first
+ international PHP obfuscated code contest if you can
+ add some bit operations and format the code like a "M" for
+ Maxim.
+
(strrpos ($url, '?') == false) && ($url .= '?');
$sin = session_name();
$sid = session_id();
$_url = '';
-
- ( !strstr ($url, $sin) and $_url = preg_replace ('/\?(.*)$/',"?$sin=$sid&\\1",$url) ) or ( $_url = preg_replace ("/($sin=[^&]+&|$sin=[^&]+$)/","$sin=$sid&",$url));
+
+ # How about?
+ # (!strstr ((strrpos ($url, '?') == false) && ($url .= '?'), $this->name) and $_url = preg_replace ('/\?(.*)$/',"?{$this->name}={$this->id}&\\1", $url) ) or ( $_url = preg_replace ("/({$this->name}=[^&]+&|{$this->name}=[^&]+$)/","{$this->name}={$this->id}&",$url));
+ #
+ (!strstr ($url, $sin) and $_url = preg_replace ('/\?(.*)$/',"?$sin=$sid&\\1",$url) ) or ( $_url = preg_replace ("/($sin=[^&]+&|$sin=[^&]+$)/","$sin=$sid&",$url));
return $_url;
- }
+ */
+ } // end func url
- /* OB: print rewritten url */
+ /**
+ * <email protected> url()
+ */
function purl($url) {
- print $this->url ($url);
- }
+ print $this->url($url);
+ } // end func purl
+
- /* OB: get current request URI */
+ /**
+ * Get current request URL.
+ *
+ * WARNING: I'm not sure with the $this->url() call. Can someone check it?
+ * WARNING: Apache variable $REQUEST_URI used -
+ * this it the best you can get but there's warranty the it's set beside
+ * the Apache world.
+ *
+ * <email protected> string
+ * <email protected> $REQUEST_URI
+ * <email protected> public
+ */
function self_url() {
- return getenv('REQUEST_URI');
- }
+ return $this->url(getenv('REQUEST_URI'));
+ } // end func self_url
- /* OB: print current request URI */
+
+ /**
+ * Print the current URL
+ * <email protected> void
+ */
function pself_url() {
print $this->self_url();
- }
+ } // end func pself_url
+
/**
- * Stores session id in a hidden variable (part of a form)
- */
+ * Stores session id in a hidden variable (part of a form).
+ *
+ * <email protected> string
+ * <email protected> public
+ */
function get_hidden_session() {
- return sprintf("<input type=\"hidden\" name=\"%s\" value=\"%s\">\n",
- session_name(),
- session_id()
+ return sprintf('<input type="hidden" name="%s" value="%s">',
+ $this->name,
+ $this->id
);
- }
+ } // end fun get_hidden_session
- /* OB: printer helper for the above one */
+
+ /**
+ * <email protected> get_hidden_session
+ * <email protected> void
+ */
function hidden_session() {
print $this->get_hidden_session();
- }
+ } // end func hidden_session
+
- /* XXX:RFC I missed the logic in the original funcs (look damn similar
- * to the above ones; should we prune this stuff? is anyone using it?
- * say yes! fight the bloated i-faces and lazzy programmers ! :)
- */
+ /**
+ * <email protected> get_hidden_session
+ */
function get_hidden_id() {
return $this->get_hidden_session();
- }
+ } // end func get_hidden_id
+
+ /**
+ * <email protected> hidden_session
+ */
function hidden_id() {
- print $this->get_hidden_id();
- }
+ print $this->get_hidden_session();
+ } // end func hidden_id
+
/**
- * XXX:RFC what's the utility of this one? Shouldn't we store them in session?
- * Prepend variables passed into an array to a query string.
- *
- * <email protected> $query_string probably getenv ('QUERY_STRING')
- * <email protected> $qarray an array with var=>val pairs
- * <email protected> the resulting quetry string, of course :)
- */
- function &add_query ($query_string ='', $qarray) {
+ * Prepend variables passed into an array to a query string.
+ *
+ * <email protected> array $qarray an array with var=>val pairs
+ * <email protected> string $query_string probably getenv ('QUERY_STRING')
+ * <email protected> string the resulting quetry string, of course :)
+ * <email protected> public
+ */
+ function add_query($qarray, $query_string = '') {
- ($query_string == '') && ($query_string = getenv ('QUERY_STRING'));
+ ('' == $query_string) && ($query_string = getenv ('QUERY_STRING'));
$qstring = $query_string . (strrpos ($query_string, '?') == false ? '?' : '&');
foreach ($qarray as $var => $val) {
@@ -246,49 +382,78 @@
}
return $qstring;
- }
+ } // end func add_query
- /* OB: print the resulting qstring */
- function padd_query ($qarray) {
- print $this->add_query ($qarray);
- }
+
+ /**
+ * <email protected> add_query()
+ */
+ function padd_query ($qarray, $query_string = '') {
+ print $this->add_query($qarray, $query_string);
+ } // end func padd_query
/**
- * Get the serialized string of session variables
- *
- * <email protected> string
- */
- function serialize () {
+ * Get the serialized string of session variables
+ *
+ * Note that the serialization format is different from what it
+ * was in session3.inc. So clear all session data when switching
+ * to the PHP 4 code, it's not possible to load old session.
+ *
+ * <email protected> string
+ */
+ function serialize() {
return session_encode();
- }
+ } // end func serialze
+
/**
- * Import (session) variables from a string
- *
- * <email protected> boolean
- */
+ * Import (session) variables from a string
+ *
+ * <email protected> string
+ *
+ * <email protected> boolean
+ */
function deserialize (&$data_string) {
- return session_decode ($data_string);
- }
+ return session_decode($data_string);
+ } // end func deserialize
- /* OB: no clue on these functions utility */
+
+ /**
+ * Reimport HTTP_GET_VARS into the global namespace previously overriden by session variables.
+ * <email protected> reimport_post_vars(), reimport_cookie_vars()
+ */
function reimport_get_vars() {
$this->reimport_any_vars("HTTP_GET_VARS");
- }
+ } // end func reimport_get_vars
+
+ /**
+ * Reimport HTTP_POST_VARS into the global namespace previously overriden by session variables.
+ * <email protected> reimport_get_vars(), reimport_cookie_vars()
+ */
function reimport_post_vars() {
$this->reimport_any_vars("HTTP_POST_VARS");
- }
+ } // end func reimport_post_vars
+
+ /**
+ * Reimport HTTP_COOKIE_VARS into the global namespace previously overriden by session variables.
+ * <email protected> reimport_post_vars(), reimport_fwr_vars()
+ */
function reimport_cookie_vars() {
$this->reimport_any_vars("HTTP_COOKIE_VARS");
- }
+ } // end func reimport_cookie_vars
+
+ /**
+ *
+ * <email protected> array
+ */
function reimport_any_vars($arrayname) {
global $$arrayname;
- $GLOBALS = array_merge ($GLOBALS, $arrayname);
- }
+ $GLOBALS = array_merge ($GLOBALS, $arrayname);
+ } // end func reimport_any_vars
-}
-?>
+} // end func session
+?>
\ No newline at end of file
Index: php-lib/php/session/session4_custom.inc
diff -u php-lib/php/session/session4_custom.inc:1.8 php-lib/php/session/session4_custom.inc:1.9
--- php-lib/php/session/session4_custom.inc:1.8 Tue May 29 13:11:32 2001
+++ php-lib/php/session/session4_custom.inc Tue May 29 17:14:58 2001
@@ -1,4 +1,5 @@
<?php
+require_once("./session4.inc");
/*
* Session Management for PHP4
*
@@ -9,204 +10,101 @@
* some of the code taken from Teodor Cimpoesu's session4 class
* Copyright (c) 2000 Teodor Cimpoesu <teo <email protected>>
*
- * $Id: session4_custom.inc,v 1.8 2001/05/29 11:11:32 uw Exp $
+ * $Id: session4_custom.inc,v 1.9 2001/05/29 15:14:58 uw Exp $
*
*/
-class Session {
+class Session4_Custom extens Session4 {
- var $class_name; ## Used here for comaptibility
- var $id;
- var $name;
+ /**
+ *
+ * <email protected> string
+ */
+ var $cookie_path = '/';
- var $auto_init = ''; ## Name of the autoinit-File, if any.
- var $cookie_path = '/';
+ /**
+ *
+ * <email protected> strings
+ */
var $cookiename;
+
+
+ /**
+ *
+ * <email protected> int
+ */
var $lifetime = 0;
- var $cookie_domain = ''; ## If set, the domain for which the
- ## session cookie is set.
- var $allowcache = 'passive'; ## "passive", "no", "private", "public"
- var $allowcache_expire = 1440; ## If you allowcache, data expires in this
- ## many minutes.
- var $module = 'user'; ## session storage module - user, files or mm
- var $save_path; ## where to save session files if module == files
- var $that_class = ''; ## Name of data storage container
- var $that;
- var $gc_time = 1440; ## Purge all session data older than 1440 minutes.
- var $trans_sid_used; ## set it to true if PHP is compiled with --enable-trans-sid
-
- // compatibility properties
- var $fallback_mode;
- var $gc_probability; ## set this in php.ini or httpd.conf (.htaccess)
- var $secure_auto_init = 1; ## Set to 0 only, if all pages call
- var $in = false; ## Marker: Did we already include the autoinit file?
- var $magic = ''; ## Some string you should change.
+ /**
+ * If set, the domain for which the session cookie is set.
+ *
+ * <email protected> string
+ */
+ var $cookie_domain = '';
-
- /** register($things):
- call this function to register the things that should become persistent
- */
- function register ($things) {
- $vars = array ();
- $things = explode (",", $things);
- foreach ($things as $thing) {
- $vars[] = trim ($thing);
- }
- return session_register ($vars);
- }
-
-
- function is_registered ($name) {
- return session_is_registered ($name);
- }
-
-
- function unregister ($things) {
-
- $ok = true;
- foreach (explode (',', $things) as $var_name) {
- $ok = $ok && session_unregister (trim ($var_name) );
- }
-
- return $ok;
- }
+ /**
+ * "passive", "no", "private", "public"
+ *
+ * <email protected> string
+ */
+ var $allowcache = 'passive';
- function get_id() {
- $this->id = session_id();
- }
-
/**
- put_id()
- Stop using the current session id (unset cookie, ...) and
- abandon a session.
- */
- function put_id() {
- global $HTTP_COOKIE_VARS;
-
- if (get_cfg_var ('session.use_cookies') == 1) {
+ * If you allowcache, data expires in this many minutes.
+ *
+ * <email protected> int
+ */
+ var $allowcache_expire = 1440;
- $cookie_params = session_get_cookie_params();
- setCookie ($this->name, '', 0, $cookie_params['path'], $cookie_params['domain']);
- $HTTP_COOKIE_VARS[$this->name] = "";
-
- }
-
- session_unset();
-
- return true;
- }
+
+ /**
+ * session storage module - user, files or mm
+ *
+ * <email protected> string
+ */
+ var $module = 'user';
-
+
/**
- * Helper function: returns $url concatenated with the current session id
- * Hint: now PHP has --enable-trans-sid for this
+ * where to save session files if module == files
+ *
+ * <email protected> string
*/
- function url ($url) {
- global $HTTP_COOKIE_VARS;
-
- if ($this->trans_sid_used)
- return $url;
-
- $url = ereg_replace("[&?]+$", "", $url);
- if (strstr($url, $this->name))
- return $url;
-
- if (!$HTTP_COOKIE_VARS[$this->name]) {
- $url .= ( strpos($url, "?") != false ? "&" : "?" ) . urlencode($this->name) . "=" . $this->id;
- }
-
- return $url;
- }
-
- function purl($url) {
- print $this->url ($url);
- }
-
- function self_url() {
- global $PHP_SELF, $QUERY_STRING;
- return $this->url($PHP_SELF.
- ((isset($QUERY_STRING) && ("" != $QUERY_STRING)) ? "?".$QUERY_STRING : ""));
- }
-
- function pself_url() {
- print $this->self_url();
- }
-
- /**
- * Stores session id in a hidden variable (part of a form)
- */
- function get_hidden_session() {
- if ($this->trans_sid_used)
- return;
-
- return sprintf("<input type=\"hidden\" name=\"%s\" value=\"%s\">\n",
- $this->name,
- $this->id
- );
- }
-
- function hidden_session() {
- print $this->get_hidden_session();
- }
-
- function add_query ($qarray) {
- global $QUERY_STRING, $HTTP_COOKIE_VARS;
-
- $sep_char = ((isset($QUERY_STRING) && ("" != $QUERY_STRING)) || $HTTP_COOKIE_VARS[$this->name]) ? "&" : "?";
-
- $qstring = "";
- while (list($k, $v) = each($qarray)) {
- $qstring .= $sep_char . urlencode($k) . "=" . urlencode($v);
- $sep_char = "&";
- }
- return $qstring;
- }
-
-
- function padd_query ($qarray) {
- print $this->add_query ($qarray);
- }
-
+ var $save_path;
+
+
/**
- * Get the serialized string of session variables
- *
- * <email protected> string
- */
- function serialize () {
- return session_encode();
- }
-
- /**
- * Import (session) variables from a string
- *
- * <email protected> boolean
- */
- function unserialize (&$data_string) {
- return session_decode ($data_string);
- }
-
- function reimport_get_vars() {
- $this->reimport_any_vars("HTTP_GET_VARS");
- }
-
- function reimport_post_vars() {
- $this->reimport_any_vars("HTTP_POST_VARS");
- }
-
- function reimport_cookie_vars() {
- $this->reimport_any_vars("HTTP_COOKIE_VARS");
- }
-
- function reimport_any_vars($arrayname) {
- global $$arrayname;
- $GLOBALS = array_merge ($GLOBALS, $arrayname);
- }
+ * Name of data storage container
+ *
+ * var string
+ */
+ var $that_class = '';
+
+ /**
+ *
+ * <email protected> object CT_*
+ */
+ var $that;
+
+ /**
+ * Purge all session data older than 1440 minutes.
+ *
+ * <email protected> int
+ */
+ var $gc_time = 1440;
+
+ // compatibility properties
+ var $fallback_mode;
+ var $gc_probability; ## set this in php.ini or httpd.conf (.htaccess)
+ var $secure_auto_init = 1; ## Set to 0 only, if all pages call
+ var $in = false; ## Marker: Did we already include the autoinit file?
+ var $magic = ''; ## Some string you should change.
+
function get_lock() {
$this->that->ac_get_lock();
}
---------------------------------------------------------------------
To unsubscribe, e-mail: phplib-dev-unsubscribe <email protected>
For additional commands, e-mail: phplib-dev-help <email protected>
- Next message: max: "[phplib-dev] cvs commit"
- Previous message: Maxim Derkachev: "Re[2]: [phplib-dev] cvs commit"
- Next in thread: max: "[phplib-dev] cvs commit"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

