sjmb/module-environment-info 问题修复 & 功能扩展

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

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

sjmb/module-environment-info

Composer 安装命令:

composer require sjmb/module-environment-info

包简介

Displays a configurable visual environment indicator on admin and frontend pages for Magento 2

README 文档

README

Displays a configurable visual environment indicator on every admin page to identify the current hostname.

Overview

Sjmb_EnvironmentInfo injects a small UI element into the Magento 2 admin panel so developers and administrators can immediately identify which environment (staging, production, local) they are working in. The indicator is driven entirely by system configuration: it can be globally disabled, always enabled, or restricted to a list of specific hostnames. Three visual styles are available — a top bar, a corner badge, and a dismissible alert — each rendered via a dedicated template.

Requirements

  • Magento 2.4.x or higher
  • PHP 8.3 or higher
  • No external module dependencies declared

Installation

Composer installation

Run command to install module:

composer require --dev sjmb/module-environment-info

Manual installation

Download module and place in directory <magento-root>/app/code/Sjmb/EnvironmentInfo

Enable the module

php bin/magento module:enable Sjmb_EnvironmentInfo
php bin/magento setup:upgrade
php bin/magento cache:flush

Configuration

CLI

To enable display info can use CLI command:

php bin/magento config:set sjmb_env_info/general/mode 1

To save config to app/etc/env.php can add flag --lock-env:

php bin/magento config:set sjmb_env_info/general/mode 1 --lock-env

env.php

To enable display by app/etc/env.php can add bellow code:

...
'system' => [
    'default' => [
        'sjmb_env_info' => [
            'general' => [
                'mode' => '1'
            ]
        ]
    ]
]
...

Admin panel

Navigate to Stores > Configuration > SJMB > Environment Info > General Settings.

Config path UI label Type Default Description
sjmb_env_info/general/mode Display Mode select 0 (Disabled) Controls when the indicator is shown
sjmb_env_info/general/display_type Display Type select topbar Visual style of the indicator; hidden when mode is Disabled
sjmb_env_info/general/allowed_domains Allowed Domains dynamic rows (JSON) List of hostnames; visible only when Display Mode is Selected Domains

Display Mode values

Value Label Behaviour
0 Disabled Indicator is never rendered
1 Enabled Indicator is rendered on every admin page
2 Selected Domains Indicator is rendered only when HTTP_HOST matches an entry in Allowed Domains

Display Type values

Value Template Visual description
topbar topbar.phtml Fixed full-width orange bar at the top of the page; JS adjusts body top margin to prevent overlap
corner corner.phtml Small purple badge fixed in the bottom-right corner; pointer-events: none
alert alert.phtml Dismissible orange bar fixed below the top navigation (top: 60px); includes a close button

Features

  • Admin system configuration section under Stores > Configuration > SJMB > Environment Info.
  • Three display modes: Disabled, Enabled, and Selected Domains.
  • Three visual indicator styles: topbar, corner badge, dismissible alert.
  • Selected Domains mode performs an exact HTTP_HOST match against a JSON-serialized list of domain rows configured via a dynamic-rows UI field.

Usage

Enable with topbar on all pages

  1. Go to Stores > Configuration > SJMB > Environment Info.
  2. Set Display Mode to Enabled.
  3. Set Display Type to Topbar.
  4. Save configuration and flush cache.

Restrict to specific environments by hostname

  1. Set Display Mode to Selected Domains.
  2. In the Allowed Domains grid, add one row per hostname (e.g. staging.example.com).
  3. Set Display Type to the desired style.
  4. Save configuration and flush cache.

The indicator will appear only when the admin is accessed from a matching hostname.

Info

Copyright (c) 2026 SJMB · Code in 🐻‍❄️ in 🇵🇱

sjmb/module-environment-info 适用场景与选型建议

sjmb/module-environment-info 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 4 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 03 月 01 日, 在 PHP 生态内属于活跃度较高的组件。

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

围绕 sjmb/module-environment-info 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: proprietary
  • 更新时间: 2026-03-01