public static function loadAll(array $options = [])
    {
        static::loadConfig();
        $plugins = [];
        foreach ((array)Configure::read('App.paths.plugins') as $path) {
            if (!is_dir($path)) {
                continue;
            }
            $dir = new DirectoryIterator($path);
            foreach ($dir as $path) {
                if ($path->isDir() && !$path->isDot()) {
                    $plugins[] = $path->getBasename();
                }
            }
        }
        if (Configure::check('plugins')) {
            $plugins = array_merge($plugins, array_keys(Configure::read('plugins')));
            $plugins = array_unique($plugins);
        }

        foreach ($plugins as $p) {
            $opts = isset($options[$p]) ? $options[$p] : null;
            if ($opts === null && isset($options[0])) {
                $opts = $options[0];
            }
            if (isset(static::$plugins[$p])) {
                continue;
            }
            static::load($p, (array)$opts);
        }
    }
public static function loadAll(array $options = [])
    {
        static::loadConfig();
        $plugins = [];
        foreach ((array)Configure::read('App.paths.plugins') as $path) {
            if (!is_dir($path)) {
                continue;
            }
            $dir = new DirectoryIterator($path);
            foreach ($dir as $path) {
                if ($path->isDir() && !$path->isDot()) {
                    $plugins[] = $path->getBasename();
                }
            }
        }
        if (Configure::check('plugins')) {
            $plugins = array_merge($plugins, array_keys(Configure::read('plugins')));
            $plugins = array_unique($plugins);
        }

        foreach ($plugins as $p) {
            $opts = isset($options[$p]) ? $options[$p] : null;
            if ($opts === null && isset($options[0])) {
                $opts = $options[0];
            }
            if (isset(static::$plugins[$p])) {
                continue;
            }
            static::load($p, (array)$opts);
        }
    }
public static function loadAll ( array $ options = [ ] ) { static :: loadConfig ( ) ; $ plugins = [ ] ; foreach ( ( array ) Configure :: read ( 'App.paths.plugins' ) as $ path ) { if ( ! is_dir ( $ path ) ) { continue ; } $ dir = new DirectoryIterator ( $ path ) ; foreach ( $ dir as $ path ) { if ( $ path -> isDir ( ) && ! $ path -> isDot ( ) ) { $ plugins [ ] = $ path -> getBasename ( ) ; } } } if ( Configure :: check ( 'plugins' ) ) { $ plugins = array_merge ( $ plugins , array_keys ( Configure :: read ( 'plugins' ) ) ) ; $ plugins = array_unique ( $ plugins ) ; } foreach ( $ plugins as $ p ) { $ opts = isset ( $ options [ $ p ] ) ? $ options [ $ p ] : null ; if ( $ opts === null && isset ( $ options [ 0 ] ) ) { $ opts = $ options [ 0 ] ; } if ( isset ( static :: $ plugins [ $ p ] ) ) { continue ; } static :: load ( $ p , ( array ) $ opts ) ; } }
Will load all the plugins located in the default plugin folder.

If passed an options array, it will be used as a common default for all plugins to be loaded
It is possible to set specific defaults for each plugins in the options array. Examples:

```
Plugin::loadAll([
['bootstrap' => true],
'Basic' => ['bootstrap' => false],
]);
```

The above example will load the bootstrap file for all plugins,
but for Basic it will not load the bootstrap file.

If a plugin has been loaded already, it will not be reloaded by loadAll().

@param array $options Options.

@return void
Will load all the plugins located in the default plugin folder .