Docs For Class IDS_Report

## Class IDS_Report

Description

Implements interfaces:

- Countable (internal interface)
- IteratorAggregate (internal interface)

PHPIDS report object

The report objects collects a number of events and thereby presents the detected results. It provides a convenient API to work with the results.

Note that this class implements Countable, IteratorAggregate and a __toString() method

- author: Lars Strojny <lars@strojny.net>
- author: Christian Matthies <ch0012@gmail.com>
- author: Mario Heiderich <mario.heiderich@gmail.com>
- version: Release: $Id:Report.php 517 2007-09-15 15:04:13Z mario $
- copyright: 2007 The PHPIDS Group
- link: http://php-ids.org/
- license: LGPL

Located in /Report.php (line 53)

Variable Summary
array $centrifuge
array $events
integer $impact
array $tags
Method Summary
void __construct ([ $events = null])
object addEvent (IDS_Event $event)
void clear ()
integer count ()
array/null getCentrifuge ()
mixed getEvent (scalar $name)
integer getImpact ()
Iterator getIterator ()
array getTags ()
boolean hasEvent (scalar $name)
boolean isEmpty ()
boolean setCentrifuge ([array $centrifuge = array()])
string __toString ()
Variables
array $centrifuge = array() (line 91)

Centrifuge data

This variable - initiated as an empty array - carries all information about the centrifuge data if available

- access: protected

array $events = array() (line 61)

Event container

- access: protected

integer $impact = 0 (line 81)

Impact level

The impact level is calculated on demand by adding the results of the event objects on IDS_Report->getImpact()

- access: protected

array $tags = array() (line 71)

List of affected tags

This list of tags is collected from the collected event objects on demand when IDS_Report->getTags() is called

- access: protected

Methods
Constructor __construct (line 100)

Constructor

- access: public

void __construct ([ $events = null])

- array $events: the events the report should include

addEvent (line 116)

Adds an IDS_Event object to the report

- access: public

object addEvent (IDS_Event $event)

- object $event: IDS_Event

clear (line 248)

Clears calculated/collected values

- access: protected

void clear ()
count (line 214)

Returns total amount of events

- access: public

integer count ()

Implementation of:

Countable::count

getCentrifuge (line 260)

This method returns the centrifuge property or null if not filled with data

- access: public

array/null getCentrifuge ()
getEvent (line 135)

Get event by name

In most cases an event is identified by the key of the variable that contained maliciously appearing content

- return: IDS_Event object or false if the event does not exist
- throws: InvalidArgumentException if argument is invalid
- access: public

mixed getEvent (scalar $name)

- scalar $name: the event name

getImpact (line 179)

Returns total impact

Each stored IDS_Event object and its IDS_Filter sub-object are called to calculate the overall impact level of this request

- access: public

integer getImpact ()
getIterator (line 228)

Return iterator object

In order to provide the possibility to directly iterate over the IDS_Event object the IteratorAggregate is implemented. One can easily use foreach() to iterate through all stored IDS_Event objects.

- access: public

Iterator getIterator ()

Implementation of:

IteratorAggregate::getIterator

getTags (line 155)

Returns list of affected tags

- access: public

array getTags ()
hasEvent (line 200)

Checks if a specific event with given name exists

- throws: InvalidArgumentException if argument is illegal
- access: public

boolean hasEvent (scalar $name)

- scalar $name: the event name

isEmpty (line 238)

Checks if any events are registered

- access: public

boolean isEmpty ()
setCentrifuge (line 275)

This method sets the centrifuge property

- return: true is arguments were valid
- throws: InvalidArgumentException if argument is illegal
- access: public

boolean setCentrifuge ([array $centrifuge = array()])

- array $centrifuge: the centrifuge data

__toString (line 289)

Directly outputs all available information

- access: public

string __toString ()

Documentation generated on Mon, 22 Dec 2008 13:36:52 +0100 by phpDocumentor 1.4.2