twoh / twoh_base
This extension allows you to move the TYPO3 context into separate files instead of working with the `AdditionalConfiguration.php`.
Installs: 14
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
Type:typo3-cms-extension
pkg:composer/twoh/twoh_base
Requires
- php: ^8.2 <8.4
- composer-plugin-api: ^2.0
- typo3/cms-core: ^13.4
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.91
- phpunit/phpunit: ^11.5
- roave/security-advisories: dev-latest
- typo3/testing-framework: ^8.0
README
This extension allows you to move the TYPO3 context into separate files instead of working with the
AdditionalConfiguration.php.
๐ Features
- Context-based Configuration โ Organize TYPO3 settings per environment (Development, Production, etc.)
- Environment Variables Support โ Includes
.envsupport for TYPO3'sAdditionalConfiguration.php - Clean Project Setup โ Provides all needed files for setting up a TYPO3 project
โ๏ธ Requirements
| Requirement | Version |
|---|---|
| PHP | ^8.2 |
| Composer | ^2.0 |
| TYPO3 | ^13.4 |
๐ Installation
Via Composer (recommended)
composer require twoh/twoh_base
Manual Installation
- Download the extension
- Upload to
typo3conf/ext/twoh_base - Activate in TYPO3 Extension Manager
๐ Usage
Configuration Structure
Create a config/ directory in your project root with environment-specific configuration files:
project-root/
โโโ config/
โ โโโ default.php # Base configuration (loaded first)
โ โโโ development.php # Development environment
โ โโโ production.php # Production environment
โ โโโ production.staging.php # Production/Staging context
Example Configuration File
<?php // config/default.php return [ 'DB' => [ 'Connections' => [ 'Default' => [ 'host' => 'localhost', 'dbname' => 'typo3', ], ], ], ];
Loading Configuration
Add to your AdditionalConfiguration.php:
<?php use TWOH\TwohBase\Configuration\Loader; use TYPO3\CMS\Core\Core\Environment; $loader = new Loader( Environment::getContext(), Environment::getProjectPath() ); $loader->load();
๐งช Development
Running Tests
composer test:unit
Code Style
# Check code style composer cs:check # Fix code style composer cs:fix
๐ License
This project is licensed under the GPL-2.0-or-later License โ see the LICENSE file for details.
๐ฅ Authors
- Andreas Reichel โ a.reichel91@outlook.com
- Igor Smertin โ igor.smertin@web.de