Download the PHP package learningbird/lbconf without Composer
On this page you can find all versions of the php package learningbird/lbconf. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download learningbird/lbconf
More information about learningbird/lbconf
Files in learningbird/lbconf
Package lbconf
Short Description Command line utility for reading and writing JSON configuration files
License MIT
Informations about the package lbconf
lbconf
Command line utility for reading and writing JSON configuration files
Installation
Install using composer:
Setup
Create an .lbconf
meta-configuration file in your project root:
Example:
File paths are relative to the location of the meta-config file.
The files in BOTH the read
and write
sections are read and merged, and the file in the write
section is written to when using the set
command.
Dynamic Configuration
For more dynamic configurations, an .lbconf.php
file can be used. This file must return an array that has the same format as the .lbconf
JSON file.
Usage
The general usage pattern is:
Where <action>
is one of: -g|--get
, -s|--set
, -d|--del
, -k|--keys
.
If only a key is provided, the action is assumed to be --get
, and can be omitted. If both a key and a value are provided, the action is assumed to be --set
, and can be omitted.
Example:
-g|--get
Retrieve configuration values.
Traverse objects by passing dot-separated keys:
-s|--set
Set configuration values. Values will be written to the file specified by the write
key in the .lbconf
meta-configuration file.
Types will be inferred, unless explicitly specified:
-d|--del
Delete overriding configuration values:
Note that the key must exist in the write
file for the deletion to be permitted. There is no way to delete a key that only exists in the read
file.
The only alternative is to set it to null, or some such value.
-k|--keys
Retrieve configuration value keys:
Misc
Keys beginning with dashes
By default, a command argument that begins with a -
is interpreted as an option. To avoid this behaviour, if a configuration key begins with a -
, you can use --
to separate the command options from the arguments: