ASRecord
extends ASObject
in
日志、统计管理器 ASRecord
!! 重要信息 除了系统信息 如: "系统颁发的证书,令牌, 系统运行(安全检测) 需要的设备信息等" 属于用户隐私信息的请在此处清空,全局设置 RECORD_PRIVACY 设置为空 或记录时手动删除 详情咨询相关法律人士, 若侵犯用户隐私涉及到法律问题, 与本程序原作者/动息科技无关
!! NOTICE Except for system information such as "system-issued certificates, tokens, device information required for system operation (security test), etc." Belongs to the user"s privacy information here empty, the global settings RECORD_PRIVACY # config.php # set to empty or record manually delete. Details Consult the relevant legal persons, if the violation of user privacy involves legal issues, and the original author of this program / dynamic technology exemption.
Table of Contents
$userid | 用户id | string |
---|---|---|
$itemid | 对象id | string |
$status | 状态码 | int |
$event | 事件 | string |
$content | 记录内容 | string |
$type | 事件类型 | string |
$sign | 签名头信息 | string |
$category | 记录分类 | string |
$DB | 数据库联接 | ASDB |
$CLASSNAME | 类名 | string |
$result | 结果包装器 | ASResult |
__construct() | ASObject constructor. | mixed |
shared() | 全局单例 shared | ASRecord |
setDB() | 设置独立数据库 setDB | $this |
setUserid() | 设定操作用户id set User id | $this |
setCategory() | 设定记录分类 (影响数据库记录表) setCategory (Change record table) | $this |
setItemid() | 设定操作对象id setItemid | $this |
setType() | 设置记录类型 setType | $this |
add() | 添加记录 add record to database | ASResult |
log() | 进行文件记录 log by file | ASResult |
generateLogName() | 生成记录文件名 generate Log File Name | string |
generateLogLine() | 生成记录行数据 generateLogLine | string |
getHost() | 获取当前来源域名 getHost | mixed|string |
getRealIP() | 获取真实IP getRealIP | array|bool|mixed|string |
__construct() | ASObject constructor. | mixed |
take() | 设置主体别称 Alias of setContent | $this |
setContent() | 设置结果包装中的主数据 set content of result | mixed |
sign() | 设置方法签名 Set method sign | mixed |
feedback() | 返回结果 通用 Returning result to the caller | ASResult |
error() | 返回错误 Returning Error result | ASResult |
success() | 返回成功 Return Success result | ASResult |
Properties
$userid
用户id
private
string
$userid
$itemid
对象id
private
string
$itemid
$status
状态码
private
int
$status
$event
事件
private
string
$event
$content
记录内容
private
string
$content
$type
事件类型
private
string
$type
$sign
签名头信息
private
string
$sign
$category
记录分类
private
string
$category
$DB
数据库联接
public
ASDB
$DB
$CLASSNAME
类名
protected
string
$CLASSNAME
$result
结果包装器
public
ASResult
$result
Methods
__construct()
ASObject constructor.
public
__construct(
[ $_ :
array
= null ]
[, $db :
ASDB
= null ]
)
: mixed
Parameters
- $_ : array = null
- $db : ASDB = null
Return values
mixedshared()
全局单例 shared
public
static shared(
[ $_ :
array|null
= null ]
[, $db :
ASDB|null
= null ]
)
: ASRecord
Parameters
- $_ : array|null = null
日志记录参数
- $db : ASDB|null = null
指定数据库链接
Return values
ASRecordsetDB()
设置独立数据库 setDB
public
setDB(
$dbInstance :
ASDB
)
: $this
Parameters
- $dbInstance : ASDB
Return values
$thissetUserid()
设定操作用户id set User id
public
setUserid(
$userid :
string
)
: $this
Parameters
- $userid : string
Return values
$thissetCategory()
设定记录分类 (影响数据库记录表) setCategory (Change record table)
public
setCategory(
$category :
string
)
: $this
Parameters
- $category : string
Return values
$thissetItemid()
设定操作对象id setItemid
public
setItemid(
$itemid :
string
)
: $this
Parameters
- $itemid : string
Return values
$thissetType()
设置记录类型 setType
public
setType(
$type :
string
)
: $this
Parameters
- $type : string
Return values
$thisadd()
添加记录 add record to database
public
add(
[ $_ :
array
= NULL ]
[, $status :
int
= NULL ]
[, $itemid :
string
= NULL ]
[, $type :
string
= NULL ]
[, $content :
array
= NULL ]
[, $category :
string
= NULL ]
[, $userid :
string
= NULL ]
[, $sign :
string
= NULL ]
[, $logToFile :
bool
= false ]
)
: ASResult
Parameters
- $_ : array = NULL
数组参数形式
- $status : int = NULL
状态码
- $itemid : string = NULL
操作对象id
- $type : string = NULL
记录类型
- $content : array = NULL
记录内容 array -> JSON
- $category : string = NULL
记录分类
- $userid : string = NULL
用户id
- $sign : string = NULL
操作签名
- $logToFile : bool = false
以文件形式记录
Return values
ASResultlog()
进行文件记录 log by file
public
log(
[ $_ :
array
= NULL ]
[, $status :
int
= NULL ]
[, $itemid :
string
= NULL ]
[, $type :
string
= NULL ]
[, $content :
array
= NULL ]
[, $category :
string
= NULL ]
[, $userid :
string
= NULL ]
[, $sign :
string
= NULL ]
)
: ASResult
Parameters
- $_ : array = NULL
- $status : int = NULL
- $itemid : string = NULL
- $type : string = NULL
- $content : array = NULL
- $category : string = NULL
- $userid : string = NULL
- $sign : string = NULL
Return values
ASResultgenerateLogName()
生成记录文件名 generate Log File Name
public
static generateLogName(
[ $pre :
string|null
= NULL ]
[, $mode :
string
= 'hour' ]
)
: string
Parameters
- $pre : string|null = NULL
- $mode : string = 'hour'
Return values
stringgenerateLogLine()
生成记录行数据 generateLogLine
public
static generateLogLine(
$content :
[, $mode :
string
= 'json' ]
)
: string
Parameters
Return values
stringgetHost()
获取当前来源域名 getHost
public
getHost(
)
: mixed|string
Return values
mixed|stringgetRealIP()
获取真实IP getRealIP
public
getRealIP(
)
: array|bool|mixed|string
Return values
array|bool|mixed|string__construct()
ASObject constructor.
public
__construct(
)
: mixed
Return values
mixedtake()
设置主体别称 Alias of setContent
public
take(
$content :
)
: $this
Parameters
Return values
$thissetContent()
设置结果包装中的主数据 set content of result
public
setContent(
$content :
)
: mixed
Parameters
Return values
mixedsign()
设置方法签名 Set method sign
public
sign(
$sign :
)
: mixed
Parameters
Return values
mixedfeedback()
返回结果 通用 Returning result to the caller
public
feedback(
[ $status :
int|null
= null ]
[, $message :
string|null
= null ]
[, $sign :
string|null
= null ]
)
: ASResult
Parameters
- $status : int|null = null
- $message : string|null = null
- $sign : string|null = null
Return values
ASResulterror()
返回错误 Returning Error result
public
error(
$status :
int
, $message :
string
[, $sign :
string|null
= null ]
)
: ASResult
Parameters
- $status : int
- $message : string
- $sign : string|null = null
Return values
ASResultsuccess()
返回成功 Return Success result
public
success(
[ $message :
string|null
= null ]
[, $sign :
string|null
= null ]
)
: ASResult
Parameters
- $message : string|null = null
- $sign : string|null = null