承接 itzbund/gsb-valkey 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

itzbund/gsb-valkey

Composer 安装命令:

composer require itzbund/gsb-valkey

包简介

GSB valkey. The extension provides Redis Sentinel based implementations of existing TYPO3 (core or extensions) implementations for Redis based caching, locking or session storage. This is Part of the Goverment Site Build (GSB) 11. Der GSB 11 ist eine Maßnahme der Dienstekonsolidierung Bund (DKB) des

README 文档

README

GSB 11 Extension gsb_valkey

TYPO3 13

About

The extension gsb_valkey provides a Valkey/Redis sentinel based implementations of existing TYPO3 (core or extensions) implementations for Redis based caching, locking or session storage.

Note: this extension only makes sense if you want to use sentinel. If you don't want to run sentinel you should use the TYPO3 core implmentations and EXT:b13/distributed_locking

Learn more about the GSB 11.

Installation

The best way to install this extension is to start with the GSB Sitepackage Kickstarter extension.

Quick installation without GSB Sitepackage Kickstarter

In a composer-based TYPO3 installation you can install the extension EXT:gsb_valkey via composer:

  composer require itzbund/gsb-valkey

Configuration

Note: when using Redis/Valkey you should use each database for only one purpose.

Locking strategy: SentinelBasedRedisLockingStrategy

To use the SentinelBasedRedisLockingStrategy you have to configure it as your locking strategy, e.g. in your additional.php:

$GLOBALS['TYPO3_CONF_VARS']['SYS']['locking']['strategies'][\ITZBund\GsbValkey\Locking\SentinelBasedRedisLockingStrategy::class] = [
    'options' => [
        'database' => 0, // Redis/Valkey database used
        'hostname' => 'redis', // Redis/Valkey host
        'persistentConnection' => true,
        'password' => 'password', // optional
        'port' => 3679, // Redis/Valkey port
        'sentinelHost' => 'redis-sentinel-1', // Redis/Valkey sentinel host
        'sentinalPassword' => 'password', // optional
        'sentinelPort' => 26379, // Redis/Valkey sentinel port
        'ttl' => 10,
    ],
];

For more details take a look at the TYPO3 documentation on locking.

It is configured to use a priority of 100, which makes it the default locker compared to those provided by the TYPO3 core.

Caching backend: SentinelBasedRedisBackend

To use the SentinelBasedRedisBackend you have to configure it as a caching backend, e.g. in your additional.php:

$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations'][$cacheName]['backend'] =  \ITZBund\GsbValkey\Cache\Backend\SentinelBasedRedisBackend::class;
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations'][$cacheName]['options'] = [
    'database' => 1, // Redis/Valkey database used
    'hostname' => 'redis', // Redis/Valkey host
    'password' => 'password', // optional
    'persistentConnection' => true,
    'port' => 3679, // Redis/Valkey port
    'sentinelHostname' => 'redis-sentinel-1', // Redis/Valkey sentinel
    'sentinalPassword' => 'password' // optional
    'sentinelPort' => 26379,  // Redis/Valkeyport
];

For more details take a look at the TYPO3 documentation on cache configurations

Feature Flags

This document explains how to use feature flags. We separate between two different kinds of feature flags:

Feature

Feature flags allow you to enable or disable specific features in your installation. \ This is of particular importance to disable features that have not passed the approval process.

Optional

Optional flags allow you to (de-)activate specific features for your installation. \ A practical use for these is the (de-)activation of an extension.

For more information about feature flags in TYPO3, please refer to the official TYPO3 Documentation on Feature Flags.

Feature Flag Configuration

Feature and Optional flags are configured in the .env or the local-dev/.ddev/docker-compose.environment.yaml file on ddev machine. To add a feature flag, use the following syntax:

# FEATURE FLAG
- TYPO3__SYS__features__GSB11_FEATURE_123_NEW_FEATURE=%const(bool:true)%
# OPTIONAL FLAG
- TYPO3__SYS__features__GSB11_OPTION_123_ENABLE_EXTENSION=%const(bool:true)%

In this example, both feature flags, GSB11_FEATURE_123_NEW_FEATURE and GSB11_OPTION_123_ENABLE_EXTENSION, are set to true. To disable the feature, change the value to false or delete the setting.

Feature Flag Truth Table

This table illustrates the behavior of feature flags in various states.

Feature Flag StateEvaluated ValueDescription
featureFlag = truetrueThe feature is explicitly enabled.
featureFlag = falsefalseThe feature is explicitly disabled.
featureFlag = ''falseAn empty value is treated as false.
featureFlag not existfalseA non-existent flag defaults to false.

Usage in PHP Code

To use a feature flag in your PHP code, you can check the flag's value with the isFeatureEnabled() method of the Features class:

if (GeneralUtility::makeInstance(Features::class)->isFeatureEnabled('GSB11_FEATURE_123_NEW_FEATURE')) {
    echo 'Feature is enabled';

    // Feature-specific code
    ...
}

Usage in Fluid Templates

Feature flags can also be checked in your Fluid templates with TYPO3's Feature ViewHelper.

Basic usage

<f:feature name="GSB11_FEATURE_123_NEW_FEATURE">
   This is being shown if the flag is enabled
</f:feature>

Feature > then > else

<f:feature name="GSB11_OPTION_123_ENABLE_EXTENSION">
    <f:then>
        Flag is enabled
    </f:then>
    <f:else>
        Flag is undefined or not enabled
    </f:else>
</f:feature>

Current feature flags of gsb_valkey

Feature flagDescription
currently none-

Usage

Nothing to do.

Contribute

As with TYPO3, we encourage you to join the project by submitting changes. Development of the GSB 11 happens mainly in the GSB 11 TYPO3 extension repositories.

To get started, have a look at our detailed contribution walkthrough.

itzbund/gsb-valkey 适用场景与选型建议

itzbund/gsb-valkey 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 46 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 09 月 08 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 itzbund/gsb-valkey 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 itzbund/gsb-valkey 我们能提供哪些服务?
定制开发 / 二次开发

基于 itzbund/gsb-valkey 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 46
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 28
  • 依赖项目数: 0
  • 推荐数: 1

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-3.0-or-later
  • 更新时间: 2025-09-08