本文整理匯總了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;
}