hackphp / config
HackPHP Config Access.
Installs: 13
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/hackphp/config
Requires (Dev)
- phpunit/phpunit: 9.5.x-dev
README
HackPHP Config Access.
Usage
composer require hackphp/config
use Hackphp\Config\Config; use Hackphp\Config\Parsers\ArrayParser; $config = new Config([ "app" => [ "name" => "HackPHP" ], "server" => [ "host" => "127.0.0.1", "port" => 8000 ], ]); $configRootDir = __DIR__ . "/config"; $config->addParser(new ArrayParser($configRootDir)); $config->load(); echo $config->get("server.host"); // output: 127.0.0.1 echo $config->get("file.key", "default value"); // output: default value