Complete the setup task.

@since 0.1.0

@return void
187035
public function complete()
    {
        foreach ($this->getConfigKey('Placeholders') as $key => $data) {
            $default = $data['default'];
            if (is_callable($default)) {
                $default = $default($this->getConfigKey('Placeholders'));
            }

            $value = $default;
            try {
                $value = $this->io->askAndValidate(
                    sprintf(
                        '<question>%1$s</question> [%2$s] <info>Default: "%3$s"</info> ? ',
                        $data['name'],
                        $data['description'],
                        $default
                    ),
                    $data['validation'],
                    null,
                    $default
                );
            } catch (Exception $exception) {
                // Fail silently.
            }

            $this->config['Placeholders'][$key]['value'] = $value;
        }
    }
1241846
public static function bootTask()
    {
        if (!self::isTaskBooted()) {
            self::configure();
            foreach (self::scheme() as $name => $scheme) {
                self::registerDriver($name, $scheme);
            }
        }
    }
1234496
protected function assemble()
    {
        $this->push('UPDATE');
        $this->pushTable();
        $this->push('SET');
        $this->pushValues();
        $this->pushWhere();
        $this->pushOrder();
        $this->pushLimit();
    }
463831
def setup():
    

    init_tasks()

    run_hook("before_setup")

    # Create shared folder
    env.run("mkdir -p %s" % (paths.get_shared_path()))
    env.run("chmod 755 %s" % (paths.get_shared_path()))

    # Create backup folder
    env.run("mkdir -p %s" % (paths.get_backup_path()))
    env.run("chmod 750 %s" % (paths.get_backup_path()))

    # Create uploads folder
    env.run("mkdir -p %s" % (paths.get_upload_path()))
    env.run("chmod 775 %s" % (paths.get_upload_path()))

    run_hook("setup")
    run_hook("after_setup")
501023
public function run() : void
    {
        $config = $this->getConfigToManipulate();
        $setup  = $this->getHookSetup();

        $setup->configureHooks($config);
        Config\Util::writeToDisk($config);

        $this->io->write(
            [
                '<info>Configuration created successfully</info>',
                'Run <comment>\'vendor/bin/captainhook install\'</comment> to activate your hook configuration',
            ]
        );
    }
483728
protected function setup() {
        if (!$this->_isSetup) {
            $defaultConfig = array(
                'srcBasePath' => Yii::getAlias('@webroot'),
                'dstBasePath' => Yii::$app->czaHelper->folderOrganizer->getEntityUploadPath(true),
                'dstUrlBase' => Yii::$app->czaHelper->folderOrganizer->getEntityUploadPath(),
                'underOwnerEntityPath' => true,
                'createMode' => 0775,
                'cachingPath' => '',
            );
            $this->config = \yii\helpers\ArrayHelper::merge($defaultConfig, $this->config);


            $defaultOptions = array(
                'isTranslation' => false,
                'handleFiles' => true,
                'handleImages' => true,
            );
            $this->options = \yii\helpers\ArrayHelper::merge($defaultOptions, $this->options);
            $this->_isSetup = true;
        }
    }
246080
public function setup() {

		if ( isset( $this->struct['description'] ) ) {
			$this->set_data( $this->struct['description'] );
		}

		$this->set_attributes();
		$this->set_dismissable();
		$this->set_state();

	}
580814
protected function _install() {
		$this->waiting->animateMessage();

		$installTasks = $this->ConfigInstaller->getListInstallerTasks();
		$this->waiting->animateMessage();
		if (empty($installTasks)) {
			$this->waiting->hideMessage();
			$this->out('<error>' . __d('cake_installer', 'Empty command list for action install. See config file.') . '</error>');

			return;
		}

		$installerCommands = $this->ConfigInstaller->getListInstallerCommands();
		$this->waiting->animateMessage();
		if (empty($installerCommands)) {
			$this->waiting->hideMessage();
			$this->out('<error>' . __d('cake_installer', 'Empty command list. See config file.') . '</error>');

			return;
		}

		$tasks = array_values(array_intersect($installerCommands, $installTasks));
		$this->waiting->animateMessage();
		if (empty($tasks)) {
			$this->waiting->hideMessage();
			$this->out('<error>' . __d('cake_installer', 'Invalid command list for action install. See config file.') . '</error>');

			return;
		}

		$this->waiting->hideMessage();
		$isAppInstalled = $this->InstallerCheck->isAppInstalled(null, false);
		if ($isAppInstalled) {
			if (!$this->_checkSure(__d('cake_installer', 'Application is installed. Reinstall?'))) {
				return;
			}

			$this->InstallerCheck->removeMarkerFileIsInstalled();
		}

		$taskCount = count($tasks);
		$result = true;
		$this->progress->init([
			'total' => $taskCount,
			'width' => $this->maxWidth,
		]);
		for ($step = 0; $step < $taskCount; $step++) {
			$this->clear();
			$this->hr();
			$this->out('<info>' . __d('cake_installer', 'Intsall: step %d of %d', $step + 1, $taskCount) . '</info>');
			$this->out(null, 0);
			$this->progress->draw();
			$this->hr(1);
			$timeProcess = 0;
			$taskName = '_' . $tasks[$step];
			if (!is_callable([$this, $taskName])) {
				$result = false;
				break;
			} else {
				$timeStart = microtime(true);
				$stepResult = call_user_func([$this, $taskName], true);
				$timeEnd = microtime(true);
				$timeProcess = $timeEnd - $timeStart;
				if (is_null($stepResult)) {
					$this->out('<success>' . __d('cake_installer', 'To apply the changes, restart the installer.') . '</success>');
					$this->InstallerCheck->setNeedRestart();

					return $this->_stop();
				} elseif (!$stepResult) {
					$result = false;
					break;
				}
			}

			$this->progress->increment(1);
			if ($timeProcess < 0.2) {
				usleep(200000);
			}
		}
		if ($result) {
			$this->clear();
			$this->hr();
			$this->out('<info>' . __d('cake_installer', 'Intsall: completed') . '</info>');
			$this->out(null, 0);
			$this->progress->draw();
			$this->hr(1);
			if (!$this->InstallerCheck->isAppInstalled(null, true)) {
				$result = false;
			}
			if ($result) {
				$this->out('<info>' . __d('cake_installer', 'Running post-install actions') . '</info>');
				$this->waiting->animateMessage();
				if (!$this->InstallerCompleted->intsallCompleted()) {
					$result = false;
				}
				$this->waiting->hideMessage();
			}
		}
		if ($result) {
			$this->out('<success>' . __d('cake_installer', 'The installation process is completed successfully.') . '</success>');
		} else {
			$this->out('<error>' . __d('cake_installer', 'The installation process is completed unsuccessfully.') . '</error>');
		}
		$this->hr();
	}
789822
public function deploy()
    {
        $this->logger->notice('Deploying ' . $this->name . ' (' . $this->releaseIdentifier . ')');
        $this->workflow->run($this);
    }
1133925
public function init()
    {
        if (!(bool)$this->ready) {
            $this->saveCurrentPID();
            $this->configureLoggers();

            $this->includeToolset();
            $this->setDefaultNamespace();
            $this->setupUrlRouting();

            $this->loadConfiguration();
            $this->addProjectNamespaces();
            $this->localize();

            $this->ready = true;
        }
    }
379517
public function setUp()
    {
        if ($this->filesystem->exists($this->outputDir) === false) {
            return;
        }

        $finder = new Finder();
        $finder->in($this->outputDir)
            ->depth('== 0');

        $this->filesystem->remove($finder);
    }
719729
protected function processInstall()
    {
        if (!$this->isError()) {

            $settings = $this->getSubmitted();
            $this->install->connectDb($settings['database']);
            $result = $this->install->process($settings, $this->current_route);

            if ($result['severity'] === 'success') {
                $this->line($result['message']);
            } else {
                $this->error($result['message']);
            }
        }
    }
1045340
protected function setUp()
    {
        if (empty($this->asset)) {
            return;
        }

        $this->asset = $this->normalizePath($this->asset);
        $this->realPath = $this->locateResource();

        // The asset has not been located, so the full path is the asset itself
        if (null === $this->realPath) {
            $this->realPath = $this->asset;
        }
        $this->absolutePath = $this->retrieveBundleWebFolder();
    }
1032261
public function process()
    {
        // Run the UpdatePackageInfo task
        $updateTask = Injector::inst()->create(UpdatePackageInfoTask::class);
        $updateTask->run(null);

        // mark job as completed
        $this->isComplete = true;
    }
1375033
public function complete()
    {
        $this->stopped();

        $this->setStatus(Job::STATUS_COMPLETE);

        $this->redis->zadd(Queue::redisKey($this->queue, 'processed'), time(), $this->payload);
        Stats::incr('processed', 1);
        Stats::incr('processed', 1, Queue::redisKey($this->queue, 'stats'));

        Event::fire(Event::JOB_COMPLETE, $this);
    }
1296171
public function setup()
    {
        $this->configure();
        $this->handleAppInclude();
        $this->validateConfiguration();
        $this->setupLogger();
        $this->setupRedis();
        $this->setupRedisEvents();
        $this->setupQueueStorage();
        $this->setupQueueFactory();
        $this->setupQueueRegistryAdapter();
        $this->setupQueueRegistry();
        $this->setupQueues();
        $this->setupFailureBackend();
        $this->setupStatisticBackend();
        $this->setupJobInstanceFactory();
        $this->setupWorkerFactory();
        $this->setupWorkerRegistryAdapter();
        $this->setupWorkerRegistry();
        $this->setupWorkers();
        $this->setupForeman();
    }
818710
public function done()
	{
		// Compute the totall length of the output
		$length = $this->contentLength + $this->initMessageLength;

		// Back up all the way
		$this->backspace($length, true);

		// In case this gets used again...
		$this->contentLength     = 0;
		$this->initMessageLength = 0;
	}