Phrozn\Config::__construct PHP Method

__construct() public method

Setup config aggregator
public __construct ( string $path )
$path string Path to config folder
    public function __construct($path)
    {
        if (is_file($path)) {
            $this->configs[basename($path, '.yml')] = Yaml::parse($path);
        } else {
            $dir = new \DirectoryIterator($path);
            foreach ($dir as $item) {
                if ($item->isFile()) {
                    if (substr($item->getBasename(), -3) === 'yml') {
                        $this->configs[$item->getBasename('.yml')] = Yaml::parse($item->getRealPath());
                    }
                }
            }
            $this->updatePaths();
            // make sure that config.yml paths are absolute
        }
    }