Class DeathByCaptcha_SocketClient

Description

Death by Captcha socket API Client

Located in /deathbycaptcha.php (line 540)

DeathByCaptcha_Client
   |
   --DeathByCaptcha_SocketClient
Class Constant Summary
 FIRST_PORT = 8123
 HOST = 'api.dbcapi.me'
 LAST_PORT = 8130
 TERMINATOR = "\r\n"
Variable Summary
mixed $_sock
Method Summary
DeathByCaptcha_SocketClient __construct ( $username,  $password)
void close ()
void get_captcha ( $cid)
void get_user ()
void report ( $cid)
void upload ( $captcha)
array|null _call (string $cmd, [array $payload = null])
void _connect ()
string _sendrecv (string $buf)
Variables
mixed $_sock = null (line 549)
  • access: protected

Inherited Variables

Inherited from DeathByCaptcha_Client

DeathByCaptcha_Client::$is_verbose
DeathByCaptcha_Client::$_userpwd
Methods
Constructor __construct (line 722)
DeathByCaptcha_SocketClient __construct ( $username,  $password)
  • $username
  • $password

Redefinition of:
DeathByCaptcha_Client::__construct()
close (line 750)
void close ()

Redefinition of:
DeathByCaptcha_Client::close()
Closes opened connection (if any), as gracefully as possible
get_captcha (line 801)
void get_captcha ( $cid)
  • $cid

Redefinition of:
DeathByCaptcha_Client::get_captcha()
Returns CAPTCHA details
get_user (line 767)
void get_user ()

Redefinition of:
DeathByCaptcha_Client::get_user()
Returns user details
report (line 814)
void report ( $cid)
  • $cid

Redefinition of:
DeathByCaptcha_Client::report()
Reports an incorrectly solved CAPTCHA
upload (line 780)
void upload ( $captcha)
  • $captcha

Redefinition of:
DeathByCaptcha_Client::upload()
Uploads a CAPTCHA
_call (line 644)

Makes an API call

  • return: API response hash map on success
  • throws: DeathByCaptcha_IOException On network errors
  • throws: DeathByCaptcha_ServerException On API server errors
  • throws: DeathByCaptcha_AccessDeniedException On failed login attempt
  • throws: DeathByCaptcha_InvalidCaptchaException On invalid CAPTCHAs rejected by the service
  • access: protected
array|null _call (string $cmd, [array $payload = null])
  • string $cmd: API command to call
  • array $payload: API request payload
_connect (line 558)

Opens a socket connection to the API server

  • throws: DeathByCaptcha_RuntimeException When socket operations fail
  • throws: DeathByCaptcha_IOException When API connection fails
  • access: protected
void _connect ()
_sendrecv (line 594)

Socket send()/recv() wrapper

  • return: Raw API response on success
  • throws: DeathByCaptcha_IOException On network failures
  • access: protected
string _sendrecv (string $buf)
  • string $buf: Raw API request to send

Inherited Methods

Inherited From DeathByCaptcha_Client

DeathByCaptcha_Client::__construct()
DeathByCaptcha_Client::close()
DeathByCaptcha_Client::decode()
DeathByCaptcha_Client::get_balance()
DeathByCaptcha_Client::get_captcha()
DeathByCaptcha_Client::get_text()
DeathByCaptcha_Client::get_user()
DeathByCaptcha_Client::parse_json_response()
DeathByCaptcha_Client::parse_plain_response()
DeathByCaptcha_Client::report()
DeathByCaptcha_Client::upload()
DeathByCaptcha_Client::_is_valid_captcha()
DeathByCaptcha_Client::_load_captcha()
Class Constants
FIRST_PORT = 8123 (line 543)
HOST = 'api.dbcapi.me' (line 542)
LAST_PORT = 8130 (line 544)
TERMINATOR = "\r\n" (line 546)

Inherited Constants

Inherited from DeathByCaptcha_Client

DeathByCaptcha_Client::API_VERSION
DeathByCaptcha_Client::DEFAULT_TIMEOUT
DeathByCaptcha_Client::POLLS_INTERVAL

Documentation generated on Fri, 11 Nov 2011 19:25:42 +0400 by phpDocumentor 1.4.3