webservco/configuration-legacy

A PHP component/library.

v0.8.0.74 2024-06-22 15:43 UTC

This package is auto-updated.

Last update: 2024-11-15 10:19:31 UTC


README

Helper for legacy projects that have to use a procedural approach.

Setup

Composer require:

"webservco/configuration-legacy": "^0"

Usage

Process configuration file

config/.env.ini

[Database]

DB_HOST = 127.0.0.1
DB_USER = db
DB_PASSWORD = db
DB_NAME = db
use WebServCo\Configuration\Service\Legacy\Procedural\Cfg;

Cfg::processConfigurationFile($projectPath);

Read configuration data

use WebServCo\Configuration\Service\Legacy\Procedural\Cfg;

$host = Cfg::getString('DB_HOST');