Services_ProjectHoneyPot
[ class tree: Services_ProjectHoneyPot ] [ index: Services_ProjectHoneyPot ] [ all elements ]

Class: Services_ProjectHoneyPot

Source Location: /Services_ProjectHoneyPot-0.5.2/Services/ProjectHoneyPot.php

Class Overview


A class to interface services provided by ProjectHoneyPot.org


Author(s):

Version:

  • Release: 0.5.2

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 68]
A class to interface services provided by ProjectHoneyPot.org


[ Top ]


Class Variables

$accesskey =

[line 92]


Type:   string


[ Top ]

$debug =  false

[line 112]


Type:   bool


[ Top ]

$dns_blacklist =  'dnsbl.httpbl.org'

[line 98]


Type:   string


[ Top ]

$honeypot =

[line 119]


Type:   string


[ Top ]

$resolver =

[line 105]


Type:   object


[ Top ]

$responseFormat =  'array'

[line 124]

  • Var: Return an array or an object in the end?
  • Access: protected

Type:   string


[ Top ]

$responseFormats = array('array', 'object')

[line 84]

  • Var: array
  • Access: public

Type:   $responseFormats


[ Top ]



Method Detail

factory   [line 148]

Services_ProjectHoneyPot factory( [string $accesskey = null], [mixed $resolver = null], [bool $debug = null])

Initialize the class.

Parameters:

string   $accesskey   —  The accesskey provided by Project HoneyPot.
mixed   $resolver   —  'null' or Net_DNS_Resolver.
bool   $debug   —  Enable debug, or maybe not? :-)

[ Top ]

getHoneyPot   [line 362]

string|array|null getHoneyPot( )

Mostly a placeholder for what's to come. Currently we return a honeypot which has been supplied with self::setHoneypot before.

[ Top ]

getHostForLookup   [line 306]

string getHostForLookup( string $ip)

Builds the host to query.

Parameters:

string   $ip   —  The IP which needs to be resolved.

[ Top ]

parseResponse   [line 328]

array|Services_ProjectHoneyPot_Response_Result parseResponse( object $respObj)

Parses the response object into a 'readable' format

For a more detailed response description, please see {@see Services_ProjectHoneyPot_Response::parse()}


Parameters:

object   $respObj   —  Whatever we received from the API.

[ Top ]

query   [line 251]

array query( [string $ip = ''])

Checks if the supplied IP is listed.
  • See: Services_ProjectHoneyPot::factory
  • Todo: Check multiple if host has 1+ IPs.
  • Throws: Services_ProjectHoneyPot_Exception
  • Access: public
  • Uses: Services_ProjectHoneyPot::$resolver
  • Uses: Services_ProjectHoneyPot::parseResponse
  • Uses: Services_ProjectHoneyPot::getHostForLookup

Parameters:

string   $ip   —  IP or hostname. Using an IP is more "expensive" because we will need to resolve it.

[ Top ]

setAccesskey   [line 218]

string setAccesskey( string $accesskey)

Set the access key necessary to use this service.
  • See: Services_ProjectHoneyPot::factory
  • Access: public

Parameters:

string   $accesskey   —  Another accesskey.

[ Top ]

setDebug   [line 378]

boolean setDebug( boolean $debug)

Enable debug on runtime.

Parameters:

boolean   $debug   —  To debug (true), or not to debug (false)?

[ Top ]

setDnsBlacklist   [line 231]

string setDnsBlacklist( string $server)

Sets another (than the default) server to query.
  • Access: public

Parameters:

string   $server   —  The DNS server to query.

[ Top ]

setHoneypot   [line 345]

null|string|array setHoneypot( [string|array $honeypot = null])

Sets an URL or an array of URLs to use for redirecting later on, if the IP is found 'guilty'. ;-)

Parameters:

string|array   $honeypot   —  Set a honeypot (string), or multiple.

[ Top ]

setResolver   [line 171]

void setResolver( [mixed $resolver = null])

Set, or create a NET_DNS_Resolver for internal use.
  • Throws: Services_ProjectHoneyPot_Exception In case of a wrong object or an error on init.
  • Access: public
  • Uses: self::$resolver

Parameters:

mixed   $resolver   —  'null' or Net_DNS_Resolver

[ Top ]

setResponseFormat   [line 199]

string setResponseFormat( string $format)

Set the format to retrieve the info in.
  • Throws: Services_ProjectHoneyPot_Exception On unknown/unsupported format.
  • Access: public

Parameters:

string   $format   —  Either 'array' or 'object'.

[ Top ]


Documentation generated on Thu, 10 Dec 2015 05:49:18 +0000 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.