Minor translation bug fix
[openemr.git] / gacl / adodb / session / adodb-session2.php
blob43396d52e521c736d243c408c750cee29188a3af
1 <?php
4 /*
5 V4.92a 29 Aug 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
6 Contributed by Ross Smith (adodb@netebb.com).
7 Released under both BSD license and Lesser GPL library license.
8 Whenever there is any discrepancy between the two licenses,
9 the BSD license will take precedence.
10 Set tabs to 4 for best viewing.
17 CREATE Table SCripts
19 Oracle
20 ======
22 CREATE TABLE SESSIONS2
24 SESSKEY VARCHAR2(48 BYTE) NOT NULL,
25 EXPIRY DATE NOT NULL,
26 EXPIREREF VARCHAR2(200 BYTE),
27 CREATED DATE NOT NULL,
28 MODIFIED DATE NOT NULL,
29 SESSDATA CLOB,
30 PRIMARY KEY(SESSKEY)
34 CREATE INDEX SESS2_EXPIRY ON SESSIONS2(EXPIRY);
35 CREATE UNIQUE INDEX SESS2_PK ON SESSIONS2(SESSKEY);
36 CREATE INDEX SESS2_EXP_REF ON SESSIONS2(EXPIREREF);
40 MySQL
41 =====
43 CREATE TABLE sessions2(
44 sesskey VARCHAR( 64 ) NOT NULL DEFAULT '',
45 expiry TIMESTAMP NOT NULL ,
46 expireref VARCHAR( 250 ) DEFAULT '',
47 created TIMESTAMP NOT NULL ,
48 modified TIMESTAMP NOT NULL ,
49 sessdata LONGTEXT DEFAULT '',
50 PRIMARY KEY ( sesskey ) ,
51 INDEX sess2_expiry( expiry ),
52 INDEX sess2_expireref( expireref )
58 if (!defined('_ADODB_LAYER')) {
59 require realpath(dirname(__FILE__) . '/../adodb.inc.php');
62 if (defined('ADODB_SESSION')) return 1;
64 define('ADODB_SESSION', dirname(__FILE__));
65 define('ADODB_SESSION2', ADODB_SESSION);
67 /*
68 Unserialize session data manually. See http://phplens.com/lens/lensforum/msgs.php?id=9821
70 From Kerr Schere, to unserialize session data stored via ADOdb.
71 1. Pull the session data from the db and loop through it.
72 2. Inside the loop, you will need to urldecode the data column.
73 3. After urldecode, run the serialized string through this function:
76 function adodb_unserialize( $serialized_string )
78 $variables = array( );
79 $a = preg_split( "/(\w+)\|/", $serialized_string, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE );
80 for( $i = 0; $i < count( $a ); $i = $i+2 ) {
81 $variables[$a[$i]] = unserialize( $a[$i+1] );
83 return( $variables );
87 Thanks Joe Li. See http://phplens.com/lens/lensforum/msgs.php?id=11487&x=1
88 Since adodb 4.61.
90 function adodb_session_regenerate_id()
92 $conn =& ADODB_Session::_conn();
93 if (!$conn) return false;
95 $old_id = session_id();
96 if (function_exists('session_regenerate_id')) {
97 session_regenerate_id();
98 } else {
99 session_id(md5(uniqid(rand(), true)));
100 $ck = session_get_cookie_params();
101 setcookie(session_name(), session_id(), false, $ck['path'], $ck['domain'], $ck['secure']);
102 //@session_start();
104 $new_id = session_id();
105 $ok =& $conn->Execute('UPDATE '. ADODB_Session::table(). ' SET sesskey='. $conn->qstr($new_id). ' WHERE sesskey='.$conn->qstr($old_id));
107 /* it is possible that the update statement fails due to a collision */
108 if (!$ok) {
109 session_id($old_id);
110 if (empty($ck)) $ck = session_get_cookie_params();
111 setcookie(session_name(), session_id(), false, $ck['path'], $ck['domain'], $ck['secure']);
112 return false;
115 return true;
119 Generate database table for session data
120 @see http://phplens.com/lens/lensforum/msgs.php?id=12280
121 @return 0 if failure, 1 if errors, 2 if successful.
122 @author Markus Staab http://www.public-4u.de
124 function adodb_session_create_table($schemaFile=null,$conn = null)
126 // set default values
127 if ($schemaFile===null) $schemaFile = ADODB_SESSION . '/session_schema2.xml';
128 if ($conn===null) $conn =& ADODB_Session::_conn();
130 if (!$conn) return 0;
132 $schema = new adoSchema($conn);
133 $schema->ParseSchema($schemaFile);
134 return $schema->ExecuteSchema();
138 \static
140 class ADODB_Session {
141 /////////////////////
142 // getter/setter methods
143 /////////////////////
147 function Lock($lock=null)
149 static $_lock = false;
151 if (!is_null($lock)) $_lock = $lock;
152 return $lock;
157 function driver($driver = null)
159 static $_driver = 'mysql';
160 static $set = false;
162 if (!is_null($driver)) {
163 $_driver = trim($driver);
164 $set = true;
165 } elseif (!$set) {
166 // backwards compatibility
167 if (isset($GLOBALS['ADODB_SESSION_DRIVER'])) {
168 return $GLOBALS['ADODB_SESSION_DRIVER'];
172 return $_driver;
177 function host($host = null) {
178 static $_host = 'localhost';
179 static $set = false;
181 if (!is_null($host)) {
182 $_host = trim($host);
183 $set = true;
184 } elseif (!$set) {
185 // backwards compatibility
186 if (isset($GLOBALS['ADODB_SESSION_CONNECT'])) {
187 return $GLOBALS['ADODB_SESSION_CONNECT'];
191 return $_host;
196 function user($user = null)
198 static $_user = 'root';
199 static $set = false;
201 if (!is_null($user)) {
202 $_user = trim($user);
203 $set = true;
204 } elseif (!$set) {
205 // backwards compatibility
206 if (isset($GLOBALS['ADODB_SESSION_USER'])) {
207 return $GLOBALS['ADODB_SESSION_USER'];
211 return $_user;
216 function password($password = null)
218 static $_password = '';
219 static $set = false;
221 if (!is_null($password)) {
222 $_password = $password;
223 $set = true;
224 } elseif (!$set) {
225 // backwards compatibility
226 if (isset($GLOBALS['ADODB_SESSION_PWD'])) {
227 return $GLOBALS['ADODB_SESSION_PWD'];
231 return $_password;
236 function database($database = null)
238 static $_database = '';
239 static $set = false;
241 if (!is_null($database)) {
242 $_database = trim($database);
243 $set = true;
244 } elseif (!$set) {
245 // backwards compatibility
246 if (isset($GLOBALS['ADODB_SESSION_DB'])) {
247 return $GLOBALS['ADODB_SESSION_DB'];
250 return $_database;
255 function persist($persist = null)
257 static $_persist = true;
259 if (!is_null($persist)) {
260 $_persist = trim($persist);
263 return $_persist;
268 function lifetime($lifetime = null)
270 static $_lifetime;
271 static $set = false;
273 if (!is_null($lifetime)) {
274 $_lifetime = (int) $lifetime;
275 $set = true;
276 } elseif (!$set) {
277 // backwards compatibility
278 if (isset($GLOBALS['ADODB_SESS_LIFE'])) {
279 return $GLOBALS['ADODB_SESS_LIFE'];
282 if (!$_lifetime) {
283 $_lifetime = ini_get('session.gc_maxlifetime');
284 if ($_lifetime <= 1) {
285 // bug in PHP 4.0.3 pl 1 -- how about other versions?
286 //print "<h3>Session Error: PHP.INI setting <i>session.gc_maxlifetime</i>not set: $lifetime</h3>";
287 $_lifetime = 1440;
291 return $_lifetime;
296 function debug($debug = null)
298 static $_debug = false;
299 static $set = false;
301 if (!is_null($debug)) {
302 $_debug = (bool) $debug;
304 $conn = ADODB_Session::_conn();
305 if ($conn) {
306 $conn->debug = $_debug;
308 $set = true;
309 } elseif (!$set) {
310 // backwards compatibility
311 if (isset($GLOBALS['ADODB_SESS_DEBUG'])) {
312 return $GLOBALS['ADODB_SESS_DEBUG'];
316 return $_debug;
321 function expireNotify($expire_notify = null)
323 static $_expire_notify;
324 static $set = false;
326 if (!is_null($expire_notify)) {
327 $_expire_notify = $expire_notify;
328 $set = true;
329 } elseif (!$set) {
330 // backwards compatibility
331 if (isset($GLOBALS['ADODB_SESSION_EXPIRE_NOTIFY'])) {
332 return $GLOBALS['ADODB_SESSION_EXPIRE_NOTIFY'];
336 return $_expire_notify;
341 function table($table = null)
343 static $_table = 'sessions2';
344 static $set = false;
346 if (!is_null($table)) {
347 $_table = trim($table);
348 $set = true;
349 } elseif (!$set) {
350 // backwards compatibility
351 if (isset($GLOBALS['ADODB_SESSION_TBL'])) {
352 return $GLOBALS['ADODB_SESSION_TBL'];
356 return $_table;
361 function optimize($optimize = null)
363 static $_optimize = false;
364 static $set = false;
366 if (!is_null($optimize)) {
367 $_optimize = (bool) $optimize;
368 $set = true;
369 } elseif (!$set) {
370 // backwards compatibility
371 if (defined('ADODB_SESSION_OPTIMIZE')) {
372 return true;
376 return $_optimize;
381 function syncSeconds($sync_seconds = null) {
382 //echo ("<p>WARNING: ADODB_SESSION::syncSeconds is longer used, please remove this function for your code</p>");
384 return 0;
389 function clob($clob = null) {
390 static $_clob = false;
391 static $set = false;
393 if (!is_null($clob)) {
394 $_clob = strtolower(trim($clob));
395 $set = true;
396 } elseif (!$set) {
397 // backwards compatibility
398 if (isset($GLOBALS['ADODB_SESSION_USE_LOBS'])) {
399 return $GLOBALS['ADODB_SESSION_USE_LOBS'];
403 return $_clob;
408 function dataFieldName($data_field_name = null) {
409 //echo ("<p>WARNING: ADODB_SESSION::dataFieldName() is longer used, please remove this function for your code</p>");
410 return '';
415 function filter($filter = null) {
416 static $_filter = array();
418 if (!is_null($filter)) {
419 if (!is_array($filter)) {
420 $filter = array($filter);
422 $_filter = $filter;
425 return $_filter;
430 function encryptionKey($encryption_key = null) {
431 static $_encryption_key = 'CRYPTED ADODB SESSIONS ROCK!';
433 if (!is_null($encryption_key)) {
434 $_encryption_key = $encryption_key;
437 return $_encryption_key;
440 /////////////////////
441 // private methods
442 /////////////////////
446 function &_conn($conn=null) {
447 return $GLOBALS['ADODB_SESS_CONN'];
452 function _crc($crc = null) {
453 static $_crc = false;
455 if (!is_null($crc)) {
456 $_crc = $crc;
459 return $_crc;
464 function _init() {
465 session_module_name('user');
466 session_set_save_handler(
467 array('ADODB_Session', 'open'),
468 array('ADODB_Session', 'close'),
469 array('ADODB_Session', 'read'),
470 array('ADODB_Session', 'write'),
471 array('ADODB_Session', 'destroy'),
472 array('ADODB_Session', 'gc')
479 function _sessionKey() {
480 // use this function to create the encryption key for crypted sessions
481 // crypt the used key, ADODB_Session::encryptionKey() as key and session_id() as salt
482 return crypt(ADODB_Session::encryptionKey(), session_id());
487 function _dumprs($rs) {
488 $conn =& ADODB_Session::_conn();
489 $debug = ADODB_Session::debug();
491 if (!$conn) {
492 return;
495 if (!$debug) {
496 return;
499 if (!$rs) {
500 echo "<br />\$rs is null or false<br />\n";
501 return;
504 //echo "<br />\nAffected_Rows=",$conn->Affected_Rows(),"<br />\n";
506 if (!is_object($rs)) {
507 return;
510 require_once ADODB_SESSION.'/../tohtml.inc.php';
511 rs2html($rs);
514 /////////////////////
515 // public methods
516 /////////////////////
518 function config($driver, $host, $user, $password, $database=false,$options=false)
520 ADODB_Session::driver($driver);
521 ADODB_Session::host($host);
522 ADODB_Session::user($user);
523 ADODB_Session::password($password);
524 ADODB_Session::database($database);
526 if ($driver == 'oci8' || $driver == 'oci8po') $options['lob'] = 'CLOB';
528 if (isset($options['table'])) ADODB_Session::table($options['table']);
529 if (isset($options['lob'])) ADODB_Session::clob($options['lob']);
530 if (isset($options['debug'])) ADODB_Session::debug($options['debug']);
534 Create the connection to the database.
536 If $conn already exists, reuse that connection
538 function open($save_path, $session_name, $persist = null)
540 $conn =& ADODB_Session::_conn();
542 if ($conn) {
543 return true;
546 $database = ADODB_Session::database();
547 $debug = ADODB_Session::debug();
548 $driver = ADODB_Session::driver();
549 $host = ADODB_Session::host();
550 $password = ADODB_Session::password();
551 $user = ADODB_Session::user();
553 if (!is_null($persist)) {
554 ADODB_Session::persist($persist);
555 } else {
556 $persist = ADODB_Session::persist();
559 # these can all be defaulted to in php.ini
560 # assert('$database');
561 # assert('$driver');
562 # assert('$host');
564 $conn =& ADONewConnection($driver);
566 if ($debug) {
567 $conn->debug = true;
568 ADOConnection::outp( " driver=$driver user=$user db=$database ");
571 if ($persist) {
572 switch($persist) {
573 default:
574 case 'P': $ok = $conn->PConnect($host, $user, $password, $database); break;
575 case 'C': $ok = $conn->Connect($host, $user, $password, $database); break;
576 case 'N': $ok = $conn->NConnect($host, $user, $password, $database); break;
578 } else {
579 $ok = $conn->Connect($host, $user, $password, $database);
582 if ($ok) $GLOBALS['ADODB_SESS_CONN'] =& $conn;
583 else
584 ADOConnection::outp('<p>Session: connection failed</p>', false);
587 return $ok;
591 Close the connection
593 function close()
596 $conn =& ADODB_Session::_conn();
597 if ($conn) $conn->Close();
599 return true;
603 Slurp in the session variables and return the serialized string
605 function read($key)
607 $conn =& ADODB_Session::_conn();
608 $filter = ADODB_Session::filter();
609 $table = ADODB_Session::table();
611 if (!$conn) {
612 return '';
615 //assert('$table');
617 $qkey = $conn->quote($key);
618 $binary = $conn->dataProvider === 'mysql' ? '/*! BINARY */' : '';
620 $sql = "SELECT sessdata FROM $table WHERE sesskey = $binary $qkey AND expiry >= " . $conn->sysTimeStamp;
621 /* Lock code does not work as it needs to hold transaction within whole page, and we don't know if
622 developer has commited elsewhere... :(
624 #if (ADODB_Session::Lock())
625 # $rs =& $conn->RowLock($table, "$binary sesskey = $qkey AND expiry >= " . time(), sessdata);
626 #else
628 $rs =& $conn->Execute($sql);
629 //ADODB_Session::_dumprs($rs);
630 if ($rs) {
631 if ($rs->EOF) {
632 $v = '';
633 } else {
634 $v = reset($rs->fields);
635 $filter = array_reverse($filter);
636 foreach ($filter as $f) {
637 if (is_object($f)) {
638 $v = $f->read($v, ADODB_Session::_sessionKey());
641 $v = rawurldecode($v);
644 $rs->Close();
646 ADODB_Session::_crc(strlen($v) . crc32($v));
647 return $v;
650 return '';
654 Write the serialized data to a database.
656 If the data has not been modified since the last read(), we do not write.
658 function write($key, $val)
660 global $ADODB_SESSION_READONLY;
662 if (!empty($ADODB_SESSION_READONLY)) return;
664 $clob = ADODB_Session::clob();
665 $conn =& ADODB_Session::_conn();
666 $crc = ADODB_Session::_crc();
667 $debug = ADODB_Session::debug();
668 $driver = ADODB_Session::driver();
669 $expire_notify = ADODB_Session::expireNotify();
670 $filter = ADODB_Session::filter();
671 $lifetime = ADODB_Session::lifetime();
672 $table = ADODB_Session::table();
674 if (!$conn) {
675 return false;
678 $sysTimeStamp = $conn->sysTimeStamp;
680 //assert('$table');
682 $expiry = $conn->OffsetDate($lifetime/(24*3600),$sysTimeStamp);
684 $binary = $conn->dataProvider === 'mysql' ? '/*! BINARY */' : '';
686 // crc32 optimization since adodb 2.1
687 // now we only update expiry date, thx to sebastian thom in adodb 2.32
688 if ($crc !== false && $crc == (strlen($val) . crc32($val))) {
689 if ($debug) {
690 echo '<p>Session: Only updating date - crc32 not changed</p>';
693 $expirevar = '';
694 if ($expire_notify) {
695 $var = reset($expire_notify);
696 global $$var;
697 if (isset($$var)) {
698 $expirevar = $$var;
703 $sql = "UPDATE $table SET expiry = $expiry ,expireref=".$conn->Param('0').", modified = $sysTimeStamp WHERE $binary sesskey = ".$conn->Param('1')." AND expiry >= $sysTimeStamp";
704 $rs =& $conn->Execute($sql,array($expirevar,$key));
705 return true;
707 $val = rawurlencode($val);
708 foreach ($filter as $f) {
709 if (is_object($f)) {
710 $val = $f->write($val, ADODB_Session::_sessionKey());
714 $expireref = '';
715 if ($expire_notify) {
716 $var = reset($expire_notify);
717 global $$var;
718 if (isset($$var)) {
719 $expireref = $$var;
723 if (!$clob) { // no lobs, simply use replace()
724 $rs =& $conn->Execute("SELECT COUNT(*) AS cnt FROM $table WHERE $binary sesskey = ".$conn->Param(0),array($key));
725 if ($rs) $rs->Close();
727 if ($rs && reset($rs->fields) > 0) {
728 $sql = "UPDATE $table SET expiry=$expiry, sessdata=".$conn->Param(0).", expireref= ".$conn->Param(1).",modified=$sysTimeStamp WHERE sesskey = ".$conn->Param('2');
730 } else {
731 $sql = "INSERT INTO $table (expiry, sessdata, expireref, sesskey, created, modified)
732 VALUES ($expiry,".$conn->Param('0').", ". $conn->Param('1').", ".$conn->Param('2').", $sysTimeStamp, $sysTimeStamp)";
736 $rs =& $conn->Execute($sql,array($val,$expireref,$key));
738 } else {
739 // what value shall we insert/update for lob row?
740 switch ($driver) {
741 // empty_clob or empty_lob for oracle dbs
742 case 'oracle':
743 case 'oci8':
744 case 'oci8po':
745 case 'oci805':
746 $lob_value = sprintf('empty_%s()', strtolower($clob));
747 break;
749 // null for all other
750 default:
751 $lob_value = 'null';
752 break;
755 $conn->StartTrans();
757 $rs =& $conn->Execute("SELECT COUNT(*) AS cnt FROM $table WHERE $binary sesskey = ".$conn->Param(0),array($key));
758 if ($rs) $rs->Close();
760 if ($rs && reset($rs->fields) > 0) {
761 $sql = "UPDATE $table SET expiry=$expiry, sessdata=$lob_value, expireref= ".$conn->Param(0).",modified=$sysTimeStamp WHERE sesskey = ".$conn->Param('1');
763 } else {
764 $sql = "INSERT INTO $table (expiry, sessdata, expireref, sesskey, created, modified)
765 VALUES ($expiry,$lob_value, ". $conn->Param('0').", ".$conn->Param('1').", $sysTimeStamp, $sysTimeStamp)";
768 $rs =& $conn->Execute($sql,array($expireref,$key));
770 $qkey = $conn->qstr($key);
771 $rs2 =& $conn->UpdateBlob($table, 'sessdata', $val, " sesskey=$qkey", strtoupper($clob));
772 $rs = $conn->CompleteTrans();
777 if (!$rs) {
778 ADOConnection::outp('<p>Session Replace: ' . $conn->ErrorMsg() . '</p>', false);
779 return false;
780 } else {
781 // bug in access driver (could be odbc?) means that info is not committed
782 // properly unless select statement executed in Win2000
783 if ($conn->databaseType == 'access') {
784 $sql = "SELECT sesskey FROM $table WHERE $binary sesskey = $qkey";
785 $rs =& $conn->Execute($sql);
786 ADODB_Session::_dumprs($rs);
787 if ($rs) {
788 $rs->Close();
792 if (ADODB_Session::Lock()) {
793 $conn->CommitTrans();
795 return $rs ? true : false;
800 function destroy($key) {
801 $conn =& ADODB_Session::_conn();
802 $table = ADODB_Session::table();
803 $expire_notify = ADODB_Session::expireNotify();
805 if (!$conn) {
806 return false;
809 //assert('$table');
811 $qkey = $conn->quote($key);
812 $binary = $conn->dataProvider === 'mysql' ? '/*! BINARY */' : '';
814 if ($expire_notify) {
815 reset($expire_notify);
816 $fn = next($expire_notify);
817 $savem = $conn->SetFetchMode(ADODB_FETCH_NUM);
818 $sql = "SELECT expireref, sesskey FROM $table WHERE $binary sesskey = $qkey";
819 $rs =& $conn->Execute($sql);
820 ADODB_Session::_dumprs($rs);
821 $conn->SetFetchMode($savem);
822 if (!$rs) {
823 return false;
825 if (!$rs->EOF) {
826 $ref = $rs->fields[0];
827 $key = $rs->fields[1];
828 //assert('$ref');
829 //assert('$key');
830 $fn($ref, $key);
832 $rs->Close();
835 $sql = "DELETE FROM $table WHERE $binary sesskey = $qkey";
836 $rs =& $conn->Execute($sql);
837 ADODB_Session::_dumprs($rs);
838 if ($rs) {
839 $rs->Close();
842 return $rs ? true : false;
847 function gc($maxlifetime)
849 $conn =& ADODB_Session::_conn();
850 $debug = ADODB_Session::debug();
851 $expire_notify = ADODB_Session::expireNotify();
852 $optimize = ADODB_Session::optimize();
853 $table = ADODB_Session::table();
855 if (!$conn) {
856 return false;
859 //assert('$table');
861 $time = $conn->sysTimeStamp;
862 $binary = $conn->dataProvider === 'mysql' ? '/*! BINARY */' : '';
864 if ($expire_notify) {
865 reset($expire_notify);
866 $fn = next($expire_notify);
867 $savem = $conn->SetFetchMode(ADODB_FETCH_NUM);
868 $sql = "SELECT expireref, sesskey FROM $table WHERE expiry < $time";
869 $rs =& $conn->Execute($sql);
870 ADODB_Session::_dumprs($rs);
871 $conn->SetFetchMode($savem);
872 if ($rs) {
873 $conn->StartTrans();
874 $keys = array();
875 while (!$rs->EOF) {
876 $ref = $rs->fields[0];
877 $key = $rs->fields[1];
878 $fn($ref, $key);
879 $del = $conn->Execute("DELETE FROM $table WHERE sesskey=".$conn->Param('0'),array($key));
880 $rs->MoveNext();
882 $rs->Close();
884 $conn->CompleteTrans();
886 } else {
888 if (0) {
889 $sql = "SELECT sesskey FROM $table WHERE expiry < $time";
890 $arr =& $conn->GetAll($sql);
891 foreach ($arr as $row) {
892 $sql2 = "DELETE FROM $table WHERE sesskey=".$conn->Param('0');
893 $conn->Execute($sql2,array($row[0]));
895 } else {
896 $sql = "DELETE FROM $table WHERE expiry < $time";
897 $rs =& $conn->Execute($sql);
898 ADODB_Session::_dumprs($rs);
899 if ($rs) $rs->Close();
901 if ($debug) {
902 ADOConnection::outp("<p><b>Garbage Collection</b>: $sql</p>");
906 // suggested by Cameron, "GaM3R" <gamr@outworld.cx>
907 if ($optimize) {
908 $driver = ADODB_Session::driver();
910 if (preg_match('/mysql/i', $driver)) {
911 $sql = "OPTIMIZE TABLE $table";
913 if (preg_match('/postgres/i', $driver)) {
914 $sql = "VACUUM $table";
916 if (!empty($sql)) {
917 $conn->Execute($sql);
922 return true;
926 ADODB_Session::_init();
927 if (empty($ADODB_SESSION_READONLY))
928 register_shutdown_function('session_write_close');
930 // for backwards compatability only
931 function adodb_sess_open($save_path, $session_name, $persist = true) {
932 return ADODB_Session::open($save_path, $session_name, $persist);
935 // for backwards compatability only
936 function adodb_sess_gc($t)
938 return ADODB_Session::gc($t);