protected function load_plugins()
    {
        if ($this->app['settings']['sonic.plugins_enabled'] === TRUE) {

            // Load plugins from 'plugins' folder
            $file_list    = $this->app['filesystem']->listContents($this->app['settings']['sonic.plugins_dir']);

            $plugin_files = array_filter($file_list, function ($file) {
                return preg_match('#^([A-Z]+\w+)Plugin.php$#', $file['basename']) === 1
                    ? TRUE
                    : FALSE;
            });

            foreach ($plugin_files as $plugin_file) {
                $plugin = $this->app['filesystem']->include($plugin_file['path']);
                $plugin->set_app($this);
                $plugins[$plugin_file['filename']] = $plugin;
            }

            $this->app['plugins'] = $plugins;
        }
    }
protected function load_plugins()
    {
        if ($this->app['settings']['sonic.plugins_enabled'] === TRUE) {

            // Load plugins from 'plugins' folder
            $file_list    = $this->app['filesystem']->listContents($this->app['settings']['sonic.plugins_dir']);

            $plugin_files = array_filter($file_list, function ($file) {
                return preg_match('#^([A-Z]+\w+)Plugin.php$#', $file['basename']) === 1
                    ? TRUE
                    : FALSE;
            });

            foreach ($plugin_files as $plugin_file) {
                $plugin = $this->app['filesystem']->include($plugin_file['path']);
                $plugin->set_app($this);
                $plugins[$plugin_file['filename']] = $plugin;
            }

            $this->app['plugins'] = $plugins;
        }
    }
protected function load_plugins ( ) { if ( $ this -> app [ 'settings' ] [ 'sonic.plugins_enabled' ] === TRUE ) { // Load plugins from 'plugins' folder $ file_list = $ this -> app [ 'filesystem' ] -> listContents ( $ this -> app [ 'settings' ] [ 'sonic.plugins_dir' ] ) ; $ plugin_files = array_filter ( $ file_list , function ( $ file ) { return preg_match ( '#^([A-Z]+\w+)Plugin.php$#' , $ file [ 'basename' ] ) === 1 ? TRUE : FALSE ; } ) ; foreach ( $ plugin_files as $ plugin_file ) { $ plugin = $ this -> app [ 'filesystem' ] -> include ( $ plugin_file [ 'path' ] ) ; $ plugin -> set_app ( $ this ) ; $ plugins [ $ plugin_file [ 'filename' ] ] = $ plugin ; } $ this -> app [ 'plugins' ] = $ plugins ; } }
Loads all plugins from the 'plugins' directory

@return
Loads all plugins from the plugins directory