Public Member Functions | Static Public Member Functions | Protected Attributes

EventLog Class Reference

List of all members.

Public Member Functions

 __get ($name)

Static Public Member Functions

static register_type ($type= 'default', $module=null)
static unregister_type ($type= 'default', $module=null)
static log ($message, $severity= 'info', $type= 'default', $module=null, $data=null)
static get_module ($module=null, $level=2)
static get ($paramarray=array())
static trim ()
static purge ()

Protected Attributes

 $get_param_cache

Detailed Description

Habari EventLog class

Todo:
Apply system error handling

Definition at line 15 of file eventlog.php.


Member Function Documentation

EventLog::__get ( name  ) 

Returns properties of a EventLog object. 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.

Parameters:
string $name The name of the property to return.
Returns:
bool

Definition at line 32 of file eventlog.php.

static EventLog::get ( paramarray = array()  )  [static]

Returns a LogEntry or EventLog array based on supplied parameters. By default,fetch as many entries as pagination allows and order them in a descending fashion based on timestamp.

Todo:
Cache query results.
Parameters:
array $paramarray 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
Returns:
array An array of LogEntry objects, or a single LogEntry object, depending on request

Build the pubdate If we've got the day, then get the date. If we've got the month, but no date, get the month. If we've only got the year, get the whole year.

Todo:
Ensure that we've actually got all the needed parts when we query on them

Definition at line 151 of file eventlog.php.

Referenced by CoreDashModules::action_block_content_latest_log_activity().

static EventLog::get_module ( module = null,
level = 2 
) [static]

Get the module in which the logged code was executed

Parameters:
null $module
integer $level How many backtrace calls to go back through the trace
Returns:
string The classname or .php module in which the log code was called.

Definition at line 110 of file eventlog.php.

Referenced by log().

static EventLog::log ( message,
severity = 'info',
type = 'default',
module = null,
data = null 
) [static]

Write an entry to the event log.

Parameters:
string $message The message
string $severity The severity
string $type The type
string $module The module
mixed $data The data
Returns:
object LogEntry The inserted LogEntry object

Definition at line 84 of file eventlog.php.

Referenced by MemcacheCache::__construct(), FileCache::__construct(), APCCache::__construct(), Plugins::_autoload(), UserThemeHandler::act(), InstallHandler::act_begin_install(), WPImport::action_auth_ajax_wp_import_comments(), WPImport::action_auth_ajax_wp_import_posts(), WPImport::action_auth_ajax_wp_import_users(), Plugins::activate_plugin(), Themes::activate_theme(), UserGroup::add(), Update::add(), User::add_to_group(), User::authenticate(), Themes::cancel_preview(), ACL::create_token(), Update::cron(), Plugins::deactivate_plugin(), Vocabulary::delete(), UserGroup::delete(), Term::delete(), Post::delete(), Block::delete(), User::delete(), ACL::destroy_token(), UserThemeHandler::display(), Error::error_handler(), Error::exception_handler(), CronJob::execute(), URL::get(), User::grant(), ACL::grant_group(), Vocabulary::insert(), UserGroup::insert(), Term::insert(), Post::insert(), Block::insert(), User::insert(), Plugins::list_active(), Plugins::load(), Plugins::load_info(), Vocabulary::merge(), Pingback::pingback_all_links(), Themes::preview_theme(), Post::publish(), UserGroup::remove(), User::remove_from_group(), User::revoke(), ACL::revoke_group_token(), CronHandler::run_cron(), Pingback::send_pingback(), UserGroup::set_member_list(), and UserGroup::update().

static EventLog::register_type ( type = 'default',
module = null 
) [static]

Adds a logging type to the lookup table

Parameters:
string $type The type of the error
string $module The module of the error

Definition at line 48 of file eventlog.php.

Referenced by Pingback::action_plugin_activation(), and LogEntry::type().

static EventLog::unregister_type ( type = 'default',
module = null 
) [static]

Removes a logging type from the lookup table

Parameters:
string $type The type of the error
string $module The module of the error

Definition at line 64 of file eventlog.php.

Referenced by Pingback::action_plugin_deactivation().


The documentation for this class was generated from the following file: