anandaerditya / dotls
Package for reading and fetch dot-ls (.ls) config file into associative array.
1.0.0
2023-09-26 08:06 UTC
README
Description
Dotls, a PHP package for convert a .ls
configuration file into readable config array.
Package Description
- Package Name : dotls
- Author : Ananda Erditya ( anandaerditya )
- Github URL : https://github.com/anandaerditya/dotls
- Language : PHP
- Licence : MIT
Requirements
- PHP Version 8.0 or higher
- PHP fileinfo extension
Installing Package
Use the following command to install the package via Composer Dependency Manager.
composer require anandaerditya/dotls
Using The Package
-
Create your
.ls
configuration file.You can create your own
.ls
file to any directory inside your project. Make sure your.ls
file
contains at least one pair syntax as follows :foo:value foo_bar:value
-
Register
.ls
configuration file.Register your
.ls
file usingregister()
method as follows :$dotls = ( new Dotls() )->register('path/to/your/.ls');
-
Using your
.ls
configuration fileUse
ls()
method to load your configuration into your project as follows :ls('foo'); ls('foo_bar');