本文整理汇总了PHP中WindUtility::mergeArray方法的典型用法代码示例。如果您正苦于以下问题:PHP WindUtility::mergeArray方法的具体用法?PHP WindUtility::mergeArray怎么用?PHP WindUtility::mergeArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WindUtility
的用法示例。
在下文中一共展示了WindUtility::mergeArray方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: emailAction
/**
* 电子邮件用户激活
*/
public function emailAction()
{
list($page, $perpage) = $this->getInput(array('page', 'perpage'));
$page = $page ? $page : 1;
$perpage = $perpage ? $perpage : $this->perpage;
$count = $this->_getDs()->countUnActived();
$list = array();
if ($count > 0) {
$totalPage = ceil($count / $perpage);
$page > $totalPage && ($page = $totalPage);
$result = $this->_getDs()->getUnActivedList($perpage, intval(($page - 1) * $perpage));
/* @var $userDs PwUser */
$userDs = Wekit::load('user.PwUser');
$list = $userDs->fetchUserByUid(array_keys($result), PwUser::FETCH_MAIN);
$list = WindUtility::mergeArray($result, $list);
}
$this->setOutput($count, 'count');
$this->setOutput($page, 'page');
$this->setOutput($perpage, 'perpage');
$this->setOutput(array('perpage' => $perpage), 'args');
$this->setOutput($list, 'list');
// seo设置
Wind::import('SRV:seo.bo.PwSeoBo');
$seoBo = PwSeoBo::getInstance();
$lang = Wind::getComponent('i18n');
$seoBo->setCustomSeo($lang->getMessage('SEO:manage.user.email.title'), '', '');
Wekit::setV('seo', $seoBo);
}
示例2: run
/**
* 关注-首页
*/
public function run()
{
$type = $this->getInput('type');
$page = intval($this->getInput('page'));
$page < 1 && ($page = 1);
$perpage = 20;
list($start, $limit) = Pw::page2limit($page, $perpage);
$url = $classCurrent = array();
$typeCounts = $this->_getTypeDs()->countUserType($this->loginUser->uid);
if ($type) {
$tmp = $this->_getTypeDs()->getUserByType($this->loginUser->uid, $type, $limit, $start);
$follows = $this->_getDs()->fetchFollows($this->loginUser->uid, array_keys($tmp));
$count = $typeCounts[$type] ? $typeCounts[$type]['count'] : 0;
$url['type'] = $type;
$classCurrent[$type] = 'current';
} else {
$follows = $this->_getDs()->getFollows($this->loginUser->uid, $limit, $start);
$count = $this->loginUser->info['follows'];
$classCurrent[0] = 'current';
}
$uids = array_keys($follows);
$fans = $this->_getDs()->fetchFans($this->loginUser->uid, $uids);
$userList = Wekit::load('user.PwUser')->fetchUserByUid($uids, PwUser::FETCH_MAIN | PwUser::FETCH_DATA | PwUser::FETCH_INFO);
$service = $this->_getService();
$typeArr = $service->getAllType($this->loginUser->uid);
$userType = $service->getUserType($this->loginUser->uid, $uids);
foreach ($userType as $key => $value) {
$tmp = array();
foreach ($value as $k => $v) {
$tmp[$v] = $typeArr[$v];
}
ksort($tmp);
$userType[$key] = $tmp;
}
$follows = WindUtility::mergeArray($follows, $userList);
if (!$type && !$follows) {
$num = 30;
$uids = $this->_getRecommendService()->getOnlneUids($num);
$uids = array_slice($uids, 0, 24);
$this->setOutput($this->_getRecommendService()->buildUserInfo($this->loginUser->uid, $uids, $num), 'recommend');
}
$this->setOutput($follows, 'follows');
$this->setOutput($typeArr, 'typeArr');
$this->setOutput($type, 'type');
$this->setOutput($userType, 'userType');
$this->setOutput($typeCounts, 'typeCounts');
$this->setOutput($fans, 'fans');
$this->setOutput($classCurrent, 'classCurrent');
$this->setOutput($page, 'page');
$this->setOutput($perpage, 'perpage');
$this->setOutput($count, 'count');
$this->setOutput($url, 'url');
// seo设置
Wind::import('SRV:seo.bo.PwSeoBo');
$seoBo = PwSeoBo::getInstance();
$lang = Wind::getComponent('i18n');
$seoBo->setCustomSeo($lang->getMessage('SEO:bbs.follow.run.title'), '', '');
Wekit::setV('seo', $seoBo);
}
示例3: getDetailList
public function getDetailList($notice)
{
$list = $uids = array();
$extendParams = $notice['extend_params'];
$uids = array_keys($extendParams);
$userList = Wekit::load('user.PwUser')->fetchUserByUid($uids, PwUser::FETCH_MAIN);
$list['follows'] = $this->_getAttention()->fetchFollows($notice['uid'], array_keys($userList));
$list['fans'] = WindUtility::mergeArray(array_unique($extendParams), $userList);
return $list;
}
示例4: run
/**
* 运行当前应用
*
* @param string $name 应用名称默认‘phpwind’
* @param array $components 组建配置信息 该组建配置将会覆盖原组建配置,默认为空
*/
public static function run($name = 'phpwind', $components = array())
{
$config = WindUtility::mergeArray(include WEKIT_PATH . '../conf/application/default.php', include WEKIT_PATH . '../conf/application/' . $name . '.php');
if (!empty($components)) {
$config['components'] = (array) $components + $config['components'];
}
/* @var $application WindWebFrontController */
$application = Wind::application($name, $config);
$application->registeFilter(new PwFrontFilters($application));
$application->run();
}
示例5: __construct
/**
* manifest path
*
* @param string $manifest
*/
public function __construct($manifest, $extends = array())
{
is_string($manifest) && ($manifest = Wind::getComponent('configParser')->parse($manifest));
if ($extends) {
$manifest = WindUtility::mergeArray($manifest, $extends);
$charset = isset($manifest['application']['charset']) ? $manifest['application']['charset'] : 'utf-8';
} else {
$charset = Wekit::app()->charset;
}
strncasecmp($charset, 'utf', 3) && ($manifest = WindConvert::convert($manifest, $charset, 'utf-8'));
$this->manifest = $manifest;
}
示例6: run
/**
* 关注-首页
*/
public function run()
{
$type = $this->getInput('type');
$page = intval($this->getInput('page'));
$page < 1 && ($page = 1);
$perpage = 20;
list($start, $limit) = Pw::page2limit($page, $perpage);
$args = $classCurrent = array();
/* $typeCounts = $this->_getTypeDs()->countUserType($this->space->spaceUid);
if ($type) {
$tmp = $this->_getTypeDs()->getUserByType($this->space->spaceUid, $type, $limit, $start);
$follows = $this->_getDs()->fetchFollows($this->space->spaceUid, array_keys($tmp));
$count = $typeCounts[$type] ? $typeCounts[$type]['count'] : 0;
$classCurrent[$type] = 'current';
$args = array('type' => $type);
} else {*/
$follows = $this->_getDs()->getFollows($this->space->spaceUid, $limit, $start);
$count = $this->space->spaceUser['follows'];
$classCurrent[0] = 'current';
//}
$uids = array_keys($follows);
$fans = $this->_getDs()->fetchFans($this->loginUser->uid, $uids);
$myfollows = $this->_getDs()->fetchFollows($this->loginUser->uid, $uids);
$userList = Wekit::load('user.PwUser')->fetchUserByUid($uids, PwUser::FETCH_ALL);
$service = $this->_getService();
$args['uid'] = $this->space->spaceUid;
$follows = WindUtility::mergeArray($follows, $userList);
if (!$follows && $this->space->tome == PwSpaceBo::MYSELF) {
$num = 20;
$uids = $this->_getRecommendService()->getRecommendAttention($this->loginUser->uid, $num);
$this->setOutput($this->_getRecommendService()->buildUserInfo($this->loginUser->uid, $uids, $num), 'recommend');
}
$this->setOutput($fans, 'fans');
$this->setOutput($follows, 'follows');
$this->setOutput($myfollows, 'myfollows');
$this->setOutput($classCurrent, 'classCurrent');
$this->setOutput($args, 'args');
$this->setOutput($page, 'page');
$this->setOutput($perpage, 'perpage');
$this->setOutput($count, 'count');
$this->setOutput('follows', 'src');
// seo设置
Wind::import('SRV:seo.bo.PwSeoBo');
$seoBo = PwSeoBo::getInstance();
$lang = Wind::getComponent('i18n');
$seoBo->setCustomSeo($lang->getMessage('SEO:space.follows.run.title', array($this->space->spaceUser['username'], $this->space->space['space_name'])), '', $lang->getMessage('SEO:space.follows.run.description', array($this->space->spaceUser['username'])));
Wekit::setV('seo', $seoBo);
}
示例7: initConfig
public function initConfig($config, $factory)
{
is_array($config) || ($config = $factory->getInstance('configParser')->parse($config));
foreach ($config['web-apps'] as $key => $value) {
if (isset($this->_config['web-apps'][$key])) {
continue;
}
$rootPath = empty($value['root-path']) ? dirname($_SERVER['SCRIPT_FILENAME']) : Wind::getRealPath($value['root-path'], true);
Wind::register($rootPath, $key, true);
if ('default' !== $key && !empty($config['default'])) {
$value = WindUtility::mergeArray($config['default'], $value);
}
$this->setConfig($key, $value);
}
$this->_config['router'] = isset($config['router']) ? $config['router'] : array();
}
示例8: emailAction
/**
* 电子邮件用户激活
*/
public function emailAction()
{
list($page, $perpage) = $this->getInput(array('page', 'perpage'));
$page = $page ? $page : 1;
$perpage = $perpage ? $perpage : $this->perpage;
$count = $this->_getDs()->countUnActived();
$list = array();
if ($count > 0) {
$totalPage = ceil($count / $perpage);
$page > $totalPage && ($page = $totalPage);
$result = $this->_getDs()->getUnActivedList($perpage, intval(($page - 1) * $perpage));
/* @var $userDs PwUser */
$userDs = Wekit::load('user.PwUser');
$list = $userDs->fetchUserByUid(array_keys($result), PwUser::FETCH_MAIN);
$list = WindUtility::mergeArray($result, $list);
}
$this->setOutput($count, 'count');
$this->setOutput($page, 'page');
$this->setOutput($perpage, 'perpage');
$this->setOutput($list, 'list');
}
示例9: run
public function run()
{
$page = intval($this->getInput('page'));
$page < 1 && ($page = 1);
$perpage = 20;
list($start, $limit) = Pw::page2limit($page, $perpage);
$count = $this->loginUser->info['fans'];
$fans = $this->_getDs()->getFans($this->loginUser->uid, $limit, $start);
$uids = array_keys($fans);
$follows = $this->_getDs()->fetchFollows($this->loginUser->uid, $uids);
$userList = Wekit::load('user.PwUser')->fetchUserByUid($uids, PwUser::FETCH_MAIN | PwUser::FETCH_DATA | PwUser::FETCH_INFO);
$this->setOutput(WindUtility::mergeArray($fans, $userList), 'fans');
$this->setOutput($follows, 'follows');
$this->setOutput($page, 'page');
$this->setOutput($perpage, 'perpage');
$this->setOutput($count, 'count');
//$this->setOutput($url, 'url');
// seo设置
Wind::import('SRV:seo.bo.PwSeoBo');
$lang = Wind::getComponent('i18n');
PwSeoBo::setCustomSeo($lang->getMessage('SEO:bbs.fans.run.title'), '', '');
}
示例10: run
public function run()
{
$page = intval($this->getInput('page'));
$page < 1 && ($page = 1);
$perpage = 20;
list($start, $limit) = Pw::page2limit($page, $perpage);
$fans = $this->_getDs()->getFans($this->space->spaceUid, $limit, $start);
$uids = array_keys($fans);
$count = $this->space->spaceUser['fans'];
$follows = $this->_getDs()->fetchFollows($this->loginUser->uid, $uids);
$userList = Wekit::load('user.PwUser')->fetchUserByUid($uids, PwUser::FETCH_ALL);
$this->setOutput(WindUtility::mergeArray($fans, $userList), 'fans');
$this->setOutput($follows, 'follows');
$this->setOutput($page, 'page');
$this->setOutput($perpage, 'perpage');
$this->setOutput($count, 'count');
$this->setOutput('fans', 'src');
// seo设置
Wind::import('SRV:seo.bo.PwSeoBo');
$lang = Wind::getComponent('i18n');
PwSeoBo::setCustomSeo($lang->getMessage('SEO:space.fans.run.title', array($this->space->spaceUser['username'], $this->space->space['space_name'])), '', $lang->getMessage('SEO:space.fans.run.description', array($this->space->spaceUser['username'])));
}
示例11: getPermissionCategoryConfig
/**
* 获取用户组根权限配置
*
* @param array $config
* @return multitype:multitype:string
*/
public function getPermissionCategoryConfig($config)
{
$markconfig = array('other' => array('sub' => array('mark' => array('name' => '评分', 'items' => array('app_mark_open', 'app_mark_credits')))), 'manage_bbs' => array('sub' => array('mark' => array('name' => '评分管理权限', 'items' => array('app_mark_manage')))));
return WindUtility::mergeArray($config, $markconfig);
}
示例12: _loadSystemConfig
/**
* 加载系统配置
*/
protected static function _loadSystemConfig($name)
{
self::$_sc = WindUtility::mergeArray(include WEKIT_PATH . '../conf/application/default.php', include WEKIT_PATH . '../conf/application/' . $name . '.php');
}
示例13: formatExtendParams
/**
*
* @see PwNoticeAction::formatExtendParams()
*/
public function formatExtendParams($extendParams, $aggregatedNotice = null)
{
$oldExtendParams = $aggregatedNotice ? unserialize($aggregatedNotice['extend_params']) : $extendParams;
return WindUtility::mergeArray($oldExtendParams, $extendParams);
}
示例14: getModules
/**
* 获得module配置,$name为空时返回当前module配置
*
* @param string $name
* module名称 默认为空
* @param boolean $merge
* 合并默认值
* @return array
* @throws WindActionException
* @throws WindException
*/
public function getModules($name = '')
{
if ($name === '') {
$name = $this->handlerAdapter->getModule();
}
if ($name === 'pattern') {
$name = $this->handlerAdapter->getDefaultModule();
}
$_module = $this->getConfig('modules', $name, array());
if (!isset($_module['_verified']) || $_module['_verified'] !== true) {
if (empty($_module) && !empty($this->_config['modules']['pattern'])) {
$_module = $this->_config['modules']['pattern'];
}
$_flag = empty($_module);
$_module = WindUtility::mergeArray($this->_config['modules']['default'], $_module);
$_module_str = implode('#', $_module);
if (strpos($_module_str, '{') !== false) {
preg_match_all('/{(\\w+)}/i', $_module_str, $matches);
if (!empty($matches[1])) {
$_replace = array();
foreach ($matches[1] as $key => $value) {
if ($value === $this->handlerAdapter->getModuleKey()) {
$_replace['{' . $value . '}'] = $this->handlerAdapter->getModule();
} elseif ($value === $this->handlerAdapter->getControllerKey()) {
$_replace['{' . $value . '}'] = $this->handlerAdapter->getController();
} elseif ($value === $this->handlerAdapter->getActionKey()) {
$_replace['{' . $value . '}'] = $this->handlerAdapter->getAction();
} else {
$_replace['{' . $value . '}'] = $this->request->getGet($value);
}
}
$_module_str = strtr($_module_str, $_replace);
$_module = array_combine(array_keys($_module), explode('#', $_module_str));
}
} elseif ($_flag) {
throw new WindException('Your request was not found on this server.', 404);
}
$_module['_verified'] = true;
$this->_config['modules'][$name] = $_module;
}
return $_module;
}
示例15: _getMenuTable
/**
* 获得菜单数据table,该菜单节点table并不展示节点间的层级关系.
*
* 该方法解析所有扩展菜单表或者扩展菜单配置文件,并将菜单合并为一份完整的菜单table并返回.
*
* @example <code> 节点列表'admin' => array('admin', array()),
* 'admin_install' => array('应用菜单安装', 'install/run', '', '',
* 'admin'),
* 'admin_auth' => array('菜单权限', 'auth/*', '', '', 'admin'),</code>
* @return array
*/
private function _getMenuTable()
{
if ($this->menuTable === null) {
/* @var $_configParser WindConfigParser */
$_configParser = Wind::getComponent('configParser');
// 'ADMIN:conf.mainmenu.php'
$mainMenuConfFile = Wind::getRealPath(Wekit::app()->menuPath, true);
$menus = $_configParser->parse($mainMenuConfFile);
/* extend menus by file */
if (isset($menus['_extensions'])) {
$_extensions = $menus['_extensions'];
foreach ($_extensions as $_extName => $_ext) {
if (!isset($_ext['resource'])) {
continue;
}
$_tmp = Wind::getRealPath($_ext['resource'], true);
$cacheKey .= filemtime($_tmp);
$_extensions[$_extName]['resource'] = $_tmp;
}
unset($menus['_extensions']);
} else {
$_extensions = array();
}
$menus = PwSimpleHook::getInstance('admin_menu')->runWithFilters($menus);
foreach ($_extensions as $key => $value) {
if (!isset($value['resource'])) {
continue;
}
$_tmp = $_configParser->parse($value['resource']);
$menus = WindUtility::mergeArray($menus, $_tmp);
}
AdminMenuHelper::verifyMenuConfig($menus, $menus, $this->menuTable);
}
return $this->menuTable;
}