本文整理匯總了PHP中ca_users::close方法的典型用法代碼示例。如果您正苦於以下問題:PHP ca_users::close方法的具體用法?PHP ca_users::close怎麽用?PHP ca_users::close使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ca_users
的用法示例。
在下文中一共展示了ca_users::close方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: close
/**
*
* Saves changes to session, user objects and sends asynchronous request for search indexing
* You should call this at the end of every request to ensure that user and session variables are saved.
*
* @access public
*/
function close()
{
$this->session->close();
if (is_object($this->user)) {
$this->user->close();
}
if (defined('__CA_SITE_HOSTNAME__') && strlen(__CA_SITE_HOSTNAME__) > 0) {
if (isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT']) {
$vn_port = $_SERVER['SERVER_PORT'];
} else {
$vn_port = 80;
}
if ($vn_port == 443) {
$vs_proto = 'tls://';
} else {
$vs_proto = 'tcp://';
}
// trigger async search indexing
if (!$this->getAppConfig()->get('disable_out_of_process_search_indexing')) {
$r_socket = fsockopen($vs_proto . __CA_SITE_HOSTNAME__, $vn_port, $errno, $err, 3);
if ($r_socket) {
$vs_http = "GET " . $this->getBaseUrlPath() . "/index.php?processIndexingQueue=1 HTTP/1.1\r\n";
$vs_http .= "Host: " . __CA_SITE_HOSTNAME__ . "\r\n";
$vs_http .= "Connection: Close\r\n\r\n";
fwrite($r_socket, $vs_http);
fclose($r_socket);
}
}
}
}
示例2: close
/**
*
* Saves changes to session and user objects. You should call this at the end of every request to ensure
* that user and session variables are saved.
*
* @access public
* @return float Seconds elapsed since request started.
*/
function close()
{
$this->session->close();
if (is_object($this->user)) {
$this->user->close();
}
}