sourcebroker/configs 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

sourcebroker/configs

Composer 安装命令:

composer require sourcebroker/configs

包简介

Read configs based on TYPO3_CONTEXT settings.

README 文档

README

What does it do?

This extension include PHP files based on TYPO3_CONTEXT value. This allows you to make fine tuning of TYPO3 settings based on different context: instance, feature activation, system verbosity etc.

Installation

  1. Install using composer:

    composer require sourcebroker/configs
    
  2. Add following code in typo3conf/AdditionalConfiguration.php

    <?php
    
    defined('TYPO3') or die();
    
    \SourceBroker\ConfigTypo3\Config::initialize()
        ->appendContextToSiteName()
        ->includeContextDependentConfigurationFiles();
    
  3. Create folder context in folder config.

  4. In folder context create folders that starts with 1_*, 2_*, 3_*, 4_*., example 1_verbosity, 2_mode, 3_instance

  5. Inside those folders create php files with the names you will use in TYPO3_CONTEXT.

Example

  1. Copy example configs from Resources/Private/Examples/Example1/context to folder config/context
  2. You can change the folder names 1_verbosity, 2_mode, 3_instance to whatever you want but do not change the number_underscore pair. Numbers decide about what part of configs to read from the folders based on TYPO3_CONTEXT parts. Part after number and underscore play no role.
  3. If TYPO3_CONTEXT will be set to Development/Staging/Beta then file Development.php will be included from folder 1_verbosity, file Staging.php will be included from folder 2_mode and file Beta.php will be included from folder 3_instance.

You can have as many folders with numbers as you like. You can also read more files from one folder when you separate string with comma. For example you can set TYPO3_CONTEXT to Production//Live/Feature1,Feature2 then file Production.php will be included from folder 1_verbosity, file Live.php will be included from folder 3_mode and file Feature1.php, Feature2.php will be included from folder 4_whatever.

If you install package helhum/dotenv-connector then you additionally have possibility to modify $GLOBALS['TYPO3_CONF_VARS'] array by adding entries in .env file with following convention: TYPO3__[first_level_array]__[second_level_array]__[third_level_array] = "value"

This allows you to provide database values per instance by putting following lines to .env files of each instance. The .env file should be out of git.

Example:

TYPO3__DB__Connections__Default__dbname=".."
TYPO3__DB__Connections__Default__host=".."
TYPO3__DB__Connections__Default__port=".."
TYPO3__DB__Connections__Default__user=".."
TYPO3__DB__Connections__Default__password=".."

TYPO3__GFX__processor_path=".."
TYPO3__GFX__processor_path_lzw=".."
TYPO3__GFX__processor_colorspace=".."

It is up to you to decide what values to put inside .env (which is out of git) and which to config/context/3_instance/Live.php, config/context/3_instance/Beta.php etc which are inside git.

Lot of values stored in .env file means that it is harder to recreate the same TYPO3 state on local development system. If those settings are in git then you can just switch TYPO3_CONTEXT from local TYPO3_CONTEXT=Development/Staging/Local to beta TYPO3_CONTEXT=Production/Staging/Beta on local development system.

Database access data are good candidate to be put inside .env.

Uncache exceptions

You can use following code to disable uncaching on development for some cache configurations:

$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['configs']['caching']['cacheConfigurations']['my_cache']['uncache'] = false

Inspiration

sourcebroker/configs 适用场景与选型建议

sourcebroker/configs 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 17.1k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2023 年 01 月 19 日, 在 PHP 生态内属于活跃度较高的组件。

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

围绕 sourcebroker/configs 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: GPL-2.0-or-later
  • 更新时间: 2023-01-19