simp / environment
This is package for handling site configuration
Installs: 27
Dependents: 2
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:package
Requires
- php: ^8.2
- symfony/yaml: ^7.2
Requires (Dev)
- symfony/var-dumper: ^7.2
This package is not auto-updated.
Last update: 2025-05-06 14:47:38 UTC
README
Overview
The Environment Library is designed to manage configuration settings and environment variables for your PHP applications. It provides an easy-to-use interface for loading, retrieving, and setting environment variables to streamline application development.
Features
- Load environment variables from files.
- Retrieve environment variables with default fallbacks.
- Dynamically set environment variables.
- Exception handling for invalid configurations.
Installation
To use the Environment Library, include it in your project directory or install it via Composer:
composer require simp/environment
Usage
Loading Environment Variables
You can load environment variables:
// Save configuration \Simp\Environment\Environment::create("server_host", [ "host" => "localhost", "port" => 3306, "database" => "database", "username" => "chance_", "password" => "12345", "prefix" => "chance_" ]); // Get configuration data. \Simp\Environment\Environment::load('server_host')
License
This project is licensed under the MIT License. See the LICENSE file for details.
Contribution
Contributions are welcome! Please fork the repository and submit a pull request with your changes.