<?php
/**
* IndexController
*
* LICENSE
*
* This source file is subject to the BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://svf.webutilities.ch/license/bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to hide@address.com so we can send you a copy immediately.
*
* @package Application
* @category Controller
* @uses Zend_Controller_Action
* @uses Zend_Registry
* @copyright Copyright (c) 2002-2008 Webutilities CH Inc. (http://www.webutilities.ch)
* @license BSD {@link http://svf.webutilities.ch/license/bsd}
* @author Silvan von Felten
* @version $Id$
*/
require_once 'Zend/Controller/Action.php';
class IndexController extends Zend_Controller_Action
{
/**
* PreDispatch: set up logger
*
* @return void
*/
public function preDispatch()
{
require_once 'Zend/Registry.php';
$request = $this->getRequest();
$messageTable = array(
'Current request information',
array(
array('Module', 'Controller', 'Action'),
array($request->getModuleName(),
$request->getControllerName(),
$request->getActionName()),
)
);
$message = 'testing the logger in: '.__FILE__.
': line: '.__LINE__.': Request: '.
$request->getModuleName().':'.
$request->getControllerName().':'.
$request->getActionName();
Zend_Registry::get('log')->emerg($message);
Zend_Registry::get('log')->alert($message);
Zend_Registry::get('log')->crit($message);
Zend_Registry::get('log')->err($message);
Zend_Registry::get('log')->warn($message);
Zend_Registry::get('log')->notice($message);
Zend_Registry::get('log')->info($message);
if (defined('SVF_LOG_TABLE'))
Zend_Registry::get('log')->table($messageTable);
}
/**
* IndexAction: Show the start page
*
* @return void
*/
public function indexAction()
{
$this->view->headTitle('LogViewer');
}
}