@param \Twig_Environment $env
@param string            $name

@return ReadNodeInterface|null
488852
public function getSpecialPage(\Twig_Environment $env, $name)
    {
        if (empty($this->specialPages)) {
            $this->loadSpecialPages();
        }

        /** @var ReadNodeInterface $specialPage */
        foreach ($this->specialPages as $specialPage) {
            if ($name === $specialPage->getSpecialPageName()) {
                return $specialPage;
            }
        }

        return null;
    }
1195494
public function renderMenu(\Twig_Environment $environment, $name, array $options = array())
    {
        $menu = $this->loadMenu($name);
        $builder = $menu->getBuilder();

        return $environment->render($builder->getTemplateName(), array('menu' => $menu));
    }
695254
public function renderPageTemplate(\Twig_Environment $env, array $twigContext, HasPageTemplateInterface $page, array $parameters = array())
    {
        $pageTemplates = $this->templateConfiguration->getPageTemplates($page);

        $pageTemplate = $pageTemplates[$this->getPageTemplate($page)];

        $template = $env->loadTemplate($pageTemplate->getTemplate());

        return $template->render(array_merge($parameters, $twigContext));
    }
869281
public static function get($name, $default = null)
    {
        $result = getenv(ENV_PREFIX . strtoupper(str_replace('.', '_', $name)));

        if (false !== $result) {
            if ('false' === $result) {
                $result = false;
            } elseif ('true' === $result) {
                $result = true;
            }

            return $result;
        }

        return $default;
    }
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;
        }
    }
814681
protected function path( $name, $env = false )
	{
		$conf = CCPath::get( $name, \CCDIR_CONFIG, static::EXT );
		
		if ( !$env )
		{
			return $conf;
		}
		
		$env_conf = CCPath::get( $name, \CCDIR_CONFIG.ClanCats::environment().'/', static::EXT );
		
		if ( file_exists( $env_conf ) ) 
		{
			return $env_conf;
		}
		
		return $conf;
	}
288086
public static function env(String $name = NULL, $value = NULL)
    {
        return self::_method($name, $value, $_ENV, __FUNCTION__);
    }
416971
public function env($name)
    {
        return isset($this->_envs[$name])
            ? $this->_envs[$name]
            : null;
    }
1113742
protected function getEnv($name)
    {
        $prefix = isset(self::$config['application']['env_prefix']) ? self::$config['application']['env_prefix'] : '';
        if (array_key_exists($prefix . $name, $this->env)) {
            return $this->env[$prefix . $name];
        }

        return getenv($prefix . $name);
    }
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;
    }
653802
public function getVariable($name)
    {
        $encodedValue = $this->getEnvironmentVariable($name);

        if ($encodedValue === null) {
            return null;
        }

        return $this->decode($encodedValue);
    }
641901
protected function enterOptimizeFor(Twig_NodeInterface $node, Twig_Environment $env)
    {
        if ($node instanceof Twig_Node_For) {
            // disable the loop variable by default
            $node->setAttribute('with_loop', false);
            array_unshift($this->loops, $node);
        } elseif (!$this->loops) {
            // we are outside a loop
            return;
        }

        // when do we need to add the loop variable back?

        // the loop variable is referenced for the current loop
        elseif ($node instanceof Twig_Node_Expression_Name && 'loop' === $node->getAttribute('name')) {
            $this->addLoopToCurrent();
        }

        // block reference
        elseif ($node instanceof Twig_Node_BlockReference || $node instanceof Twig_Node_Expression_BlockReference) {
            $this->addLoopToCurrent();
        }

        // include without the only attribute
        elseif ($node instanceof Twig_Node_Include && !$node->getAttribute('only')) {
            $this->addLoopToAll();
        }

        // the loop variable is referenced via an attribute
        elseif ($node instanceof Twig_Node_Expression_GetAttr
            && (!$node->getNode('attribute') instanceof Twig_Node_Expression_Constant
                || 'parent' === $node->getNode('attribute')->getAttribute('value')
               )
            && (true === $this->loops[0]->getAttribute('with_loop')
                || ($node->getNode('node') instanceof Twig_Node_Expression_Name
                    && 'loop' === $node->getNode('node')->getAttribute('name')
                   )
               )
        ) {
            $this->addLoopToAll();
        }
    }
581539
private function compactEnv(Environment $env)
    {
        for ($envs = []; $env; $env = $env->parent) {
            $envs[] = $env;
        }

        return $envs;
    }
692148
public function getTwig(): \Twig_Environment
    {
        if (is_null($this->twig)) {
            // Init Twig
            $this->twigLoader = new \Twig_Loader_Filesystem();
            $this->twig = new \Twig_Environment($this->twigLoader);
        }

        return $this->twig;
    }
14183
public static function getVar(string $name, $defaultValue = null)
    {
        $value = getenv($name);
        return $value !== false ? $value : $defaultValue;
    }
1172000
public static function getEnv($name)
    {
        switch (true) {
            case  is_array(static::$env) && array_key_exists($name, static::$env):
                return static::$env[$name];
            case  is_array($_ENV) && array_key_exists($name, $_ENV):
                return $_ENV[$name];
            case  is_array($_SERVER) && array_key_exists($name, $_SERVER):
                return $_SERVER[$name];
            default:
                return getenv($name);
        }
    }
767985
public function getEnvironment($name)
    {
        return isset($this->environments[$name]) ? $this->environments[$name] : null;
    }