public function isCommentSpam($permaLink, $content, $type, $author = '', $authorEmailAddress = '', $authorUri = '')
    {
        if ($this->settings['apiKey'] === '' || $this->settings['apiKey'] === null) {
            $this->systemLogger->log('Could not check comment for spam because no Akismet API key was provided in the settings.', LOG_DEBUG);

            return false;
        }

        $arguments = array(
            'permalink' => $permaLink,
            'comment_type' => $type,
            'comment_author' => $author,
            'comment_author_email' => $authorEmailAddress,
            'comment_author_url' => $authorUri,
            'comment_content' => $content
        );
        $response = $this->sendRequest('comment-check', $arguments);
        switch ($response->getContent()) {
            case 'true':
                $this->systemLogger->log(sprintf('Akismet determined that the given comment referring to content with permalink "%s" is spam.', $permaLink), LOG_INFO);

                return true;
            case 'false':
                $this->systemLogger->log(sprintf('Akismet determined that the given comment referring to content with permalink "%s" is not spam.', $permaLink), LOG_INFO);

                return false;
            default:
                throw new Exception\ConnectionException('API error: ' . $response->getContent() . ' ' . $response->getHeader('X-akismet-debug-help'), 1335192487);
        }
    }
public function isCommentSpam($permaLink, $content, $type, $author = '', $authorEmailAddress = '', $authorUri = '')
    {
        if ($this->settings['apiKey'] === '' || $this->settings['apiKey'] === null) {
            $this->systemLogger->log('Could not check comment for spam because no Akismet API key was provided in the settings.', LOG_DEBUG);

            return false;
        }

        $arguments = array(
            'permalink' => $permaLink,
            'comment_type' => $type,
            'comment_author' => $author,
            'comment_author_email' => $authorEmailAddress,
            'comment_author_url' => $authorUri,
            'comment_content' => $content
        );
        $response = $this->sendRequest('comment-check', $arguments);
        switch ($response->getContent()) {
            case 'true':
                $this->systemLogger->log(sprintf('Akismet determined that the given comment referring to content with permalink "%s" is spam.', $permaLink), LOG_INFO);

                return true;
            case 'false':
                $this->systemLogger->log(sprintf('Akismet determined that the given comment referring to content with permalink "%s" is not spam.', $permaLink), LOG_INFO);

                return false;
            default:
                throw new Exception\ConnectionException('API error: ' . $response->getContent() . ' ' . $response->getHeader('X-akismet-debug-help'), 1335192487);
        }
    }
public function isCommentSpam ( $ permaLink , $ content , $ type , $ author = '' , $ authorEmailAddress = '' , $ authorUri = '' ) { if ( $ this -> settings [ 'apiKey' ] === '' || $ this -> settings [ 'apiKey' ] === null ) { $ this -> systemLogger -> log ( 'Could not check comment for spam because no Akismet API key was provided in the settings.' , LOG_DEBUG ) ; return false ; } $ arguments = array ( 'permalink' => $ permaLink , 'comment_type' => $ type , 'comment_author' => $ author , 'comment_author_email' => $ authorEmailAddress , 'comment_author_url' => $ authorUri , 'comment_content' => $ content ) ; $ response = $ this -> sendRequest ( 'comment-check' , $ arguments ) ; switch ( $ response -> getContent ( ) ) { case 'true' : $ this -> systemLogger -> log ( sprintf ( 'Akismet determined that the given comment referring to content with permalink "%s" is spam.' , $ permaLink ) , LOG_INFO ) ; return true ; case 'false' : $ this -> systemLogger -> log ( sprintf ( 'Akismet determined that the given comment referring to content with permalink "%s" is not spam.' , $ permaLink ) , LOG_INFO ) ; return false ; default : throw new Exception \ ConnectionException ( 'API error: ' . $ response -> getContent ( ) . ' ' . $ response -> getHeader ( 'X-akismet-debug-help' ) , 1335192487 ) ; } }
Checks if the given comment is considered spam by the service.

@param string $permaLink An absolute, permanent URI pointing to the item which was commented
@param string $content The actual content of the comment sent
@param string $type The comment type – can be any string, for example "post", "trackback" or the like
@param string $author The author name specified
@param string $authorEmailAddress The email address specified
@param string $authorUri A URI specified linking to the author's homepage or similar
@return boolean TRUE if the comment is considered spam, otherwise FALSE
@throws Exception\ConnectionException
@api
Checks if the given comment is considered spam by the service .