Pantheon\Terminus\Commands\Upstream\Updates\ApplyCommand::applyUpstreamUpdates PHP Метод

applyUpstreamUpdates() публичный Метод

Apply the available upstream updates to the given site's environment
public applyUpstreamUpdates ( string $site_env, $options = ['updatedb' => false, 'accept-upstream' => false] )
$site_env string Site & environment to which to apply updates
    public function applyUpstreamUpdates($site_env, $options = ['updatedb' => false, 'accept-upstream' => false])
    {
        list($site, $env) = $this->getSiteEnv($site_env, 'dev');
        if (in_array($env->id, ['test', 'live'])) {
            throw new TerminusException('Upstream updates cannot be applied to the {env} environment', ['env' => $env->id]);
        }
        $updates = $this->getUpstreamUpdatesLog($site);
        $count = count($updates);
        if ($count) {
            $this->log()->notice('Applying {count} upstream update(s) to the {env} environment of {site_id}...', ['count' => $count, 'env' => $env->id, 'site_id' => $site->get('name')]);
            $workflow = $env->applyUpstreamUpdates(isset($options['updatedb']) ? $options['updatedb'] : false, isset($options['accept-upstream']) ? $options['accept-upstream'] : false);
            while (!$workflow->checkProgress()) {
                // @TODO: Add Symfony progress bar to indicate that something is happening.
            }
            $this->log()->notice($workflow->getMessage());
        } else {
            $this->log()->warning('There are no available updates for this site.');
        }
    }