ZF2rapid\Generator\ConfigArrayGenerator::resetConfigDirCompilation PHP Method

resetConfigDirCompilation() protected method

protected resetConfigDirCompilation ( array $configData, integer $level = 1 ) : array
$configData array
$level integer
return array
    protected function resetConfigDirCompilation(array $configData, $level = 1)
    {
        // loop config data
        foreach ($configData as $key => $value) {
            // ignore configuration keys on first level
            if ($level == 1 && in_array($key, $this->ignoreKeys)) {
                continue;
            }
            // check for array
            if (is_array($value)) {
                $configData[$key] = $this->resetConfigDirCompilation($value, $level + 1);
            } else {
                if (strpos($value, $this->params->moduleConfigDir) === 0) {
                    $configData[$key] = '__DIR__ . \'' . str_replace($this->params->moduleConfigDir, '', $value) . '\'';
                } elseif (strpos($value, $this->params->moduleDir) === 0) {
                    $configData[$key] = $this->params->moduleRootConstant . ' . \'' . str_replace($this->params->moduleDir, '', $value) . '\'';
                } elseif (strpos($value, $this->params->workingPath) === 0) {
                    $configData[$key] = $this->params->applicationRootConstant . ' . \'' . str_replace($this->params->workingPath, '', $value) . '\'';
                }
            }
        }
        return $configData;
    }