Zend Framework
1.12
|
Public Member Functions | |
__construct ($apiKey, $blog) | |
Constructor. | |
getBlogUrl () | |
Retrieve blog URL. | |
setBlogUrl ($blogUrl) | |
Set blog URL. | |
getApiKey () | |
Retrieve API key. | |
setApiKey ($apiKey) | |
Set API key. | |
getCharset () | |
Retrieve charset. | |
setCharset ($charset) | |
Set charset. | |
getPort () | |
Retrieve TCP/IP port. | |
setPort ($port) | |
Set TCP/IP port. | |
getUserAgent () | |
Retrieve User Agent string. | |
setUserAgent ($userAgent) | |
Set User Agent. | |
verifyKey ($key=null, $blog=null) | |
Verify an API key. | |
isSpam ($params) | |
Check a comment for spam. | |
submitSpam ($params) | |
Submit spam. | |
submitHam ($params) | |
Submit ham. | |
Protected Member Functions | |
_post ($host, $path, array $params) | |
Post a request. | |
_makeApiCall ($path, $params) | |
Perform an API call. | |
Protected Attributes | |
$_apiKey | |
$_blogUrl | |
$_charset = 'UTF-8' | |
$_port = 80 | |
$_userAgent | |
Additional Inherited Members | |
![]() | |
static | setHttpClient (Zend_Http_Client $httpClient) |
Sets the HTTP client object to use for retrieving the feeds. | |
static | getHttpClient () |
Gets the HTTP client object. | |
![]() | |
static | $_httpClient = null |
__construct | ( | $apiKey, | |
$blog | |||
) |
Constructor.
string | $apiKey | Akismet API key |
string | $blog | Blog URL |
|
protected |
Perform an API call.
string | $path | |
array | $params |
Zend_Service_Exception | if missing user_ip or user_agent fields |
|
protected |
Post a request.
string | $host | |
string | $path | |
array | $params |
getApiKey | ( | ) |
Retrieve API key.
getBlogUrl | ( | ) |
Retrieve blog URL.
getCharset | ( | ) |
Retrieve charset.
getPort | ( | ) |
Retrieve TCP/IP port.
getUserAgent | ( | ) |
Retrieve User Agent string.
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):
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.
array | $params |
Zend_Service_Exception | with invalid API key |
setApiKey | ( | $apiKey | ) |
setBlogUrl | ( | $blogUrl | ) |
Set blog URL.
string | $blogUrl |
Zend_Service_Exception | if invalid URL provided |
setCharset | ( | $charset | ) |
setPort | ( | $port | ) |
Set TCP/IP port.
int | $port |
Zend_Service_Exception | if non-integer value provided |
setUserAgent | ( | $userAgent | ) |
Set User Agent.
Should be of form "Some user agent/version | Akismet/version"
string | $userAgent |
Zend_Service_Exception | with invalid user agent string |
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.
array | $params |
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.
array | $params |
Zend_Service_Exception | with invalid API key |
verifyKey | ( | $key = null , |
|
$blog = null |
|||
) |
Verify an API key.
string | $key | Optional; API key to verify |
string | $blog | Optional; blog URL against which to verify key |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |