The standalone package library
Reviewable at https://dev.tornevall.net/sources/dnsbl/tornevall_dnsbl.php
Usage
require_once(__DIR__ . "/tornevall_dnsbl.php"); $dnsbl = new \TorneLIB\TorneLIB_DNSBL(); if ($dnsbl->isListed($testaddr)) { /* Actions to take against this host */ }
Other methods
Method | Parameters | Type | Result |
---|---|---|---|
isListed() | ipAddress | bool | The example above |
resolveBlacklist() | ipAddress (v4/v6) getListedTypes (default=false) | array | An array with strings defined in TORNEVALL_DNSBL_BITS. BIT_REPORTED = 1 |
getBitArray() | bitValue (integer) | array | |
getBlVersion() | blZone | string | If no zone are given the default value from the class TORNEVALL_DNSBL_ZONES is set to dnsbl.tornevall.org. As described above, which DNSBL version is active, this function returns the version id of the current release. |
isBit() | bitType, bitValue | bool | The TORNEVALL_DNSBL_BITS-class also have another method callable from public called isBit(). isBit()-method $bitValue = 80; $BitClass = new \TorneLIB\TORNEVALL_DNSBL_BITS(); if ($BitClass->isBit(self::BIT_SPAM, $bitValue)) { /* Do something here */ } if ($BitClass->isBit(self::BIT_ABUSE, $bitValue)) { /* Do something here */ } This method is calling isBit() in the TORNEVALL_DNSBL_BITS-class. |
What is happening in this component?