Akismet REST service implementation
uses | |
---|---|
category | Zend |
package | Zend_Service |
subpackage | Akismet |
copyright | Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) |
license | New BSD License |
inherited_from | \Zend_Service_Abstract |
__construct(string $apiKey, string $blog) : void
string
Akismet API key
string
Blog URL
getApiKey() : string
string
getBlogUrl() : string
string
getCharset() : string
string
getHttpClient() : \Zend_Http_Client
\Zend_Http_Client
getPort() : integer
integer
getUserAgent() : string
string
isSpam(array $params) : boolean
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
\Zend_Service_Exception |
with invalid API key |
---|
boolean
setApiKey(string $apiKey) : \Zend_Service_Akismet
string
\Zend_Service_Akismet
setBlogUrl(string $blogUrl) : \Zend_Service_Akismet
string
\Zend_Service_Exception |
if invalid URL provided |
---|
\Zend_Service_Akismet
setCharset(string $charset) : \Zend_Service_Akismet
string
\Zend_Service_Akismet
setHttpClient(\Zend_Http_Client $httpClient)
\Zend_Http_Client
setPort(integer $port) : \Zend_Service_Akismet
integer
\Zend_Service_Exception |
if non-integer value provided |
---|
\Zend_Service_Akismet
setUserAgent(string $userAgent) : \Zend_Service_Akismet
Should be of form "Some user agent/version | Akismet/version"
string
\Zend_Service_Exception |
with invalid user agent string |
---|
\Zend_Service_Akismet
submitHam(array $params) : void
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
submitSpam(array $params) : void
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
\Zend_Service_Exception |
with invalid API key |
---|
verifyKey(string $key= null
, string $blog= null
) : boolean
string
Optional; API key to verify
string
Optional; blog URL against which to verify key
boolean
_makeApiCall(string $path, array $params) : \Zend_Http_Response
string
array
\Zend_Service_Exception |
if missing user_ip or user_agent fields |
---|
\Zend_Http_Response
_post(string $host, string $path, array $params) : mixed
string
string
array
mixed
$_apiKey : string
$_blogUrl : string
$_charset : string
'UTF-8'
$_httpClient : \Zend_Http_Client
null
$_port : integer
80
$_userAgent : string