Platformsh\Cli\SelfUpdate\SelfUpdater::setTimeout PHP Method

setTimeout() public method

Set the timeout for the version check.
public setTimeout ( integer $timeout )
$timeout integer The timeout in seconds.
    public function setTimeout($timeout)
    {
        $this->timeout = $timeout;
    }

Usage Example

 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $manifestUrl = $input->getOption('manifest') ?: self::$config->get('application.manifest_url');
     $currentVersion = $input->getOption('current-version') ?: self::$config->get('application.version');
     $cliUpdater = new SelfUpdater($input, $output, self::$config, $this->getHelper('question'));
     $cliUpdater->setAllowMajor(!$input->getOption('no-major'));
     $cliUpdater->setAllowUnstable((bool) $input->getOption('unstable'));
     $cliUpdater->setTimeout($input->getOption('timeout'));
     $result = $cliUpdater->update($manifestUrl, $currentVersion);
     if ($result === false) {
         return 1;
     }
     // Phar cannot load more classes after the update has occurred. So to
     // avoid errors from classes loaded after this (e.g.
     // ConsoleTerminateEvent), we exit directly now.
     exit(0);
 }
All Usage Examples Of Platformsh\Cli\SelfUpdate\SelfUpdater::setTimeout