lch/maintenance-bundle

Symfony LchMaintenanceBundle

0.1.2 2020-11-20 16:22 UTC

This package is auto-updated.

Last update: 2024-09-21 02:18:50 UTC


README

提供辅助工具以将Web应用程序设置为维护模式。当使用自动化部署流程时,这非常有用,可以确保在部署过程中网站无法正确访问。

此捆绑包提供用于维护启动屏幕的平面HTML文件。这是为了避免在维护期间生成缓存

安装

composer require lch/maintenance-bundle

使用

使用命令切换维护模式

  • php bin/console lch:maintenance:mode 1 启用维护(在 public/ 中创建 .maintenance 文件)
  • php bin/console lch:maintenance:mode 0 禁用维护(从 public/ 中删除 .maintenance 文件)

当维护模式开启时,将提供静态启动HTML页面,并带有503 HTTP代码。

待办事项

  • 使HTML文件可配置
  • 添加选项
  • 增强异常处理
  • ...