I am using zend framework. Sometimes I want to disable or down my site for specific time for maintenance. So how can I stop people to access any page of my site when needed ?
Where is the bottleneck in Zend Framework where I can stop all requests and stop user to proceed.
Thanks
The tricky part of doing this within the ZF app is that presumably your maintenance will affect the app itself. So, if the app is “broken” during the maintenance, the risk is that an “in-app” solution may break, too. In that sense, “external” approaches like modifying .htaccess or tweaking the
public/index.phpfile are probably more robust.However, an “in-app” approach could utilize a front-controller plugin. In
application/plugins/TimedMaintenance.php:Then register the plugin in
application/Bootstrap.php:In practice, you might want to push the start/end times up to config. In
application/configs/application.ini:Then you could modify the plugin registration to look like:
This way, you can enable maintenance mode simply by editing the config entry.