本文整理汇总了PHP中core_plugin_manager::get_installed_plugins方法的典型用法代码示例。如果您正苦于以下问题:PHP core_plugin_manager::get_installed_plugins方法的具体用法?PHP core_plugin_manager::get_installed_plugins怎么用?PHP core_plugin_manager::get_installed_plugins使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类core_plugin_manager
的用法示例。
在下文中一共展示了core_plugin_manager::get_installed_plugins方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_plugins
/**
* Gathers and returns the information about all plugins of the given type,
* either on disk or previously installed.
*
* @param string $type the name of the plugintype, eg. mod, auth or workshopform
* @param string $typerootdir full path to the location of the plugin dir
* @param string $typeclass the name of the actually called class
* @param core_plugin_manager $pluginman the plugin manager calling this method
* @return array of plugintype classes, indexed by the plugin name
*/
public static function get_plugins($type, $typerootdir, $typeclass, $pluginman)
{
$return = array();
$plugins = $pluginman->get_installed_plugins($type);
foreach ($plugins as $name => $version) {
$plugin = new $typeclass();
$plugin->type = $type;
$plugin->typerootdir = $typerootdir;
$plugin->name = $name;
$plugin->rootdir = null;
$plugin->displayname = $name;
$plugin->versiondb = $version;
$plugin->pluginman = $pluginman;
$plugin->init_is_standard();
$return[$name] = $plugin;
}
return $return;
}