liberty_code / config
Library
Requires
- php: ~7 || ~8
- liberty_code/cache: ^1.0.
- liberty_code/data: ^1.0.
- liberty_code/library: ^1.0.
- liberty_code/register: ^1.0.
This package is auto-updated.
Last update: 2024-10-29 04:14:51 UTC
README
Description
Library contains configuration components, allows to get value from specified key.
Requirement
- Script language: PHP: version 7 || 8
Installation
Several ways are possible:
Composer
Requirement
It requires composer installation. For more information: https://getcomposer.org
Command: Move in project root path
cd "<project_root_path>"
Command: Installation
php composer.phar require liberty_code/config ["<version>"]
Note
Include vendor
If project uses composer, vendor must be included:
require_once('<project_root_path>/vendor/autoload.php');
Configuration
Installation command allows to add, on composer file "
{ "require": { "liberty_code/config": "<version>" } }
Include
Download
- Download following repository.
- Put it on repository root path.
Include source
require_once('<repository_root_path>/include/Include.php');
Usage
Configuration
Configuration allows to retrieve values from keys.
Elements
Config
Configuration allows to design basic configuration class, with features to retrieve value, from specified key.
DataConfig
Extends configuration features. It uses data features to get values.
RegisterConfig
Extends configuration features. It uses register features to get values.
CacheConfig
Extends configuration features. It uses cache repository features to get values.
Example
// Get data
use liberty_code\data\data\table\path\model\PathTableData;
$data = new PathTableData();
...
// Set data source
$data->setDataSrc(...);
...
// Get data configuration
use liberty_code\config\config\data\model\DataConfig;
$config = new DataConfig($data);
...
// Show specified value
echo($config->getValue('... string key'));
...