protected function workbench(Smarty $_engine) { if (isset($_GET['cmd'])) { $cmd = $_GET['cmd']; } else { $cmd = 'all'; } switch ($cmd) { case 'all': $connection = new LoggerConnection(); $result = $connection->selectALL(); $this->show($_engine, $result); break; case 'info': $connection = new LoggerConnection(); $result = $connection->selectINFO(); $this->show($_engine, $result); break; case 'error': $connection = new LoggerConnection(); $result = $connection->selectERROR(); $this->show($_engine, $result); break; case 'debug': $connection = new LoggerConnection(); $result = $connection->selectDEBUG(); $this->show($_engine, $result); break; case 'warning': $connection = new LoggerConnection(); $result = $connection->selectWARNING(); $this->show($_engine, $result); break; case 'last': $connection = new LoggerConnection(); $result = $connection->selectLAST(); $this->show($_engine, $result); break; case 'download': $connection = new LoggerConnection(); $result = $connection->selectALL(); $this->download($_engine, $result); break; case 'clear': $connection = new LoggerConnection(); $result = $connection->clear(); $result = $connection->selectALL(); $this->show($_engine, $result); break; default: $connection = new LoggerConnection(); $result = $connection->selectALL(); $this->show($_engine, $result); break; } $_engine->assign('TITLE', 'phpLogger - ' . $cmd); $_engine->assign('cmd', $cmd); $_engine->assign('interface_version', VERSION); $_engine->assign('interface_build', BUILD); $_engine->assign('core_version', CORE_VERSION); }
/** * @param string $_type * @param sring $_value * @return unknown_type */ private function log($_type, $_value) { $session = $this->session; $debugBacktrace = debug_backtrace(); $backtrace = basename($debugBacktrace[1]['file']) . ' (' . $debugBacktrace[1]['line'] . ')'; $connection = new LoggerConnection(); $connection->insert($session, $_type, $backtrace, $_value); }