code711/updatetrutstedhostsfromsite

TYPO3 扩展,用于根据配置的网站自动更新 $GLOBALS['TYPO3_CONF_VARS']['SYS']['trustedHostsPattern'] 设置

1.1.0 2023-04-07 20:51 UTC

This package is auto-updated.

Last update: 2024-09-07 23:57:04 UTC


README

Latest Stable Version TYPO3 12 TYPO3 11 Total Downloads Monthly Downloads PHPSTAN:Level 9 build:passing

此 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(或其他类似)环境变量。

点号(.)不会被转义(应该如此)。这是一个限制,因为转义字符 \ 会被某种方式再次转义。