Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Generated on May 18, 2024 via composer

league/config v1.2.0

Define configuration arrays with strict schemas and access values with dot notation
Package summary
Share
2
issues
2
high severity
license
2
3
licenses
2
(BSD-3-Clause OR GPL-2.0-only OR GPL-3.0-only)
1
MIT
1
BSD-3-Clause
Package created
30 May 2021
Version published
11 Dec 2022
Maintainers
1
Total deps
4
Direct deps
2
License
BSD-3-Clause

Issues

2

2 high severity issues

high
Recommendation: Validate that the license expression complies with your license policy
via: nette/schema@v1.3.0
Recommendation: Validate that the license expression complies with your license policy
via: nette/schema@v1.3.0
Collapse
Expand

Licenses

(BSD-3-Clause OR GPL-2.0-only OR GPL-3.0-only)

Expression
2 Packages, Including:
nette/schema@v1.3.0
nette/utils@v4.0.4

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
dflydev/dot-access-data@v3.0.2

BSD 3-Clause "New" or "Revised" License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
place-warranty
Cannot
use-trademark
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
league/config@v1.2.0
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

2
All Dependencies CSV
β“˜ This is a list of league/config 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
dflydev/dot-access-datav3.0.210.25 kBMIT
prod
nette/schemav1.3.0-(BSD-3-Clause OR GPL-2.0-only OR GPL-3.0-only)
prod
2

Visualizations

Frequently Asked Questions

What does league/config do?

League/Config is a comprehensive library in PHP that aids you in defining robust configurations for your applications. With this tool, you can specify configuration arrays with rigorous schemas, which ensures your configurations are error-free and standards-compliant. In addition, league/config supports nested configuration arrays, thereby providing a hierarchical arrangement of your settings. This can enhance the readability and maintainability of your configuration files. Furthermore, the library enables access to configuration values using dot notation, which can simplify the retrieval process.

How do you use league/config?

The use of League/Config is quite straightforward. To begin, you'll need PHP 7.4 or higher and Composer installed on your system. You can then install it via Composer using the command composer require league/config.

With the library installed, you can define your configuration schema using the Configuration class. You can set the values using the merge() or set() methods. After the configurations are set, you can retrieve the values using the get() method. Here is a simple example code:

use League\Config\Configuration;
use Nette\Schema\Expect;

$config = new Configuration([
    'database' => Expect::structure([...]),
    'logging' => Expect::structure([...]),
]);

$config->merge([...]);
$config->set('logging.path', '/var/log/myapp.log');

$config->get('database');
$config->get('database.driver');
$this->config->get('database.host');
$config->get('logging.path');

In the example above, Expect::structure([...]) is used to define what each configuration entry should include. Note that validation and default values will be automatically applied when you retrieve the values.

Where are the league/config docs?

The League/Config official documentation is a great resource to get more in-depth knowledge on using the library, including detailed usage examples, schemas, methods, and background philosophy. It provides a clear explanation of the features and functionality of the library. You can access the full documentation at config.thephpleague.com.