Download the PHP package jameslevi/silhouette without Composer
On this page you can find all versions of the php package jameslevi/silhouette. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jameslevi/silhouette
More information about jameslevi/silhouette
Files in jameslevi/silhouette
Package silhouette
Short Description Is a simple configuration management library that supports multiple configuration file formats.
License MIT
Informations about the package silhouette
Silhouette
Is a simple configuration management library that supports multiple configuration file formats.
Features
- Supports php array and json format.
- Facade implementation to beautifully access your configuration data.
- Easy integration with other frameworks or even without framework at all.
Installation
-
You can install via composer.
- Include the autoloader at the upper part of your code.
Getting Started
-
Import the config class into your project.
-
Create a new config file in php or json. But for this example let's try a php file that returns an array.
-
Instantiate a new config object.
- You can now get data using "get" method.
You can also get data using object keys.
-
You can also set add new value into your config.
- You can edit config data using "set" method.
You can also set data using object keys.
-
You can check if keyword exists using "has" method.
-
You can remove a configuration data using "remove" method.
-
You can return your configuration data in array.
- You can also return json format of your configuration data.
Config Injection
You can also make a config object without loading a config file.
Facade
-
Create a class that extends silhouette facade class then override the parent constructor by passing the config path.
- You can now get each configurations by calling it's static methods.
You must call properties that are in snake case to camel case.
-
You can edit configuration value by providing the first argument of the method called.
- You can add, edit or delete configuration data using config "context".
Muted Configuration Object
Configuration objects that only returns data.
You can also mute config object in facade.
Contribution
For issues, concerns and suggestions, you can email James Crisostomo via [email protected].
License
This package is an open-sourced software licensed under MIT License.