|
Moodle
2.2.1
http://www.collinsharper.com
|


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 | |
Definition at line 45 of file Akismet.php.
| __construct | ( | $ | apiKey, |
| $ | blog | ||
| ) |
Constructor
| string | $apiKey | Akismet API key |
| string | $blog | Blog URL |
Definition at line 84 of file Akismet.php.

| _makeApiCall | ( | $ | path, |
| $ | params | ||
| ) | [protected] |
Perform an API call
| string | $path | |
| array | $params |
| Zend_Service_Exception | if missing user_ip or user_agent fields |
Definition at line 284 of file Akismet.php.


Post a request
| string | $host | |
| string | $path | |
| array | $params |
Definition at line 232 of file Akismet.php.


| getApiKey | ( | ) |
Retrieve API key
Definition at line 125 of file Akismet.php.

| getBlogUrl | ( | ) |
Retrieve blog URL
Definition at line 96 of file Akismet.php.

| getCharset | ( | ) |
Retrieve charset
Definition at line 147 of file Akismet.php.

| getPort | ( | ) |
Retrieve TCP/IP port
Definition at line 169 of file Akismet.php.

| getUserAgent | ( | ) |
Retrieve User Agent string
Definition at line 197 of file Akismet.php.

| 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 |
Definition at line 324 of file Akismet.php.

| setApiKey | ( | $ | apiKey | ) |
Set API key
| string | $apiKey |
Definition at line 136 of file Akismet.php.
| setBlogUrl | ( | $ | blogUrl | ) |
Set blog URL
| string | $blogUrl |
| Zend_Service_Exception | if invalid URL provided |
Definition at line 108 of file Akismet.php.


| setCharset | ( | $ | charset | ) |
Set charset
| string | $charset |
Definition at line 158 of file Akismet.php.
| setPort | ( | $ | port | ) |
Set TCP/IP port
| int | $port |
| Zend_Service_Exception | if 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"
| string | $userAgent |
| Zend_Service_Exception | with 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.
| array | $params |
Definition at line 383 of file Akismet.php.

| 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 |
Definition at line 355 of file Akismet.php.

| 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 |
Definition at line 258 of file Akismet.php.

$_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.