Download the PHP package phrity/config without Composer
On this page you can find all versions of the php package phrity/config. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download phrity/config
More information about phrity/config
Files in phrity/config
Download phrity/config
More information about phrity/config
Files in phrity/config
Vendor phrity
Package config
Short Description Configuration interface, class, and factories
License MIT
Homepage https://phrity.sirn.se/net-uri
Package config
Short Description Configuration interface, class, and factories
License MIT
Homepage https://phrity.sirn.se/net-uri
Please rate this library. Is it a good library?
Informations about the package config
Introduction
Tools for handling configuration. Interfaces, implementation class, various readers and a factory.
Installation
Install with Composer;
The ConfigurationInterface
interface
The Phrity\Config\ConfigurationInterface
extends
PSR-11 ContainerInterface and
JsonSerializable interfaces.
The Configuration
class
The Phrity\Config\Configuration
class implements the ConfigurationInterface
.
Accessing by path
Specifying default
Type coercion
- Target type
boolean
0
,0.0
,"0"
,"0.0"
,""
,"false"
andnull
will be coerced tofalse
1
,1.1
,"1"
,"1.0"
and"true"
will be coerced totrue
- Target types
integer
anddouble
- numeric
string
will be coerced tointeger
ordouble
null
andfalse
will be coerced to0
or0.0
true
will be coerced to1
or1.0
- numeric
- Target type
string
integer
anddouble
will be coerced to numericstring
null
will be coerced to"null"
false
will be coerced to"false"
true
will be coerced to"true"
- Target type
null
0
,0.0
,"0"
,"0.0"
,""
,"null"
andfalse
will be coerced tonull
Any coercion not specified above will cause a CoercionException
.
Merging configurations
The Reader classes
A number of configuration readers are available.
- DataReader - Reader for PHP data input
- EnvReader and EnvFileReader - Readers for ENV input
- JsonReader and JsonFileReader - Readers for JSON input
- YamlReader and YamlFileReader - Readers for YAML input
The ConfigurationFactory
class
The Phrity\Config\ConfigurationFactory
provides shortcuts to create and merge configurations.
Versions
Version | PHP | |
---|---|---|
1.3 |
^8.1 |
Coerce option |
1.2 |
^8.1 |
Reader (data), all file-readers get optional option |
1.1 |
^8.1 |
Readers (yaml, env-file) |
1.0 |
^8.1 |
Interface, implementation, readers (json, json-file, yaml-file, env), factory |
All versions of config with dependencies
PHP Build Version
Package Version
Requires
php Version
^8.1
ext-json Version *
phrity/util-accessor Version ^1.0
psr/container Version ^1.0 | ^2.0
ext-json Version *
phrity/util-accessor Version ^1.0
psr/container Version ^1.0 | ^2.0
The package phrity/config contains the following files
Loading the files please wait ....