plog 日志
人人商城 plog 日志
函数 plog
core\inc\functions.php
定义了全局的系统函数
通用的全局函数还有
show_json(0, array('message' => '总价不能小于定金')); //第一个参数 status,第二个参数 data
使用示例
plog('goods.edit', "修改商品状态<br/>ID: {$item['id']}<br/>商品名称: {$item['title']}<br/>状态: " .$goodsstatus);
在 function.php
中 定义了
com_run('perm::log', $type, $op);
function com_run($name = '')
{
$names = explode("::", $name);
$com = com($names[0]);
if (!$com) {
return false;
}
if (!method_exists($com, $names[1])) {
return false;
}
$func_args = func_get_args();
$args = array_splice($func_args, 1);
return call_user_func_array(array($com, $names[1]), $args);
}
call_user_func_array( array(
‘perm’,'log',$args))
表示调用 perm
模块中的 log函数,后面是调用它的参数
在 文件 core\com\perm.php
中 ,定义了log
函数
public function log($type = '', $op = '')
{
global $_W;
$is_xxx = $this->check_xxx($type);
if ($is_xxx) {
$type = $is_xxx;
}
static $_logtypes;
if (!$_logtypes) {
$_logtypes = $this->getLogTypes();
}
$log = array(
'uniacid' => $_W['uniacid'],
'uid' => $_W['uid'],
'name' => $this->getLogName($type, $_logtypes),
'type' => $type,
'op' => $op,
'ip' => CLIENT_IP,
'createtime' => time()
);
pdo_insert('ewei_shop_perm_log', $log);
}
最后会保存到 表ims_ewei_shop_perm_log
中