src/Application.php
protected function setupPlugins()
    {
        // Default plugins
        $plugins = ['I18nPlugin', 'ProcessChainPlugin'];

        $disable = $this->config->getArray('plugins', 'disable', new DefVal([]));
        $enable = $this->config->getArray('plugins', 'enable', new DefVal([]));

        foreach ($enable as $plugin)
        {
            if (array_search($plugin, $plugins) === false)
            {
                $plugins[] = $plugin;
            }
        }

        foreach ($disable as $plugin)
        {
            if (($idx = array_search($plugin, $plugins)) !== false)
            {
                array_splice($plugins, $idx, 1);
            }
        }

        foreach ($plugins as $value)
        {
            if (!is_string($value))
            {
                self::$logger->error("Not a plugin class: {0}", [$value]);
                continue;
            }
                
            if (is_a($value, Plugins\WedetoPlugin::class, true))
            {
                $fqcn = $value;
            }
            else
            {
                $fqcn = __NAMESPACE__ . "\\Plugins\\" . $value;
            }


            if (is_a($fqcn, Plugins\WedetoPlugin::class, true))
            {
                $instance = $this->injector->getInstance($fqcn);
                $instance->initialize($this);
            }
            else
            {
                self::$logger->error("Not a plugin class: {0}", [$fqcn]);
            }
        }
    }
protected function setupPlugins()
    {
        // Default plugins
        $plugins = ['I18nPlugin', 'ProcessChainPlugin'];

        $disable = $this->config->getArray('plugins', 'disable', new DefVal([]));
        $enable = $this->config->getArray('plugins', 'enable', new DefVal([]));

        foreach ($enable as $plugin)
        {
            if (array_search($plugin, $plugins) === false)
            {
                $plugins[] = $plugin;
            }
        }

        foreach ($disable as $plugin)
        {
            if (($idx = array_search($plugin, $plugins)) !== false)
            {
                array_splice($plugins, $idx, 1);
            }
        }

        foreach ($plugins as $value)
        {
            if (!is_string($value))
            {
                self::$logger->error("Not a plugin class: {0}", [$value]);
                continue;
            }
                
            if (is_a($value, Plugins\WedetoPlugin::class, true))
            {
                $fqcn = $value;
            }
            else
            {
                $fqcn = __NAMESPACE__ . "\\Plugins\\" . $value;
            }


            if (is_a($fqcn, Plugins\WedetoPlugin::class, true))
            {
                $instance = $this->injector->getInstance($fqcn);
                $instance->initialize($this);
            }
            else
            {
                self::$logger->error("Not a plugin class: {0}", [$fqcn]);
            }
        }
    }
protected function setupPlugins ( ) { // Default plugins $ plugins = [ 'I18nPlugin' , 'ProcessChainPlugin' ] ; $ disable = $ this -> config -> getArray ( 'plugins' , 'disable' , new DefVal ( [ ] ) ) ; $ enable = $ this -> config -> getArray ( 'plugins' , 'enable' , new DefVal ( [ ] ) ) ; foreach ( $ enable as $ plugin ) { if ( array_search ( $ plugin , $ plugins ) === false ) { $ plugins [ ] = $ plugin ; } } foreach ( $ disable as $ plugin ) { if ( ( $ idx = array_search ( $ plugin , $ plugins ) ) !== false ) { array_splice ( $ plugins , $ idx , 1 ) ; } } foreach ( $ plugins as $ value ) { if ( ! is_string ( $ value ) ) { self :: $ logger -> error ( "Not a plugin class: {0}" , [ $ value ] ) ; continue ; } if ( is_a ( $ value , Plugins \ WedetoPlugin :: class , true ) ) { $ fqcn = $ value ; } else { $ fqcn = __NAMESPACE__ . "\\Plugins\\" . $ value ; } if ( is_a ( $ fqcn , Plugins \ WedetoPlugin :: class , true ) ) { $ instance = $ this -> injector -> getInstance ( $ fqcn ) ; $ instance -> initialize ( $ this ) ; } else { self :: $ logger -> error ( "Not a plugin class: {0}" , [ $ fqcn ] ) ; } } }
Set up all plugins specified in the config file. Plugins can be specified
in the [plugins] section.

The default plugins are:

- Wedeto\Application\Plugins\I18nPlugin
- Wedeto\Application\Plugins\ProcessChainPlugin

You can load additional plugins by adding elements to the [plugins] section
with key enable[]

You can also disable default plugins by adding them to the [plugins] section
with key disable[]. You should use their class name without the namespace.

Each key should be the fully qualified class name or a name of a class in
Wedeto\Application\Plugins. Each plugin should implement
Wedeto\Application\Plugins\WedetoPlugin
Set up all plugins specified in the config file . Plugins can be specified in the [ plugins ] section .