Grabs a backup from Pantheon.

@param $env
The environemnt to get the backup from.

@return bool
True if the backup was downloaded.
329730
private function downloadPantheonBackup($env) {
    $project_properties = $this->getProjectProperties();
    $terminus_site_env  = $this->getPantheonSiteEnv($env);

    $terminus_url_request = $this->taskExec('terminus backup:get ' . $terminus_site_env . ' --element="db"')
      ->dir($project_properties['web_root'])
      ->interactive(false)
      ->run();

    if ($terminus_url_request->wasSuccessful()) {
      $terminus_url = $terminus_url_request->getMessage();
    }
    else {
      $this->yell('Failed to find a recent backup for the ' . $terminus_site_env . ' site. Does one exist?');
      return FALSE;
    }

    $wget_database = $this->taskExec('wget -O vendor/database.sql.gz "' . trim($terminus_url) . '"')->run();

    if (!$wget_database->wasSuccessful()) {
      $this->yell('Remote database sync failed.');
      return FALSE;
    }

    return TRUE;
  }
639345
public static function loadPackages($env = 'dev', CoreConsole $console = null)
    {
        $console = $console ?: Ioc::getApplication();

        return (array) (new Structure())
            ->loadFile($console->get('path.etc') . '/app/console.php', 'php')
            ->loadFile($console->get('path.etc') . '/app/' . $env . '.php', 'php')
            ->get('packages');
    }
581427
public static function getEvnironment($env)
    {
        // 获得全部环境描述
        $allEnv = static::environmentName();

        if ( $allEnv && array_key_exists($env, $allEnv)) {
            return $allEnv[$env];
        }

        // 否则返回第一个
        return array_pop($allEnv);
    }
338475
private function Skip($path, $env){

		$path = Less_Parser::AbsPath($path, true);

		if( $path && Less_Parser::FileParsed($path) ){

			if( isset($this->currentFileInfo['reference']) ){
				return true;
			}

			return !isset($this->options['multiple']) && !$env->importMultiple;
		}

	}
1374393
protected function getSearchDirs(/*# string */ $env)/*# : array */
    {
        if (!isset($this->sub_dirs[$env])) {
            $this->sub_dirs[$env] = $this->buildSearchDirs($env);
        }
        return $this->sub_dirs[$env];
    }
141476
public static function loadEnvironment($env = null)
    {
        $env = $env ? $env : static::$env;

        foreach((array) static::$loadedPaths as $path){
            if(is_dir($path.DS.$env)){
                self::load($path.DS.$env);
            }
        }
    }
725738
public static function getFileEnv(string $env):string
    {
        $env = strtolower($env);
        if (in_array($env, array("dev", "prod"))) {
            return (self::$env_file);
        } else {
            throw new \Exception("Environment Error : Environment $env doesn't exist");
        }
    }
362431
public static function getEnv($key)
    {
        switch (true) {
            case array_key_exists($key, $_ENV):
                return $_ENV[$key];
            case array_key_exists($key, $_SERVER);
                return $_SERVER[$key];
            default:
                return getenv($key);
        }
    }
78581
public function get($key, $env = NULL)
    {
        if (!$env) {
            $env = self::$current_env;
        }

        return isset(self::$params[$env][$key]) ? self::$params[$env][$key] : NULL;
    }
460751
private function deleteCache(string $env)
    {
        Output::displayAsSuccess("Hey, I delete cache from $env environment ", "none");
        $this->callDelCreaServer($env);
        if (in_array("--noexit", $this->options["options"])) {
            Output::displayAsEndSuccess("Cache delete for $env environment is successfull.", "none");
        } else {
            Output::displayAsNormal("Cache delete for $env environment is successfull.");
        }
    }
340484
public function updateActivity(string $env):Renderer
    {
        $allowed     = $this->get("request")->get("allowed");
        $denied     = $this->get("request")->get("denied");

        if (!in_array($env, array("dev", "prod"))) {
            throw new Server500(new \ArrayObject(array("explain" => "Undefined environment $env", "solution" =>
                "Environment must be [dev or prod]")));
        }

        if (trim($allowed) == "" || trim($denied) == "") {
            return ((new Renderer())->jsonRenderer(array("code" => 500, "msg" => "Error on hosts parameters")));
        }


        $allowed = (object)(explode(";", $allowed));
        $denied = (object)(explode(";", $denied));

        $a = new \stdClass();
        $a->allowed = $allowed;
        $a->denied = $denied;

        JL::put(
            FEnv::get("framework.config").'hosts/hosts.'.$env.'.json',
            json_encode($a, JSON_PRETTY_PRINT)
        );

        return ((new Renderer())->jsonRenderer(array("code" => 200, "msg" => "OK")));
    }
202572
protected function getPantheonSiteEnv($env = '') {
    $site = getenv('TERMINUS_SITE');

    if (!$env) {
      $env = getenv('TERMINUS_ENV');
    }

    return join('.', [$site, $env]);
  }
539269
public function setEnv($env = null)
    {
        if (in_array($env, \WebServCo\Framework\Environment::getOptions())) {
            $this->env = $env;
        } else {
            $this->env = \WebServCo\Framework\Environment::ENV_DEV;
        }

        return true;
    }
385602
public function getStatus($env = null)
    {
        $command = ['status'];
        if ($env ?: $this->hasOption('environment')) {
            $command += ['-e' => $env ?: $this->getOption('environment')];
        }
        if ($this->hasOption('configuration')) {
            $command += ['-c' => $this->getOption('configuration')];
        }
        if ($this->hasOption('parser')) {
            $command += ['-p' => $this->getOption('parser')];
        }

        return $this->executeRun($command);
    }
514667
public function getPoFilePath($env = null)
    {
        $localeDir = Strata::getLocalePath();

        if (!is_null($env)) {
            return $localeDir . $this->getCode() . '-' . $env . '.po';
        }

        return $localeDir . $this->getCode() . '.po';
    }
1247502
private function callDelCreaServer(string $env)
    {
        Server::delete(FEnvFcm::get("framework.cache").$env, 'directory');
        Server::create(FEnvFcm::get("framework.cache").$env, 'directory');
    }
1258255
public function getEnv ($key, $default = false) 
    {
        return isset($this->env[$key]) ? $this->env[$key] : $default; 
    }