Discover all components

@return array Components
763241
public static function discoverAll()
    {
        $components = [];

        // Run through all extensions
        foreach (ExtensionManagementUtility::getLoadedExtensionListArray() as $extensionKey) {
            $components = array_merge($components, self::discoverExtensionComponents($extensionKey));
        }

        return $components;
    }
935870
public function getAll() {
    if (is_null($this->components)) {
      $identifier = self::COMPONENT_PREFIX;

      $filter = function (Extension $module) use ($identifier) {
        return strpos($module->getName(), $identifier) === 0;
      };

      $this->components = array_filter($this->discovery->scan('module'), $filter);
    }
    return $this->components;
  }
1347311
public function getNumberOfComponents()
    {
        $visitedVertices = array();
        $components = 0;

        // for each vertices
        foreach ($this->graph->getVertices()->getMap() as $vid => $vertex) {
            // did I visit this vertex before?
            if (!isset($visitedVertices[$vid])) {

                // get all vertices of this component
                $newVertices = $this->createSearch($vertex)->getVertices()->getIds();

                ++$components;

                // mark the vertices of this component as visited
                foreach ($newVertices as $vid) {
                    $visitedVertices[$vid] = true;
                }
            }
        }

        // return number of components
        return $components;
    }
667982
public function all(): array
    {
        $out = [];
        foreach (parent::all() as $key => $props) {
            $out[$props['originalKey']] = $props['value'];
        }

        return $out;
    }
580077
public function findAll(): array
    {
        $rootPackage = $this->composer->getPackage();
        $dependencies = $this->composer->getRepositoryManager()->getLocalRepository()->getPackages();

        $packagesWithDuplicates = array_merge([$rootPackage], $dependencies);

        return $this->removeDuplicates($packagesWithDuplicates);
    }
139189
public static function get_all_filters() {
        $filters = \core_component::get_component_classes_in_namespace('tool_usertours', 'local\filter');
        $filters = array_keys($filters);

        $filters = array_filter($filters, function($filterclass) {
            $rc = new \ReflectionClass($filterclass);
            return $rc->isInstantiable();
        });

        return $filters;
    }
1001010
public static function list_components() {

        $list['moodle'] = 'core';

        $coresubsystems = core_component::get_core_subsystems();
        ksort($coresubsystems); // should be but just in case
        foreach ($coresubsystems as $name => $location) {
            $list[$name] = 'core_'.$name;
        }

        $plugintypes = core_component::get_plugin_types();
        foreach ($plugintypes as $type => $location) {
            $pluginlist = core_component::get_plugin_list($type);
            foreach ($pluginlist as $name => $ununsed) {
                if ($type == 'mod') {
                    // Plugin names are now automatically validated.
                    $list[$name] = $type.'_'.$name;
                } else {
                    $list[$type.'_'.$name] = $type.'_'.$name;
                }
            }
        }

        return $list;
    }
737933
function getComponents() {
	var results = [];

	if (extensions && extensions.hasOwnProperty('components')) {
		var sourceArray = extensions.components;

		for (index = 0; index < sourceArray.length; ++index) {
		    results.push(sourceArray[index]);
		}
	}

	return results;
}
1071569
private function getServices()
    {
        $container = new DependencyInjectionContainer();
        $components = $this->getComponents();

        foreach ($components as $component) {
            // Sometimes on failures due to invalid configuration, components might return void
            if (is_object($component)) {
                $container->register($component->getName(), $component->getInstance($container, $this->config, $this->input));
            }
        }

        return $container->getAll();
    }
192966
public function detect()
    {
        
        $components = $this->finder()->detect();
        if (!$this->isValidRoute()) {
            return $components;
        }
        $this->app->make('events')->fire('antares.ui-components: detecting');
        $this->app->make('events')->fire(new ComponentsDetecting());
        
        
        $service = app(Service::class);
        foreach ($components as $component) {
            $result = $service->findOne($component, uri());
            if (!empty($result)) {
                continue;
            }
            $this->app->make('ui-components')->save(array_get($component, 'name'), $component);
        }
        
        return $components;
    }
952885
public function getComponentTypes()
    {
        $types = array(
            'cart' => $this->translation->text('Cart'),
            'payment' => $this->translation->text('Payment'),
            'shipping' => $this->translation->text('Shipping')
        );

        $this->hook->attach('order.component.types', $types);
        return $types;
    }
1060639
public function findAll()
    {
        $deploymentNodes = array();
        foreach ($this->getSystemConfiguration()->getContainers() as $container) {
            $deploymentNode = $container->getDeployment();
            $deploymentNodes[$deploymentNode->getUuid()] = $deploymentNode;
        }
        return $deploymentNodes;
    }
1085412
public function getComponents()
    {
        $components = [
            'Base'                          => 'GetOlympus\Zeus\Base\Controller\Base',
            'BaseWidget'                    => 'GetOlympus\Zeus\Base\Controller\BaseWidget',
            'Helpers'                       => 'GetOlympus\Zeus\Helpers\Controller\Helpers',

            'AdminPage'                     => 'GetOlympus\Zeus\AdminPage\Controller\AdminPage',
            'Ajax'                          => 'GetOlympus\Zeus\Ajax\Controller\Ajax',
            'Configuration'                 => 'GetOlympus\Zeus\Configuration\Controller\Configuration',
            'Cron'                          => 'GetOlympus\Zeus\Cron\Controller\Cron',
            'Error'                         => 'GetOlympus\Zeus\Error\Controller\Error',
            'Field'                         => 'GetOlympus\Zeus\Field\Controller\Field',
            'Hook'                          => 'GetOlympus\Zeus\Hook\Controller\Hook',
            'Metabox'                       => 'GetOlympus\Zeus\Metabox\Controller\Metabox',
            'Option'                        => 'GetOlympus\Zeus\Option\Controller\Option',
            'Posttype'                      => 'GetOlympus\Zeus\Posttype\Controller\Posttype',
            'PosttypeHook'                  => 'GetOlympus\Zeus\Posttype\Controller\PosttypeHook',
            'Render'                        => 'GetOlympus\Zeus\Render\Controller\Render',
            'Request'                       => 'GetOlympus\Zeus\Request\Controller\Request',
            'Template'                      => 'GetOlympus\Zeus\Template\Controller\Template',
            'Term'                          => 'GetOlympus\Zeus\Term\Controller\Term',
            'TermHook'                      => 'GetOlympus\Zeus\Term\Controller\TermHook',
            'Translate'                     => 'GetOlympus\Zeus\Translate\Controller\Translate',
            'WalkerSingle'                  => 'GetOlympus\Zeus\WalkerSingle\Controller\WalkerSingle',
            'Widget'                        => 'GetOlympus\Zeus\Widget\Controller\Widget',
        ];

        // Iterate on externals
        foreach ($this->externals as $shortname => $classname) {
            $components[$shortname] = $classname;
        }

        return $components;
    }
22883
function findComponents(directory, components = []) {
  const items = fs.readdirSync(directory);

  items.forEach(item => {
    const itemPath = path.resolve(directory, item);

    if (fs.statSync(itemPath).isDirectory()) {
      findComponents(itemPath, components);
      return;
    }

    if (!componentRegex.test(item)) {
      return;
    }

    components.push({
      filename: itemPath,
    });
  });

  return components;
}
918304
public function getComponents($domain = null)
    {
        $components = $result = array_keys($this->_components);

        if($domain)
        {
            foreach($components as $key => $component)
            {
                if(strpos($component, 'com://'.$domain) === false) {
                    unset($components[$key]);
                }
            }
        }

        return $components;
    }
519685
public function get_subplugins() {

        if (is_array($this->subpluginsinfo)) {
            return $this->subpluginsinfo;
        }

        $plugintypes = core_component::get_plugin_types();

        $this->subpluginsinfo = array();
        foreach (core_component::get_plugin_types_with_subplugins() as $type => $ignored) {
            foreach (core_component::get_plugin_list($type) as $plugin => $componentdir) {
                $component = $type.'_'.$plugin;
                $subplugins = core_component::get_subplugins($component);
                if (!$subplugins) {
                    continue;
                }
                $this->subpluginsinfo[$component] = array();
                foreach ($subplugins as $subplugintype => $ignored) {
                    $subplugin = new stdClass();
                    $subplugin->type = $subplugintype;
                    $subplugin->typerootdir = $plugintypes[$subplugintype];
                    $this->subpluginsinfo[$component][$subplugintype] = $subplugin;
                }
            }
        }
        return $this->subpluginsinfo;
    }
639200
public function ComponentListingItems()
    {
        $manyMany = singleton($this->ListType)->config()->many_many;
        $tagClass = isset($manyMany[$this->ComponentFilterName]) ? $manyMany[$this->ComponentFilterName] : '';
        if (!$tagClass) {
            return new ArrayList();
        }
        $result = DataList::create($tagClass);
        if ($this->ComponentFilterWhere
            && ($componentWhereFilters = $this->ComponentFilterWhere->getValue())
        ) {
            $result = $result->filter($componentWhereFilters);
        }
        return $result;
    }