Acl\AclExtras::_processPlugins PHP Method

_processPlugins() protected method

Updates the Aco Tree with all Plugins.
protected _processPlugins ( Acl\Model\Entity\Aco $root, array $plugins = [] ) : void
$root Acl\Model\Entity\Aco The root note of Aco Tree
$plugins array list of App plugins
return void
    protected function _processPlugins($root, array $plugins = [])
    {
        foreach ($plugins as $plugin) {
            $controllers = $this->getControllerList($plugin);
            $pluginAlias = $this->_pluginAlias($plugin);
            $path = [$this->rootNode, $pluginAlias];
            $path = implode('/', Hash::filter($path));
            $pathNode = $this->_checkNode($path, $pluginAlias, $root->id);
            $this->foundACOs[$root->id][] = $pluginAlias;
            if (isset($this->foundACOs[$pathNode->id])) {
                $this->foundACOs[$pathNode->id] += $this->_updateControllers($pathNode, $controllers, $plugin);
            } else {
                $this->foundACOs[$pathNode->id] = $this->_updateControllers($pathNode, $controllers, $plugin);
            }
            if (isset($this->pluginPrefixes[$plugin])) {
                foreach (array_keys($this->pluginPrefixes[$plugin]) as $prefix) {
                    $path = [$this->rootNode, $pluginAlias];
                    $path = implode('/', Hash::filter($path));
                    $pluginNode = $this->_checkNode($path, $pluginAlias, $root->id);
                    $this->foundACOs[$root->id][] = $pluginAlias;
                    $path = [$this->rootNode, $pluginAlias, $prefix];
                    $path = implode('/', Hash::filter($path));
                    $pathNode = $this->_checkNode($path, $prefix, $pluginNode->id);
                    $this->foundACOs[$pluginNode->id][] = $prefix;
                    $controllers = $this->getControllerList($plugin, $prefix);
                    if (isset($this->foundACOs[$pathNode->id])) {
                        $this->foundACOs[$pathNode->id] += $this->_updateControllers($pathNode, $controllers, $pluginAlias, $prefix);
                    } else {
                        $this->foundACOs[$pathNode->id] = $this->_updateControllers($pathNode, $controllers, $pluginAlias, $prefix);
                    }
                }
            }
        }
    }