本文整理汇总了PHP中misc::arrlist_multisort方法的典型用法代码示例。如果您正苦于以下问题:PHP misc::arrlist_multisort方法的具体用法?PHP misc::arrlist_multisort怎么用?PHP misc::arrlist_multisort使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类misc
的用法示例。
在下文中一共展示了misc::arrlist_multisort方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_plugins
public static function get_plugins(&$conf, $force = 0)
{
// 缓存结果
static $plugins = array();
if (!empty($plugins) && !$force) {
return $plugins;
}
if (empty($conf['plugin_path'])) {
return array();
}
$path = $conf['plugin_path'];
if (!is_dir($path)) {
return array();
}
$settingfile = $conf['upload_path'] . 'plugin.json';
$setting = is_file($settingfile) ? (array) core::json_decode(file_get_contents($settingfile)) : array();
$arr = self::get_paths($path);
foreach ($arr as $v) {
$conffile = $path . $v . '/conf.php';
$pconf = is_file($conffile) ? (array) (include $conffile) : array();
!isset($pconf['enable']) && ($pconf['enable'] = isset($setting[$v]['enable']) ? $setting[$v]['enable'] : 0);
!isset($pconf['installed']) && ($pconf['installed'] = isset($setting[$v]['installed']) ? $setting[$v]['installed'] : 0);
!isset($pconf['pluginid']) && ($pconf['pluginid'] = isset($setting[$v]['pluginid']) ? $setting[$v]['pluginid'] : 0);
!isset($pconf['rank']) && ($pconf['rank'] = isset($setting[$v]['rank']) ? $setting[$v]['rank'] : 100);
// 按照正序排序
$plugins[$v] = $pconf;
}
//第二次根据 rank 排序
misc::arrlist_multisort($plugins, 'rank');
return $plugins;
}