Get or set the default stack that Sticky Context should use.

@param string $stackName
@return string
19411
public static function defaultStack(string $stackName = null)
    {
        if ($stackName) {
            // If the default stack has already been written to, we
            // will make sure to move the existing default stack
            // to the new stack name, as to not lose any data.
            if (static::hasStack(static::$defaultStack)) {
                static::$stacks[$stackName] = static::stack(static::$defaultStack);
                unset(static::$stacks[static::$defaultStack]);
            }

            static::$defaultStack = $stackName;
        }

        return static::$defaultStack;
    }
438222
public function getRequestHeader($headerName = null){
        return (is_null($headerName)) ? $this->currentRequest->getHeaders() : $this->currentRequest->getHeaderLine($headerName);
    }
426276
public function get($key = null, $default = null)
    {
        if ($key === null) {
            return $this->all();
        }

        return $this->getStackReference($this->storage, explode(self::SEPARATOR, $key), $default);
    }
97748
public static function getDefaultsFile($defaultsFolder = '')
    {
        if (!$defaultsFolder) {
            $defaultsFolder = FULCRUM_PLUGIN_DIR . 'config/' . static::$defaultsFolder;
        }

        if (!$defaultsFolder) {
            return '';
        }

        $defaultFile = static::$defaultsFile ?: self::getClassname() . '.php';

        return trailingslashit($defaultsFolder) . $defaultFile;
    }
1020589
public function loadStack($name)
    {
        $stacks = Configuration::get('template.stacks');

        if (! isset($stacks[$name])) {
            throw new RendererException("Stack '" . $name . "' not found!");
        }

        $this->render->replaceAll($stacks[$name]);

        return $this;
    }
68988
static function contextCache( $contextName )
    {
        $translationCache = eZTranslationCache::cacheTable();
        if ( isset( $translationCache[$contextName] ) )
        {
            return $translationCache[$contextName]['root'];
        }
        return null;
    }
244815
protected function getHook($hookName, $hookType)
    {
        $hook = HookQuery::create()
            ->filterByCode($hookName)
            ->filterByType($hookType)
            ->findOne();

        if (null === $hook) {
            $this->logAlertMessage(sprintf("Hook %s is unknown.", $hookName));

            return null;
        }

        if (! $hook->getActivate()) {
            $this->logAlertMessage(sprintf("Hook %s is not activated.", $hookName), true);
        }

        return $hook;
    }
221244
public function pop($name)
    {
        $stack = $this->getInstance($name);
        return $stack->isEmpty() ? false : $stack->pop();
    }
1221855
private static function lookupContentType($filename) {
    foreach ($_FILES as $file) {
      if ($file['tmp_name'] == $filename) {
        return $file['type'] ?: static::DEFAULT_CONTENT_TYPE;
      }
    }
    return static::DEFAULT_CONTENT_TYPE;
  }
719364
public function getPluginWrappersByPageContainerName($containerName)
    {
        // check cache
        if (!empty($this->wrappersSortedByPageContainer[$containerName])) {
            return $this->wrappersSortedByPageContainer[$containerName];
        }

        // if value was not in cache and cache is not empty, we dont have it, return null
        if (!empty($this->wrappersSortedByPageContainer)) {
            return null;
        }

        $this->wrappersSortedByPageContainer = $this->orderPluginWrappersByContainerName(
            $this->pluginWrappers->toArray()
        );

        if (empty($this->wrappersSortedByPageContainer[$containerName])) {
            return null;
        }

        return $this->wrappersSortedByPageContainer[$containerName];
    }
63190
public static function stack(string $stack)
    {
        if (! static::hasStack($stack)) {
            static::$stacks[$stack] = new StickyContextStack;
        }

        return static::$stacks[$stack];
    }
1250905
private static function _stack($matches = false)
    {
        static $safe_blocks = [];
        if ($matches !== false) {
            $key = '<' . count($safe_blocks) . '>';
            $safe_blocks[$key] = $matches[0];
            return $key;
        } else {
            $tmp = $safe_blocks;
            unset($safe_blocks);
            return $tmp;
        }
    }
1149365
public static TaintMethodConfig getDefaultConstructorConfig(int stackSize) {
        if (stackSize < 1) {
            throw new IllegalArgumentException("stack size less than 1");
        }
        TaintMethodConfig config = new TaintMethodConfig(false);
        config.outputTaint = new Taint(Taint.State.UNKNOWN);
        config.mutableStackIndices.add(stackSize - 1);
        config.mutableStackIndices.add(stackSize);
        return config;
    }
227761
protected function getHookList($scope, $hookName)
    {
        $key = $scope . '_' . $hookName;

        if (!isset($this->hookListHash[$key])) {
            $hookList = array();

            if (isset($this->data['Common'][$hookName])) {
                $hookList = $this->data['Common'][$hookName];
            }

            if (isset($this->data[$scope][$hookName])) {
                $hookList = array_merge($hookList, $this->data[$scope][$hookName]);
                usort($hookList, array($this, 'cmpHooks'));
            }

            $normalizedList = array();
            foreach ($hookList as $hookData) {
                $normalizedList[] = $hookData['className'];
            }

            $this->hookListHash[$key] = $normalizedList;
        }

        return $this->hookListHash[$key];
    }
576880
public function getStackFactory($profile=null) {
        $cachKey = ($profile ? $profile : '__empty__');
        if (!isset($this->stackFactories[$cachKey])) {
            $this->stackFactories[$cachKey] = new StackFactory($this->getCfnClient($profile));
        }
        return $this->stackFactories[$cachKey];
    }
92838
public function getHook(string $fn = null)
    {
        if ($fn == null) {
            return $this->hookMap;
        }
        if (isset($this->hookMap[$fn])) {
            return $this->hookMap[$fn];
        }
        return null;
    }
952630
public static function cfg($name = '@default', $default = '') {
        $app  = self::$app;
        $keys = null;
        if ($name != null) {
            $names = explode('@', $name);
            if ($names[0]) {
                $name = $names[0];
                $keys = explode('.', $name);
                $name = array_shift($keys);
            } else {
                $name = null;
            }
            if (isset($names[1]) && $names[1]) {
                $config = $names[1];
            } else {
                $config = 'default';
            }
        } else {
            $config = 'default';
        }
        if (isset ($app->configs [ $config ])) {
            $confObj = $app->configs [ $config ];
        } else {
            $confObj = $app->configLoader->loadConfig($config);
            if (!$confObj) {
                $confObj = new Configuration ($config);
            }
            $app->configs [ $config ] = $confObj;
        }

        if ($name == null) {
            return $confObj;
        } else {
            $values = $confObj->get($name, $default);
            if ($keys && is_array($values)) {
                foreach ($keys as $ky) {
                    if (isset($values[ $ky ])) {
                        $values = $values[ $ky ];
                    }
                }
            }

            return $values;
        }
    }