diff --git a/composer.json b/composer.json index ff22e09..63ad02f 100644 --- a/composer.json +++ b/composer.json @@ -19,6 +19,7 @@ "slim/slim": "^4.11", "slim/psr7": "^1.6", "php-di/php-di": "^6.4", - "slim/twig-view": "^3.3" + "slim/twig-view": "^3.3", + "hassankhan/config": "^3.0" } } diff --git a/composer.lock b/composer.lock index 1a46794..6677984 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "f0f0ba9a399b27b278723cab83da45ef", + "content-hash": "e1122a37fac48e878d4d709af32db520", "packages": [ { "name": "fig/http-message-util", @@ -62,6 +62,69 @@ }, "time": "2020-11-24T22:02:12+00:00" }, + { + "name": "hassankhan/config", + "version": "3.0.1", + "source": { + "type": "git", + "url": "https://github.com/hassankhan/config.git", + "reference": "82421bb17d21cb0c10b98b89ea54aa4027adfc3f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/hassankhan/config/zipball/82421bb17d21cb0c10b98b89ea54aa4027adfc3f", + "reference": "82421bb17d21cb0c10b98b89ea54aa4027adfc3f", + "shasum": "" + }, + "require": { + "php": ">=5.5.9" + }, + "require-dev": { + "phpunit/phpunit": "~4.8.36 || ~5.7 || ~6.5 || ~7.5 || ~8.5", + "scrutinizer/ocular": "~1.1", + "squizlabs/php_codesniffer": "~2.2", + "symfony/yaml": "~3.4", + "yoast/phpunit-polyfills": "^1.0" + }, + "suggest": { + "symfony/yaml": "~3.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "Noodlehaus\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Hassan Khan", + "homepage": "http://hassankhan.me/", + "role": "Developer" + } + ], + "description": "Lightweight configuration file loader that supports PHP, INI, XML, JSON, and YAML files", + "homepage": "http://hassankhan.me/config/", + "keywords": [ + "config", + "configuration", + "ini", + "json", + "microphp", + "unframework", + "xml", + "yaml", + "yml" + ], + "support": { + "issues": "https://github.com/hassankhan/config/issues", + "source": "https://github.com/hassankhan/config/tree/3.0.1" + }, + "time": "2022-03-26T19:37:50+00:00" + }, { "name": "laravel/serializable-closure", "version": "v1.2.2", diff --git a/conf/defaults.json b/conf/defaults.json new file mode 100644 index 0000000..c997be4 --- /dev/null +++ b/conf/defaults.json @@ -0,0 +1,6 @@ +{ + "database": { + "driver": "sqlite", + "database": "./data/goliath.db" + } +} diff --git a/src/app.php b/src/app.php index dfbbabe..8af16c4 100644 --- a/src/app.php +++ b/src/app.php @@ -1,6 +1,8 @@ set('config', function () use ($config) { -// return $config; -//}); +$container->set('config', function () use ($config) { + return $config; +}); // Set container to create App with on AppFactory AppFactory::setContainer($container);