Dotclear 2.25
Loading...
Searching...
No Matches
akismet Class Reference
Inheritance diagram for akismet:
netHttp netSocket

Public Member Functions

 __construct (string $blog_url, ?string $api_key)
 
 verify ()
 
 comment_check (string $permalink, string $type, ?string $author, ?string $email, ?string $url, ?string $content)
 
 submit_spam (string $permalink, string $type, ?string $author, ?string $email, ?string $url, ?string $content)
 
 submit_ham (string $permalink, string $type, ?string $author, ?string $email, ?string $url, ?string $content)
 
- Public Member Functions inherited from netHttp
 __construct ($host, int $port=80, ?int $timeout=null)
 
 get (string $path, $data=false)
 
 post (string $path, $data, ?string $charset=null)
 
 getStatus ()
 
 getContent ()
 
 getHeaders ()
 
 getHeader ($header)
 
 getCookies ()
 
 getRequestURL ()
 
 setHost (string $host, int $port=80)
 
 setProxy ($host, int $port=8080)
 
 setTimeout (int $timeout)
 
 setUserAgent (string $user_agent)
 
 setAuthorization (?string $username, ?string $password)
 
 setMoreHeader (string $header)
 
 voidMoreHeaders ()
 
 setCookies (array $cookies)
 
 useSSL (bool $flag)
 
 useGzip (bool $flag)
 
 setPersistCookies (bool $flag)
 
 setPersistReferers (bool $flag)
 
 setHandleRedirects (bool $flag)
 
 setMaxRedirects (int $num)
 
 setHeadersOnly (bool $flag)
 
 setDebug (bool $flag)
 
 setOutput (?string $out)
 
- Public Member Functions inherited from netSocket
 __construct (string $host, int $port, int $timeout=10)
 
 __destruct ()
 
 host (?string $host=null)
 
 port (?int $port=null)
 
 timeout (?int $timeout=null)
 
 setBlocking (bool $block)
 
 open ()
 
 close ()
 
 write ($data)
 
 flush ()
 
 isOpen ()
 

Protected Member Functions

 callFunc (string $function, string $permalink, string $type, ?string $author, ?string $email, ?string $url, ?string $content, array $info=[])
 
- Protected Member Functions inherited from netHttp
 buildQueryString ($data)
 
 doRequest ()
 
 buildRequest ()
 
 outputOpen ()
 
 outputClose ()
 
 outputWrite ($content)
 
 debug (string $msg, $object=false)
 
- Protected Member Functions inherited from netSocket
 iterator ()
 

Protected Attributes

 $base_host = 'rest.akismet.com'
 
 $ak_host = ''
 
 $ak_version = '1.1'
 
 $ak_path = '/%s/%s'
 
 $ak_key = null
 
 $blog_url
 
- Protected Attributes inherited from netHttp
 $host
 
 $port
 
 $path
 
 $method
 
 $postdata = ''
 
 $post_charset
 
 $cookies = []
 
 $referer
 
 $accept = 'text/xml,application/xml,application/xhtml+xml,text/html,text/plain,image/png,image/jpeg,image/gif,image/webp,*/*'
 
 $accept_encoding = 'gzip'
 
 $accept_language = 'en-us'
 
 $user_agent = 'Clearbricks HTTP Client'
 
 $more_headers = []
 
 $timeout = 10
 
 $use_ssl = false
 
 $use_gzip = false
 
 $persist_cookies = true
 
 $persist_referers = true
 
 $debug = false
 
 $handle_redirects = true
 
 $max_redirects = 5
 
 $headers_only = false
 
 $username
 
 $password
 
 $proxy_host
 
 $proxy_port
 
 $status
 
 $status_string
 
 $headers = []
 
 $content = ''
 
 $redirect_count = 0
 
 $cookie_host = ''
 
 $output = null
 
 $output_h = null
 
- Protected Attributes inherited from netSocket
 $_host
 
 $_port
 
 $_transport = ''
 
 $_timeout
 
 $_handle
 

Additional Inherited Members

- Static Public Member Functions inherited from netHttp
static quickGet (string $url, ?string $output=null)
 
static quickPost (string $url, array $data, ?string $output=null)
 
static initClient (string $url, string &$path)
 
static readURL (string $url, bool &$ssl, string &$host, int &$port, string &$path, string &$user, string &$pass)
 

Constructor & Destructor Documentation

◆ __construct()

__construct ( string  $blog_url,
?string  $api_key 
)

Constructs a new instance.

Parameters
string$blog_urlThe blog URL
null | string$api_keyThe API key

References $base_host, $blog_url, and DC_QUERY_TIMEOUT.

Member Function Documentation

◆ verify()

verify ( )

◆ comment_check()

comment_check ( string  $permalink,
string  $type,
?string  $author,
?string  $email,
?string  $url,
?string  $content 
)

Check if a comment is valid or not

Parameters
string$permalinkThe permalink
string$typeThe type
null | string$authorThe author
null | string$emailThe email
null | string$urlThe url
null | string$contentThe content
Returns
bool

References netHttp\$content, and callFunc().

◆ submit_spam()

submit_spam ( string  $permalink,
string  $type,
?string  $author,
?string  $email,
?string  $url,
?string  $content 
)

Submit positive (spam) comment to Akismet API

Parameters
string$permalinkThe permalink
string$typeThe type
null | string$authorThe author
null | string$emailThe email
null | string$urlThe url
null | string$contentThe content
Returns
bool

References netHttp\$content, and callFunc().

◆ submit_ham()

submit_ham ( string  $permalink,
string  $type,
?string  $author,
?string  $email,
?string  $url,
?string  $content 
)

Submit negative (not spam) comment to Akismet API

Parameters
string$permalinkThe permalink
string$typeThe type
null | string$authorThe author
null | string$emailThe email
null | string$urlThe url
null | string$contentThe content
Returns
bool

References netHttp\$content, and callFunc().

◆ callFunc()

callFunc ( string  $function,
string  $permalink,
string  $type,
?string  $author,
?string  $email,
?string  $url,
?string  $content,
array  $info = [] 
)
protected

Call an Akismet API method

Parameters
string$functionThe function
string$permalinkThe permalink
string$typeThe type
string$authorThe author
string$emailThe email
string$urlThe url
string$contentThe content
array$infoThe information
Exceptions
Exception
Returns
bool

References $ak_host, $blog_url, netHttp\$content, netHttp\$path, netHttp\$referer, netHttp\getContent(), netHttp\getStatus(), netSocket\host(), netHttp\post(), and http\realIP().

Referenced by comment_check(), submit_ham(), and submit_spam().

Field Documentation

◆ $base_host

$base_host = 'rest.akismet.com'
protected

Referenced by __construct(), and verify().

◆ $ak_host

$ak_host = ''
protected

Referenced by callFunc().

◆ $ak_version

$ak_version = '1.1'
protected

◆ $ak_path

$ak_path = '/%s/%s'
protected

◆ $ak_key

$ak_key = null
protected

Referenced by verify().

◆ $blog_url

$blog_url
protected

Blog URL

$var string

Referenced by __construct(), callFunc(), and verify().


The documentation for this class was generated from the following file: