carlcs/craft-maintenance 问题修复 & 功能扩展

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

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

carlcs/craft-maintenance

Composer 安装命令:

composer require carlcs/craft-maintenance

包简介

Maintenance plugin for Craft CMS

README 文档

README

screenshot

The plugin provides tools to help you do maintenance on your Craft CMS website:

Installation

The plugin is available on Packagist and can be installed using Composer. You can also download the latest release and copy the files into craft/plugins/maintenance/.

$ composer require carlcs/craft-maintenance

Maintenance Announcements

Set up maintenance announcements or messages from the plugin’s settings page. You can use markdown to add links, or to format the message. To configure scheduled maintenance you have to set a start date in the announcement’s settings and enable “Backend Maintenance” and/or “Frontend Maintenance”.

Create a new “Maintenance Announcements” widget to display all notifications on the users’ Dashboards. Upcoming maintenance will also be announced with a banner notification.

Maintenance Modes

When backend maintenance mode is active, users navigating the Control Panel will be shown a full screen “Maintenance in progress” overlay. It informs them about the undergoing maintenance, in order to prevent from useless data entry.

The frontend maintenance mode redirects all (frontend) requests to /503, your “service unavailable” page. You can exclude URLs from being redirected and whitelist visitor IP addresses in the plugin settings.

Note: the plugin doesn’t do “content freeze” in a way, that it actually prevents data from being saved or changed in the database. That being said, there are template variables and plugins API provided.

Settings

The plugin can be configured from a craft/config/maintenance.php config file or from Settings/Maintenance.

In Settings/Users you can assign user permissions to configure the “Maintenance in progress” overlay or to grant access for individual user groups while frontend maintenance is carried out.

Template Variables

The plugin provides template variables to get the active announcement model, or to check whether the site is currently undergoing maintenance.

isCpMaintenance

Returns whether the Control Panel is currently undergoing maintenance.

{{ isCpMaintenance ? 'Shop closed' : '<a href="/shop">Shop</a>' }}

isSiteMaintenance

Returns whether the site is currently undergoing maintenance.

{% set reason = isSiteMaintenance ? 'scheduled' : 'unscheduled' %}

getAnnouncement( timeInAdvance )

Returns the latest, either currently active or soon to be activated maintenance announcement.

{% set announcement = craft.maintenance.getAnnouncement('2 hours') %}

{% if announcement and announcement.blockSite %}
    <span>{{ announcement.message }}</span>
{% endif %}

Planned features

  • Quick set up maintenance via environment variable

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2016-02-23

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固