Created
May 27, 2011 16:09
-
-
Save Nully/995582 to your computer and use it in GitHub Desktop.
Zend_Application_Resouce_Maintenance
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resources.frontController.plugins[] = "Zend_Controller_Plugin_Maintenance" | |
; メンテナンスモードで利用するリソースデータ | |
resources.maintenance.table[] = "xxx.xxx.xxx.xxx/24" ; とか | |
resources.maintenance.table[] = "xxx.xxx.xxx.xxx/8" ; とか | |
; ゆくゆくはコントローラ名なども指定したい | |
; resources.maintenance.controller = "maintenance" | |
; resources.maintenance.action = "index" | |
; resources.maintenance.module = "hoge" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h1>メンテナンス中</h1> | |
<p>メンテナンスが終わるまで</p> | |
<pre> | |
_人人人人人人人人人人人人人人人_ ,.-‐-、 | |
> ゆっくりしていってね!!! < / \ | |
 ̄^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^ ̄ / \ | |
/ _____/\ ,.ヘ | |
,.-‐-、 _/‐'''"" ̄ 〉 -7)-〈 | |
/ \ / `ー/」l_〉7 | |
/ \ く _;;::-‐‐'''"" ̄`"''iヽ、_/」 | |
/ ______/\ ,.ヘ 〈y'´..、 .,、、ゝ .', | |
_/‐'''"" ̄ 〉 -7)-〈 !| __, 、__ `‐、 ,.、 ', | |
/ `ー/」l_〉7 ||(rr=-, r=;ァ'i | |7}. ', | |
く _;;::-‐''7" ̄ ̄`"'''iヽ、_/」 ||. ̄ ,' ´ ̄ リ!|/ ', | |
〈y'´ .i |_!_,.ハ i 、!,_.| |〉 !.', i,_っ l!| ヽ | |
! ヽ.| |__,.!/ Vレ,、!__!| | .l ', ,___, | l \ | |
| | : rr=-, r=;ァ'i | | ヽ 'ー=-' , ヽヽ \ | |
i | :!'" "! | ヽ. ヽ、 ,.ィ ヽ, | |
`ヽ、__,,' | i| 'ー=-' ノ| | /,、ri个`,゙゙゙゙´ //ヽ ,、 | |
i / ヽ、!>,、 _____, ,.イ | | | .// | ||| | ',',\ / / // /\ | |
</pre> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Zend Framework - メンテナンスモードプラグイン | |
*/ | |
require_once "Zend/Controller/Plugin/Abstract.php"; | |
class Zend_Controller_Plugin_Maintenance | |
extends Zend_Controller_Plugin_Abstract | |
{ | |
public function routeShutdown(Zend_Controller_Request_Abstract $request) { | |
// ここでIP許可リスト内か判別 | |
// 許可リストのものでなければ、以下の処理を行う | |
$request->setActionName("index") | |
->setControllerName("maintenance") | |
->setModuleName("default"); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Maintenance_Controller extends Zend_Controller_Action { | |
public function init() { | |
// 何かしら初期化 | |
} | |
// Viewを表示するためだけの空アクション | |
public function indexAction() { | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment