PHP Класс Habari\EventLog

Наследование: extends ArrayObject
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$get_param_cache

Открытые методы

Метод Описание
__get ( string $name ) : boolean Returns properties of a EventLog object.
get ( array $paramarray = [] ) : array Returns a LogEntry or EventLog array based on supplied parameters.
get_module ( null $module = null, integer $level = 2 ) : string Get the module in which the logged code was executed
log ( string $message, string $severity = 'info', string $type = 'default', string $module = null, mixed $data = null ) : object Write an entry to the event log.
purge ( )
register_type ( string $type = 'default', string $module = null ) Adds a logging type to the lookup table
trim ( ) * Trim the EventLog down to the defined number of days to prevent it getting massively large.
unregister_type ( string $type = 'default', string $module = null ) Removes a logging type from the lookup table

Описание методов

__get() публичный Метод

This is the function that returns information about the set of log entries that was requested. This function should offer property names that are identical to properties of instances of the URL class. A call to EventLog::get() without parameters should return mostly the same property values as the global $url object for the request. The difference would occur when the data returned doesn't necessarily match the request, such as when several log entries are requested, but only one is available to return.
public __get ( string $name ) : boolean
$name string The name of the property to return.
Результат boolean

get() публичный статический Метод

By default,fetch as many entries as pagination allows and order them in a descending fashion based on timestamp.
public static get ( array $paramarray = [] ) : array
$paramarray array An associated array of parameters, or a querystring The following keys are supported: - id => an entry id or array of post ids - user_id => id of the logged in user for which to return entries - severity => severity level for which to return entries - type_id => the numeric id or array of ids for the type of entries for which which to return entries - module => a name or array of names of modules for which to return entries - type => a single type name or array of type names for which to return entries - ip => the IP number for which to return entries - criteria => a literal search string to match entry message content or a special search - day => a day of entry creation, ignored if month and year are not specified - month => a month of entry creation, ignored if year isn't specified - year => a year of entry creation - orderby => how to order the returned entries - fetch_fn => the function used to fetch data, one of 'get_results', 'get_row', 'get_value' - count => return the number of entries that would be returned by this request - month_cts => return the number of entries created in each month - nolimit => do not implicitly set limit - limit => the maximum number of entries to return, implicitly set for many queries - index => - offset => amount by which to offset returned entries, used in conjunction with limit - where => manipulate the generated WHERE clause - return_data => set to return the data associated with the entry
Результат array An array of LogEntry objects, or a single LogEntry object, depending on request

get_module() публичный статический Метод

Get the module in which the logged code was executed
public static get_module ( null $module = null, integer $level = 2 ) : string
$module null
$level integer How many backtrace calls to go back through the trace
Результат string The classname or .php module in which the log code was called.

log() публичный статический Метод

Write an entry to the event log.
public static log ( string $message, string $severity = 'info', string $type = 'default', string $module = null, mixed $data = null ) : object
$message string The message
$severity string The severity
$type string The type
$module string The module
$data mixed The data
Результат object LogEntry The inserted LogEntry object

purge() публичный статический Метод

public static purge ( )

register_type() публичный статический Метод

Adds a logging type to the lookup table
public static register_type ( string $type = 'default', string $module = null )
$type string The type of the error
$module string The module of the error

trim() публичный статический Метод

* Trim the EventLog down to the defined number of days to prevent it getting massively large.
public static trim ( )

unregister_type() публичный статический Метод

Removes a logging type from the lookup table
public static unregister_type ( string $type = 'default', string $module = null )
$type string The type of the error
$module string The module of the error

Описание свойств

$get_param_cache защищенное свойство

protected $get_param_cache