src/includes/classes/App.php
public function fillConfigReplacementCodes($value, array $___config = null)
    {
        if (is_array($value) || is_object($value)) {
            if (!isset($___config)) {
                $___config = &$value; // Reference.
            }
            foreach ($value as $_key => &$_value) {
                $_value = $this->fillConfigReplacementCodes($_value, $___config);
            } // unset($_key, $_value);
            return $value;
        }
        if ($value && is_string($value) && mb_strpos($value, '%%') !== false) {
            $value = str_replace(
                [
                    '%%app_class%%',
                    '%%app_namespace%%',
                    '%%app_namespace_sha1%%',

                    '%%app_file%%',
                    '%%app_dir%%',
                    '%%app_dir_basename%%',

                    '%%app_base_dir%%',
                    '%%app_base_dir_basename%%',

                    '%%ws_core_dir%%',

                    '%%home_dir%%',

                    '%%app_slug%%',
                    '%%app_var%%',
                ],
                [
                    $this->class,
                    $this->namespace,
                    $this->namespace_sha1,

                    $this->file,
                    $this->dir,
                    $this->dir_basename,

                    $this->base_dir,
                    $this->base_dir_basename,

                    $this->ws_core_dir,

                    (string) ($_SERVER['HOME'] ?? $_SERVER['WEBSHARK_HOME'] ?? ''),

                    !empty($___config['©brand']['©slug']) ? (string) $___config['©brand']['©slug'] : '',
                    !empty($___config['©brand']['©var']) ? (string) $___config['©brand']['©var'] : '',
                ],
                $value
            );
        }
        return $value;
    }
public function fillConfigReplacementCodes($value, array $___config = null)
    {
        if (is_array($value) || is_object($value)) {
            if (!isset($___config)) {
                $___config = &$value; // Reference.
            }
            foreach ($value as $_key => &$_value) {
                $_value = $this->fillConfigReplacementCodes($_value, $___config);
            } // unset($_key, $_value);
            return $value;
        }
        if ($value && is_string($value) && mb_strpos($value, '%%') !== false) {
            $value = str_replace(
                [
                    '%%app_class%%',
                    '%%app_namespace%%',
                    '%%app_namespace_sha1%%',

                    '%%app_file%%',
                    '%%app_dir%%',
                    '%%app_dir_basename%%',

                    '%%app_base_dir%%',
                    '%%app_base_dir_basename%%',

                    '%%ws_core_dir%%',

                    '%%home_dir%%',

                    '%%app_slug%%',
                    '%%app_var%%',
                ],
                [
                    $this->class,
                    $this->namespace,
                    $this->namespace_sha1,

                    $this->file,
                    $this->dir,
                    $this->dir_basename,

                    $this->base_dir,
                    $this->base_dir_basename,

                    $this->ws_core_dir,

                    (string) ($_SERVER['HOME'] ?? $_SERVER['WEBSHARK_HOME'] ?? ''),

                    !empty($___config['©brand']['©slug']) ? (string) $___config['©brand']['©slug'] : '',
                    !empty($___config['©brand']['©var']) ? (string) $___config['©brand']['©var'] : '',
                ],
                $value
            );
        }
        return $value;
    }
Fill replacement codes.

@since 150424 Config utils.

@param mixed      $value     Input value.
@param array|null $___config Internal use only.

@return mixed string|array|object Output value.

@internal This method must be capable of running w/o a fully-constructed app.
Only dependency is the initial reflection-based properties.