本文整理汇总了PHP中Audit::Instance方法的典型用法代码示例。如果您正苦于以下问题:PHP Audit::Instance方法的具体用法?PHP Audit::Instance怎么用?PHP Audit::Instance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Audit
的用法示例。
在下文中一共展示了Audit::Instance方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: audit
function audit($msg)
{
if (defined('AUDIT') && AUDIT) {
$db = DB::Instance();
$debug = $db->debug;
$db->debug = FALSE;
$audit = Audit::Instance();
$audit->write($msg, TRUE, microtime(TRUE) - START_TIME);
$db->debug($debug);
}
}
示例2: rawurlencode
$email_body = "Request: " . $_SERVER['REQUEST_URI'] . "\n";
$email_body .= "uzERP Version: " . $config->get('SYSTEM_VERSION') . "\n\n" . $exception->getMessage();
$smarty->assign('email_body', rawurlencode($email_body));
$smarty->display(STANDARD_TPL_ROOT . 'error.tpl');
}
// set the error reporting based on the environment
switch (strtolower(get_config('ENVIRONMENT'))) {
case 'development':
error_reporting(E_ALL ^ E_USER_DEPRECATED ^ E_DEPRECATED ^ E_NOTICE);
// error_reporting(E_ALL);
break;
case 'production':
default:
error_reporting(E_ERROR);
break;
}
// define where the log should go, syslog or a file of your liking with
$log = $_SERVER["DOCUMENT_ROOT"] . 'data/logs/' . session_id() . '.log';
// set the php_ini error log value with the log path
ini_set("error_log", $log);
// *******************
// LOAD THE FRAMEWORK
$system->display();
if (AUDIT || get_config('AUDIT_LOGIN')) {
if (is_array($system->controller->_data) && isset($system->controller->_data['password'])) {
$system->controller->_data['password'] = '********************';
}
$audit = Audit::Instance();
$audit->write(print_r($system->controller->_data, TRUE) . print_r($system->flash, TRUE), TRUE, microtime(TRUE) - START_TIME);
$audit->update();
}
示例3: logout
function logout()
{
if (AUDIT || get_config('AUDIT_LOGIN')) {
$audit = Audit::Instance();
$audit->write('logout', TRUE, microtime(TRUE) - START_TIME);
$audit->update();
}
session_destroy();
session_unset();
//remove session cookie
$params = session_get_cookie_params();
setcookie(session_name(), '', 0, $params['path'], $params['domain'], $params['secure'], isset($params['httponly']));
// don't show the login form for non-interactive logins
$injector = $this->_injector;
$authentication = $injector->Instantiate('LoginHandler');
if (!$authentication->interactive()) {
$this->view->display($this->getTemplateName('logout'));
exit;
}
header("Location: /");
exit;
}