PHPackages                             webcoast/typo3-context-config-loader - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. webcoast/typo3-context-config-loader

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

webcoast/typo3-context-config-loader
====================================

Easy to use configuration loader for loading context specific configuration

v2.0.0(2y ago)13.3k1[2 PRs](https://github.com/webcoast-dk/typo3-context-config-loader/pulls)GPL-3.0-or-laterPHPPHP ^8.1

Since Sep 9Pushed 7mo agoCompare

[ Source](https://github.com/webcoast-dk/typo3-context-config-loader)[ Packagist](https://packagist.org/packages/webcoast/typo3-context-config-loader)[ RSS](/packages/webcoast-typo3-context-config-loader/feed)WikiDiscussions master Synced yesterday

READMEChangelog (4)Dependencies (2)Versions (7)Used By (0)

TYPO3 configuration loader
==========================

[](#typo3-configuration-loader)

A loader to make it easy to include context specific additional configuration files inside `typo3conf/AdditionalConfiguration.php`.

This loader can

- load additional configuration from the current root and sub context
- load local configuration files containing credentials
- load a default configuration with non-standard settings (which would be removed from `LocalConfiguration.php` on each write)
- read database credentials from a `.my.cnf` file.

Installation
------------

[](#installation)

Require via composer

```
composer req webcoast/typo3-config-loader
```

Usage
-----

[](#usage)

Put this inside your `typo3conf/AdditionalConfiguration.php`

```
(new \WEBcoast\Typo3ConfigLoader\Loader())->load();
```

This will automatically include configuration with standard settings (see below).

To adjust the behavior call the according setter function on the loader instance, e.g.

```
(new \WEBcoast\Typo3ConfigLoader\Loader())
    ->setIncludeDefaultConfiguration(true)
    ->setUseFolderPerContext(true)
    ->setIncludeMyCnf(true)
    ->setConfigFileSuffix('AdditionalConfiguration')
    ->load();
```

This loader does not parse different configuration formats like PHP, XML or YAML. It just `require`s the PHP files for the different context. The only file that is actually parsed is the `.my.cnf` file, if enabled. This gives you the freedom to do whatever you want inside those PHP files.

### Order of inclusion

[](#order-of-inclusion)

1. `Default.php` (if enabled)
2. `.my.cnf` (if enabled; parent context is applied first, if inheritance is enabled)
3. Context specific PHP files (parent context is applied first, if inheritance is enabled)
4. Local context specific PHP files (if enabled; parent context is applied first, if inheritance is enabled)

Settings
--------

[](#settings)

Setter methodTypeDefaultDescriptionsetInheritFromParentContextbooleantrueIf enabled the configuration for the root context (e.g. `Production`) would be included before the configuration from the current sub context (e.g. `Production/Staging`). If there is no sub context, the root context configuration will be always included.setIncludeDefaultConfigurationbooleanfalseIf enabled the file `{configRootPath}/Default.php` will be included before any other configuration. This could be helpful to have non-standard settngs, which should be included in each context. Non-standard settings will be removed from `LocalConfiguration.php`, meaning they need to live either in your `typo3conf/AdditionalConfiguration.php` or on this `Default` configuration file.setIncludeLocalConfigurationFilesbooleanfalseIf enabled files with a `Local` suffix will be included. The should be used to include files that only exist on the target server and are not part of your repository, because they contain credentials (database, SMTP, external API). This allows for versioned and unversioned setting for each context.setIncludeMyCnfbooleanfalseIf enabled a `.my.cnf` style file (INI) is parsed to get the database credentials. Some sys-admins prefer those `.my.cnf` files to store the database credentials. They are also used, when accessing the database through the command line MySQL client.setSubContextSeparatorstring: `.`, `-`, `_` or empty`.`Adjust this to match your naming of your configuration files, e.g. `Production/Staging` would become `Production.Staging.php` or `Production_Staging.php` depending on this setting.setConfigFileSuffixstring`empty`If you want your configuration files look like `ProductionConfig.php`, set this to `Config`. This is required, when you use folders per context.setUseFolderPerContextboolfalseInstead of putting all configuration files in the configuration root folder, folder are used for the different contexts, e.g. `Production` would be `{configRoot}/Production` and `Production/Staging` woudl be `{configRoot}/Production/Staging`. The config file suffix is used as the file name, e.g. `Production/Staging/Config.php`. If usage of local configuration files is enabled, they would look like `Production/Staging/LocalConfig.php`.License
-------

[](#license)

See the [license file](LICENSE).

Contribution
------------

[](#contribution)

Open an issue or fork and provide a pull request.

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance45

Moderate activity, may be stable

Popularity22

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~450 days

Total

4

Last Release

406d ago

Major Versions

v1.0.0 → v2.0.02023-09-11

PHP version history (2 changes)v2.0.0PHP ^8.1

v1.0.1PHP ^7.4 || ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/40136e31ed1adbb309036dc82652bc7185f763ea98e8de9bc588e3f2a2bde6fc?d=identicon)[webcoast](/maintainers/webcoast)

---

Top Contributors

[![thommyhh](https://avatars.githubusercontent.com/u/13288620?v=4)](https://github.com/thommyhh "thommyhh (13 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/webcoast-typo3-context-config-loader/health.svg)

```
[![Health](https://phpackages.com/badges/webcoast-typo3-context-config-loader/health.svg)](https://phpackages.com/packages/webcoast-typo3-context-config-loader)
```

###  Alternatives

[friendsoftypo3/content-blocks

TYPO3 CMS Content Blocks - Content Types API | Define reusable components via YAML

103519.9k53](/packages/friendsoftypo3-content-blocks)[wazum/sluggi

TYPO3 extension for URL slug management with inline editing, auto-sync, locking, access control, and redirects

40529.5k](/packages/wazum-sluggi)[typo3/cms-scheduler

TYPO3 CMS Scheduler - Schedule tasks to run once or periodically at a specific time.

169.3M231](/packages/typo3-cms-scheduler)[typo3/cms-lowlevel

TYPO3 CMS Lowlevel - Technical analysis of the system. This includes raw database search, checking relations, counting pages and records etc.

178.2M316](/packages/typo3-cms-lowlevel)[typo3/cms-redirects

TYPO3 CMS Redirects - Create manual redirects, list existing redirects and automatically createredirects on slug changes.

167.4M80](/packages/typo3-cms-redirects)[typo3/cms-form

TYPO3 CMS Form - Flexible TYPO3 frontend form framework that comes with a backend editor interface.

147.6M265](/packages/typo3-cms-form)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
