当前位置: 首页>>代码示例>>PHP>>正文


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怎么用?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);
     }
 }
开发者ID:alanaipe2015,项目名称:moodle,代码行数:16,代码来源:lib_test.php

示例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;
 }
开发者ID:eamador,项目名称:moodle-course-custom-fields,代码行数:22,代码来源:locallib.php

示例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;
}
开发者ID:tyleung,项目名称:CMPUT401MoodleExams,代码行数:26,代码来源:questionlib.php

示例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');
 }
开发者ID:sriysk,项目名称:moodle-integration,代码行数:9,代码来源:manager.php

示例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);
}
开发者ID:evltuma,项目名称:moodle,代码行数:20,代码来源:deprecatedlib.php

示例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');
 }
开发者ID:gabrielrosset,项目名称:moodle,代码行数:7,代码来源:accessmanager.php


注:本文中的core_component::get_plugin_list_with_class方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。