Wrapper method to load plugins from an arbitrary
source definition - either a string package name,
or an array of string package names.

@param mixed $_
@return self
15641
public function loadPlugins($_) {
		$arguments = func_get_args();
		foreach ($arguments as $possiblePackage) {
			if (FALSE === is_array($possiblePackage)) {
				$this->plugins += $this->loadPluginsFromPackage($possiblePackage);
			} else {
				foreach ($possiblePackage as $package) {
					$this->plugins += $this->loadPluginsFromPackage($package);
				}
			}
		}
		return $this;
	}
854702
def plugin(cls, name):
        
        cls.loadPlugins()
        plugs = getattr(cls, '_%s__plugins' % cls.__name__, {})
        return plugs.get(nstr(name))
268995
static function plugins()
    {
        if (! self::isEnabledPlugins() )
            throw new \Exception('Using Plugins depends on Poirot/Ioc; that not exists currently.');


        if (! self::$pluginManager )
            self::$pluginManager = new PluginsHttpHeader;

        return self::$pluginManager;
    }
1222689
public function bootstrap(): self
    {
        if (!$this->info->installMode()) {
            $this->getApplicationInitializer()->init($this);
            $this->emit('system.init');

            return $this;
        }

        $manager = $this->moduleManager();

        /** @var Module|null $installer */
        $installer = null;

        foreach ($manager->modules() as $module) {
            if ($module->isApplicationInstaller()) {
                if ($installer !== null) {
                    $formatText = '%s was defined as an application installer before %s';
                    $formatArgs = [$installer->name(), $module->name()];
                    throw new \RuntimeException(vsprintf($formatText, $formatArgs));
                }

                $installer = $module;
            }
        }

        if ($installer === null) {
            throw new \RuntimeException("No application installer was found");
        }

        $enabled = [$installer->name() => Module::ENABLED];

        foreach ($manager->recursiveDependencies($installer) as $module) {
            $enabled[$module->name()] = Module::ENABLED;
        }

        $this->getApplicationInitializer()->init($this);
        $manager->setStatusList($enabled);

        $this->emit('system.init');

        return $this;
    }
472295
protected function loadShortCodes()
    {
        if ($config = $this->loadConfigFile('shortcodes.php')) {
            $renderer = $this->renderer;
            $app      = $this->app;

            foreach ($config as $shortcode => $provider) {
                add_shortcode($shortcode, function ($attrs, $content) use ($app, $provider, $renderer)
                {
                    if (is_string($provider) && is_subclass_of($provider, 'Tev\Plugin\Shortcode\AbstractProvider')) {
                        $sp = new $provider($app, $renderer);
                        return $sp->shortcode($attrs, $content);
                    } elseif ($provider instanceof Closure) {
                        return $provider($attrs, $content, $renderer);
                    }
                });
            }
        }

        return $this;
    }
717900
public function load_plugins($subtype) {
        global $CFG;
        $result = array();

        $names = core_component::get_plugin_list($subtype);

        foreach ($names as $name => $path) {
            if (file_exists($path . '/locallib.php')) {
                require_once($path . '/locallib.php');

                $shortsubtype = substr($subtype, strlen('assign'));
                $pluginclass = 'assign_' . $shortsubtype . '_' . $name;

                $plugin = new $pluginclass($this, $name);

                if ($plugin instanceof assign_plugin) {
                    $idx = $plugin->get_sort_order();
                    while (array_key_exists($idx, $result)) {
                        $idx +=1;
                    }
                    $result[$idx] = $plugin;
                }
            }
        }
        ksort($result);
        return $result;
    }
945326
public function loadPlugin($pluginName)
    {
        if (isset($this->loadedPlugins[$pluginName])) {
            return $this->loadedPlugins[$pluginName];
        }
        $newPlugin = $this->makePluginClass($pluginName);

        $this->addLoadedPlugin($pluginName, $newPlugin);
        return $newPlugin;
    }
155937
def load_local_plugin(name):
        """"""
        try:
            module_name = '.'.join(name.split('.')[:-1])
            module_obj = importlib.import_module(name=module_name)
            obj = getattr(module_obj, name.split('.')[-1])
            return obj
        except (ImportError, AttributeError, ValueError) as e:
            raise PluginNotFoundError(e)
102378
public function _loadPlugins()
    {
        if (empty($this->config['plugins']) || !defined('WP_PLUGIN_DIR')) {
            return;
        }
        $pluginsPath = $this->getPluginsFolder() . DIRECTORY_SEPARATOR;
        $plugins     = $this->config['plugins'];
        foreach ($plugins as $plugin) {
            $path = $pluginsPath . $plugin;
            if (!file_exists($path)) {
                throw new ModuleConfigException(
                    __CLASS__,
                    "The '{$plugin}' plugin file was not found in the {$pluginsPath} directory; "
                    . 'this might be due to a wrong configuration of the `wpRootFolder` setting or a missing inclusion '
                    . 'of one ore more additional config files using the `configFile` setting.'
                );
                continue;
            }
            require_once $path;
        }
    }
853195
def load_plugins():
    
    loader = _PluginLoader()

    for pkg in PLUGIN_PACKAGES:
        loader.load_plugins(pkg)

    return loader.plugins
1011144
public function load()
    {
        $this->extensions = [];
        foreach ($this->getPackages() as $package) {
            [$v, $p] = explode('/', $package['name']);
            $extension = Extension::findBy([
                'vendor' => $v,
                'package' => $p
            ]);
            if (!$extension) {
                $extension = (new Extension())
                    ->vendor($v)
                    ->package($p);
            }
            $extension
                ->version($package['version'] ?? '')
                ->description($package['description'] ?? '')
                ->save();
            $this->extensions[] = $extension;
        }
        return $this;
    }
67220
public static function loadPlugin($name)
    {
        $name = ucfirst($name);
        if (($config = &self::getRef("plugins.$name")) === null) {
            $config = array();
        }
        return self::loadCustomPlugin($name, $config);
    }
990729
def load_plugin(plugin_name):
    
    plugin_cls = plugin_map.get(plugin_name, None)
    if not plugin_cls:
        try:
            plugin_module_name, plugin_cls_name = plugin_name.split(":")
            plugin_module = import_module(plugin_module_name)
            plugin_cls = getattr(plugin_module, plugin_cls_name)
        except ValueError:
            raise click.ClickException(
                '"{}" is not a valid plugin path'.format(plugin_name)
            )
        except ImportError:
            raise click.ClickException(
                '"{}" does not name a Python module'.format(
                    plugin_module_name
                )
            )
        except AttributeError:
            raise click.ClickException(
                'Module "{}" does not contain the class "{}"'.format(
                    plugin_module_name, plugin_cls_name
                )
            )
    return plugin_cls
969833
def load_plugins(plugins)
      unless plugins.is_a?(Array)
        raise ArgumentError, "load_plugins expects an array, got #{plugins.inspect}"
      end

      plugins.each do |plugin|
        plugin_file = plugin.start_with?("/") ? plugin : File.expand_path("../../#{plugin}", File.dirname(__FILE__))
        unless File.file?(plugin_file)
          raise Errno::ENOENT, "Failed to find plugin #{plugin.inspect} at #{plugin_file}"
        end
        require plugin_file
      end
    end
938199
def load_plug_in(self, name):
        
        if not isinstance(name, basestring):
            raise TypeError("name can only be an instance of type basestring")
        plug_in_name = self._call("loadPlugIn",
                     in_p=[name])
        return plug_in_name
562750
def load_plugin(self, p):
        
        if p.is_loaded():
            return
        # load required plugins first
        reqnames = p.required
        reqplugins = []
        for name in reqnames:
            try:
                reqplugins.append(self.__plugins[name])
            except KeyError as e:
                log.error("Required Plugin %s not found. Cannot load %s." % (name, p))
                raise errors.PluginInitError('Required Plugin %s not found. Cannot load %s. Reason: %s' % (name, p, e))
        for plug in reqplugins:
            try:
                self.load_plugin(plug)
            except errors.PluginInitError as e:
                log.error("Required Plugin %s could not be loaded. Cannot load %s" % (plug, p))
                raise errors.PluginInitError('Required Plugin %s could not be loaded. Cannot load %s. Reason: %s' % (plug,p, e))
        # load the actual plugin
        p._load()
        log.info('Initialized the plugin: %s' % p)
13335
def loadPlugins(cls):
        
        plugs = getattr(cls, '_%s__plugins' % cls.__name__, None)
        if plugs is not None:
            return

        plugs = {}
        setattr(cls, '_%s__plugins' % cls.__name__, plugs)
        typ = cls.pluginRegisterType()

        for path in cls.pluginPath():
            base_package = projex.packageFromPath(path)
            base_path = os.path.normpath(projex.packageRootPath(path))

            # make sure it is at the front of the path
            if base_path in sys.path:
                sys.path.remove(base_path)

            sys.path.insert(0, base_path)
            processed = ['__init__']

            # load support for registries
            if typ & Plugin.Type.RegistryFile:
                files = glob.glob(os.path.join(path, '*/register.xml'))
                for file_ in files:
                    name = os.path.normpath(file_).split(os.path.sep)[-2]
                    processed.append(name)

                    try:
                        proxy = PluginProxy.fromFile(cls, file_)
                        cls.register(proxy)

                    except Exception, e:
                        name = projex.text.pretty(name)
                        err = Plugin(name)
                        err.setError(e)
                        err.setFilepath(file_)

                        cls.register(err)

                        # log the error
                        msg = "%s.plugin('%s') failed to load from %s."
                        logger.warning(msg % (cls.__name__, name, file_))
                        logger.error(e)

            # load support for packages
            if typ & Plugin.Type.Package:
                files = glob.glob(os.path.join(path, '*/__init__.py'))
                for file_ in files:
                    name = os.path.normpath(file_).split(os.path.sep)[-2]
                    if name in processed:
                        continue

                    processed.append(name)
                    package = '.'.join([base_package, name]).strip('.')
                    if not package:
                        continue

                    try:
                        __import__(package)

                    except Exception, e:
                        name = projex.text.pretty(name)
                        err = Plugin(name)
                        err.setError(e)
                        err.setFilepath(file_)

                        cls.register(err)

                        # log the error
                        msg = "%s.plugin('%s') failed to load from %s."
                        logger.warning(msg % (cls.__name__, name, file_))
                        logger.error(e)

            # load support for modules
            if typ & Plugin.Type.Module:
                files = glob.glob(os.path.join(path, '*.py'))
                for file_ in files:
                    name = os.path.basename(file_).split('.')[0]
                    if name in processed:
                        continue

                    processed.append(name)
                    package = '.'.join([base_package, name]).strip('.')
                    if not package:
                        continue

                    try:
                        __import__(package)

                    except Exception, e:
                        name = projex.text.pretty(name)
                        err = Plugin(name)
                        err.setError(e)
                        err.setFilepath(file_)

                        cls.register(err)

                        # log the error
                        msg = "%s.plugin('%s') failed to load from %s."
                        logger.warning(msg % (cls.__name__, name, file_))
                        logger.error(e)