utopia-php / config
A simple Config library to managing application config variables
Installs: 82 174
Dependents: 1
Suggesters: 0
Security: 0
Stars: 14
Watchers: 9
Forks: 9
Open Issues: 1
Requires
- php: >=7.3
Requires (Dev)
- phpunit/phpunit: ^9.3
- vimeo/psalm: 4.0.1
This package is auto-updated.
Last update: 2024-11-08 04:23:56 UTC
README
Utopia Config library is simple and lite library for managing application configuration. This library is aiming to be as simple and easy to learn and use. This library is maintained by the Appwrite team.
Although this library is part of the Utopia Framework project it is dependency free and can be used as standalone with any other PHP project or framework.
Getting Started
Install using composer:
composer require utopia-php/config
<?php require_once '../vendor/autoload.php'; use Utopia\Config\Config; // Basic params Config::setParam('key', 'value'); Config::getParam('key'); // Value Config::getParam('keyx', 'default'); // default // Nested params Config::setParam('key3', ['key4' => 'value4']); Config::getParam('key3'); // ['key4' => 'value4'] Config::getParam('key3.key4'); // value4 // Load config file (plain array) Config::load('key5', __DIR__.'/demo.php'); Config::getParam('key5.key1', 'default'); // value1
System Requirements
Utopia Framework requires PHP 8.0 or later. We recommend using the latest PHP version whenever possible.
Copyright and license
The MIT License (MIT) http://www.opensource.org/licenses/mit-license.php