Deployer\Deployer::getDefault PHP Method

getDefault() public static method

public static getDefault ( string $name, mixed $default = null ) : mixed
$name string
$default mixed
return mixed
    public static function getDefault($name, $default = null)
    {
        return self::hasDefault($name) ? Deployer::get()->config[$name] : $default;
    }

Usage Example

コード例 #1
0
ファイル: TaskCommand.php プロジェクト: elfet/deployer
 /**
  * {@inheritdoc}
  */
 protected function execute(Input $input, Output $output)
 {
     $stage = $input->hasArgument('stage') ? $input->getArgument('stage') : null;
     $tasks = $this->deployer->getScriptManager()->getTasks($this->getName(), $stage);
     $servers = $this->deployer->getStageStrategy()->getServers($stage);
     $environments = iterator_to_array($this->deployer->environments);
     if (isset($this->executor)) {
         $executor = $this->executor;
     } else {
         if ($input->getOption('parallel')) {
             $executor = new ParallelExecutor($this->deployer->getConsole()->getUserDefinition());
         } else {
             $executor = new SeriesExecutor();
         }
     }
     try {
         $executor->run($tasks, $servers, $environments, $input, $output);
     } catch (\Exception $exception) {
         \Deployer\logger($exception->getMessage(), Logger::ERROR);
         // Check if we have tasks to execute on failure.
         if ($this->deployer['onFailure']->has($this->getName())) {
             $taskName = $this->deployer['onFailure']->get($this->getName());
             $tasks = $this->deployer->getScriptManager()->getTasks($taskName, $stage);
             $executor->run($tasks, $servers, $environments, $input, $output);
         }
         throw $exception;
     }
     if (Deployer::hasDefault('terminate_message')) {
         $output->writeln(Deployer::getDefault('terminate_message'));
     }
 }
All Usage Examples Of Deployer\Deployer::getDefault