當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ca_users::close方法代碼示例

本文整理匯總了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);
             }
         }
     }
 }
開發者ID:samrahman,項目名稱:providence,代碼行數:37,代碼來源:RequestHTTP.php

示例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();
     }
 }
開發者ID:kai-iak,項目名稱:providence,代碼行數:15,代碼來源:RequestHTTP.php


注:本文中的ca_users::close方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。