<?php
class AccessLogPlugin extends Yaf_Plugin_Abstract
{
public function dispatchLoopShutdown(Yaf_Request_Abstract $request, Yaf_Response_Abstract $response)
{
/* last hook before the response is sent: write an
* access log entry */
error_log(sprintf(
"[%s] %s dispatched to %s/%s",
date("c"),
$request->getRequestUri(),
$request->getControllerName(),
$request->getActionName()
));
}
}
/* plugins are registered in the bootstrap */
class Bootstrap extends Yaf_Bootstrap_Abstract
{
public function _initPlugin(Yaf_Dispatcher $dispatcher)
{
$dispatcher->registerPlugin(new AccessLogPlugin());
}
}
?>