View Single Post
  #4 (permalink)  
Old 08-26-2008, 08:38 PM
brreddy brreddy is offline
Junior Member
 
Join Date: Aug 2008
Posts: 2
Default

Instead of adding preDispatch in all controllers you can register a plugin to Zend_Controller_Front and handle timeout in it.

in bootstrap:
Quote:
...
$front = Zend_Controller_Front::getInstance();
$front->setControllerDirectory('controllers');
$front->registerPlugin(new TimeoutHandlerPlugin());
$front->dispatch();
...
timeout handler plugin:

Quote:
class TimeoutHandlerPlugin extends Zend_Controller_Plugin_Abstract
{
public function preDispatch(Zend_Controller_Request_Abstract $request) {
// reset the timer here
}
}
Cheers,
Ravi
Reply With Quote