Install the module via git.

@return \Symfony\Component\Process\Process
507718
public function installViaGit()
    {
        return new Process(sprintf(
            'cd %s && git clone %s %s && cd %s && git checkout %s',
            base_path(),
            $this->getRepoUrl(),
            $this->getDestinationPath(),
            $this->getDestinationPath(),
            $this->getBranch()
        ));
    }
422874
public function getProcess(): Process
    {
        if ($this->process === null) {
            $this->process = new Process(
                $this->getSchemaName(),
                $this->getInitialState(),
                $this->buildStates()
            );
        }

        return $this->process;
    }
531227
def install_module(
    self, target=None, package_manager=None, 
    install_optional=False, production_only=False, force=False, 
    node_paths=None, frozen_lockfile=None, workunit_name=None, workunit_labels=None):
    """"""
    package_manager = package_manager or self.get_package_manager(target=target)
    command = package_manager.install_module(
      install_optional=install_optional,
      force=force,
      production_only=production_only,
      node_paths=node_paths,
      frozen_lockfile=frozen_lockfile
    )
    return self._execute_command(
      command, workunit_name=workunit_name, workunit_labels=workunit_labels)
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);
    }
517919
public function install()
    {
        // We get all the packages required
        $packages = $this->composer->getPackage()->getRequires();
        /** @var Package\Link $package */
        foreach ($packages as $package) {
            $this->packagesStatuses[$package->getTarget()] = array('extra' => null, 'dirs' => null);
            $this->installPackage($package);
        }
        return $this;
    }
1242863
protected function doExecute()
    {
        if ($this->io->getOption('h')) {
            return $this->help();
        }

        $this->tag = $tag = $this->io->getOption('t') ?: $this->io->getOption('tag');

        $branch = $this->io->getOption('b') ?: $this->io->getOption('branch', 'test');

        $force = $this->io->getOption('f') ?: $this->io->getOption('force', false);

        $force = $force ? ' -f' : false;

        if ($this->tag && !$this->io->getOption('no-replace')) {
            $this->replaceDocblockTags();
        }

        $this->branch = $branch;

        $this->exec('git fetch origin');

        $this->exec('git branch -D ' . $branch);

        $this->exec('git checkout -b ' . $branch);

        $this->exec('git merge master');

        if ($this->tag) {
            $this->exec('git tag -d ' . $tag);

            $this->exec('git push origin :refs/tags/' . $tag);

            $this->exec('git tag ' . $tag);

            $this->exec(sprintf('git push origin %s' . $force, $this->tag));
        }

        $this->exec(sprintf('git push origin %s %s:%s master:master' . $force, $tag, $branch, $branch));

        $allows = $this->io->getArguments();

        foreach ($this->subtrees as $subtree => $namespace) {
            if ($allows && !in_array($subtree, $allows)) {
                continue;
            }

            $this->splitTree($subtree, $namespace);
        }

        $this->exec('git checkout master');

        $this->out()->out('Split finish.');

        return true;
    }
55352
public function install()
    {
        $this->controlAccessInstall();

        if ($this->getParam()) {
            $this->validateFastInstall();
        } else {
            $this->validateWizardInstall();
        }

        $this->processInstall();
        $this->output();
    }
761474
protected function installFromFile()
    {
        if (!file_exists($path = base_path('components.json'))) {
            $this->error("File 'components.json' does not exist in your project root.");

            return;
        }

        $components = Json::make($path);

        $dependencies = $components->get('require', []);

        foreach ($dependencies as $component) {
            $component = collect($component);

            $this->install(
                $component->get('name'),
                $component->get('version'),
                $component->get('type')
            );
        }
    }
302244
public function bootModuleManager(){
        $app = $this->app;
        $this->app->container->singleton('module', function() use ($app){
            return new ModuleManager($app);
        });
    }
123613
public function actionCreate()
    {
        if (empty($this->type)) {
            Console::clearScreenBeforeCursor();
            $this->type = $this->select('Do you want to create an app or module Block?', [
                self::TYPE_APP => 'Creates a project block inside your @app Namespace (casual).',
                self::TYPE_MODULE => 'Creating a block inside a later specified Module.',
            ]);
        }

        if ($this->type == self::TYPE_MODULE && count($this->getModuleProposal()) === 0) {
            return $this->outputError('Your project does not have Project-Modules registered!');
        }

        if (empty($this->moduleName) && $this->type == self::TYPE_MODULE) {
            $this->moduleName = $this->select('Choose a module to create the block inside:', $this->getModuleProposal());
        }

        if (empty($this->blockName)) {
            $this->blockName = $this->prompt('Insert a name for your Block (e.g. HeadTeaser):', ['required' => true]);
        }
        
        if ($this->isContainer === null) {
            $this->isContainer = $this->confirm("Do you want to add placeholders to your block that serve as a container for nested blocks?", false);
        }
        
        if ($this->cacheEnabled === null) {
            $this->cacheEnabled = $this->confirm("Do you want to enable the caching for this block or not?", true);
        }
        
        if ($this->config === null) {
            $this->config = [
                'vars' => [], 'cfgs' => [], 'placeholders' => [],
            ];
    
            $doConfigure = $this->confirm('Would you like to configure this Block? (vars, cfgs, placeholders)', false);
    
            if ($doConfigure) {
                $doVars = $this->confirm('Add new Variable (vars)?', false);
                $i = 1;
                while ($doVars) {
                    $item = $this->varCreator('Variabel (vars) #'.$i, 'var');
                    $this->phpdoc[] = '{{vars.'.$item['var'].'}}';
                    $this->viewFileDoc[] = '$this->varValue(\''.$item['var'].'\');';
                    $this->config['vars'][] = $item;
                    $doVars = $this->confirm('Add one more?', false);
                    ++$i;
                }
                $doCfgs = $this->confirm('Add new Configuration (cfgs)?', false);
                $i = 1;
                while ($doCfgs) {
                    $item = $this->varCreator('Configration (cfgs) #'.$i, 'cfg');
                    $this->phpdoc[] = '{{cfgs.'.$item['var'].'}}';
                    $this->viewFileDoc[] = '$this->cfgValue(\''.$item['var'].'\');';
                    $this->config['cfgs'][] = $item;
                    $doCfgs = $this->confirm('Add one more?', false);
                    ++$i;
                }
                $doPlaceholders = $this->confirm('Add new Placeholder (placeholders)?', false);
                $i = 1;
                while ($doPlaceholders) {
                    $item = $this->placeholderCreator('Placeholder (placeholders) #'.$i);
                    $this->phpdoc[] = '{{placeholders.'.$item['var'].'}}';
                    $this->viewFileDoc[] = '$this->placeholderValue(\''.$item['var'].'\');';
                    $this->config['placeholders'][] = $item;
                    $doPlaceholders = $this->confirm('Add one more?', false);
                    ++$i;
                }
            }
        }
        
        $folder = $this->getFileBasePath() . DIRECTORY_SEPARATOR . 'blocks';
        $filePath = $folder . DIRECTORY_SEPARATOR . $this->blockName . '.php';
        
        sort($this->phpdoc);
        
        $content = $this->view->render('@cms/views/commands/block/create_block', [
            'namespace' => $this->getFileNamespace(),
            'className' => $this->blockName,
            'name' => Inflector::camel2words($this->blockName),
            'type' => $this->type,
            'module' => $this->moduleName,
            'isContainer' => $this->isContainer,
            'cacheEnabled' => $this->cacheEnabled,
            'config' => $this->config,
            'phpdoc' => $this->phpdoc,
            'extras' => $this->extras,
            'luyaText' => $this->getGeneratorText('block/create'),
        ]);

        if ($this->dryRun) {
            return $content;
        }
        
        if (FileHelper::createDirectory($folder) && FileHelper::writeFile($filePath, $content)) {
            
            // generate view file based on block object view context
            $object = Yii::createObject(['class' => $this->getFileNamespace() . '\\' . $this->blockName]);
            $viewsFolder = Yii::getAlias($object->getViewPath());
            $viewFilePath = $viewsFolder . DIRECTORY_SEPARATOR . $object->getViewFileName('php');
            if (FileHelper::createDirectory($viewsFolder) && FileHelper::writeFile($viewFilePath, $this->generateViewFile($this->blockName))) {
                $this->outputInfo('View file for the block has been created: ' . $viewFilePath);
            }
            
            return $this->outputSuccess("Block {$this->blockName} has been created: " . $filePath);
        }
        
        return $this->outputError("Error while creating block '$filePath'");
    }
526728
function install()
    {
        $this->createConfigurationDirectory();
        $this->createDriversDirectory();
        $this->createSitesDirectory();
        $this->createExtensionsDirectory();
        $this->createLogDirectory();
        $this->createCertificatesDirectory();
        $this->writeBaseConfiguration();

        $this->files->chown($this->path(), user());
    }
1153228
public function install()
    {
        return parent::install()
            && $this->installTab()
            && $this->registerHook('displayAdminNavBarBeforeEnd')
            && $this->registerHook('displayAdminAfterHeader')
            && $this->registerHook('displayBackOfficeHeader');
    }
1361062
public function installAction()
    {
        // Create database connection and load migrations
        $connection = ConnectionManager::create($_SESSION['db']);
        $this->loadMigrations();

        // Migrate the database.
        $m = new Migrator;
        $m->migrate('up');

        // Create admin account
        $admin = new User($_SESSION['admin'] + [
            'name'     => $_SESSION['admin']['username'],
            'group_id' => 1
        ]);
        $admin->save();

        // Set config file contents
        $this->set("config", $this->makeConfig());

        // Insert defaults
        $seeder = new Seeder;
        $seeder->seed();

        // Remove database and account details from the session.
        unset($_SESSION['db'], $_SESSION['admin']);

        $this->title("Complete");
        return $this->render("complete.phtml");
    }
495780
public function execute()
    {
        $path  = $this->phpci->buildPath;
        $build = $this->build;

        if ($this->directory == $path) {
            return false;
        }

        $filename = str_replace('%build.commit%', $build->getCommitId(), $this->filename);
        $filename = str_replace('%build.id%', $build->getId(), $filename);
        $filename = str_replace('%build.branch%', $build->getBranch(), $filename);
        $filename = str_replace('%project.title%', $build->getProject()->getTitle(), $filename);
        $filename = str_replace('%date%', date('Y-m-d'), $filename);
        $filename = str_replace('%time%', date('Hi'), $filename);
        $filename = preg_replace('/([^a-zA-Z0-9_-]+)/', '', $filename);

        $curdir = getcwd();
        chdir($this->phpci->buildPath);

        if (!is_array($this->format)) {
            $this->format = array($this->format);
        }

        foreach ($this->format as $format) {
            switch ($format) {
                case 'tar':
                    $cmd = 'tar cfz "%s/%s.tar.gz" ./*';
                    break;
                default:
                case 'zip':
                    $cmd = 'zip -rq "%s/%s.zip" ./*';
                    break;
            }

            $success = $this->phpci->executeCommand($cmd, $this->directory, $filename);
        }

        chdir($curdir);

        return $success;
    }
1233624
public function run()
    {
        // Run compilation based on class dependencies.
        $this->runCompilationByArrangedPriority();

        // Run remaining components (if any).
        foreach ($this->components as $name => $classes) {
            $this->compileGroupClasses($name, $classes);
        }

        // Append application file to the bottom.
        $original = $this->config->get('compile.files', []);

        foreach ($original as $class) {
            $this->collection['added'][] = $class;
        }

        $this->config->set('compile.files', $this->collection['added']);

        return new Fluent([
            'added'   => $this->collection['added'],
            'missing' => $this->collection['missing'],
        ]);
    }
685844
public function install() {
		if (file_exists(__DIR__.'/../../../../../../mouf/no_commit/MoufUsers.php')) {
			$this->contentBlock->addFile(dirname(__FILE__)."/../../views/mouf_installer/moufusers_exists.php", $this);
			$this->template->toHtml();
			return;
		}
		
		$oldUmask = umask();
		umask(0);
		
		// Now, let's write the basic Mouf files:
		if (!file_exists(__DIR__."/../../../../../../mouf")) {
			mkdir(__DIR__."/../../../../../../mouf", 0775);
		}
		if (!file_exists(__DIR__."/../../../../../../mouf/no_commit")) {
			mkdir(__DIR__."/../../../../../../mouf/no_commit", 0775);
		}
		
		
		// Write Mouf.php (always):
		//if (!file_exists(__DIR__."/../../../../../../mouf/Mouf.php")) {
			$moufStr = "<?php
define('ROOT_PATH', realpath(__DIR__.'/..').DIRECTORY_SEPARATOR);
require_once __DIR__.'/../config.php';
if (defined('ROOT_URL')) {
	define('MOUF_URL', ROOT_URL.'vendor/mouf/mouf/');
}
		
require_once __DIR__.'/../vendor/autoload.php';
		
require_once 'MoufComponents.php';
?>";
		
			file_put_contents(__DIR__."/../../../../../../mouf/Mouf.php", $moufStr);
			// Change rights on Mouf.php, but ignore errors (the file might be writable but still belong to someone else).
			@chmod(__DIR__."/../../../../../../mouf/Mouf.php", 0664);
		//}
		
		
		
		// Write MoufComponents.php:
		if (!file_exists(__DIR__."/../../../../../../mouf/MoufComponents.php")) {
			$moufComponentsStr = "<?php
/**
 * This is a file automatically generated by the Mouf framework. Do not modify it, as it could be overwritten.
 */
		
use Mouf\MoufManager;
MoufManager::initMoufManager();
\$moufManager = MoufManager::getMoufManager();
		
?>";
		
			file_put_contents(__DIR__."/../../../../../../mouf/MoufComponents.php", $moufComponentsStr);
			chmod(__DIR__."/../../../../../../mouf/MoufComponents.php", 0664);
		}
		
		// Finally, let's generate the MoufUI.php file:
		if (!file_exists(__DIR__."/../../../../../../mouf/MoufUI.php")) {
			$moufUIStr = "<?php
/**
 * This is a file automatically generated by the Mouf framework. Do not modify it, as it could be overwritten.
 */
		
	?>";
		
			file_put_contents(__DIR__."/../../../../../../mouf/MoufUI.php", $moufUIStr);
			chmod(__DIR__."/../../../../../../mouf/MoufUI.php", 0664);
		}
		
		// Finally 2, let's generate the config.php file:
		if (!file_exists(__DIR__."/../../../../../../config.php")) {
			$moufConfig = "<?php
/**
 * This is a file automatically generated by the Mouf framework. Do not modify it, as it could be overwritten.
 * Use the UI to edit it instead.
 */
		
?>";
		
			file_put_contents(__DIR__."/../../../../../../config.php", $moufConfig);
			chmod(__DIR__."/../../../../../../config.php", 0664);
		}
		
		// Finally 3 :), let's generate the MoufUsers.php file:
		if (!file_exists(__DIR__."/../../../../../../mouf/no_commit/MoufUsers.php")) {
			$moufConfig = "<?php
/**
 * This contains the users allowed to access the Mouf framework.
 */
\$users[".var_export(userinput_to_plainstring($_REQUEST['login']), true)."] = array('password'=>".var_export(sha1(userinput_to_plainstring($_REQUEST['password'])), true).", 'options'=>null);
		
?>";
		
			file_put_contents(__DIR__."/../../../../../../mouf/no_commit/MoufUsers.php", $moufConfig);
			chmod(__DIR__."/../../../../../../mouf/no_commit/MoufUsers.php", 0664);
		}
		
		umask($oldUmask);
		
		header("Location: ".ROOT_URL);
		
		
	}
1004662
function install()
    {
        if ($this->error_handler) {
            throw new Exception(sprintf('%s->install() must only be called once', get_class($this)));
        }
        $this->error_handler = new ErrorHandler($this, false, $this->error_types);
        $this->error_handler->registerExceptionHandler();
        $this->error_handler->registerErrorHandler();
        $this->error_handler->registerShutdownFunction();
        return $this;
    }