當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。