<?php
class BenchmarkPlugin extends Yaf_Plugin_Abstract
{
public function dispatchLoopStartup(Yaf_Request_Abstract $request, Yaf_Response_Abstract $response)
{
/* the view engine is not initialized yet, so this hook is a
* good place to start request-wide bookkeeping */
Yaf_Registry::set("request_start", microtime(true));
}
}
/* plugins are registered in the bootstrap */
class Bootstrap extends Yaf_Bootstrap_Abstract
{
public function _initPlugin(Yaf_Dispatcher $dispatcher)
{
$dispatcher->registerPlugin(new BenchmarkPlugin());
}
}
?>