@param Environment $env
@param mixed       $context

@return bool|null|string
976383
public function dump(Environment $env, $context)
    {
        if (!$this->isEnabled($env)) {
            return null;
        }

        if (func_num_args() === 2) {
            $vars = [];
            foreach ($context as $key => $value) {
                if (!$value instanceof Template) {
                    $vars[$key] = $value;
                }
            }

            $vars = [$vars];
        } else {
            $vars = func_get_args();
            unset($vars[0], $vars[1]);
        }

        $output = fopen('php://memory', 'r+b');
        $this->dumper->setCharset($env->getCharset());

        foreach ($vars as $value) {
            $this->dumper->dump($this->cloner->cloneVar($value), $output);
        }

        return stream_get_contents($output, -1, 0);
    }
203507
public function getEnvBaseUrl($env)
    {
        switch ($env) {
            case self::ENV_PROD:
                return self::BASE_URL_PROD;
            case self::ENV_STAGE:
                return self::BASE_URL_STAGE;
            case self::ENV_MOCK:
                return null;
        }
    }
1218943
def _with_context(self, *args, **kwargs):
        """"""
        context = dict(args[0] if args else self.env.context, **kwargs)
        return self.with_env(self.env(context=context))
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);
            }
        }
    }
1050934
public function evaluate(EnvironmentInterface $env)
    {
        $qb = $env->queryBuilder;
        
        $value = $env->newParamName();

        $joins = $qb->getDqlPart('join');
        if (!isset($joins[$this->relation])) {
            $qb->leftJoin('a.'.$this->relation, $this->relation);
        }

        switch ($this->operator) {
            case 'equals':
                $qb->andWhere($this->relation.'.'.$this->attribute.' = :'.$value);
                $qb->setParameter($value, $this->getRight()->getValue());
                break;
            case 'notequals':
                $qb->andWhere($this->relation.'.'.$this->attribute.' <> :'.$value);
                $qb->setParameter($value, $this->getRight()->getValue());
                break;
            case 'contains':
                $qb->andWhere($this->relation.'.'.$this->attribute.' LIKE :'.$value);
                $qb->setParameter($value, '%'. $this->getRight()->getValue().'%');
                break;
            case 'greaterthan':
                $qb->andWhere($this->relation.'.'.$this->attribute.' > :'.$value);
                $qb->setParameter($value, $this->getRight()->getValue());
                break;
            case 'lessthan':
                $qb->andWhere($this->relation.'.'.$this->attribute.' < :'.$value);
                $qb->setParameter($value, $this->getRight()->getValue());
                break;
        }
    }
15861
public function getCoreErrors($env = null)
    {
        $env = $env ?: $this->running_env;
        return isset($this->errors[$env]) ? $this->errors[$env] : 0;
    }
909413
protected function updateEnvironmentFile($env = null)
    {
        if ($env === null) {
            $env = $this->generateEnv();
        }

        if ($env !== null) {
            // Store the new .env file values
            if (file_put_contents($this->laravel->environmentFilePath(), $env)) {
                return true;
            }

            // Attempt to store settings in a separate file so the user doesn't have to repeat
            Storage::put('temp.env', $env);
        }

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

        return $this['env'] = (new EnvironmentDetector())->detect($envs, $args);
    }
692351
public function renderBlock(Twig_Environment $env, $template, $block, $context)
    {
        $template = $env->loadTemplate($template);
        $context = $env->mergeGlobals($context);

        return $template->renderBlock($block, $context);
    }
1111458
public function getlogActivity(string $env):Renderer
    {
        if (!in_array($env, array("dev", "prod"))) {
            throw new Server500(new \ArrayObject(array("explain" => "Bad environment name $env",
                "solution" => "Environment must be 'dev' or 'prod' ")));
        }
        $last = array_values((AbstractServer::getLogs($env)));
        $lastn = array();
        $request = $this->get('request');
        $loglastpos =  $request->get('pos');
        $orderby = 29;
        if ($loglastpos == null) {
            return ((new Renderer())->jsonRenderer(array("code" => 500, "results" => "Cannot get the last position")));
        }
        $loglastpos = (int)$loglastpos;
        $max = $loglastpos + $orderby;
        for ($i = $loglastpos; $i <= $max; $i++) {
            if (!isset($last[$i])) {
                continue;
            }
            $one = $last[$i];
            $last["env"] = strtoupper($env);
            $last[$i]['time'] = strtotime($last[$i]['time']);
            $last[$i]['log_url'] = $this->generateRoute(
                "iumio_manager_logs_manager_get_one",
                array("uidie" => $one['uidie'], "env" => $env)
            );
            array_push($lastn, $last[$i]);
        }
        return ((new Renderer())->jsonRenderer(array("code" => 200, "results" => $lastn)));
    }
636202
public function is(string $env): bool
    {
        return $this->env === $env || str_starts_with($this->env, "$env.");
    }
1168767
public function dumpBacktrace(Environment $env, $context, $depth)
    {
        if (!$this->isEnabled($env)) {
            return null;
        }

        return $this->dump($env, $context, debug_backtrace(DEBUG_BACKTRACE_PROVIDE_OBJECT, $depth));
    }
577962
protected function has($name, Environment $env = null)
    {
        return $this->get($name, false, $env) !== null;
    }
496800
public function env(string $key)
    {
        $result = null;
        $break  = false;
        $keys   = explode('.', $key);
        $env    = $this->config->env;
        foreach ($keys as $key) {
            if (isset($env[$key])) {
                $env = $env[$key];
            } else {
                $break = true;
                break;
            }
        }
        if (!$break) {
            $result = $env;
        }
        return $result;
    }
27556
private function getCustomUrlsForEnvironment(Portal $portal, Environment $environment, Context $context)
    {
        $customUrls = [];
        foreach ($environment->getCustomUrls() as $customUrl) {
            $customUrl = $context->accept($customUrl);
            $customUrl['locales'] = $context->accept($portal->getLocalizations());
            $customUrls[] = $customUrl;
        }

        return $customUrls;
    }
1004116
public function env($key, $value = null)
    {
        if ($value !== null) {
            $_ENV[$key] = $value;
            putenv($key . '=' . $value);
        }

        if (isset($_ENV[$key])) {
            return $_ENV[$key];
        }
        return false === getenv($key) ? null : getenv($key);
    }
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();
            }
        }
    }