【问题标题】:How to create a maintenance mode page in cakephp?如何在 cakephp 中创建维护模式页面?
【发布时间】:2015-02-03 13:46:22
【问题描述】:

我是 cakephp 框架的新手。在现有站点中创建正在建设或维护页面的程序是什么,因为我将要做一些更改。我正在使用 cakephp 1.3。 我用谷歌搜索了它,但它没有得到任何一步一步的过程。

我参考了以下链接:

http://mark-story.com/posts/view/quick-and-dirty-down-for-maintenance-page-with-cakephp http://www.fedevel.com/welldoneblog/2011/01/cakephp-quick-and-simple-maintenance-page/

谁能给我一个解决方案。

【问题讨论】:

  • 这些链接中的解决方案有什么问题?您到底在寻找什么?

标签: php .htaccess cakephp maintenance-mode


【解决方案1】:

将以下代码添加到公共或 webroot 文件夹中的 index.php 文件中:

define('MAINTENANCE', 0); if(MAINTENANCE > 0 && $_SERVER['REMOTE_ADDR'] !='188.YOUR.IP.HERE'){ require('maintenance.php'); die(); }

为了启用该模式,您必须在代码的第一行将0 更改为1

将您的 IP 放在您将要进行更改的位置 188.YOUR.IP.HERE

还要在您编辑的 index.php 所在的同一文件夹中添加 maintenance.php 文件。 maintenance.php文件为维护模式模板文件。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-12-06
    • 1970-01-01
    • 1970-01-01
    • 2010-11-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多