PHP 클래스 bedezign\yii2\audit\Audit

This module is also responsible for starting the audit process. To configure it you need to do 2 things: - add a module configuration entry: 'modules' => [ 'audit' => 'bedezign\yii2\audit\Audit', ] or optionally with configuration: 'modules' => [ 'audit' => [ 'class' => 'bedezign\yii2\audit\Audit', 'ignoreActions' => ['debug/*'] ] - If you want to auto track actions, be sure to add the module to the application bootstrapping: 'bootstrap' => ['audit'],
상속: extends yii\base\Module
파일 보기 프로젝트 열기: bedezign/yii2-audit 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$accessIps IP address or list of IP addresses with access to the viewer, null for everyone (if the IP matches) An IP address can contain the wildcard * at the end so that it matches IP addresses with the same prefix. For example, '192.168.*' matches all IP addresses in the segment '192.168.'.
$accessRoles Role or list of roles with access to the viewer, null for everyone (if the user matches)
$accessUsers User ID or list of user IDs with access to the viewer, null for everyone (if the role matches)
$batchSave The module does batch saving of the data records by default. You can disable this if you are experiencing max_allowed_packet errors when logging huge data quantities. Records will be saved per piece instead of all at once
$compressData Compress extra data generated or just keep in text? For people who don't like binary data in the DB
$db name of the component to use for database access
$ignoreActions Action or list of actions to ignore. '*' is allowed as the first or last character to use as wildcard (eg 'debug/*').
$layout the layout that should be applied for views within this module. This refers to a view name relative to [[layoutPath]]. If this is not set, it means the layout value of the [[module|parent module]] will be taken. If this is false, layout will be disabled within this module.
$logTarget bedezign\yii2\audit\LogTarget
$maxAge Maximum age (in days) of the audit entries before they are truncated
$panels list of panels that should be active/tracking/available during the auditing phase. If the value is a simple string, it is the identifier of an internal panel to activate (with default settings) If the entry is a '' => '|' it is either a new panel or a panel override (if you specify a core id). It is important that the key is unique, as this is the identifier used to store any data associated with the panel. Please note: - If you just want to change the configuration for a core panel, use the $panelConfiguration, it will be merged into this one - If you add custom panels, please namespace them ("mynamespace/panelname").
$panelsMerge This gives you an easy way to just add or modify panels/configurations without having to re-specify every panel. This only accepts regular definitions ('' => ''), but the core class will be added if needed Take a look at the module configuration for more information.
$traceLine
$trackActions Action or list of actions to track. '*' is allowed as the first or last character to use as wildcard.
$userFilterCallback Will be called to translate text in the user filter into a (or more) user id's
$userIdentifierCallback The callback to use to convert a user id into an identifier (username, email, ...). Can also be html.

공개 메소드들

메소드 설명
__call ( string $name, array $params ) : mixed
findModuleIdentifier ( ) : integer | null | string
findPanelIdentifier ( string $className ) : boolean | string
getDb ( ) : Connection
getEntry ( boolean $create = false, boolean $new = false ) : AuditEntry | static
getPanel ( string $identifier ) : null | bedezign\yii2\audit\components\panels\Panel
getPanelIdentifiers ( ) : string[] Returns a list of all available panel identifiers
getUserIdentifier ( $user_id ) : string
init ( )
loadPanels ( $list ) : bedezign\yii2\audit\components\panels\Panel[] Tries to assemble the configuration for the panels that the user wants for auditing
onAfterRequest ( )
onBeforeAction ( ActionEvent $event ) Called to evaluate if the current request should be logged
registerFunction ( string $name, callable $callback ) Allows panels to register functions that can be called directly on the module
registerPanel ( Panel $panel )

보호된 메소드들

메소드 설명
normalizePanelConfiguration ( ) Make sure the configured panels array is a uniform set of => entries.
routeMatches ( string $route, string[] $list ) : boolean Verifies a route against a given list and returns whether it matches or not.

메소드 상세

__call() 공개 메소드

public __call ( string $name, array $params ) : mixed
$name string
$params array
리턴 mixed

findModuleIdentifier() 공개 정적인 메소드

public static findModuleIdentifier ( ) : integer | null | string
리턴 integer | null | string

findPanelIdentifier() 공개 정적인 메소드

public static findPanelIdentifier ( string $className ) : boolean | string
$className string
리턴 boolean | string

getDb() 공개 메소드

public getDb ( ) : Connection
리턴 yii\db\Connection the database connection.

getEntry() 공개 메소드

public getEntry ( boolean $create = false, boolean $new = false ) : AuditEntry | static
$create boolean
$new boolean
리턴 bedezign\yii2\audit\models\AuditEntry | static

getPanel() 공개 메소드

public getPanel ( string $identifier ) : null | bedezign\yii2\audit\components\panels\Panel
$identifier string
리턴 null | bedezign\yii2\audit\components\panels\Panel

getPanelIdentifiers() 공개 메소드

Returns a list of all available panel identifiers
public getPanelIdentifiers ( ) : string[]
리턴 string[]

getUserIdentifier() 공개 메소드

public getUserIdentifier ( $user_id ) : string
$user_id
리턴 string

init() 공개 메소드

public init ( )

loadPanels() 공개 메소드

Tries to assemble the configuration for the panels that the user wants for auditing
public loadPanels ( $list ) : bedezign\yii2\audit\components\panels\Panel[]
리턴 bedezign\yii2\audit\components\panels\Panel[]

normalizePanelConfiguration() 보호된 메소드

Make sure the configured panels array is a uniform set of => entries.

onAfterRequest() 공개 메소드

public onAfterRequest ( )

onBeforeAction() 공개 메소드

Called to evaluate if the current request should be logged
public onBeforeAction ( ActionEvent $event )
$event yii\base\ActionEvent

registerFunction() 공개 메소드

Allows panels to register functions that can be called directly on the module
public registerFunction ( string $name, callable $callback )
$name string
$callback callable

registerPanel() 공개 메소드

public registerPanel ( Panel $panel )
$panel yii\debug\Panel

routeMatches() 보호된 메소드

Entries in the list are allowed to end with a '*', which means that a substring will be used for the match instead of a full compare.
protected routeMatches ( string $route, string[] $list ) : boolean
$route string An application rout
$list string[] List of routes to compare against.
리턴 boolean

프로퍼티 상세

$accessIps 공개적으로 프로퍼티

IP address or list of IP addresses with access to the viewer, null for everyone (if the IP matches) An IP address can contain the wildcard * at the end so that it matches IP addresses with the same prefix. For example, '192.168.*' matches all IP addresses in the segment '192.168.'.
public $accessIps

$accessRoles 공개적으로 프로퍼티

Role or list of roles with access to the viewer, null for everyone (if the user matches)
public $accessRoles

$accessUsers 공개적으로 프로퍼티

User ID or list of user IDs with access to the viewer, null for everyone (if the role matches)
public $accessUsers

$batchSave 공개적으로 프로퍼티

The module does batch saving of the data records by default. You can disable this if you are experiencing max_allowed_packet errors when logging huge data quantities. Records will be saved per piece instead of all at once
public $batchSave

$compressData 공개적으로 프로퍼티

Compress extra data generated or just keep in text? For people who don't like binary data in the DB
public $compressData

$db 공개적으로 프로퍼티

name of the component to use for database access
public $db

$ignoreActions 공개적으로 프로퍼티

Action or list of actions to ignore. '*' is allowed as the first or last character to use as wildcard (eg 'debug/*').
public $ignoreActions

$layout 공개적으로 프로퍼티

the layout that should be applied for views within this module. This refers to a view name relative to [[layoutPath]]. If this is not set, it means the layout value of the [[module|parent module]] will be taken. If this is false, layout will be disabled within this module.
public $layout

$logTarget 공개적으로 프로퍼티

public LogTarget,bedezign\yii2\audit $logTarget
리턴 bedezign\yii2\audit\LogTarget

$maxAge 공개적으로 프로퍼티

Maximum age (in days) of the audit entries before they are truncated
public $maxAge

$panels 공개적으로 프로퍼티

list of panels that should be active/tracking/available during the auditing phase. If the value is a simple string, it is the identifier of an internal panel to activate (with default settings) If the entry is a '' => '|' it is either a new panel or a panel override (if you specify a core id). It is important that the key is unique, as this is the identifier used to store any data associated with the panel. Please note: - If you just want to change the configuration for a core panel, use the $panelConfiguration, it will be merged into this one - If you add custom panels, please namespace them ("mynamespace/panelname").
public $panels

$panelsMerge 공개적으로 프로퍼티

This gives you an easy way to just add or modify panels/configurations without having to re-specify every panel. This only accepts regular definitions ('' => ''), but the core class will be added if needed Take a look at the module configuration for more information.
public $panelsMerge

$traceLine 공개적으로 프로퍼티

또한 보기: yii\debug\Module::$traceLine
public $traceLine

$trackActions 공개적으로 프로퍼티

Action or list of actions to track. '*' is allowed as the first or last character to use as wildcard.
public $trackActions

$userFilterCallback 공개적으로 프로퍼티

Will be called to translate text in the user filter into a (or more) user id's
public $userFilterCallback

$userIdentifierCallback 공개적으로 프로퍼티

The callback to use to convert a user id into an identifier (username, email, ...). Can also be html.
public $userIdentifierCallback