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

1.0.4 2025-12-09 12:59 UTC

This package is auto-updated.

Last update: 2025-12-09 13:03:25 UTC


README

TYPO3 13 PHP 8.2+ License: GPL v2

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 .env support for TYPO3's AdditionalConfiguration.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

  1. Download the extension
  2. Upload to typo3conf/ext/twoh_base
  3. 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

๐Ÿ”— Links