Get the configuration directory

@return string
@throws \RuntimeException
975242
protected function getConfigurationDirectory()
    {
        $reflector = new \ReflectionClass($this);
        $fileName = $reflector->getFileName();

        if (!is_dir($directory = dirname($fileName) . $this->configDirectory)) {
            throw new \RuntimeException(sprintf('The configuration directory "%s" does not exists.', $directory));
        }

        return $directory;
    }
979202
public function getRuntimeDir()
    {
        if (!isset($this->runtimeDir)) {
            $this->runtimeDir = ConfigPaths::getRuntimeDir();
        }

        if (!\is_dir($this->runtimeDir)) {
            \mkdir($this->runtimeDir, 0700, true);
        }

        return $this->runtimeDir;
    }
1112822
protected function getHomeDirectory()
    {
        $home = getenv('HOME');
        if (!$home && ($userProfile = getenv('USERPROFILE'))) {
            $home = $userProfile;
        }
        if (!$home || !is_dir($home)) {
            throw new \RuntimeException('Could not determine home directory');
        }

        return $home;
    }
463972
protected function getConfigFile()
    {
        $inputPath = $this->input->getArgument('path');

        $dir = './';

        if (1 == count($inputPath) && $first = reset($inputPath)) {
            $dir = is_dir($first) ? $first : dirname($first);
        }

        $filename = rtrim($dir, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR.'.phplint.yml';

        return realpath($filename);
    }
1081409
public function getThemesConfig()
    {
        if (empty($this->config['Rcm'])
            || empty($this->config['Rcm']['themes'])
        ) {
            throw new RuntimeException(
                'No Themes found defined in configuration.  Please report the issue
                 with the themes author.'
            );
        }

        return $this->config['Rcm']['themes'];
    }
1200978
public function getConfiguration()
    {
        $configurationFiles = $this->locator->locate('config.yml', null, false);
        $configurations     = [];

        foreach ($configurationFiles as $path) {
            $configurations[] = $this->loader->load($path);
        }

        return $this->processor->processConfiguration($this->configuration, $configurations);
    }
1190676
public function get()
    {
        if (null === $this->path) {
            throw new \RuntimeException('Path not set.');
        }
        $path = $this->path;
        for ($i = 0, $mx = substr_count($path, DIRECTORY_SEPARATOR); $i <= $mx; $i++) {
            if (is_dir($path . DIRECTORY_SEPARATOR . '.phrozn')) {
                return realpath($path . DIRECTORY_SEPARATOR . '.phrozn');
            }
            $path =  dirname($path);
        }
        return '';
    }
777629
public function getSharedDirectory()
    {
        $result = self::DEFAULT_SHARED_DIR;
        if ($this->hasOption('sharedDirectory') && !empty($this->getOption('sharedDirectory'))) {
            $sharedPath = $this->getOption('sharedDirectory');
            if (preg_match('/(^|\/)\.\.(\/|$)/', $sharedPath)) {
                throw new InvalidConfigurationException(
                    sprintf(
                        'Relative constructs as "../" are not allowed in option "sharedDirectory". Given option: "%s"',
                        $sharedPath
                    ),
                    1490107183141
                );
            }
            $result = rtrim($sharedPath, '/');
        }
        return $result;
    }
255492
public function getBaseDir(): string
    {
        // Four levels back.
        $ds = DIRECTORY_SEPARATOR;
        $dir = __DIR__ . "$ds..$ds..$ds..$ds..$ds";
        $base_dir = realpath($dir);
        if (!$base_dir) {
            $message = 'Cannot resolve project base directory.';
            throw new Exception\RuntimeException($message);
        }

        return $base_dir;
    }
194696
public function getConfigDirectory()
    {
        $directory = $this->baseDir.DIRECTORY_SEPARATOR.BundleInterface::CONFIG_DIRECTORY_NAME;
        if (false === is_dir($directory)) {
            $directory = $this->baseDir.DIRECTORY_SEPARATOR.BundleInterface::OLD_CONFIG_DIRECTORY_NAME;
        }

        return $directory;
    }
790096
private function config()
    {
        if (realpath($this->configPath) !== false) {
            $json = file_get_contents($this->configPath);
            $this->config = json_decode($json);
            $this->config->rootDir = $this->rootDir;
        } else {
            throw new \RuntimeException('Framework not initialized yet. Consider running composer install');
        }
    }
1258971
public function getConfig()
    {
        if ($this->configuration) {
            return $this->configuration;
        }

        $dir = APP_DIR . DS . 'Resource' . DS . 'migrations';
        $migrationTable = 'phinxlog';

        if ($bundleName = $this->input->getOption('bundle')) {
            $dir = Bundles::getPath($bundleName) . DS . 'Resource' . DS . 'migrations';
        }

        return $this->configuration = new Config([
            'paths' => [
                'migrations' => $dir
            ],
            'environments' => [
                'default_migration_table' => $migrationTable,
                'default_database' => getenv('RAD_ENVIRONMENT'),
                getenv('RAD_ENVIRONMENT') => \Rad\Configure\Config::get('migrations.environments.' . getenv('RAD_ENVIRONMENT'))
            ]
        ]);
    }
913647
public function getConfiguration()
    {
        if (is_null($this->_configuration)) {
            $config = $this->getContainer()->get('configuration');
            $this->_configuration = $config;
        }
        return $this->_configuration;
    }
84790
private function getSettings()
    {
        $rootPath = $this->complement['path']['root'];
        $configFile = $rootPath . 'config/';

        if (is_dir($configFile) && $handle = scandir($configFile)) {
            $files = array_slice($handle, 2);

            foreach ($files as $file) {
                $content = require $configFile . $file;
                $merge = array_merge($this->complement, $content);
                $this->complement = $merge;
            }
        }

        $this->complement['path']['root'] = $rootPath;
        $this->complement['path']['config'] = $configFile;
    }
1009151
public function getConfiguration()
    {
        if (is_null($this->_configuration)) {
            $this->_configuration = Configuration::get('config');
        }
        return $this->_configuration;
    }
932099
protected function getClientDirectoryName() {
    return strtolower($this->getEnvironment()->getClient()) . '-' . strtolower($this->getEnvironment()->getName()) . '-' . $this->getConfiguration()->getBranch();
  }
295795
public function getDirectory()
    {
        $dir = clone $this;
        $dir->path = str_replace(DIRECTORY_SEPARATOR, '/', dirname($this->path));
        if (!$dir->path) $dir->path = '/';

        return $dir;
    }