定制 thisisbd/silverstripe-maintenance-mode 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

thisisbd/silverstripe-maintenance-mode

Composer 安装命令:

composer require thisisbd/silverstripe-maintenance-mode

包简介

SilverStripe Maintenance Mode Module. Allows an administrator to put site in offline mode with 503 status to display a 'Coming Soon', 'Under Construction' or 'Down for Maintenance' Page to regular visitors, whilst allowing a logged in admin user to browse and make changes to the site.

README 文档

README

Maintainance/Offline Mode Module for SilverStripe. Allows an administrator to put site in offline mode with 503 status to display a 'Coming Soon', 'Under Construction' or 'Down for Maintenance' Page to regular visitors, whilst allowing a logged in admin user to browse and make changes to the site.

Maintainer Contacts

  • Dynamic <dev (at) dynamicagency (dot) com>

Requirements

This branch will aim for compatibility with SilverStripe 4.x.

For SilverStripe 3.x, please see the compatible branch.

Installation Instructions

Installation can be done either by composer or by manually downloading a release.

Via composer

composer require "dljoseph/silverstripe-maintenance-mode:*"

Manually

  1. Download the module from the releases page.
  2. Extract the file (if you are on windows try 7-zip for extracting tar.gz files
  3. Make sure the folder after being extracted is named 'maintenance-mode'
  4. Place this directory in your sites root directory. This is the one with framework and cms in it.
  5. Visit <yoursite.com>/dev/build/?flush to rebuild the database.

Usage Overview

A "Maintenance Mode" checkbox will be added to the SiteConfig Access settings; from there you can activate maintenance mode to take the site offline - and a new Utility Page will be added to the SiteTree in the Pages section of the CMS. You can edit the content of the Utility Page and/or manually override which theme template SilverStripe uses to render the page for display.

Templating

To override the default UtilityPage template, add a template called UtilityPage.ss in the templates folder of your theme (above Layouts) and then flush the template cache.

If you wish to use a different template for the UtilityPage, there are no restrictions, simply create a new SilverStripe template file, be sure to place it directly in the templates folder (above Layouts) and visit /?flush to flush the template cache. Afterwards, you must go to the UtilityPage in the CMS and select the manually select the template from the dropdown to tell SilverStripe which template to use to render the page for display.

Redirecting vs. Displaying at any URL

By default, the current functionality is to redirect users to a separate URL which you can configure within the CMS (e.g. /offline/), however it may be useful for you to simply display the maintenance message at any URL that the user may visit (to ensure user does not lose the page that they're currently at, in case maintenance window is very short).

To disable redirects, drop the following lines into your site's config.yaml file:

UtilityPage:
  DisableRedirect: true

Command Line

You can toggle maintenance mode either on or off via the command line easily by simply running the MaintenanceMode task. For example:

# Via Sake:
sake dev/tasks/MaintenanceMode on

# Via the CLI script directly:
php framework/cli-script.php dev/tasks/MaintenanceMode on

Allowing specific IP addresses

You can configure the module to also allow specific IP addresses pass the maintenance page. To add IP's add the following lines into your site's config.yaml file:

Page_Controller:
  allowed_ips:
    - '127.0.0.1'
    - '::1'

thisisbd/silverstripe-maintenance-mode 适用场景与选型建议

thisisbd/silverstripe-maintenance-mode 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 11.56k 次下载、GitHub Stars 达 20, 最近一次更新时间为 2015 年 02 月 17 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「silverstripe」 「under construction」 「Maintenance mode」 「coming soon」 「utility page」 「offline page」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

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

围绕 thisisbd/silverstripe-maintenance-mode 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

  • Stars: 20
  • Watchers: 4
  • Forks: 19
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2015-02-17