Pantheon\Terminus\Commands\Backup\GetCommand::getBackup PHP Метод

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

Fetch the download URL for a specific backup or latest backup
public getBackup ( string $site_env, array $options = ['file' => null, 'element' => null] )
$site_env string Site & environment to deploy to, in the form `site-name.env`.
$options array
    public function getBackup($site_env, array $options = ['file' => null, 'element' => null])
    {
        list($site, $env) = $this->getSiteEnv($site_env);
        if (isset($options['file']) && !is_null($file_name = $options['file'])) {
            $backup = $env->getBackups()->getBackupByFileName($file_name);
        } else {
            $element = $options['element'] == 'db' ? 'database' : $options['element'];
            $backups = $env->getBackups()->getFinishedBackups($element);
            if (empty($backups)) {
                throw new TerminusNotFoundException('No backups available. Create one with `terminus backup:create {site}.{env}`', ['site' => $site->get('name'), 'env' => $env->id]);
            }
            $backup = array_shift($backups);
        }
        return $backup->getUrl();
    }
GetCommand