Pantheon\Terminus\Commands\Env\WakeCommand::wake PHP Method

wake() public method

Ping a site to ensure it responds
public wake ( string $site_env )
$site_env string The site and environment to wake
    public function wake($site_env)
    {
        list(, $env) = $this->getSiteEnv($site_env);
        $data = $env->wake();
        // @TODO: Move the exceptions up the chain to the `wake` function. (One env is ported over).
        if (empty($data['success'])) {
            throw new TerminusException('Could not reach {target}', $data);
        }
        if (empty($data['styx'])) {
            throw new TerminusException('Pantheon headers missing, which is not quite right.');
        }
        $this->log()->notice('OK >> {target} responded in {time}', $data);
    }
WakeCommand