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