Date: 05/29/01
- Next message: Ulf Wendel: "Re: [phplib-dev] cvs commit"
- Previous message: Barend Scholtus: "RE: [phplib-dev] cvs commit"
- Next in thread: Ulf Wendel: "Re: [phplib-dev] cvs commit"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
From: uw
Date: Tue May 29 13:31:02 2001
Modified files:
php-lib/php/session/session4.inc
Log message:
- code formatting tabs vs. spaces
Index: php-lib/php/session/session4.inc
diff -u php-lib/php/session/session4.inc:1.4 php-lib/php/session/session4.inc:1.5
--- php-lib/php/session/session4.inc:1.4 Tue Sep 26 18:22:13 2000
+++ php-lib/php/session/session4.inc Tue May 29 13:30:31 2001
@@ -1,5 +1,5 @@
<?php
-/*
+/**
* Session Management for PHP4
*
* Copyright (c) 1998,1999 NetUSE GmbH
@@ -7,7 +7,7 @@
*
* Copyright (c) 2000 Teodor Cimpoesu <teo <email protected>>
*
- * $Id: session4.inc,v 1.4 2000/09/26 16:22:13 teo Exp $
+ * $Id: session4.inc,v 1.5 2001/05/29 11:30:31 uw Exp $
*
*/
@@ -73,7 +73,7 @@
* Start a new session or recovers from an existing session
*/
function start() {
- return <email protected>();
+ return <email protected>();
}
/**
@@ -82,7 +82,7 @@
* <email protected> current session name, most likely php.ini->session.name
*/
function name () {
- return session_name ();
+ return session_name ();
}
/**
@@ -91,9 +91,9 @@
*
* <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());
+ */
+ function id ($sid = '') {
+ return ($sid != '' ? session_id($sid) : session_id());
}
/**
@@ -104,7 +104,7 @@
* <email protected> false if registration failed, true on success.
*/
function register ($var_names) {
- return session_register (explode (',', $var_names));
+ return session_register (explode (',', $var_names));
}
@@ -126,16 +126,18 @@
* <email protected> false if any error, true on success.
*/
function unregister ($var_names) {
- $ok = true;
- foreach (explode (',', $var_names) as $var_name) {
- $ok = $ok && session_unregister ($var_name);
- }
- return $ok;
+
+ $ok = true;
+ foreach (explode (',', $var_names) as $var_name) {
+ $ok = $ok && session_unregister ($var_name);
+ }
+
+ return $ok;
}
/* OB: compatibility func. Misleading, `get' with param actually `set's */
function get_id($sid = '') {
- $this->id ($sid);
+ $this->id ($sid);
}
/**
@@ -146,12 +148,13 @@
* doesn't seem to do (looking @ the session.c:940)
*/
function put_id() {
- if (get_cfg_var ('session.use_cookies') == 1) {
- $cookie_params = session_get_cookie_params();
- setCookie (session_name(), '',0,
- $cookie_params['path'], $cookie_params['domain']);
- }
- return true;
+
+ if (get_cfg_var ('session.use_cookies') == 1) {
+ $cookie_params = session_get_cookie_params();
+ setCookie (session_name(), '',0, $cookie_params['path'], $cookie_params['domain']);
+ }
+
+ return true;
}
/**
@@ -159,7 +162,7 @@
*
*/
function delete () {
- return (session_destroy() && $this->put_id());
+ return (session_destroy() && $this->put_id());
}
/**
@@ -170,17 +173,15 @@
* <email protected> rewritten url with session id included
*/
function url ($url) {
- (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)
- );
-
+
+ (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));
+
return $_url;
}
@@ -192,7 +193,7 @@
/* OB: get current request URI */
function self_url() {
- return getenv('REQUEST_URI');
+ return getenv('REQUEST_URI');
}
/* OB: print current request URI */
@@ -204,11 +205,10 @@
* Stores session id in a hidden variable (part of a form)
*/
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\">\n",
+ session_name(),
+ session_id()
+ );
}
/* OB: printer helper for the above one */
@@ -237,14 +237,13 @@
* <email protected> the resulting quetry string, of course :)
*/
function &add_query ($query_string ='', $qarray) {
-
- ($query_string == '') && ($query_string = getenv ('QUERY_STRING'));
-
- $qstring = $query_string . (strrpos ($query_string, '?') == false ? '?' : '&');
-
- foreach ($qarray as $var => $val) {
- $qstring .= sprintf ( '%s=%s&', $var, urlencode ($val)) ;
- }
+
+ ($query_string == '') && ($query_string = getenv ('QUERY_STRING'));
+ $qstring = $query_string . (strrpos ($query_string, '?') == false ? '?' : '&');
+
+ foreach ($qarray as $var => $val) {
+ $qstring .= sprintf ( '%s=%s&', $var, urlencode ($val)) ;
+ }
return $qstring;
}
@@ -260,7 +259,7 @@
* <email protected> string
*/
function serialize () {
- return session_encode();
+ return session_encode();
}
/**
@@ -269,7 +268,7 @@
* <email protected> boolean
*/
function deserialize (&$data_string) {
- return session_decode ($data_string);
+ return session_decode ($data_string);
}
/* OB: no clue on these functions utility */
---------------------------------------------------------------------
To unsubscribe, e-mail: phplib-dev-unsubscribe <email protected>
For additional commands, e-mail: phplib-dev-help <email protected>
- Next message: Ulf Wendel: "Re: [phplib-dev] cvs commit"
- Previous message: Barend Scholtus: "RE: [phplib-dev] cvs commit"
- Next in thread: Ulf Wendel: "Re: [phplib-dev] cvs commit"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

