[ Index ]

PHP Cross Reference of moodle-2.8

title

Body

[close]

/lib/zend/Zend/Service/ -> Akismet.php (summary)

Zend Framework LICENSE

Copyright: Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
License: http://framework.zend.com/license/new-bsd New BSD License
Version: $Id$
File Size: 387 lines (10 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

Zend_Service_Akismet:: (17 methods):
  __construct()
  getBlogUrl()
  setBlogUrl()
  getApiKey()
  setApiKey()
  getCharset()
  setCharset()
  getPort()
  setPort()
  getUserAgent()
  setUserAgent()
  _post()
  verifyKey()
  _makeApiCall()
  isSpam()
  submitSpam()
  submitHam()


Class: Zend_Service_Akismet  - X-Ref

Akismet REST service implementation

__construct($apiKey, $blog)   X-Ref
Constructor

param: string $apiKey Akismet API key
param: string $blog Blog URL
return: void

getBlogUrl()   X-Ref
Retrieve blog URL

return: string

setBlogUrl($blogUrl)   X-Ref
Set blog URL

param: string $blogUrl
return: Zend_Service_Akismet

getApiKey()   X-Ref
Retrieve API key

return: string

setApiKey($apiKey)   X-Ref
Set API key

param: string $apiKey
return: Zend_Service_Akismet

getCharset()   X-Ref
Retrieve charset

return: string

setCharset($charset)   X-Ref
Set charset

param: string $charset
return: Zend_Service_Akismet

getPort()   X-Ref
Retrieve TCP/IP port

return: int

setPort($port)   X-Ref
Set TCP/IP port

param: int $port
return: Zend_Service_Akismet

getUserAgent()   X-Ref
Retrieve User Agent string

return: string

setUserAgent($userAgent)   X-Ref
Set User Agent

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

param: string $userAgent
return: Zend_Service_Akismet

_post($host, $path, array $params)   X-Ref
Post a request

param: string $host
param: string $path
param: array  $params
return: mixed

verifyKey($key = null, $blog = null)   X-Ref
Verify an API key

param: string $key Optional; API key to verify
param: string $blog Optional; blog URL against which to verify key
return: boolean

_makeApiCall($path, $params)   X-Ref
Perform an API call

param: string $path
param: array $params
return: Zend_Http_Response

isSpam($params)   X-Ref
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 {@link 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.

param: array $params
return: boolean

submitSpam($params)   X-Ref
Submit spam

Takes the same arguments as {@link isSpam()}.

Submits known spam content to Akismet to help train it.

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

param: array $params
return: void

submitHam($params)   X-Ref
Submit ham

Takes the same arguments as {@link 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 {@link submitSpam()} and {@link 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.

param: array $params
return: void



Generated: Fri Nov 28 20:29:05 2014 Cross-referenced by PHPXref 0.7.1