当前位置: 首页>>代码示例>>PHP>>正文


PHP ADODB_Session::persist方法代码示例

本文整理汇总了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;
 }
开发者ID:amjadtbssm,项目名称:website,代码行数:49,代码来源:adodb-session.php

示例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;
 }
开发者ID:nateirwin,项目名称:custom-historic,代码行数:41,代码来源:adodb-session.php


注:本文中的ADODB_Session::persist方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。