本文整理汇总了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();
}
}