Class XFFilter

Description

XFFilter is an api for filtering identifiers against "spam databases"

XFFilter is an api for filtering identifiers against "spam databases"

Located in /lb_private/class.filter.php (line 43)


	
			
Class Constant Summary
 TYPE_IPA = 0x02
 TYPE_MSG = 0x04
 TYPE_UID = 0x01
Variable Summary
static array $data
mixed $raw
array $result
Method Summary
mixed add (integer $id, integer $type, boolean $value)
boolean bitmap_to_value (integer $bm)
mixed check (integer $id, integer $type, [string $flags = ''])
void dump (none 0)
true load (none 0)
mixed poll_sink (integer $id, integer $type)
integer prepend (integer $id, integer $type, boolean $value)
mixed query (integer $id, integer $type)
boolean remove (integer $key)
integer restrict_id (string $id, integer $type)
boolean save (none 0)
Variables
static array $data = array() (line 63)
  • var: the local database
  • access: protected
mixed $raw = array('_'=>1,'rrd'=>array()) (line 70)
  • access: protected
array $result = '' (line 68)
  • var: empty database structure
  • access: protected
mixed $result_cache = null (line 59)
  • var: result cache for later decisions (null=unknown,true=spam,false=ham)
  • access: public
Methods
add (line 153)

add a new entry to database

add a new entry to database

  • since: 1.1.0
  • access: public
mixed add (integer $id, integer $type, boolean $value)
  • integer $id: the sha1-hash as entry id
  • integer $type: select the type (uid,ipa,msg)
  • boolean $value: if 'true' this entry will be marked as spam
bitmap_to_value (line 386)

extract the spam marker from database entry

extract the spam marker from database entry

  • since: 1.1.0
  • access: protected
boolean bitmap_to_value (integer $bm)
  • integer $bm: the bitmap value from db
check (line 128)

check, if a entry is stored in database returns 'true', if spam is detected, 'false' otherwise.

check, if a entry is stored in database returns 'true', if spam is detected, 'false' otherwise. 'null' if an error has occured.

  • since: 1.1.0
  • access: public
mixed check (integer $id, integer $type, [string $flags = ''])
  • integer $id: the sha1-hash as entry id
  • integer $type: select the type (uid,ipa,msg)
  • string $flags: available: getifmissing,autosave
dump (line 163)

dump database to human-readable format

dump database to human-readable format

  • since: 1.1.0
  • access: public
void dump (none 0)
  • none 0
load (line 93)

load the database

load the database

  • since: 1.1.0
  • access: public
true load (none 0)
  • none 0
poll_sink (line 223)

ask external sources ("sink") for "spam score"

ask external sources ("sink") for "spam score" currently we have: real-time dns-blacklisting for IPs and scanners for message texts these can be on the local machine (e.g. spamassassin) or an external source (e.g. akismet)

  • since: 1.1.0
  • access: protected
mixed poll_sink (integer $id, integer $type)
  • integer $id: the sha1-hash as entry id
  • integer $type: select the type (uid,ipa,msg)
prepend (line 339)

really add an entry in our round-robin database

really add an entry in our round-robin database

  • since: 1.1.0
  • access: protected
integer prepend (integer $id, integer $type, boolean $value)
  • integer $id: the sha1-hash as entry id
  • integer $type: select the type (uid,ipa,msg)
  • boolean $value: if 'true' this entry will be marked as spam
query (line 194)

the real dirty work is done here by querying the database

the real dirty work is done here by querying the database

  • since: 1.1.0
  • access: protected
mixed query (integer $id, integer $type)
  • integer $id: the sha1-hash as entry id
  • integer $type: select the type (uid,ipa,msg)
remove (line 374)

remove an entry from database

remove an entry from database

  • since: 1.1.0
  • access: protected
boolean remove (integer $key)
  • integer $key: the key of the array entry
restrict_id (line 397)

restrict input id to an hash (sha1) for identifying entries

restrict input id to an hash (sha1) for identifying entries

  • since: 1.1.0
  • access: protected
integer restrict_id (string $id, integer $type)
  • string $id: this input will be converted to a sha1-hash as id
  • integer $type: select the type (uid,ipa,msg)
save (line 112)

save the database

save the database

  • since: 1.1.0
  • access: public
boolean save (none 0)
  • none 0
Class Constants
TYPE_IPA = 0x02 (line 51)
  • var: mapped id for IP Address entries
TYPE_MSG = 0x04 (line 55)
  • var: mapped id for Message entries
TYPE_UID = 0x01 (line 47)
  • var: mapped id for User-ID entries

Documentation generated on Sun, 20 Jun 2010 11:59:11 +0200 by phpDocumentor 1.4.3