当前位置: 首页>>代码示例>>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;未经允许,请勿转载。