Get Plugin Instances

@return array
492596
public function getPluginWrappersByRow($refresh = false)
    {
        if ($this->pluginWrappers->count() < 1) {
            return [];
        }

        // Per request caching
        if (!empty($this->wrappersByRows) && !$refresh) {
            return $this->wrappersByRows;
        }

        $this->wrappersByRows = $this->orderPluginWrappersByRow(
            $this->pluginWrappers->toArray()
        );

        return $this->wrappersByRows;
    }
406673
protected function getPluginMetas(PluginInterface $plugin)
    {
        $metas = $plugin->getMetas();

        if (is_array($metas) === false) {
            $classname = get_class($plugin);

            throw new \RuntimeException(sprintf('Expected an array at method "getMetas" of the plugin: "%s".', $classname));
        }

        $metas = $this->resolver->resolve($metas);

        if (empty($metas['name']) === true) {
            $metas['name'] = get_class($plugin);
        }

        return $metas;
    }
1363955
protected static function getFiles()
    {
        $files = [];
        //
        foreach (glob(Application::$root.'plugins/*') as  $value) {
            $files[] = $value;
        }
        //
        return $files;
    }
451870
public static function get_instance( $plugin_name, $plugin_file ) {
		if ( ! isset( self::$_instances[ $plugin_name ] ) ) {
			self::$_instances[ $plugin_name ] = new static( $plugin_name, $plugin_file );
		}

		return self::$_instances[ $plugin_name ];
	}
656388
public static function configs()
    {
        $files = File::allFiles(base_path().'/plugins');
        $result = [];
        foreach ($files as $file){
            if($file->getBasename() == "config.json") {
                $result[] = json_decode(File::get($file->getPathname()));
            }
        }
        return $result;
    }
1207306
public static function get_enabled_plugins() {
        global $CFG;

        if (empty($CFG->texteditors)) {
            return array('atto'=>'atto', 'tinymce'=>'tinymce', 'textarea'=>'textarea');
        }

        $enabled = array();
        foreach (explode(',', $CFG->texteditors) as $editor) {
            $enabled[$editor] = $editor;
        }

        return $enabled;
    }
1255850
function get_installed_addons() {
            $installed_addons = array();
            foreach ( self::$_instances as $instance ) {
                if ( $instance->is_addon() && is_object( $instance->_parent_plugin ) ) {
                    if ( $this->_plugin->id == $instance->_parent_plugin->id ) {
                        $installed_addons[] = $instance;
                    }
                }
            }

            return $installed_addons;
        }
849899
public static function getDimensions(Plugin $plugin)
    {
        $dimensions = $plugin->findMultipleComponents('Columns', '\\Piwik\\Plugin\\Dimension\\VisitDimension');
        $instances  = array();

        foreach ($dimensions as $dimension) {
            $instances[] = new $dimension();
        }

        return $instances;
    }
1325235
public function getPlugins()
    {
        if ($this->noRequire) {
            return [];
        }
        $res = [
            'hiqdev/hidev-php' => 'dev-master',
        ];
        if ($this->vendorRequire) {
            $res[$this->vendorRequire] = 'dev-master';
        }

        return $res;
    }
6656
public function instanceAllApps(): array
    {
        $allAppIds = $this->applicationConfig->getAllApplicationIds();

        return array_map(function (string $id) {
            return $this->instanceAppById($id);
        }, $allAppIds);
    }
614101
public function getConfig()
    {
        return [
            'service_manager'    => [
                'aliases'   => [
                    'ModuleRouteListener' => ModuleRouteListener::class
                ],
                'factories' => [
                    ModuleRouteListener::class                   => InvokableFactory::class,
                    Listener\ApplicationBootstrapListener::class => InvokableFactory::class,
                    Listener\ErrorLoggerListener::class          => InvokableFactory::class,
                    Listener\RouteTrailingSlashListener::class   => InvokableFactory::class,
                    Listener\SetupRouterBaseUrl::class           => InvokableFactory::class
                ]
            ],
            'controller_plugins' => [
                'aliases'   => [
                    'config'    => Controller\Plugin\Config::class,
                    'Config'    => Controller\Plugin\Config::class,
                    'flashdata' => Controller\Plugin\FlashData::class,
                    'flashData' => Controller\Plugin\FlashData::class,
                    'FlashData' => Controller\Plugin\FlashData::class,
                    'htmlclass' => Controller\Plugin\HtmlClass::class,
                    'htmlClass' => Controller\Plugin\HtmlClass::class,
                    'HtmlClass' => Controller\Plugin\HtmlClass::class,
                    'log'       => Controller\Plugin\Log::class,
                    'Log'       => Controller\Plugin\Log::class,
                    'redirect'  => Controller\Plugin\Redirect::class,
                    'Redirect'  => Controller\Plugin\Redirect::class,
                    'headtitle' => Controller\Plugin\Title::class,
                    'headTitle' => Controller\Plugin\Title::class,
                    'HeadTitle' => Controller\Plugin\Title::class,
                    'title'     => Controller\Plugin\Title::class,
                    'Title'     => Controller\Plugin\Title::class,
                    'url'       => Controller\Plugin\Url::class,
                    'Url'       => Controller\Plugin\Url::class
                ],
                'factories' => [
                    Controller\Plugin\Config::class    => function(ContainerInterface $container) {
                        return new  Controller\Plugin\Config($container->get('Config'));
                    },
                    Controller\Plugin\FlashData::class => InvokableFactory::class,
                    Controller\Plugin\HtmlClass::class => InvokableFactory::class,
                    Controller\Plugin\Log::class       => InvokableFactory::class,
                    Controller\Plugin\Redirect::class  => InvokableFactory::class,
                    Controller\Plugin\Title::class     => InvokableFactory::class,
                    Controller\Plugin\Url::class       => InvokableFactory::class
                ]
            ],
            'listeners'          => [
                ModuleRouteListener::class                 => ModuleRouteListener::class,
                Listener\ErrorLoggerListener::class        => Listener\ErrorLoggerListener::class,
                Listener\RouteTrailingSlashListener::class => Listener\RouteTrailingSlashListener::class,
                Listener\SetupRouterBaseUrl::class         => Listener\RouteTrailingSlashListener::class
            ]
        ];
    }
236759
public function getLoadedPluginPaths()
    {
        $pluginPaths = [];

        $plugins = Plugin::loaded() ?? [];
        foreach ($plugins as $p) {
            // @TODO load active plugins from plugin manager
            if (in_array($p, ['DebugKit', 'Migrations'])) {
                continue;
            }
            $pluginPaths[$p] = Plugin::path($p);
        }

        return $pluginPaths;
    }
614793
public function createInstances(array $plugin_ids, array $configurations = []) {
    $instances = [];

    foreach ($plugin_ids as $plugin_id) {
      $configuration = isset($configurations[$plugin_id]) ? $configurations[$plugin_id] : [];
      $instances[$plugin_id] = static::createInstance($plugin_id, $configuration);
    }

    return $instances;
  }
893553
public function pluginDetails()
    {
        $thisClass = get_class($this);

        $configuration = $this->getConfigurationFromYaml(sprintf('Plugin configuration file plugin.yaml is not '.
            'found for the plugin class %s. Create the file or override pluginDetails() '.
            'method in the plugin class.', $thisClass));

        if (!array_key_exists('plugin', $configuration)) {
            throw new SystemException(sprintf(
                'The plugin configuration file plugin.yaml should contain the "plugin" section: %s.', $thisClass)
            );
        }

        return $configuration['plugin'];
    }
1334803
private function getPluginList(): array
    {
        $plugins = [];
        $files   = glob(__DIR__ . '/BatchUpdate/BatchUpdate*Plugin.php', GLOB_NOSORT);

        foreach ($files as $file) {
            $base_class = basename($file, '.php');

            if ($base_class !== 'BatchUpdateBasePlugin') {
                $class           = __NAMESPACE__ . '\\BatchUpdate\\' . basename($file, '.php');
                $plugins[$class] = new $class();
            }
        }

        return $plugins;
    }
785060
public function getSelectedPlugins()
    {
        $manager = $this;

        return array_filter($this->selectedPlugins, function ($plugin) use ($manager) {
            return $manager->isAvailable($plugin);
        });
    }
739249
public function getPluginNamespaces()
    {
        $classNames = [];

        foreach ($this->getVendorAndPluginNames() as $vendorName => $vendorList) {
            foreach ($vendorList as $pluginName => $pluginPath) {
                $namespace = '\\'.$vendorName.'\\'.$pluginName;
                $namespace = Str::normalizeClassName($namespace);
                $classNames[$namespace] = $pluginPath;
            }
        }

        return $classNames;
    }