public function getConfigFile($name, $required = true, $directory = 'config')
    {
        $sep = DIRECTORY_SEPARATOR;
        $path = rtrim($this->directory, $sep) . $sep . trim($directory, $sep) . $sep . $name;
        if (!file_exists($path)) {
            if ($required) {
                throw new \Exception("Config file '$path' does not exist");
            } else {
                return null;
            }
        }
        return $path;
    }