Installs the plugins via a separate PHP process.

You do not need to call this directly, it is only public because it is hooked
to an action by self::hook_up_installer().

@since 0.1.0
542338
public function install_plugins() {

		$result = system(
			WP_PHP_BINARY
			. ' ' . escapeshellarg( dirname( dirname( __FILE__ ) ) . '/bin/install-plugins.php' )
			. ' ' . escapeshellarg( json_encode( $this->plugins ) )
			. ' ' . escapeshellarg( $this->locate_wp_tests_config() )
			. ' ' . (int) is_multisite()
			. ' ' . escapeshellarg( json_encode( $this->files ) )
			, $exit_code
		);

		if ( 0 !== $exit_code ) {
			echo( 'Remote plugin installation failed with exit code ' . $exit_code . PHP_EOL );
			exit( 1 );
		} elseif ( ! empty( $result ) ) {
			echo( PHP_EOL . 'Remote plugin installation produced unexpected output.' . PHP_EOL );
			exit( 1 );
		}

		// The caching functions may not be loaded yet.
		if ( function_exists( 'wp_cache_flush' ) ) {
			wp_cache_flush();
		}

		remove_action( 'all', array( $this, 'install_plugins' ) );
	}
37721
protected function installDone()
    {
        $this->nl();
        if ($this->seemsFine) {
            $this->output->writeLn("========================================================================");
            $this->nl();
            $this->output->writeLn("                      Repair completed!");
            $this->nl();
            $this->output->writeLn("========================================================================");
        } else {
            $this->output->writeLn("Automatic installation failed to complete cleanly.");
            $this->output->writeLn("Head over to https://github.com/strata-mvc/strata/ to get help.");
        }
        $this->nl();
    }
1157643
protected function installPlugin(string $name)
    {
        $this->info('Downloading plugin...');

        $this->files->copy($this->option('url'), $this->temp);

        if (true !== $this->zip->open($this->temp)) {
            $this->error('Cannot open plugin zip file.');

            return;
        }

        $this->zip->extractTo($this->path());
        $this->zip->close();

        $this->files->move(
            $this->path($this->option('dir')),
            $this->path($name)
        );

        $this->files->delete($this->temp);
    }
648809
public static function init()
    {
        /*
         * Push the Services into the Dependency Injector.
         */
        call_user_func(function() {
            if (file_exists(self::$basePath . '/.manifest/plugins/services.php')) {
                /** @noinspection PhpIncludeInspection */
                include self::$basePath . '/.manifest/plugins/services.php';
            }
            /** @noinspection PhpIncludeInspection */
            require self::$basePath . '/boot/services.php';
        });

        /*
         * Bootstrap the framework.
         */
        call_user_func(function() {
            /** @noinspection PhpIncludeInspection */
            require self::$basePath . '/boot/bootstrap.php';
            if (file_exists(self::$basePath . '/.manifest/plugins/bootstrap.php')) {
                /** @noinspection PhpIncludeInspection */
                include self::$basePath . '/.manifest/plugins/bootstrap.php';
            }
        });
    }
662019
public function loadPlugins()
    {
        $activePlugins = $this->getActivePlugins();
        foreach ($activePlugins as $plugin) {
            if ($class = $this->load($plugin)) {
                $class->run();
            }
        }
    }
429454
protected function installSubAddons()
    {
        if ($subAddons = $this->addon->installs()) {
            foreach ($subAddons as $slug => $path) {
                app(self::class)->setSlug($slug)
                                ->setPath($this->path.'/'.$path)
                                ->install();
            }
        }
    }
416244
def install(self, plugin):
        ''' 
        '''
        if hasattr(plugin, 'setup'): plugin.setup(self)
        if not callable(plugin) and not hasattr(plugin, 'apply'):
            raise TypeError("Plugins must be callable or implement .apply()")
        self.plugins.append(plugin)
        self.reset()
        return plugin
69259
protected function install()
    {
        $this->setupCore();
        $this->setupBackend();
        $this->initializeDatabase();
        $this->runCommand('cache:clear', array('--no-warmup' => true));
    }
1032044
public function init() {
		if ( ! function_exists( 'get_plugin_data' ) ) {
			require_once ABSPATH . 'wp-admin/includes/plugin.php';
		}
		$this->plugin_data = get_plugin_data( $this->plugin_file, false, false );
	}
915605
protected function load_installed_plugins() {
        global $DB, $CFG;

        if ($this->installedplugins) {
            return;
        }

        if (empty($CFG->version)) {
            // Nothing installed yet.
            $this->installedplugins = array();
            return;
        }

        $cache = cache::make('core', 'plugin_manager');
        $installed = $cache->get('installed');

        if (is_array($installed)) {
            $this->installedplugins = $installed;
            return;
        }

        $this->installedplugins = array();

        $versions = $DB->get_records('config_plugins', array('name'=>'version'));
        foreach ($versions as $version) {
            $parts = explode('_', $version->plugin, 2);
            if (!isset($parts[1])) {
                // Invalid component, there must be at least one "_".
                continue;
            }
            // Do not verify here if plugin type and name are valid.
            $this->installedplugins[$parts[0]][$parts[1]] = $version->value;
        }

        foreach ($this->installedplugins as $key => $value) {
            ksort($this->installedplugins[$key]);
        }

        $cache->set('installed', $this->installedplugins);
    }
120017
protected function _loadPlugins()
    {
        $autoloader = $this->getPluginPath() . '/vendor/autoload.php';

        if (file_exists($autoloader)) {
            require_once $autoloader;
        }

        $plugins = $this->getPlugins();

        $classes = array();
        foreach ($plugins as $package => $version)
        {
            $path        = $this->getPluginPath() . '/vendor/' . $package;
            $directories = glob($path.'/*/Console/Command', GLOB_ONLYDIR);

            foreach ($directories as $directory)
            {
                $vendor   = substr($directory, strlen($path) + 1, strlen('/Console/Command') * -1);
                $iterator = new \DirectoryIterator($directory);

                foreach ($iterator as $file)
                {
                    if ($file->getExtension() == 'php') {
                        $classes[] = sprintf('%s\Console\Command\%s', $vendor, $file->getBasename('.php'));
                    }
                }
            }
        }

        foreach ($classes as $class)
        {
            if (class_exists($class))
            {
                $command = new $class();

                if (!$command instanceof \Symfony\Component\Console\Command\Command) {
                    continue;
                }

                $name = $command->getName();

                if(!$this->has($name)) {
                    $this->add($command);
                }
                else $this->_output->writeln("<fg=yellow;options=bold>Notice:</fg=yellow;options=bold> The '$class' command wants to register the '$name' command but it already exists, ignoring.");
            }
        }
    }
538066
protected function _install()
    {
        $message = __d('installer', "Please provide a theme source, it can be either an URL or a filesystem path to a ZIP/directory within your server?\n[Q]uit");
        while (true) {
            $source = $this->in($message);
            if (strtoupper($source) === 'Q') {
                $this->err(__d('installer', 'Installation aborted'));
                break;
            } else {
                $this->out(__d('installer', 'Starting installation...'), 0);
                $task = $this->dispatchShell("Installer.plugins install -s \"{$source}\" --theme -a");

                if ($task === 0) {
                    $this->_io->overwrite(__d('installer', 'Starting installation... successfully installed!'), 2);
                    $this->out();
                    break;
                } else {
                    $this->_io->overwrite(__d('installer', 'Starting installation... failed!'), 2);
                    $this->out();
                }
            }
        }

        $this->out();
    }
1257370
public function install()
    {
        $this->ensureComponentDirectoryExists();
        $this->updatePackages();
        $this->updateWebpackConfiguration();
        $this->updateBootstrapping();
        $this->updateComponent();
        $this->removeNodeModules();
    }
526728
function install()
    {
        $this->createConfigurationDirectory();
        $this->createDriversDirectory();
        $this->createSitesDirectory();
        $this->createExtensionsDirectory();
        $this->createLogDirectory();
        $this->createCertificatesDirectory();
        $this->writeBaseConfiguration();

        $this->files->chown($this->path(), user());
    }
1243563
def install(self, plugin, name=None, **opts):
        """"""
        source = plugin

        if isinstance(plugin, str):
            module, _, attr = plugin.partition(':')
            module = import_module(module)
            plugin = getattr(module, attr or 'Plugin', None)

        if isinstance(plugin, types.ModuleType):
            plugin = getattr(module, 'Plugin', None)

        if plugin is None:
            raise MuffinException('Plugin is not found %r' % source)

        name = name or plugin.name
        if name in self.ps:
            raise MuffinException('Plugin with name `%s` is already intalled.' % name)

        if isinstance(plugin, type):
            plugin = plugin(**opts)

        if hasattr(plugin, 'setup'):
            plugin.setup(self)

        if hasattr(plugin, 'middleware') and plugin.middleware not in self.middlewares:
            self.middlewares.append(plugin.middleware)

        if hasattr(plugin, 'startup'):
            self.on_startup.append(plugin.startup)

        if hasattr(plugin, 'cleanup'):
            self.on_cleanup.append(plugin.cleanup)

        # Save plugin links
        self.ps[name] = plugin

        return plugin
66587
public function install()
    {
        $definition = $this->file->read();
        $excluded   = $definition['archive']['exclude'] ?? [];

        $excluded = array_map(
            function (string $exclude): string {
                return substr($exclude, 0, 1) !== '/'
                    ? '/' . $exclude
                    : $exclude;
            },
            $excluded
        );

        $files = array_merge(
            $this->defaults,
            array_map(
                function (FileMappingInterface $mapping): string {
                    return '/' . $mapping->getRelativeDestination();
                },
                iterator_to_array(
                    $this->resolver->resolve()
                )
            )
        );

        foreach ($files as $file) {
            if (!in_array($file, $excluded)
                && file_exists($this->destination . $file)
            ) {
                $excluded[] = $file;
                $this->io->write(
                    sprintf(
                        '<info>Added:</info> %s to archive exclude in composer.json',
                        $file
                    )
                );
            }
        }

        $definition['archive']['exclude'] = $excluded;
        $this->file->write($definition);
    }
1030128
protected function install()
    {
        $installScripts = array();
        foreach ($this->autoloaderCollection as $dir => $jsonAutoloader) {
            $bundleName = $jsonAutoloader->getBundleName();
            $this->installPackage($dir, $jsonAutoloader);

            // Check if the bundle under exam has attached an ActionManager file
            $actionsManager = $jsonAutoloader->getActionManager();
            if ((!array_key_exists($bundleName, $this->installedBundles) && null !== $actionsManager)) {
                if (null !== $jsonAutoloader->getActionManagerClass()) {
                    $installScripts[$bundleName] = $actionsManager;

                    // Copies the current ActionManager class to app/config/bundles/cache folder
                    // because it must be preserved when a bundle is uninstalled
                    $reflection = new \ReflectionClass($actionsManager);
                    $fileName = $reflection->getFileName();
                    $className = $this->cachePath . '/' . $bundleName . '/' . basename($fileName);
                    $this->filesystem->copy($fileName, $className, true);
                }
            }

            unset($this->installedBundles[$bundleName]);
        }

        $installerScript = $this->scriptFactory->createScript('PreBootInstaller');
        $installerScript->executeActions($installScripts);
    }