ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
Log_observer Class Reference
+ Collaboration diagram for Log_observer:

Public Member Functions

 Log_observer ($priority=PEAR_LOG_INFO)
 Creates a new basic Log_observer instance.
factory ($type, $priority=PEAR_LOG_INFO, $conf=array())
 Attempts to return a new concrete Log_observer instance of the requested type.
 notify ($event)
 This is a stub method to make sure that Log_Observer classes do something when they are notified of a message.

Data Fields

 $_id = 0
 $_priority = PEAR_LOG_INFO

Detailed Description

Definition at line 21 of file observer.php.

Member Function Documentation

& Log_observer::factory (   $type,
  $priority = PEAR_LOG_INFO,
  $conf = array() 
)

Attempts to return a new concrete Log_observer instance of the requested type.

Parameters
string$typeThe type of concreate Log_observer subclass to return.
integer$priorityThe highest priority at which to receive log event notifications.
array$confOptional associative array of additional configuration values.
Returns
object The newly created concrete Log_observer instance, or null on an error.

Definition at line 70 of file observer.php.

References $type.

{
$type = strtolower($type);
$class = 'Log_observer_' . $type;
/*
* If the desired class already exists (because the caller has supplied
* it from some custom location), simply instantiate and return a new
* instance.
*/
if (class_exists($class)) {
$object = new $class($priority, $conf);
return $object;
}
/* Support both the new-style and old-style file naming conventions. */
$newstyle = true;
$classfile = dirname(__FILE__) . '/observer_' . $type . '.php';
if (!file_exists($classfile)) {
$classfile = 'Log/' . $type . '.php';
$newstyle = false;
}
/*
* Attempt to include our version of the named class, but don't treat
* a failure as fatal. The caller may have already included their own
* version of the named class.
*/
@include_once $classfile;
/* If the class exists, return a new instance of it. */
if (class_exists($class)) {
/* Support both new-style and old-style construction. */
if ($newstyle) {
$object = new $class($priority, $conf);
} else {
$object = new $class($priority);
}
return $object;
}
$null = null;
return $null;
}
Log_observer::Log_observer (   $priority = PEAR_LOG_INFO)

Creates a new basic Log_observer instance.

Parameters
integer$priorityThe highest priority at which to receive log event notifications.

public

Definition at line 50 of file observer.php.

{
$this->_id = md5(microtime());
$this->_priority = $priority;
}
Log_observer::notify (   $event)

This is a stub method to make sure that Log_Observer classes do something when they are notified of a message.

The default behavior is to just print the message, which is obviously not desireable in practically any situation - which is why you need to override this method. :)

Parameters
array$eventA hash describing the log event.

Definition at line 125 of file observer.php.

{
print_r($event);
}

Field Documentation

Log_observer::$_id = 0

Definition at line 29 of file observer.php.

Log_observer::$_priority = PEAR_LOG_INFO

Definition at line 40 of file observer.php.


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