Autoload all active plugins.

@return void
357412
public function autoloadPlugins()
    {
        foreach(self::activePlugins() as $plugin){
            // plugin composer autoload
            if(File::exists($plugin->basePath().'/vendor/autoload.php')) {
                include $plugin->basePath() . '/vendor/autoload.php';
            }
            // plugin helpers
            if(File::exists($plugin->basePath().'/support/helpers.php')) {
                include $plugin->basePath() . '/support/helpers.php';
            }
        }
        return;
    }
454739
function load() {
			$all_plugins_data = $this->get_all_data();
			$this->_data      = isset( $all_plugins_data[ $this->_secondary_id ] ) ?
				$all_plugins_data[ $this->_secondary_id ] :
				array();
		}
1045578
protected function loadDependencies()
    {
        foreach ($this->plugins as $id => $plugin) {
            if (!$required = $this->getDependencies($plugin)) {
                continue;
            }

            $disable = false;

            foreach ($required as $require) {
                if (!$pluginObj = $this->findByIdentifier($require)) {
                    $disable = true;
                }
                elseif ($pluginObj->disabled) {
                    $disable = true;
                }
            }

            if ($disable) {
                $this->disablePlugin($id);
            }
            else {
                $this->enablePlugin($id);
            }
        }
    }
753354
public function addManagedExtensions()
    {
        if ($this->loaded) {
            throw new \RuntimeException('Extensions already loaded.');
        }

        try {
            $this->extFs->includeFile('vendor/autoload.php');
        } catch (FileNotFoundException $e) {
            $this->loaded = true;

            return;
        }

        $descriptors = $this->loadPackageDescriptors();
        foreach ($descriptors as $descriptor) {
            // Skip loading if marked invalid
            if ($descriptor->isValid() === false) {
                continue;
            }
            $this->addManagedExtension($descriptor);
        }
    }
1124063
public function actionActivateAll()
    {
        if (isset($_POST['items'])) {
            foreach ($_POST['items'] as $id) {
                if ($model = $this->findModel($id)) {
                    $model->status = ActiveRecord::STATUS_ACTIVE;
                    $model->save(false);
                }
            }
        }
    }
692262
public function autoload_on_admin()
	{
		$this->on_admin();
		// Addons
		for ( $i = count( $this->addons ) - 1; $i >= 0; --$i ) {
			$this->addons[$i]->on_admin();
		}
	}
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);
            }
        });
    }
764485
def load_plugins(self, ):
        
        for p in self.__plugins.values():
            try:
                self.load_plugin(p)
            except errors.PluginInitError:
                log.exception('Initializing the plugin: %s failed.' % p)
1247240
public function run()
    {
        if (!defined('ABSPATH')) {
            return;
        }

        // Required for 'add_filter' & 'add_action' function.
        require_once ABSPATH.(defined('WPINC') ? WPINC : 'wp-includes').'/plugin.php';

        // Load mu-plugins just before ordinary plugins.
        // wp-settings.php, Line 301: "foreach ( wp_get_active_and_valid_plugins() as $plugin ) {"
        add_filter('pre_option_active_plugins', ($callback = function ($plugins) use (&$callback) {
            remove_filter('pre_option_active_plugins', $callback);

            $this->loadPlugins();

            return $plugins;
        }));

        $this->addActivePluginsFilter();

        // Activate admin filters
        add_action('wp_loaded', function () {
            $this->addAdminFilter();
        });
    }
585292
public static function Start() {
      
      self::$Prefixes = array(
         self::CONTEXT_CORE            => 'c',
         self::CONTEXT_APPLICATION     => 'a',
         self::CONTEXT_PLUGIN          => 'p',
         self::CONTEXT_THEME           => 't'
      );
      self::$ContextOrder = array(
         self::CONTEXT_THEME,
         self::CONTEXT_LOCALE,
         self::CONTEXT_PLUGIN,
         self::CONTEXT_APPLICATION,
         self::CONTEXT_CORE
      );
      
      self::$Maps = array();
      self::$MapGroups = array();
   
      // Register autoloader with the SPL
      spl_autoload_register(array('Gdn_Autoloader', 'Lookup'));
      
      // Configure library/core and library/database
      self::RegisterMap(self::MAP_LIBRARY, self::CONTEXT_CORE, PATH_LIBRARY.'/core');
      self::RegisterMap(self::MAP_LIBRARY, self::CONTEXT_CORE, PATH_LIBRARY.'/database');
      self::RegisterMap(self::MAP_LIBRARY, self::CONTEXT_CORE, PATH_LIBRARY.'/vendors');
      
      // Register shutdown function to auto save changed cache files
      register_shutdown_function(array('Gdn_Autoloader', 'Shutdown'));
   }
993966
public function loadPlugins(array $pluginsToLoad)
    {
        $this->resetTransientCache();
        $this->pluginsToLoad = $this->makePluginsToLoad($pluginsToLoad);
        $this->reloadActivatedPlugins();
    }
1306382
private function onConfigLoaded()
    {
        $this->log('controller config loaded/updated');
        $this->stopPlugins();
        if (!$this->state['config']['enabled']) {
            $this->log('controller disabled');
            return;
        }

        foreach ($this->state['config']['plugins'] as $pluginId => $config) {
            if (!$config['enabled']) {
                continue;
            }

            $this->log('loading plugin '.$pluginId);

            foreach ($this->registeredPlugins as $className) {
                if ($className::getPluginId() == $pluginId) {
                    $plugin = new $className($this);
                    $this->plugins[] = $plugin;
                    $plugin->init();
                    continue 2;
                }
            }

            $this->log("plugin ${pluginId} is not registered with the controller");
        }
    }
157688
protected function loadPlugins()
    {
        if (
            !defined('WP_PLUGIN_DIR') ||
            !defined('WPMU_PLUGIN_DIR') ||
            !is_blog_installed()
        ) {
            return;
        }

        $cache = get_site_option('wordplate_autoloader_plugin_cache');

        if ($cache !== false && isset($cache['files'])) {
            $cacheFiles = $cache['files'];

            foreach ($cacheFiles as $file) {
                // Check if plugin have been removed.
                if (!file_exists(WPMU_PLUGIN_DIR.'/'.$file)) {
                    $cache = false; // Invalidate cache.
                    break;
                }
            }
        } else {
            $cache = false; // Invalidate cache.
            $cacheFiles = [];
        }

        // Required for 'get_plugins' & 'get_mu_plugins' functions.
        require_once ABSPATH.'wp-admin/includes/plugin.php';

        $this->relativePath = UrlGenerator::getRelativePath(
            WP_PLUGIN_DIR.'/',
            WPMU_PLUGIN_DIR.'/'
        );

        $this->autoloadPlugins = get_plugins('/'.$this->relativePath);
        $this->mustUsePlugins = get_mu_plugins();

        // Remove duplicate plugins.
        $this->plugins = array_diff_key($this->autoloadPlugins, $this->mustUsePlugins);

        $this->files = array_keys($this->plugins);

        // Add relativePath before filename
        $this->relativeFiles = preg_filter('/^/', $this->relativePath, $this->files);

        $this->activate = array_diff($this->files, $cacheFiles);

        // Check if plugin have been added.
        if ($this->activate) {
            $cache = false; // Invalidate cache.
        }

        if ($cache === false) {
            // Update cache.
            update_site_option('wordplate_autoloader_plugin_cache', [
                'files' => $this->files,
            ]);
        }

        // Load already activated plugins
        $activated = array_diff($this->files, $this->activate);
        foreach ($activated as $file) {
            include_once WPMU_PLUGIN_DIR.'/'.$file;
        }

        add_action('after_setup_theme', function () {
            $this->activatePlugins();
        });
    }
186140
private function autoload()
    {
        $app = $this;
        $finder = new Finder();

        foreach ($finder->in($app['singular.directory.app'])->files()->name('*.php') as $file) {
            include_once $file->getRealpath();
        }
    }
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);
        }
    }
798110
private function startPluginTraits()
    {
        foreach ($this->getPluginTraits() as $trait) {
            if (method_exists(get_called_class(), $method = 'start' . class_basename($trait) . 'Plugin')) {
                call_user_func([ $this, $method ], $this->app);
            }
        }
    }
1360511
def load(self):
        

        self._setup_directories()
        self._load_plugins()
        self._setup_task(load=True)
        self._loaded = True