本文整理汇总了PHP中core_component::get_plugin_list_with_class方法的典型用法代码示例。如果您正苦于以下问题:PHP core_component::get_plugin_list_with_class方法的具体用法?PHP core_component::get_plugin_list_with_class怎么用?PHP core_component::get_plugin_list_with_class使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类core_component
的用法示例。
在下文中一共展示了core_component::get_plugin_list_with_class方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: test_report_participation_supports_logstore
/**
* Test report_log_supports_logstore.
*/
public function test_report_participation_supports_logstore()
{
$logmanager = get_log_manager();
$allstores = \core_component::get_plugin_list_with_class('logstore', 'log\\store');
$supportedstores = array('logstore_legacy' => '\\logstore_legacy\\log\\store', 'logstore_standard' => '\\logstore_standard\\log\\store');
// Make sure all supported stores are installed.
$expectedstores = array_keys(array_intersect($allstores, $supportedstores));
$stores = $logmanager->get_supported_logstores('report_outline');
$stores = array_keys($stores);
foreach ($expectedstores as $expectedstore) {
$this->assertContains($expectedstore, $stores);
}
}
示例2: get_addable_lock_options
/**
* Returns an array of lock plugins for which we can add an instance.
*
* Suitable for use within an mform select element.
*
* @return array
*/
public static function get_addable_lock_options()
{
$plugins = core_component::get_plugin_list_with_class('cachelock', '', 'lib.php');
$options = array();
$len = strlen('cachelock_');
foreach ($plugins as $plugin => $class) {
$method = "{$class}::can_add_instance";
if (is_callable($method) && !call_user_func($method)) {
// Can't add an instance of this plugin.
continue;
}
$options[substr($plugin, $len)] = get_string('pluginname', $plugin);
}
return $options;
}
示例3: get_import_export_formats
/**
* Get list of available import or export formats
* @param string $type 'import' if import list, otherwise export list assumed
* @return array sorted list of import/export formats available
*/
function get_import_export_formats($type)
{
global $CFG;
require_once $CFG->dirroot . '/question/format.php';
$formatclasses = core_component::get_plugin_list_with_class('qformat', '', 'format.php');
$fileformatname = array();
foreach ($formatclasses as $component => $formatclass) {
$format = new $formatclass();
if ($type == 'import') {
$provided = $format->provide_import();
} else {
$provided = $format->provide_export();
}
if ($provided) {
list($notused, $fileformat) = explode('_', $component, 2);
$fileformatnames[$fileformat] = get_string('pluginname', $component);
}
}
core_collator::asort($fileformatnames);
return $fileformatnames;
}
示例4: get_store_plugins
/**
* Intended for store management, do not use from reports.
*
* @return store[] Returns list of available store plugins.
*/
public static function get_store_plugins()
{
return \core_component::get_plugin_list_with_class('logstore', 'log\\store');
}
示例5: get_plugin_list_with_class
/**
* Get a list of all the plugins of a given type that define a certain class
* in a certain file. The plugin component names and class names are returned.
*
* @deprecated since 2.6, use core_component::get_plugin_list_with_class()
*
* @param string $plugintype the type of plugin, e.g. 'mod' or 'report'.
* @param string $class the part of the name of the class after the
* frankenstyle prefix. e.g 'thing' if you are looking for classes with
* names like report_courselist_thing. If you are looking for classes with
* the same name as the plugin name (e.g. qtype_multichoice) then pass ''.
* @param string $file the name of file within the plugin that defines the class.
* @return array with frankenstyle plugin names as keys (e.g. 'report_courselist', 'mod_forum')
* and the class names as values (e.g. 'report_courselist_thing', 'qtype_multichoice').
*/
function get_plugin_list_with_class($plugintype, $class, $file)
{
// NOTE: do not add any other debugging here, keep forever.
return core_component::get_plugin_list_with_class($plugintype, $class, $file);
}
示例6: get_rule_classes
/**
* @return array of all the installed rule class names.
*/
protected static function get_rule_classes()
{
return core_component::get_plugin_list_with_class('quizaccess', '', 'rule.php');
}