code711 / updatetrutstedhostsfromsite
TYPO3 扩展,用于根据配置的网站自动更新 $GLOBALS['TYPO3_CONF_VARS']['SYS']['trustedHostsPattern'] 设置
1.1.0
2023-04-07 20:51 UTC
Requires
- php: 7.4.*||8.0.*||8.1.*||8.2.*
- code711/siteconfigurationevents: ^1.0
- typo3/cms-core: 11.5.*||^12.0
Requires (Dev)
- friendsoftypo3/phpstan-typo3: ^0.9
- helhum/typo3-console: *
- typo3/cms-backend: ^12.0
- typo3/cms-frontend: ^12.0
- typo3/cms-install: ^12.0
- typo3/cms-lowlevel: ^12.0
- typo3/cms-tstemplate: ^12.0
- typo3/coding-standards: ^0.5
- vimeo/psalm: ^4.10
README
此 TYPO3 扩展将在对网站配置进行更改时自动更新 $GLOBALS['TYPO3_CONF_VARS']['SYS']['trustedHostsPattern'] 变量,反映系统使用的域名。
这是通过使用扩展 EXT:siteconfigurationevents 实现的,该扩展在后台更改网站配置时提供 PSR-14 事件。
此外,还提供了一条 CLI 命令,可以从 shell 或在 CI/CD 或通过 cron 作为计划任务更新受信任的主机模式。
./vendor/bin/typo3 code711:updatetrustedhostfromsites -h ✔ 10118 16:52:23 Description: update SYS/trustedHostsPattern based on the site configuration Usage: code711:updatetrustedhostfromsites Options: -h, --help Display help for the given command. When no command is given display help for the list command -q, --quiet Do not output any message -V, --version Display this application version --ansi|--no-ansi Force (or disable --no-ansi) ANSI output -n, --no-interaction Do not ask any interactive question -v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
使用 -v 或 --verbose 调用命令将在控制台打印新值,同时将其设置为配置。
安装
composer req code711/updatetrustedhostfromsites
配置
截至目前,没有可用的配置选项
备注
如果网站配置中有变体设置,此扩展将使用 TYPO3_CONTEXT(或其他类似)环境变量。
点号(.)不会被转义(应该如此)。这是一个限制,因为转义字符 \ 会被某种方式再次转义。