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


PHP IPSLib::arrayMergeRecursive方法代码示例

本文整理汇总了PHP中IPSLib::arrayMergeRecursive方法的典型用法代码示例。如果您正苦于以下问题:PHP IPSLib::arrayMergeRecursive方法的具体用法?PHP IPSLib::arrayMergeRecursive怎么用?PHP IPSLib::arrayMergeRecursive使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IPSLib的用法示例。


在下文中一共展示了IPSLib::arrayMergeRecursive方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _startSession

 /**
  * Starts session
  * Loads / creates a session based on activity
  *
  * @return
  */
 protected function _startSession()
 {
     if (!is_array($this->request['sid'])) {
         $session_id = IPSText::md5Clean($this->request['sid']);
     } else {
         $session_id = '';
     }
     $requestType = $this->request['request_method'] == 'post' ? 'post' : 'get';
     if ($session_id) {
         /* We check on member id 'cos we can. Obviously guests will have a member ID of zero, but meh */
         $this->_session = $this->DB->buildAndFetch(array('select' => '*', 'from' => 'search_sessions', 'where' => 'session_id=\'' . $session_id . '\' AND session_member_id=' . $this->memberData['member_id']));
     }
     /* Deflate */
     if ($this->_session['session_id']) {
         if ($this->_session['session_data']) {
             $this->_session['_session_data'] = unserialize($this->_session['session_data']);
             if (isset($this->_session['_session_data']['search_app_filters'])) {
                 $this->request['search_app_filters'] = is_array($this->request['search_app_filters']) ? array_merge($this->_session['_session_data']['search_app_filters'], $this->request['search_app_filters']) : $this->_session['_session_data']['search_app_filters'];
             }
         }
         IPSDebug::addMessage("Loaded search session: <pre>" . var_export($this->_session['_session_data'], true) . "</pre>");
     } else {
         /* Create a session */
         $this->_session = array('session_id' => md5(uniqid(microtime(), true)), 'session_created' => time(), 'session_updated' => time(), 'session_member_id' => $this->memberData['member_id'], 'session_data' => serialize(array('search_app_filters' => $this->request['search_app_filters'])));
         $this->DB->insert('search_sessions', $this->_session);
         $this->_session['_session_data']['search_app_filters'] = $this->request['search_app_filters'];
         IPSDebug::addMessage("Created search session: <pre>" . var_export($this->_session['_session_data'], true) . "</pre>");
     }
     /* Do we have POST infos? */
     if (isset($_POST['search_app_filters'])) {
         $this->_session['_session_data']['search_app_filters'] = is_array($this->_session['_session_data']['search_app_filters']) ? IPSLib::arrayMergeRecursive($this->_session['_session_data']['search_app_filters'], $_POST['search_app_filters']) : $_POST['search_app_filters'];
         $this->request['search_app_filters'] = $this->_session['_session_data']['search_app_filters'];
         IPSDebug::addMessage("Updated filters: <pre>" . var_export($_POST['search_app_filters'], true) . "</pre>");
     }
     /* Globalize the session ID */
     $this->request['_sid'] = $this->_session['session_id'];
 }
开发者ID:mover5,项目名称:imobackup,代码行数:43,代码来源:search.php


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