Download the PHP package folded/config without Composer
On this page you can find all versions of the php package folded/config. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download folded/config
More information about folded/config
Files in folded/config
Package config
Short Description Configuration utilities for your PHP web app.
License MIT
Informations about the package config
folded/config
Configuration and environment utilities for your PHP web app.
Summary
- About
- Features
- Requirements
- Installation
- Examples
- Version support
About
I created this library to get an easy to setup way to perform configuration/environment value fetch.
Folded is a constellation of packages to help you setting up a web app easily, using ready to plug in packages.
- folded/action: A way to organize your controllers for your web app.
- folded/config: Configuration and environment utilities for your PHP web app.
- folded/crypt: Encrypt and decrypt strings for your web app.
- folded/exception: Various kind of exception to throw for your web app.
- folded/history: Manipulate the browser history for your web app.
- folded/http: HTTP utilities for your web app.
- folded/orm: An ORM for you web app.
- folded/request: Request utilities, including a request validator, for your PHP web app.
- folded/routing: Routing functions for your PHP web app.
- folded/session: Session functions for your web app.
- folded/view: View utilities for your PHP web app.
Features
- Can get configuration or
.env
values (using dot syntax) - Can check if a configuration or an env value exist
- Eager load the configuration, such as it is only booted when you get a configuration or an env value
Requirements
- PHP version >= 7.4.0
- Composer installed
Installation
- 1. Install the package
- 2. Set up the library
1. Install the package
In your project root directory, run this command:
2. Set up the library
Right before getting the config or env values, integrate this script:
You don't have to set up both if you only want to use one or the other. However, if you plan to use both, make sure that setEnvFolderPath()
is called before setConfigFolderPath()
in order to take advantage of env variables in configurations.
The env folder path is the folder that contains your .env
file.
Examples
Since this library uses vlucas/phpdotenv for the env feature, you can learn more on this file format in the documentation.
- 1. Getting a configuration value
- 2. Getting an env value
- 3. Checking if a configuration exist
- 4. Check if an env value exist
- 5. Get all config variables
1. Getting a configuration value
In this example, we will get a configuration value.
Asuming your configuration file is located at config/app.php
, and contains:
2. Getting an env value
In this example, we will get a value stored in the .env
file.
Asuming your .env
file contains:
3. Checking if a configuration exist
In this example, we will check if a configuration key exist.
4. Check if an env value exist
In this example, we will check if an env variable exist.
5. Get all config variables
In this example, we will get all the key/values inside the config file app.php
.
Version support
7.3 | 7.4 | 8.0 | |
---|---|---|---|
v0.1.0 | ❌ | ✔️ | ❓ |
v0.1.1 | ❌ | ✔️ | ❓ |
v0.1.2 | ❌ | ✔️ | ❓ |
v0.1.3 | ❌ | ✔️ | ❓ |
v0.1.4 | ❌ | ✔️ | ❓ |
v0.1.5 | ❌ | ✔️ | ❓ |
All versions of config with dependencies
illuminate/config Version 7.*
vlucas/phpdotenv Version 5.*
folded/exception Version 0.4.*