Download the PHP package b13/typo3-config without Composer

On this page you can find all versions of the php package b13/typo3-config. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package typo3-config

Manage TYPO3 System-Wide Configuration

TLDR: Don't repeat yourself.

At b13 we run similar code and site-specific functionality based on the actual environment (development / production context). For this, we usually have a list of default "best practice" settings which we usually copy from one project to the next.

This small library ships with a single PHP class which makes our life a bit easier when setting global $TYPO3_CONF_VARS settings, which usually takes place in LocalConfiguration, AdditionalConfiguration and the extensions' ext_localconf.php files.

Note using TYPO3 v12

The configuration files LocalConfiguration and AdditionalConfiguration have been moved and renamed, s. Configuration files

Reason 1: We want context-dependent config files

With our configuration class, TYPO3's "AdditionalConfiguration" (located in :file:typo3conf/AdditionalConfiguration.php) just looks like this:

<?php

    \B13\Config::initialize()
        ->appendContextToSiteName()
        ->includeContextDependentConfigurationFiles();

This sets some sensible defaults (see below), and also checks for the existence of the following files:

If you have a TYPO3_CONTEXT with Subcontexts such as "Production/QA" then the file config/system/production/qa.php is also included, in addition to config/system/production.php.

Reason 2: We don't want to repeat the same "best b13 practice"

The initialize() method sets sensible defaults for a specific environment, activates debugging for Development environments, and deactivates deprecation logging in production by default.

b13 uses DDEV-Local for local environments, however, it is somehow tedious to maintain the same configuration over and over again. If DDEV-Local is in use, initialize automatically sets the respective settings for DDEV-Local environments.

If you want to avoid any kind of magic, you can just use this in your AdditionalConfiguration file.

<?php
    \B13\Config::initialize(false)
        ->appendContextToSiteName()
        ->includeContextDependentConfigurationFiles();

On top, the API ships with useful helper methods which we accustomed to set specific values. You can use this API in combination with setting other environment- or project-specific settings of course.

\B13\Config::get()
    ->useMailhog()
    ->allowInvalidCacheHashQueryParameter()
    ->initializeRedisCaching();

# Also set other TYPO3 configuration values as you need
$GLOBALS['TYPO3_CONF_VARS']['FE']['versionNumberInFilename'] = 'embed';

Installation

Install this package in composer req b13/typo3-config in your existing TYPO3 project – you are ready to go. This package only supports TYPO3 v9 LTS and higher, as we consider having multiple branches for multiple versions at some point where this package provides a stable API while not modifying.

Why we created this package

We use this approach for a few years now and publishing this package helps us to maintain this logic in a standardized way. We invite other web agencies to do the same, to see what everybody can improve and we can collaborate.

TYPO3 does not have a good API to set such options for developers, and this is our list of best practices, which we love to share with the world until TYPO3 Core will provide a standardized and better solution.

With TYPO3 it is possible to configure your system in many ways, and some do this via extensions, and we do it like this, hence: a common ground for us to use.

Drawbacks

  1. If you have a slow file system (NFS) or older PHP version, where your files are located, this package might slow down your file system due to a few more file look ups. Ideally we'd love to cache such information, but TYPO3 Core does not work with cached configuration for TYPO3_CONF_VARS.

  2. Using the "Install Tool" to set global configuration values might not work as expected, as our configuration logic currently works AFTER LocalConfiguration.php has been loaded. This is one of the major issues with TYPO3 Core's configuration system.

Naming TYPO3_CONTEXT

This package works best in TYPO3 projects if you use Git, Composer and various environments. We usually use Contexts also in TYPO3's site configuration and think it is very powerful to use if done right. Internally we committed ourselves across projects to the following names.

Regular projects

If you have one code base that powers multiple sites, we use sub-sub-schema as well.

Thanks

Prior functionality was heavily inspired by Neos Flow, and our initial TYPO3 solution was developed by Achim Fritz.

License

The package is licensed under GPL v2+, same as the TYPO3 Core. For details see the LICENSE file in this repository.

Credits

This package was created by Achim Fritz and Benni Mack in 2021 for b13 GmbH.

Find more TYPO3 packages we have developed that help us deliver value in client projects. As part of the way we work, we focus on testing and best practices to ensure long-term performance, reliability, and results in all our code.


All versions of typo3-config with dependencies

PHP Build Version
Package Version
Requires php Version ^7.2 || ~8.0
typo3/cms-core Version ^9.5.14 || ^10.0.0 || ^11.0.0 || ^12.0.0 || ^13.0.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package b13/typo3-config contains the following files

Loading the files please wait ....