Services_Akismet
[ class tree: Services_Akismet ] [ index: Services_Akismet ] [ all elements ]

Class: Services_Akismet

Source Location: /Services_Akismet-0.4.0/Akismet.php

Class Overview


Class to use Akismet API from PHP


Author(s):

Copyright:

  • 2007-2008 Bret Kuhns, 2008 silverorange

Methods


Inherited Variables

Inherited Methods


Class Details

[line 169]
Class to use Akismet API from PHP


[ Top ]


Method Detail

__construct (Constructor)   [line 249]

Services_Akismet __construct( string $blog_uri, string $api_key, [string $http_client_implementation = 'sockets'])

Creates a new Akismet object
  • Throws: Services_Akismet_InvalidApiKeyException if the provided Wordpress API key is not valid.
  • Throws: Services_Akismet_CommunicationException if there is an error communicating with the Akismet API server.
  • Throws: PEAR_Exception if the specified HTTP client implementation may not be used with this PHP installation or if the specified HTTP client implementation does not exist.
  • Access: public

Parameters:

string   $blog_uri   —  the URI of the webblog homepage.
string   $api_key   —  the Wordpress API key to use for Akismet services.
string   $http_client_implementation   —  optional. The name of the HTTP client implementation to use. This must be one of the implementations specified by Services_Akismet_HttpClient. If not specified, defaults to 'sockets'.

[ Top ]

isSpam   [line 282]

boolean isSpam( Services_Akismet_Comment $comment)

Checks whether or not a comment is spam
  • Return: true if the comment is spam and false if it is not.
  • Throws: Services_Akismet_InvalidCommentException if the specified comment is missing required fields.
  • Throws: Services_Akismet_CommunicationException if there is an error communicating with the Akismet API server.
  • Access: public

Parameters:

Services_Akismet_Comment   $comment   —  the comment to check.

[ Top ]

setHttpClientImplementation   [line 365]

void setHttpClientImplementation( string $implementation)

Sets the HTTP client implementation to use for this Akismet object

Available implementations are:

  • sockets
  • streams
  • curl

  • See: Services_Akismet_HttpClient
  • Throws: PEAR_Exception if the specified HTTP client implementation may not be used with this PHP installation or if the specified HTTP client implementation does not exist.
  • Access: public

Parameters:

string   $implementation   —  the name of the HTTP client implementation to use. This must be one of the implementations specified by Services_Akismet_HttpClient.

[ Top ]

submitFalsePositive   [line 336]

void submitFalsePositive( Services_Akismet_Comment $comment)

Submits a false-positive comment to the Akismet server

Use this method to submit comments that are detected as spam but are not actually spam.

  • Throws: Services_Akismet_InvalidCommentException if the specified comment is missing required fields.
  • Throws: Services_Akismet_CommunicationException if there is an error communicating with the Akismet API server.
  • Access: public

Parameters:

Services_Akismet_Comment   $comment   —  the comment that is <em>not</em> spam.

[ Top ]

submitSpam   [line 309]

void submitSpam( Services_Akismet_Comment $comment)

Submits a comment as an unchecked spam to the Akismet server

Use this method to submit comments that are spam but are not detected by Akismet.

  • Throws: Services_Akismet_InvalidCommentException if the specified comment is missing required fields.
  • Throws: Services_Akismet_CommunicationException if there is an error communicating with the Akismet API server.
  • Access: public

Parameters:

Services_Akismet_Comment   $comment   —  the comment to submit as spam.

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:16:42 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.