ifcastle/configurator-ini

Configurator component.

Installs: 21

Dependents: 1

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Type:ifcastle-component

v0.6.0 2024-11-03 08:49 UTC

This package is auto-updated.

Last update: 2024-11-20 07:24:57 UTC


README

A simple ini-configurator for the IfCastle framework. Implement the main application configuration and service configuration.

The package implements the following interfaces:

  • ConfigInterface
  • RepositoryReaderInterface
  • ServiceCollectionInterface
  • ServiceCollectionWriterInterface

Installation

This package must be installed within the IfCastle application environment, i.e., in ifcastle/package-installer, if you want the dependencies to be correctly defined.

composer require ifcastle/configurator-ini

Usage

The package defines two ini files:

  • the main application configuration file: main.ini
  • the service registry: services.ini

All files must be located in the root directory of the project.

Syntax

This package uses the ini_parse function under the hood in data type mode and additionally converts sections of the type [section.key] into a nested array.

Automatic replacement for ENV variables will also work, i.e., syntax with "%":

[database]
host = %DB_HOST%
port = %DB_PORT%
user = %DB_USER%
password = %DB_PASSWORD%

See also the ini_parse function.