save one hosts configuration
@param string $env Environment name
@return Renderer
@throws
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")));
    }
524531
public function saveParams(array $parameters, $environment = "")
    {


        foreach ($parameters as $namespace => $section) {

            $_file = PATH_CONFIG . DS . strtolower($namespace) . ".ini";
            $_globals = "";

            foreach ($section as $key => $params) {

                if (!empty($params) && is_array($params)) {
                    // 2 loops to write `globals' on top, alternative: buffer
                    $_globals .= static::toIniString($params, $key);
                }
            }

            //Only save if the config file is not empty

            if (!empty($_globals)) {
                //check if we have a file;
                if (!$this->isFile($_file)) {
                    if (!$this->create($_file)) {
                        throw new \Exception("Could not create the configuration file {$_file}. Please check you have sufficient permission to do this");
                        return false;
                    }
                }

                //write to file
                if (!$this->write($_file, $_globals)) {
                    throw new \Exception(t("Could not write out to the configuration file"));
                    return false;
                }
            }
        }

        return true;
    }
507876
public function detectEnvironment($envs)
    {
        $args = isset($_SERVER['argv']) ? $_SERVER['argv'] : null;

        return $this['env'] = (new EnvironmentDetector())->detect($envs, $args);
    }
238081
public function putEnvs(array $env)
    {
        foreach ($env as $key => $value) {
            $this->putEnv($key, $value);
        }
    }
463133
static function getConfiguration(array $env): Configuration {
    $nodes = (int) ($env['CIRCLE_NODE_TOTAL'] ?? '0');
    return new Configuration([
      'commit_sha' => $env['CIRCLE_SHA1'] ?? null,
      'parallel' => $nodes > 1 ? 'true' : 'false',
      'service_branch' => $env['CIRCLE_BRANCH'] ?? null,
      'service_build_url' => $env['CIRCLE_BUILD_URL'] ?? null,
      'service_job_number' => $env['CIRCLE_NODE_INDEX'] ?? null,
      'service_name' => 'circleci',
      'service_number' => $env['CIRCLE_BUILD_NUM'] ?? null
    ]);
  }
309783
protected function getEnvConfig($name, $env = 'development')
    {
        $default = $this->getArrayDot($this->config, $name, null);
        $env     = $this->getArrayDot($this->config, "env.{$env}.{$name}", null);

        // get merged subtree
        if (is_array($default) && is_array($env)) {
            return array_replace_recursive($default, $env);
        }

        // no default => get env value
        if (!is_null($env)) {
            return $env;
        }

        return $default;
    }
1369028
public static function setEnv($value) {
    self::$env = $value;
    if ($value == "production") {
      self::$authservicesUrl = "https://authservices.satispay.com";
    } else {
      self::$authservicesUrl = "https://".$value.".authservices.satispay.com";
    }
  }
202572
protected function getPantheonSiteEnv($env = '') {
    $site = getenv('TERMINUS_SITE');

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

    return join('.', [$site, $env]);
  }
212513
public function renderBody(&$env, $exception)
    {
        $title   = 'Slimore Application ErrorException';
        $code    = $exception->getCode();
        $message = $exception->getMessage();
        $file    = $exception->getFile();
        $line    = $exception->getLine();
        $type    = get_class($exception);
        $trace   = str_replace(array('#', "\n"), array('<div class="trace-line">#', '</div>'), $exception->getTraceAsString());

        $html = html($title, [
            '<meta http-equiv="X-UA-Compatible" content="IE=edge" />',
            '<meta name="renderer" content="webkit" />',
            '<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />',
            style([
                '*{margin:0;padding:0;}',
                'html {font-size: 62.5%;}',
                'html, body {max-width: 100%;width: 100%;}',
                'body {font-size: 1.4rem;font-family: "Microsoft Yahei", Helvetica, Tahoma, STXihei, arial,verdana,sans-serif;background:#fff;color:#555;}',
                'img {border: none;}',
                'pre, pre code {font-family:Consolas, arial,verdana,sans-serif;}',
                '#layout {padding: 6rem;}',
                '#main {margin: 0 auto;line-height: 1.5;}',
                '#main > h1 {font-size: 10rem;margin-bottom: 1rem;}',
                '#main > h3 {margin-bottom: 2rem; font-size: 1.8rem;}',
                '#main > h4 {margin-bottom: 1rem; font-size: 1.8rem;}',
                '#main pre {margin: 1.5rem 0;white-space: pre-wrap;word-wrap: break-word;}',
                '#main > p {white-space: pre-wrap;word-wrap: break-word;line-height: 1.3;margin-bottom: 0.6rem;}',
                '#main > p > strong {width: 7rem;display:inline-block;}',
                '.logo {text-align: left;border-top:1px solid #eee;margin-top: 5rem;padding: 3rem 0 0;color: #ccc;}',
                '.logo > h1 {font-weight: normal;font-size: 5rem;}',
                '.logo img {margin-left: -2rem;}',
                '.trace-line {padding: 0.3rem 0.6rem;margin-left:-0.6rem;-webkit-transition: background-color 300ms ease-out;transition: background-color 300ms ease-out;}',
                '.trace-line:hover {background:#fffccc;}'
            ])
        ], [
            '<div id="layout">',
                '<div id="main">',
                    '<h1>:(</h1>',
                    '<h3>' . $type . '</h3>',
                    '<h4>Details ：</h4>',
                    '<p><strong>Type: </strong> ' . $type . '</p>',
                    '<p><strong>Message: </strong> ' . $message . '</p>',
                    '<p><strong>File: </strong> ' . $file . '</p>',
                    '<p><strong>Line: </strong> ' . $line . '</p>',
                    '<br/>',
                    '<h4>Trace：</h4>',
                    '<pre>' . $trace . '</pre>',
                    '<div class="logo">',
                        '<h1>Slimore</h1>',
                        '<p>The fully (H)MVC framework, based on the Slim PHP Framwork.</p>',
                    '</div>',
                '</div>',
            '</div>'
        ]);

        return $html;
    }
802100
private function setEnvironment($env) {
    if (isset($this->environments[$env])) {
      $this->loadEnvironment($env);
      return TRUE;
    }
    else {
      return FALSE;
    }
  }
176957
public static function enableComponents(string $env)
    {
        $base = realpath(__DIR__ . "/../../../../../../")."/";
        $f = json_decode(file_get_contents($base."elements/config_files/core/framework.config.json"));
        if (in_array($env, array("dev", "prod"))) {
            if ("dev" === $env) {
                TaskBar::switchStatus(((true  === $f->taskbar_dev)? "on" : "off"));
            } elseif ("prod" === $env) {
                TaskBar::switchStatus(((true  === $f->taskbar_prod)? "on" : "off"));
            }
            if (property_exists($f, "debug") &&
                property_exists($f->debug, $env) && true === $f->debug->$env) {
                Debug::enabled();
            } else {
                Debug::disabled();
            }
        }
    }
997899
public static function createFromEnvironment(\Slim\Environment $env) {
        if (isset($env['slim.files']) && is_array($env['slim.files'])) {
            return $env['slim.files'];
        } elseif (isset($_FILES)) {
            return static::parseUploadedFiles($_FILES);
        }

        return array();
    }
49510
protected function createDotenv($app)
    {
        return Dotenv::create(
            $app->environmentPath(),
            $app->environmentFile(),
            new DotenvFactory([new EnvConstAdapter, new ServerConstAdapter, new PutenvAdapter])
        );
    }
8191
public function saveConfig($group, $environment = '')
    {
        // Path do arquivo
        $path = config_path();

        // Itens
        $items = config($group, []);

        // Nome do arquivo
        $file = (! $environment || ($environment == 'production'))
            ? "{$path}/{$group}.php"
            : "{$path}/{$environment}/{$group}.php";

        // Salvar arquivo
        $code = '<?php' . "\r\n\r\n";
        $code .= 'return ' . var_export($items, true) . ';';
        $this->put($file, $code);
    }
1116096
public function onPeridotStart(Environment $env)
    {
        $definition = $env->getDefinition();
        $definition->option('concurrent', null, InputOption::VALUE_NONE, 'run specs concurrently');
        $definition->option('processes', 'p', InputOption::VALUE_REQUIRED, 'number of processes to use');
    }
635030
public static function setEnv(array $env = [])
    {
        self::$envIsSet = true;

        foreach ($env as $variable => $value) {
            self::setEnvironmentVariable($variable, $value);
        }
    }
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");
        }
    }