0

我是 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/

谁能给我一个解决方案。

4

1 回答 1

2

将以下代码添加到 public 或 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您将要进行更改的地方。

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

于 2015-02-03T16:21:09.623 回答