public function registerPlugins()
    {
        $jsonFile = Environment::getJsonConfigFilename();
        if (!$jsonFile) {
            return;
        }

        $config = new Config;
        $var    = $config->validate($jsonFile);

        foreach ($var['plugins'] as $plugin) {
            if (class_exists($plugin['class'])) {
                if (isset($plugin['options'])) {
                    $options = $plugin['options'];
                    if (is_string($options)) {
                        if (class_exists($options)) {
                            $options = new $options;
                        } else {
                            $options = null;
                        }
                    }
                } else {
                    $options = null;
                }
                $plugin = new $plugin['class']($options);

                if ($plugin instanceof PluginInterface) {
                    $this->addPlugin($plugin);
                }
            }
        }
    }
public function registerPlugins()
    {
        $jsonFile = Environment::getJsonConfigFilename();
        if (!$jsonFile) {
            return;
        }

        $config = new Config;
        $var    = $config->validate($jsonFile);

        foreach ($var['plugins'] as $plugin) {
            if (class_exists($plugin['class'])) {
                if (isset($plugin['options'])) {
                    $options = $plugin['options'];
                    if (is_string($options)) {
                        if (class_exists($options)) {
                            $options = new $options;
                        } else {
                            $options = null;
                        }
                    }
                } else {
                    $options = null;
                }
                $plugin = new $plugin['class']($options);

                if ($plugin instanceof PluginInterface) {
                    $this->addPlugin($plugin);
                }
            }
        }
    }
public function registerPlugins ( ) { $ jsonFile = Environment :: getJsonConfigFilename ( ) ; if ( ! $ jsonFile ) { return ; } $ config = new Config ; $ var = $ config -> validate ( $ jsonFile ) ; foreach ( $ var [ 'plugins' ] as $ plugin ) { if ( class_exists ( $ plugin [ 'class' ] ) ) { if ( isset ( $ plugin [ 'options' ] ) ) { $ options = $ plugin [ 'options' ] ; if ( is_string ( $ options ) ) { if ( class_exists ( $ options ) ) { $ options = new $ options ; } else { $ options = null ; } } } else { $ options = null ; } $ plugin = new $ plugin [ 'class' ] ( $ options ) ; if ( $ plugin instanceof PluginInterface ) { $ this -> addPlugin ( $ plugin ) ; } } } }
Loads all plugins declared in the JSON config file.

@return void
Loads all plugins declared in the JSON config file .