Moodle  2.2.1
http://www.collinsharper.com
Zend_Service_Akismet Class Reference
Inheritance diagram for Zend_Service_Akismet:
Collaboration diagram for Zend_Service_Akismet:

Public Member Functions

 __construct ($apiKey, $blog)
 getBlogUrl ()
 setBlogUrl ($blogUrl)
 getApiKey ()
 setApiKey ($apiKey)
 getCharset ()
 setCharset ($charset)
 getPort ()
 setPort ($port)
 getUserAgent ()
 setUserAgent ($userAgent)
 verifyKey ($key=null, $blog=null)
 isSpam ($params)
 submitSpam ($params)
 submitHam ($params)

Protected Member Functions

 _post ($host, $path, array $params)
 _makeApiCall ($path, $params)

Protected Attributes

 $_apiKey
 $_blogUrl
 $_charset = 'UTF-8'
 $_port = 80
 $_userAgent

Detailed Description

Definition at line 45 of file Akismet.php.


Constructor & Destructor Documentation

__construct ( apiKey,
blog 
)

Constructor

Parameters:
string$apiKeyAkismet API key
string$blogBlog URL
Returns:
void

Definition at line 84 of file Akismet.php.

Here is the call graph for this function:


Member Function Documentation

_makeApiCall ( path,
params 
) [protected]

Perform an API call

Parameters:
string$path
array$params
Returns:
Zend_Http_Response
Exceptions:
Zend_Service_Exceptionif missing user_ip or user_agent fields

Definition at line 284 of file Akismet.php.

Here is the call graph for this function:

Here is the caller graph for this function:

_post ( host,
path,
array params 
) [protected]

Post a request

Parameters:
string$host
string$path
array$params
Returns:
mixed

Definition at line 232 of file Akismet.php.

Here is the call graph for this function:

Here is the caller graph for this function:

getApiKey ( )

Retrieve API key

Returns:
string

Definition at line 125 of file Akismet.php.

Here is the caller graph for this function:

Retrieve blog URL

Returns:
string

Definition at line 96 of file Akismet.php.

Here is the caller graph for this function:

Retrieve charset

Returns:
string

Definition at line 147 of file Akismet.php.

Here is the caller graph for this function:

getPort ( )

Retrieve TCP/IP port

Returns:
int

Definition at line 169 of file Akismet.php.

Here is the caller graph for this function:

Retrieve User Agent string

Returns:
string

Definition at line 197 of file Akismet.php.

Here is the caller graph for this function:

isSpam ( params)

Check a comment for spam

Checks a comment to see if it is spam. $params should be an associative array with one or more of the following keys (unless noted, all keys are optional):

  • blog: URL of the blog. If not provided, uses value returned by getBlogUrl()
  • user_ip (required): IP address of comment submitter
  • user_agent (required): User Agent used by comment submitter
  • referrer: contents of HTTP_REFERER header
  • permalink: location of the entry to which the comment was submitted
  • comment_type: typically, one of 'blank', 'comment', 'trackback', or 'pingback', but may be any value
  • comment_author: name submitted with the content
  • comment_author_email: email submitted with the content
  • comment_author_url: URL submitted with the content
  • comment_content: actual content

Additionally, Akismet suggests returning the key/value pairs in the $_SERVER array, and these may be included in the $params.

This method implements the Akismet comment-check REST method.

Parameters:
array$params
Returns:
boolean
Exceptions:
Zend_Service_Exceptionwith invalid API key

Definition at line 324 of file Akismet.php.

Here is the call graph for this function:

setApiKey ( apiKey)

Set API key

Parameters:
string$apiKey
Returns:
Zend_Service_Akismet

Definition at line 136 of file Akismet.php.

setBlogUrl ( blogUrl)

Set blog URL

Parameters:
string$blogUrl
Returns:
Zend_Service_Akismet
Exceptions:
Zend_Service_Exceptionif invalid URL provided

Definition at line 108 of file Akismet.php.

Here is the call graph for this function:

Here is the caller graph for this function:

setCharset ( charset)

Set charset

Parameters:
string$charset
Returns:
Zend_Service_Akismet

Definition at line 158 of file Akismet.php.

setPort ( port)

Set TCP/IP port

Parameters:
int$port
Returns:
Zend_Service_Akismet
Exceptions:
Zend_Service_Exceptionif non-integer value provided

Definition at line 181 of file Akismet.php.

setUserAgent ( userAgent)

Set User Agent

Should be of form "Some user agent/version | Akismet/version"

Parameters:
string$userAgent
Returns:
Zend_Service_Akismet
Exceptions:
Zend_Service_Exceptionwith invalid user agent string

Definition at line 211 of file Akismet.php.

submitHam ( params)

Submit ham

Takes the same arguments as isSpam().

Submits a comment that has been falsely categorized as spam by Akismet as a false positive, telling Akismet's filters not to filter such comments as spam in the future.

Unlike submitSpam() and isSpam(), a valid API key is never necessary; as a result, this method never throws an exception (unless an exception happens with the HTTP client layer).

this method implements Akismet's submit-ham REST method.

Parameters:
array$params
Returns:
void

Definition at line 383 of file Akismet.php.

Here is the call graph for this function:

submitSpam ( params)

Submit spam

Takes the same arguments as isSpam().

Submits known spam content to Akismet to help train it.

This method implements Akismet's submit-spam REST method.

Parameters:
array$params
Returns:
void
Exceptions:
Zend_Service_Exceptionwith invalid API key

Definition at line 355 of file Akismet.php.

Here is the call graph for this function:

verifyKey ( key = null,
blog = null 
)

Verify an API key

Parameters:
string$keyOptional; API key to verify
string$blogOptional; blog URL against which to verify key
Returns:
boolean

Definition at line 258 of file Akismet.php.

Here is the call graph for this function:


Field Documentation

$_apiKey [protected]

Definition at line 51 of file Akismet.php.

$_blogUrl [protected]

Definition at line 57 of file Akismet.php.

$_charset = 'UTF-8' [protected]

Definition at line 63 of file Akismet.php.

$_port = 80 [protected]

Definition at line 69 of file Akismet.php.

$_userAgent [protected]

Definition at line 75 of file Akismet.php.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations