Plugin adaptees.

@return void
18221
public function plugIn($adaptee)
    {
        if (is_array($adaptee)) {
            foreach ($adaptee as $item) {
                $this->plugIn($item);
            }

            return $this;
        }

        $this->collection->push($this->connectAdapter($adaptee));

        return $this;
    }
1172752
public function loadPluginConfiguration(): void
	{
		$builder = $this->getContainerBuilder();
		$config = $this->setupConfig($this->defaults, $this->getConfig());

		$builder->addDefinition($this->prefix('request.parameters.decorator'))
			->setFactory(RequestParametersDecorator::class)
			->addTag(ApiExtension::CORE_DECORATOR_TAG, ['priority' => 100]);

		$builder->addDefinition($this->prefix('request.entity.decorator'))
			->setFactory(RequestEntityDecorator::class)
			->addTag(ApiExtension::CORE_DECORATOR_TAG, ['priority' => 101]);

		$parametersMapping = $builder->addDefinition($this->prefix('request.parameters.mapping'))
			->setFactory(RequestParameterMapping::class);

		foreach ($config['types'] as $type => $mapper) {
			$parametersMapping->addSetup('addMapper', [$type, $mapper]);
		}

		$builder->addDefinition($this->prefix('request.entity.mapping.validator'))
			->setType(IEntityValidator::class)
			->setFactory($config['request']['validator']);

		$builder->addDefinition($this->prefix('request.entity.mapping'))
			->setFactory(RequestEntityMapping::class)
			->addSetup('setValidator', ['@' . $this->prefix('request.entity.mapping.validator')]);
	}
66233
protected function validatePlugins(): void
    {
        $plugins = array_filter($this->getActivePlugins(), function ($plugin) {
            return file_exists(WPMU_PLUGIN_DIR.'/'.$plugin);
        });

        if (array_diff($plugins, $this->getActivePlugins())) {
            $this->setActivePlugins($plugins);
        }
    }
825377
protected function collectPlugins() {
		$plugins = Configure::read('plugins');

		$names = array_keys($plugins);

		sort($names);

		return $names;
	}
732385
public function adapt(Grid &$grid)
    {
        $this->grid   = $grid;
        $customfields = app('customfields')->get();
        if (empty($customfields)) {
            return;
        }
        foreach ($customfields as $classname => $customfield) {

            if (is_array($grid->row)) {
                continue;
            }
            if (get_class($grid->row) !== $classname) {
                continue;
            }
            if (!is_array($customfield)) {
                $customfield = [$customfield];
            }

            foreach ($customfield as $instance) {
                if (!is_object($instance)) {
                    continue;
                }

                $this->addToForm($instance);
            }
        }



        if (extension_active('customfields')) {
            $map   = config('antares/customfields::map', []);
            $types = [];
            foreach ($map as $type => $classnames) {
                foreach ($classnames as $classname) {

                    if (is_array($this->grid->row)) {
                        continue;
                    }
                    if (get_class($this->grid->row) !== $classname) {
                        continue;
                    }
                    array_push($types, $type);
                }
            }
            if (!empty($types)) {
                $this->getFields($types);
            }
        }
    }
192218
private function applyDefaults(): void
    {
        $timezone = $this->config->get('timezone');
        if ($timezone != null) {
            date_default_timezone_set($timezone);
        }

        $encoding = $this->config->get('encoding');
        if ($encoding != null) {
            mb_internal_encoding($encoding);
            ini_set('default_charset', $encoding);
        }

        $locales = $this->config->get('locales');
        if ($locales != null) {
            foreach ((array) $locales as $category => $locale) {
                setlocale($category, $locale);
            }
        }
    }
249924
public function loadPlugins()
    {
        $this->checkCache();
        $this->validatePlugins();
        $this->countPlugins();

        array_map(static function () {
            include_once WPMU_PLUGIN_DIR . '/' . func_get_args()[0];
        }, array_keys(self::$cache['plugins']));

        $this->pluginHooks();
    }
99300
private function setupExtensionAdapter()
    {
        $extension = $this->createTemplatingExtensionAdapter();

        $extension->addHelperCollection('template', $this->getDefaultTemplateHelperCollection());
        $extension->addHelperCollection('view', $this->getDefaultViewHelperCollection());

        if (isset($this->options[self::OPTION_HELPERS])) {
            $viewHelperCollection = $this->createViewHelperCollection();
            $viewHelperCollection->addHelpers($this->options[self::OPTION_HELPERS]);

            $extension->addHelperCollection('component', $viewHelperCollection);
        }

        $this->templateEngine->setExtensionAdapter($extension);
    }
388894
private function loadPlugins(): void
    {
        $finder = Finder::create();
        $finder
            ->name('*Plugin.php')
        ;
        if (is_dir($dir = __DIR__.'/../Plugins')) {
            $finder->in(__DIR__.'/../Plugins');
        }
        $dirs = $this->loadDirectoryFromAutoloader();
        $finder->in($dirs);
        foreach ($finder->files() as $file) {
            $namespace = 'Dotfiles\\Plugins\\'.str_replace('Plugin.php', '', $file->getFileName());
            $className = $namespace.'\\'.str_replace('.php', '', $file->getFileName());
            if (class_exists($className)) {
                /* @var \Dotfiles\Core\Plugin $plugin */
                $plugin = new $className();
                $this->registerPlugin($plugin);
            }
        }
    }
255249
public function loadActivatedPlugins()
    {
        $pluginsToLoad = $this->getActivatedPluginsFromConfig();
        if (!SettingsPiwik::isInternetEnabled()) {
            $pluginsToLoad = array_filter($pluginsToLoad, function($name) {
                $plugin = Manager::makePluginClass($name);
                return !$plugin->requiresInternetConnection();
            });
        }
        $this->loadPlugins($pluginsToLoad);
    }
899019
protected function updatePluginData()
    {
        $this->pluginBaseName = \plugin_basename($this->pluginFile);
        $this->pluginSlug = dirname($this->pluginBaseName);
        $this->pluginData = \get_plugin_data($this->pluginFile);
    }
960831
function(plugins) {
    _.each(
      plugins,
      _.bind(function(plugin) {
        if (!this.plugins[plugin]) {
          this.plugins[plugin] = this.requirePlugin(plugin);
        }
      }, this)
    );
  }
1090216
function init_extensions()
	{
		$filename = $this->froot.'cfg/extensions.php';
		if (is_file($filename))
		{
			include_once($filename);
		}

		$this->extensions = new EresusExtensions();
	}
735048
public function installLoadedPlugins()
    {
        Log::debug("Loaded plugins: " . implode(", ", array_keys($this->getLoadedPlugins())));
        
        foreach ($this->getLoadedPlugins() as $plugin) {
            $this->installPluginIfNecessary($plugin);
        }
    }
1161597
public function bootstrapPlugins()
    {
        $plugins = (array) $this->config->get('plugins.loaded');
        $plugins = array_filter($plugins, 'class_exists');

        $this->events->onTag('plugins', function () use ($plugins) {
            foreach ($plugins as $plugin) {
                $this->container->addServiceProvider($plugin);
            }
        });
    }
1028409
private function _buildPlugins()
    {
        $pluginroot = $this->_xml->addChild("Plugins");
        if (($this->_plugin_request || $this->_complete_request) && count($this->_plugins) > 0) {
            $plugins = array();
            if ($this->_complete_request) {
                $plugins = $this->_plugins;
            }
            if ($this->_plugin_request) {
                $plugins = array($this->_plugin);
            }
            foreach ($plugins as $plugin) {
                $object = new $plugin($this->_sysinfo->getEncoding());
                $object->execute();
                $oxml = $object->xml();
                if (sizeof($oxml) > 0) {
                    $pluginroot->combinexml($oxml);
                }
            }
        }
    }
1287409
protected function loadFunctions() : void
    {
        $this->extendForTranslator();
        $this->extendForWidget();
        $this->extendForSiteUrl();
        $this->extendForGetUrl();
        $this->extendForQueryParams();
        $this->extendForPagination();
        $this->extendForVarDump();
    }