本文整理汇总了PHP中ADODB_Session::database方法的典型用法代码示例。如果您正苦于以下问题:PHP ADODB_Session::database方法的具体用法?PHP ADODB_Session::database怎么用?PHP ADODB_Session::database使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ADODB_Session
的用法示例。
在下文中一共展示了ADODB_Session::database方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: define
$ADODB_SESSION_DB = $database;
$ADODB_SESSION_DRIVER = $driver;
$ADODB_SESSION_PWD = $password;
$ADODB_SESSION_TBL = $table;
$ADODB_SESSION_USER = $user;
$ADODB_SESSION_USE_LOBS = $clob;
$ADODB_SESS_DEBUG = $debug;
$ADODB_SESS_LIFE = $lifetime;
if ($optimize) {
define('ADODB_SESSION_OPTIMIZE', $optimize);
}
define('ADODB_SESSION_SYNCH_SECS', $sync_seconds);
if (class_exists('ADODB_Session')) {
ADODB_Session::clob($clob);
ADODB_Session::dataFieldName($data_field_name);
ADODB_Session::database($database);
ADODB_Session::debug($debug);
ADODB_Session::driver($driver);
ADODB_Session::filter($filters);
ADODB_Session::host($host);
ADODB_Session::lifetime($lifetime);
ADODB_Session::optimize($optimize);
ADODB_Session::password($password);
ADODB_Session::syncSeconds($sync_seconds);
ADODB_Session::table($table);
ADODB_Session::user($user);
}
function NotifyFn($var, $sesskey)
{
echo "NotifyFn({$var}, {$sesskey}) called<br />\n";
}
示例3: 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;
}
示例4: config
function config($driver, $host, $user, $password, $database = false, $options = false)
{
ADODB_Session::driver($driver);
ADODB_Session::host($host);
ADODB_Session::user($user);
ADODB_Session::password($password);
ADODB_Session::database($database);
if ($driver == 'oci8' || $driver == 'oci8po') {
$options['lob'] = 'CLOB';
}
if (isset($options['table'])) {
ADODB_Session::table($options['table']);
}
if (isset($options['lob'])) {
ADODB_Session::clob($options['lob']);
}
if (isset($options['debug'])) {
ADODB_Session::debug($options['debug']);
}
}
示例5: ini_set
ini_set('session.gc_maxlifetime', $gBitSystem->isFeatureActive('site_session_lifetime'));
}
// is session data stored in DB or in filesystem?
if ($gBitSystem->isFeatureActive('site_store_session_db') && !empty($gBitDbType)) {
if (file_exists(EXTERNAL_LIBS_PATH . 'adodb/session/adodb-session.php')) {
include_once EXTERNAL_LIBS_PATH . 'adodb/session/adodb-session.php';
} elseif (file_exists(UTIL_PKG_PATH . 'adodb/session/adodb-session.php')) {
include_once UTIL_PKG_PATH . 'adodb/session/adodb-session.php';
}
if (class_exists('ADODB_Session')) {
ADODB_Session::dataFieldName('session_data');
ADODB_Session::driver($gBitDbType);
ADODB_Session::host($gBitDbHost);
ADODB_Session::user($gBitDbUser);
ADODB_Session::password($gBitDbPassword);
ADODB_Session::database($gBitDbName);
ADODB_Session::table(BIT_DB_PREFIX . 'sessions');
ini_set('session.save_handler', 'user');
}
}
session_name(BIT_SESSION_NAME);
if ($gBitSystem->isFeatureActive('users_remember_me')) {
session_set_cookie_params($gBitSystem->getConfig('site_session_lifetime'), $gBitSystem->getConfig('cookie_path', BIT_ROOT_URL), $gBitSystem->getConfig('cookie_domain', ''));
} else {
session_set_cookie_params($gBitSystem->getConfig('site_session_lifetime'), BIT_ROOT_URL, '');
}
// just use a simple COOKIE (unique random string) that is linked to the users_cnxn table.
// This way, nuking rows in the users_cnxn table can log people out and is much more reliable than SESSIONS
global $gShellScript;
if (empty($gShellScript)) {
if (session_status() == PHP_SESSION_NONE) {