public static function determinePlugins($packages, $pluginsDir = 'plugins', $vendorDir = 'vendor')
    {
        $plugins = [];

        foreach ($packages as $package) {
            if ($package->getType() !== 'skinny-plugin') {
                continue;
            }

            $ns = static::primaryNamespace($package);
            $path = $vendorDir . DIRECTORY_SEPARATOR . $package->getPrettyName();
            $plugins[$ns] = $path;
        }

        if (is_dir($pluginsDir)) {
            $dir = new \DirectoryIterator($pluginsDir);
            foreach ($dir as $info) {
                if (!$info->isDir() || $info->isDot()) {
                    continue;
                }

                $name = $info->getFilename();
                $plugins[$name] = $pluginsDir . DIRECTORY_SEPARATOR . $name;
            }
        }

        ksort($plugins);
        return $plugins;
    }
public static function determinePlugins($packages, $pluginsDir = 'plugins', $vendorDir = 'vendor')
    {
        $plugins = [];

        foreach ($packages as $package) {
            if ($package->getType() !== 'skinny-plugin') {
                continue;
            }

            $ns = static::primaryNamespace($package);
            $path = $vendorDir . DIRECTORY_SEPARATOR . $package->getPrettyName();
            $plugins[$ns] = $path;
        }

        if (is_dir($pluginsDir)) {
            $dir = new \DirectoryIterator($pluginsDir);
            foreach ($dir as $info) {
                if (!$info->isDir() || $info->isDot()) {
                    continue;
                }

                $name = $info->getFilename();
                $plugins[$name] = $pluginsDir . DIRECTORY_SEPARATOR . $name;
            }
        }

        ksort($plugins);
        return $plugins;
    }
public static function determinePlugins ( $ packages , $ pluginsDir = 'plugins' , $ vendorDir = 'vendor' ) { $ plugins = [ ] ; foreach ( $ packages as $ package ) { if ( $ package -> getType ( ) !== 'skinny-plugin' ) { continue ; } $ ns = static :: primaryNamespace ( $ package ) ; $ path = $ vendorDir . DIRECTORY_SEPARATOR . $ package -> getPrettyName ( ) ; $ plugins [ $ ns ] = $ path ; } if ( is_dir ( $ pluginsDir ) ) { $ dir = new \ DirectoryIterator ( $ pluginsDir ) ; foreach ( $ dir as $ info ) { if ( ! $ info -> isDir ( ) || $ info -> isDot ( ) ) { continue ; } $ name = $ info -> getFilename ( ) ; $ plugins [ $ name ] = $ pluginsDir . DIRECTORY_SEPARATOR . $ name ; } } ksort ( $ plugins ) ; return $ plugins ; }
Find all plugins available.

Add all composer packages of type skinny-plugin, and all plugins located
in the plugins directory to a plugin-name indexed array of paths.

@param array $packages An array of \Composer\Package\PackageInterface objects.
@param string $pluginsDir The path to the plugins dir.
@param string $vendorDir The path to the vendor dir.

@return array plugin-name Indexed paths to plugins.
Find all plugins available .