本文整理汇总了PHP中ADODB_Session::persist方法的典型用法代码示例。如果您正苦于以下问题:PHP ADODB_Session::persist方法的具体用法?PHP ADODB_Session::persist怎么用?PHP ADODB_Session::persist使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ADODB_Session
的用法示例。
在下文中一共展示了ADODB_Session::persist方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: open
function open($save_path, $session_name, $persist = null)
{
$conn =& ADODB_Session::_conn();
if ($conn) {
return true;
}
$database = ADODB_Session::database();
$debug = ADODB_Session::debug();
$driver = ADODB_Session::driver();
$host = ADODB_Session::host();
$password = ADODB_Session::password();
$user = ADODB_Session::user();
if (!is_null($persist)) {
ADODB_Session::persist($persist);
} else {
$persist = ADODB_Session::persist();
}
# these can all be defaulted to in php.ini
# assert('$database');
# assert('$driver');
# assert('$host');
$conn =& ADONewConnection($driver);
if ($debug) {
$conn->debug = true;
// ADOConnection::outp( " driver=$driver user=$user pwd=$password db=$database ");
}
if ($persist) {
switch ($persist) {
default:
case 'P':
$ok = $conn->PConnect($host, $user, $password, $database);
break;
case 'C':
$ok = $conn->Connect($host, $user, $password, $database);
break;
case 'N':
$ok = $conn->NConnect($host, $user, $password, $database);
break;
}
} else {
$ok = $conn->Connect($host, $user, $password, $database);
}
if ($ok) {
$GLOBALS['ADODB_SESS_CONN'] =& $conn;
} else {
ADOConnection::outp('<p>Session: connection failed</p>', false);
}
return $ok;
}
示例2: open
function open($save_path, $session_name, $persist = null)
{
$conn =& ADODB_Session::_conn();
if ($conn) {
return true;
}
$database = ADODB_Session::database();
$debug = ADODB_Session::debug();
$driver = ADODB_Session::driver();
$host = ADODB_Session::host();
$password = ADODB_Session::password();
$user = ADODB_Session::user();
if (!is_null($persist)) {
$persist = (bool) $persist;
ADODB_Session::persist($persist);
} else {
$persist = ADODB_Session::persist();
}
# these can all be defaulted to in php.ini
# assert('$database');
# assert('$driver');
# assert('$host');
//print "driver is ". $host. $user. $password. $driver;
// cannot use =& below - do not know why...
$conn = ADONewConnection($driver);
if ($debug) {
$conn->debug = true;
// ADOConnection::outp( " driver=$driver user=$user pwd=$password db=$database ");
}
if ($persist) {
$ok = $conn->PConnect($host, $user, $password, $database);
} else {
$ok = $conn->Connect($host, $user, $password, $database);
}
if ($ok) {
$GLOBALS['ADODB_SESS_CONN'] =& $conn;
} else {
ADOConnection::outp('<p>Session: connection failed</p>', false);
}
return $ok;
}