Complete the setup task.

@since 0.1.0

@return void
540381
public function complete()
    {
        $placeholders    = $this->getPlaceholderArray();
        $templatesFolder = $this->getConfigKey('Folders', 'templates');
        $finder          = new Finder();
        foreach ($finder->files()->in($templatesFolder) as $file) {
            $template = file_get_contents($file);
            $mustache = new Mustache_Engine();
            $result   = $mustache->render($template, $placeholders);
            file_put_contents($file, $result);
        }
    }
1289133
private function setup()
    {
        if ($this->started) {
            return;
        }

        if ($this->app['extend.writeable']) {
            // Do required JSON update/set up
            try {
                $this->updateJson();
            } catch (ParseException $e) {
                $this->app['logger.flash']->danger(Trans::__('Error reading extensions/composer.json file: %ERROR%', ['%ERROR%' => $e->getMessage()]));
                $this->started = false;

                return;
            }
        }

        $this->started = true;
    }
1371237
public function install()
    {
        // 1. Set options
        $this->setOptions($this->config->options());

        // 2. Activate plugins
        $this->activatePlugins($this->config->plugins());

        // 3. Maybe set the theme (and settings)
        if ($theme = $this->config->theme()) {
            $this->setTheme($theme->name, $theme->mods, $theme->options, $theme->menus, $theme->sidebars);
        }

        // 4. Maybe set the permalink structure
        global $wp_rewrite;
        if ($wp_rewrite && $permalinks = $this->config->permalinks()) {
            $this->setPermalinkStructure($wp_rewrite, $permalinks);
        }

        // 5. Maybe set the timezone
        if ($timezone = $this->config->timezone()) {
            $this->setTimezone($timezone);
        }
    }
253592
protected function setUp()
	{
		if (isset($this->configurator->tags[$this->tagName]))
		{
			return;
		}

		// Create tag
		$tag = $this->configurator->tags->add($this->tagName);

		// Create attribute
		$tag->attributes->add($this->attrName);

		// Create a template that replaces its content with the replacement char
		$tag->template
			= '<xsl:value-of select="@' . htmlspecialchars($this->attrName) . '"/>';
	}
856593
public function install()
    {
        $disk = Storage::createLocalDriver([
            'driver' => 'local',
            'root'   => app_path(),
        ]);
        
        $this->info('Publishing required files', 1);
        $this->call('vendor:publish', ['--provider' => TwoStreamServiceProvider::class, '--tag' => ['required']], 2);
        
        $this->info('Applying your app\'s namespace <comment>[' . $this->appNamespace . ']</comment>', 1);
        foreach (TwoStreamServiceProvider::pathsToPublish(TwoStreamServiceProvider::class, 'required') as $required) {
            $required = str_replace(app_path(), '', $required);
            $originalFile = $disk->get($required);
            $file = str_replace('{{namespace}}', $this->appNamespace, $originalFile);
            
            if ($file != $originalFile) {
                $this->info('Setting namespace for <comment>[/app' . str_replace([app_path(), '.php', '.stub'], '', $required) . ']</comment>', 2);
                $disk->put($required, $file);
            }
            
            if (! $disk->exists(str_replace('.stub', '.php', $required))) {
                $disk->move($required, str_replace('.stub', '.php', $required));
            }
        }
        
        $this->info('Cleaning up...', 1);
        $this->level(0);
        $files = array_merge($disk->allFiles('Ws'), $disk->allFiles('Exceptions'));
        foreach ($files as $key => $file) {
            if (preg_match('/\\.stub$/', $file)) {
                $disk->delete($file);
            }
        }
    }
426562
public function prepare()
    {
        $this->taskFileSystemStack()
             ->mkdir($this->getDistDir())
             ->mkdir($this->getTargetDir())
             ->mkdir($this->getReportsDir())
             ->run();
    }
947589
public function finish()
    {

        foreach ($this->drivers as $name => $class) {
            $handler = $class->getHandler();
            if (isset($handler->terminatable) && $handler->terminatable == false) {
                unset($this->drivers[$name]);
                continue;
            }

            if ($class->get('terminate') !== true) {
                $class->finish();
            }
            unset($this->drivers[$name]);
        }
        $this->drivers = [];
    }
322232
protected function setUp(): void
    {
        parent::setUp();

        $this->prevSniffedFile = $this->file->getFilename();

        if (!array_key_exists($var = $this->token['content'], $this->sniffedVars)) {
            // "Sniff" the var name only once ...
            $this->sniffedVars[$var] = Common::isCamelCaps(substr($var, 1));
        }
    }
55352
public function install()
    {
        $this->controlAccessInstall();

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

        $this->processInstall();
        $this->output();
    }
659197
protected function resetup() {
		$this->setup_instance();

		$this->metadata = $this->fetch_metadata();
		$this->setup_metadata();

		$this->setup();
	}
417434
private function boot()
    {
        if ($this->booted) {
            return;
        }

        $this->booted = true;

        foreach ($this->finder->findAllTemplates() as $reference) {
            $this->addTemplate($reference);
        }

        foreach (array_keys($this->bundle_paths) as $name) {
            if (false !== ($resolved_path = $this->resolveResourcePath('@' . $name))) {
                $this->aliases['@' . $name] = $resolved_path;
                $this->addPath($resolved_path);
            }
        }

        $this->profiler->set('bundles', $this->aliases);
        $this->profiler->set('templates', $this->templates);
    }
665347
public function complete()
    {
        $this->io->write('<info>Summary :</info>');
        foreach ($this->getConfigKey('Placeholders') as $placeholder) {
            $this->io->write(
                sprintf(
                    '%1$s: <info>%2$s</info>',
                    $placeholder['name'],
                    $placeholder['value']
                )
            );
        }
    }
717128
protected function _setup()
    {
        if (!file_exists($this->getConsoleHome()))
        {
            $result = @mkdir($this->getConsoleHome(), 0775, true);

            if (!$result) {
                $this->_output->writeln(sprintf('<error>Unable to write to home directory: %s. Please check write permissions.</error>', getenv('HOME')));
            }
        }

        // Handle legacy plugin directory
        if (is_writable($this->getConsoleHome()) && !file_exists($this->getPluginPath()))
        {
            $old = realpath(dirname(__FILE__) . '/../../../plugins/');

            if (file_exists($old))
            {
                $this->_output->writeln('<comment>Moving legacy plugin directory to ~/.joomlatools-console/plugins.</comment>');

                $cmd = sprintf('mv %s %s', escapeshellarg($old), escapeshellarg($this->getPluginPath()));
                exec($cmd);
            }
        }
    }
1127076
protected function finalizeSetup()
    {
        // Run migrations if possible
        $attemptMigrate = false;

        if ($this->connection === 'sqlite') {
            $attemptMigrate = $this->createSqliteDatabase();
        } else {
            $attemptMigrate = $this->canConnectToDb();
        }

        sleep(1);

        if ($attemptMigrate) {
            // We need to reconnect using new settings if we're running SQLite
            if ($this->connection === 'sqlite') {
                app()['db']->reconnect();
            }

            $this->call('migrate', ['--force' => true]);

            // Mark as installer complete
            Storage::put('installer', '2');

            sleep(1);

            // Create the first user's account if we need to
            if (User::count() < 1) {
                $this->info("Now let's create your user account...");
                $this->call('network:user', ['--name' => $this->user_name]);
            }
        }

        // Make the symlinks we need
        $this->createSymlinks();

        sleep(1);

        if (! $this->hasError) {
            $this->alert("Great news, {$this->user_name}: your Network is set up! I hope you enjoy using Network.");
        } else {
            $this->warn("Sorry, {$this->user_name}, I couldn't complete your Network setup this time.");
            $this->warn("Please check the warning messages to see what you need to do and rerun `php artisan network:config`.");
        }
    }
159342
protected function setUp()
	{
		$tags = [
			'TABLE' => ['template' => '<table><xsl:apply-templates/></table>'],
			'TBODY' => ['template' => '<tbody><xsl:apply-templates/></tbody>'],
			'TD'    => $this->generateCellTagConfig('td'),
			'TH'    => $this->generateCellTagConfig('th'),
			'THEAD' => ['template' => '<thead><xsl:apply-templates/></thead>'],
			'TR'    => ['template' => '<tr><xsl:apply-templates/></tr>']
		];
		foreach ($tags as $tagName => $tagConfig)
		{
			if (!isset($this->configurator->tags[$tagName]))
			{
				$this->configurator->tags->add($tagName, $tagConfig);
			}
		}
	}
818235
public function complete()
    {
        $templatesFolder = $this->getConfigKey('Folders', 'vcs');
        try {
            $filesystem = new Filesystem();
            $filesystem->removeDirectory($templatesFolder);
        } catch (Exception $exception) {
            $this->io->writeError(
                sprintf(
                    'Could not remove VCS folder "%1$s". Reason: %2$s',
                    $templatesFolder,
                    $exception->getMessage()
                )
            );
        }
    }
1366690
public function install()
    {
        $process = new Process($this->command(), $this->command->path);

        if ('\\' !== DIRECTORY_SEPARATOR && file_exists('/dev/tty') && is_readable('/dev/tty')) {
            $process->setTty(true);
        }

        $process->run(function ($type, $line) {
            $this->command->output->write($line);
        });
    }