Upgrade typo3 configuration
I got one project which uses helhum/typo3-config-handling. I therefore needed to adjust the config to return the final result, as the package expects an array instead of globals. It also loads config multiple times. I therefore needed to remove require_once and replace by require. But some code can't be required multiple times and was moved to dedicated files with require_once. This package prevents writing back silent upgrades, I therefore needed to clean up the very old configs for TYPO3 < 10.
This commit is contained in:
parent
ae427a8ffe
commit
4fbf1a0f6c
|
@ -1,18 +1,24 @@
|
|||
<?php
|
||||
|
||||
// Note on using helhum/typo3-config-handling package:
|
||||
// adjust /src/Xclass/ConfigurationManager.php
|
||||
// - exportConfiguration() to require this file here.
|
||||
// - getLocalConfiguration() to require this file here.
|
||||
|
||||
date_default_timezone_set('Europe/Berlin');
|
||||
ini_set('timezone', 'Europe/Berlin');
|
||||
|
||||
require_once 'SystemSettings.php';
|
||||
require_once 'Assets.php';
|
||||
require_once 'Gfx.php';
|
||||
require_once 'MailSettings.php';
|
||||
require_once 'CachingConfigurations.php';
|
||||
require_once 'CacheFileBackend.php';
|
||||
require_once 'Debugging.php';
|
||||
require_once 'Logging.php';
|
||||
require_once 'Autologin.php';
|
||||
require_once __DIR__ . '/client-specific/ClientSpecific.php';
|
||||
require_once 'ExtensionConfigurations.php';
|
||||
require 'SystemSettings.php';
|
||||
require 'Assets.php';
|
||||
require 'Gfx.php';
|
||||
require 'MailSettings.php';
|
||||
require 'Caching.php';
|
||||
require 'Debugging.php';
|
||||
require 'Logging.php';
|
||||
require 'Autologin.php';
|
||||
require __DIR__ . '/client-specific/ClientSpecific.php';
|
||||
require 'Extensions.php';
|
||||
// Last, as we need client specific db adjustments
|
||||
require_once 'Database.php';
|
||||
require 'Database.php';
|
||||
|
||||
return $GLOBALS['TYPO3_CONF_VARS'];
|
||||
|
|
|
@ -1,66 +1,7 @@
|
|||
<?php
|
||||
|
||||
namespace Codappix\CdxAutoLogin;
|
||||
require_once 'AutologinClass.php';
|
||||
|
||||
// >= 10.4
|
||||
if (class_exists(\TYPO3\CMS\Core\Authentication\AbstractAuthenticationService::class) !== false) {
|
||||
class AutoAuthenticationTypo3Service extends \TYPO3\CMS\Core\Authentication\AbstractAuthenticationService
|
||||
{
|
||||
public function getUser()
|
||||
{
|
||||
$possibleUsernames = [
|
||||
'dsiepmann',
|
||||
'daniel.siepmann',
|
||||
'daniel_siepmann',
|
||||
];
|
||||
|
||||
foreach ($possibleUsernames as $username) {
|
||||
$record = $this->fetchUserRecord($username);
|
||||
if (is_array($record)) {
|
||||
return $record;
|
||||
}
|
||||
}
|
||||
|
||||
return [];
|
||||
}
|
||||
|
||||
public function authUser(array $user)
|
||||
{
|
||||
return 200;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// < 10.4
|
||||
if (class_exists(\TYPO3\CMS\Sv\AbstractAuthenticationService\AbstractAuthenticationService::class) !== false) {
|
||||
class AutoAuthenticationTypo3Service extends \TYPO3\CMS\Sv\AbstractAuthenticationService\AbstractAuthenticationService
|
||||
{
|
||||
public function getUser()
|
||||
{
|
||||
$possibleUsernames = [
|
||||
'dsiepmann',
|
||||
'daniel.siepmann',
|
||||
'daniel_siepmann',
|
||||
];
|
||||
|
||||
foreach ($possibleUsernames as $username) {
|
||||
$record = $this->fetchUserRecord($username);
|
||||
if (is_array($record)) {
|
||||
return $record;
|
||||
}
|
||||
}
|
||||
|
||||
return [];
|
||||
}
|
||||
|
||||
public function authUser(array $user)
|
||||
{
|
||||
return 200;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Autologin
|
||||
if (
|
||||
class_exists(\Codappix\CdxAutoLogin\AutoAuthenticationTypo3Service::class)
|
||||
&& ($_COOKIE['das_prevent_login'] ?? false) == false
|
||||
|
@ -73,7 +14,7 @@ if (
|
|||
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addService(
|
||||
'sitepackage',
|
||||
'auth',
|
||||
AutoAuthenticationTypo3Service::class,
|
||||
\Codappix\CdxAutoLogin\AutoAuthenticationTypo3Service::class,
|
||||
[
|
||||
'title' => 'Auto User authentication',
|
||||
'description' => 'Auto authenticate user with configured username',
|
||||
|
@ -81,7 +22,7 @@ if (
|
|||
'available' => true,
|
||||
'priority' => 100,
|
||||
'quality' => 50,
|
||||
'className' => AutoAuthenticationTypo3Service::class,
|
||||
'className' => \Codappix\CdxAutoLogin\AutoAuthenticationTypo3Service::class,
|
||||
]
|
||||
);
|
||||
}
|
||||
|
|
61
home/files/typo3-configuration/AutologinClass.php
Normal file
61
home/files/typo3-configuration/AutologinClass.php
Normal file
|
@ -0,0 +1,61 @@
|
|||
<?php
|
||||
|
||||
namespace Codappix\CdxAutoLogin;
|
||||
|
||||
// >= 10.4
|
||||
if (class_exists(\TYPO3\CMS\Core\Authentication\AbstractAuthenticationService::class) !== false) {
|
||||
class AutoAuthenticationTypo3Service extends \TYPO3\CMS\Core\Authentication\AbstractAuthenticationService
|
||||
{
|
||||
public function getUser()
|
||||
{
|
||||
$possibleUsernames = [
|
||||
'dsiepmann',
|
||||
'daniel.siepmann',
|
||||
'daniel_siepmann',
|
||||
];
|
||||
|
||||
foreach ($possibleUsernames as $username) {
|
||||
$record = $this->fetchUserRecord($username);
|
||||
if (is_array($record)) {
|
||||
return $record;
|
||||
}
|
||||
}
|
||||
|
||||
return [];
|
||||
}
|
||||
|
||||
public function authUser(array $user)
|
||||
{
|
||||
return 200;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// < 10.4
|
||||
if (class_exists(\TYPO3\CMS\Sv\AbstractAuthenticationService\AbstractAuthenticationService::class) !== false) {
|
||||
class AutoAuthenticationTypo3Service extends \TYPO3\CMS\Sv\AbstractAuthenticationService\AbstractAuthenticationService
|
||||
{
|
||||
public function getUser()
|
||||
{
|
||||
$possibleUsernames = [
|
||||
'dsiepmann',
|
||||
'daniel.siepmann',
|
||||
'daniel_siepmann',
|
||||
];
|
||||
|
||||
foreach ($possibleUsernames as $username) {
|
||||
$record = $this->fetchUserRecord($username);
|
||||
if (is_array($record)) {
|
||||
return $record;
|
||||
}
|
||||
}
|
||||
|
||||
return [];
|
||||
}
|
||||
|
||||
public function authUser(array $user)
|
||||
{
|
||||
return 200;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -4,6 +4,8 @@
|
|||
// Disable some for local development
|
||||
// => Done inside Vim, Vim will delete some files after editing
|
||||
|
||||
require_once 'CachingFileBackend.php';
|
||||
|
||||
// Extensions
|
||||
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['thuecat_fetchdata']['backend'] = \Codappix\CdxFileBackend\FileBackend::class;
|
||||
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['thuecat_fetchdata']['options'] = [
|
||||
|
@ -27,10 +29,16 @@ if (
|
|||
unset($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['hash']['options']['compression']);
|
||||
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['pages']['backend'] =
|
||||
\Codappix\CdxFileBackend\FileBackend::class;
|
||||
unset($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['pages']['options']['compression']);
|
||||
unset(
|
||||
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['pages']['options']['compression'],
|
||||
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['pages']['options']['tokenName'],
|
||||
);
|
||||
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['pagesection']['backend'] =
|
||||
\Codappix\CdxFileBackend\FileBackend::class;
|
||||
unset($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['pagesection']['options']['compression']);
|
||||
unset(
|
||||
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['pagesection']['options']['compression'],
|
||||
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['pagesection']['options']['tokenName'],
|
||||
);
|
||||
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['imagesizes']['backend'] =
|
||||
\Codappix\CdxFileBackend\FileBackend::class;
|
||||
unset($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['imagesizes']['options']['compression']);
|
||||
|
@ -41,12 +49,25 @@ if (
|
|||
} else {
|
||||
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['cache_rootline']['backend'] =
|
||||
\Codappix\CdxFileBackend\FileBackend::class;
|
||||
unset($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['cache_pagesection']['options']['compression']);
|
||||
|
||||
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['cache_pagesection']['backend'] =
|
||||
\Codappix\CdxFileBackend\FileBackend::class;
|
||||
unset(
|
||||
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['cache_pagesection']['options']['compression'],
|
||||
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['cache_pagesection']['options']['tokenName'],
|
||||
);
|
||||
|
||||
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['cache_hash']['backend'] =
|
||||
\Codappix\CdxFileBackend\FileBackend::class;
|
||||
unset($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['cache_pages']['options']['compression']);
|
||||
unset(
|
||||
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['cache_hash']['options']['compression'],
|
||||
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['cache_hash']['options']['tokenName'],
|
||||
);
|
||||
|
||||
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['cache_pages']['backend'] =
|
||||
\Codappix\CdxFileBackend\FileBackend::class;
|
||||
unset(
|
||||
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['cache_pages']['options']['compression'],
|
||||
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['cache_pages']['options']['tokenName'],
|
||||
);
|
||||
}
|
|
@ -1,25 +1,13 @@
|
|||
<?php
|
||||
|
||||
// Database
|
||||
$GLOBALS['TYPO3_CONF_VARS']['DB']['username'] = 'dev';
|
||||
$GLOBALS['TYPO3_CONF_VARS']['DB']['password'] = 'dev';
|
||||
// Looks like TYPO3 doesn't work with my socket inside the install tool ...
|
||||
$GLOBALS['TYPO3_CONF_VARS']['DB']['host'] = '127.0.0.1';
|
||||
// $GLOBALS['TYPO3_CONF_VARS']['DB']['host'] = '';
|
||||
$GLOBALS['TYPO3_CONF_VARS']['DB']['socket'] = '/var/run/mysqld/mysqld.sock';
|
||||
$GLOBALS['TYPO3_CONF_VARS']['SYS']['no_pconnect'] = true;
|
||||
// Auto set for simple instances via http host. or env from apache This allows
|
||||
// to set it at one place for the whole project if multiple domains are used
|
||||
|
||||
$GLOBALS['TYPO3_CONF_VARS']['DB']['database'] = $typo_db;
|
||||
$GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']['Default'] = array_merge($GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']['Default'], [
|
||||
'dbname' => $GLOBALS['TYPO3_CONF_VARS']['DB']['database'],
|
||||
'host' => $GLOBALS['TYPO3_CONF_VARS']['DB']['host'],
|
||||
'password' => $GLOBALS['TYPO3_CONF_VARS']['DB']['password'],
|
||||
'user' => $GLOBALS['TYPO3_CONF_VARS']['DB']['username'],
|
||||
'port' => $GLOBALS['TYPO3_CONF_VARS']['DB']['port'] ?? null,
|
||||
'socket' => $GLOBALS['TYPO3_CONF_VARS']['DB']['socket'],
|
||||
'unix_socket' => $GLOBALS['TYPO3_CONF_VARS']['DB']['socket'],
|
||||
$GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']['Default'] = array_merge($GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']['Default'] ?? [], [
|
||||
'dbname' => $typo_db,
|
||||
'host' => '127.0.0.1',
|
||||
'password' => 'dev',
|
||||
'user' => 'dev',
|
||||
'port' => null,
|
||||
'socket' => '/var/run/mysqld/mysqld.sock',
|
||||
'unix_socket' => '/var/run/mysqld/mysqld.sock',
|
||||
'driver' => 'mysqli',
|
||||
'charset' => 'utf8mb4',
|
||||
'tableoptions' => [
|
||||
|
|
|
@ -1,20 +1,14 @@
|
|||
<?php
|
||||
|
||||
$GLOBALS['TYPO3_CONF_VARS']['SYS']['belogErrorReporting'] = 1;
|
||||
|
||||
$GLOBALS['TYPO3_CONF_VARS']['SYS']['enable_errorDLOG'] = true;
|
||||
$GLOBALS['TYPO3_CONF_VARS']['SYS']['enable_exceptionDLOG'] = true;
|
||||
|
||||
$GLOBALS['TYPO3_CONF_VARS']['SYS']['systemLog'] = 'error_log,,0;';
|
||||
$GLOBALS['TYPO3_CONF_VARS']['SYS']['systemLogLevel'] = 0;
|
||||
$GLOBALS['TYPO3_CONF_VARS']['SYS']['devIPmask'] = '*';
|
||||
$GLOBALS['TYPO3_CONF_VARS']['BE']['debug'] = true;
|
||||
$GLOBALS['TYPO3_CONF_VARS']['FE']['debug'] = true;
|
||||
$GLOBALS['TYPO3_CONF_VARS']['SYS']['sqlDebug'] = true;
|
||||
$GLOBALS['TYPO3_CONF_VARS']['SYS']['displayErrors'] = 1;
|
||||
|
||||
// Disable by default
|
||||
$GLOBALS['TYPO3_CONF_VARS']['BE']['lang']['debug'] = false;
|
||||
$GLOBALS['TYPO3_CONF_VARS']['BE']['languageDebug'] = false;
|
||||
|
||||
$GLOBALS['TYPO3_CONF_VARS']['SYS']['errorHandlerErrors'] = E_ALL & ~ (E_NOTICE | E_DEPRECATED);
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
<?php
|
||||
|
||||
$GLOBALS['TYPO3_CONF_VARS']['GFX']['processor'] = 'ImageMagick';
|
||||
$GLOBALS['TYPO3_CONF_VARS']['GFX']['im_version_5'] = 'im6';
|
||||
$GLOBALS['TYPO3_CONF_VARS']['GFX']['im_path'] = getenv('IMAGEMAGICK_PATH') ?: '/usr/bin/';
|
||||
$GLOBALS['TYPO3_CONF_VARS']['GFX']['im_path_lzw'] = $GLOBALS['TYPO3_CONF_VARS']['GFX']['im_path'];
|
||||
$GLOBALS['TYPO3_CONF_VARS']['GFX']['processor_path'] = $GLOBALS['TYPO3_CONF_VARS']['GFX']['im_path'];
|
||||
$GLOBALS['TYPO3_CONF_VARS']['GFX']['processor_path_lzw'] = $GLOBALS['TYPO3_CONF_VARS']['GFX']['im_path'];
|
||||
$GLOBALS['TYPO3_CONF_VARS']['GFX']['processor_path'] = getenv('IMAGEMAGICK_PATH') ?: '/usr/bin/';
|
||||
$GLOBALS['TYPO3_CONF_VARS']['GFX']['processor_path_lzw'] = $GLOBALS['TYPO3_CONF_VARS']['GFX']['processor_path'];
|
||||
|
|
|
@ -1,22 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Codappix\CdxLogging;
|
||||
|
||||
use TYPO3\CMS\Core\Log\LogRecord;
|
||||
use TYPO3\CMS\Core\Log\Processor\AbstractProcessor;
|
||||
use TYPO3\CMS\Core\Log\Processor\ProcessorInterface;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
|
||||
class UriProcessor extends AbstractProcessor implements ProcessorInterface
|
||||
{
|
||||
public function processLogRecord(LogRecord $logRecord)
|
||||
{
|
||||
$logRecord->addData([
|
||||
'URI' => GeneralUtility::getIndpEnv('TYPO3_REQUEST_URL'),
|
||||
]);
|
||||
return $logRecord;
|
||||
}
|
||||
}
|
||||
require_once 'LoggingUriProcessor.php';
|
||||
|
||||
$GLOBALS['TYPO3_CONF_VARS']['LOG']['das']['writerConfiguration'] = [
|
||||
\TYPO3\CMS\Core\Log\LogLevel::DEBUG => [
|
||||
|
|
20
home/files/typo3-configuration/LoggingUriProcessor.php
Normal file
20
home/files/typo3-configuration/LoggingUriProcessor.php
Normal file
|
@ -0,0 +1,20 @@
|
|||
<?php
|
||||
|
||||
namespace Codappix\CdxLogging;
|
||||
|
||||
use TYPO3\CMS\Core\Log\LogRecord;
|
||||
use TYPO3\CMS\Core\Log\Processor\AbstractProcessor;
|
||||
use TYPO3\CMS\Core\Log\Processor\ProcessorInterface;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
|
||||
class UriProcessor extends AbstractProcessor implements ProcessorInterface
|
||||
{
|
||||
public function processLogRecord(LogRecord $logRecord)
|
||||
{
|
||||
$logRecord->addData([
|
||||
'URI' => GeneralUtility::getIndpEnv('TYPO3_REQUEST_URL'),
|
||||
]);
|
||||
return $logRecord;
|
||||
}
|
||||
}
|
||||
|
|
@ -15,10 +15,6 @@
|
|||
}
|
||||
');
|
||||
|
||||
$GLOBALS['TYPO3_CONF_VARS']['SYS']['clearCacheSystem'] = true;
|
||||
|
||||
$GLOBALS['TYPO3_CONF_VARS']['SYS']['curlProxyServer'] = '';
|
||||
$GLOBALS['TYPO3_CONF_VARS']['SYS']['curlProxyTunnel'] = false;
|
||||
$GLOBALS['TYPO3_CONF_VARS']['SYS']['proxy_host'] = '';
|
||||
$GLOBALS['TYPO3_CONF_VARS']['SYS']['proxy_port'] = '';
|
||||
|
||||
|
|
Binary file not shown.
BIN
home/files/typo3-configuration/client-specific/ItccSteelnet.php
Normal file
BIN
home/files/typo3-configuration/client-specific/ItccSteelnet.php
Normal file
Binary file not shown.
Binary file not shown.
Loading…
Reference in a new issue