Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Moscow' for 'MSK/4.0/no DST' instead in /usr/share/php/smarty/Smarty_Compiler.class.php on line 400 Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Moscow' for 'MSK/4.0/no DST' instead in /usr/share/php/smarty/Smarty_Compiler.class.php on line 400 Docs For Class DeathByCaptcha_Client

Class DeathByCaptcha_Client

Description
Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Moscow' for 'MSK/4.0/no DST' instead in /usr/share/php/smarty/Smarty_Compiler.class.php on line 400

Base Death by Captcha API client

  • property-read: array|null $user: User's details
  • property-read: float|null $balance: User's balance (in US cents)
  • abstract:

Located in /deathbycaptcha.php (line 96)


	
			
Direct descendents
Class Description
DeathByCaptcha_HttpClient Death by Captcha HTTP API Client
DeathByCaptcha_SocketClient Death by Captcha socket API Client
Class Constant Summary
 API_VERSION = 'DBC/PHP v4.1.1'
Variable Summary
array $_userpwd
Method Summary
static array parse_json_response (string $s)
static array parse_plain_response (string $s)
DeathByCaptcha_Client __construct (string $username, string $password)
array|null decode ( $captcha, [int $timeout = self::DEFAULT_TIMEOUT])
float|null get_balance ()
array|null get_captcha (int $cid)
string|null get_text (int $cid)
array|null get_user ()
bool report (int $cid)
array|null upload (string|array|resource $captcha)
void _is_valid_captcha (string $img)
void _load_captcha ( $captcha)
Variables
Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Moscow' for 'MSK/4.0/no DST' instead in /usr/share/php/smarty/Smarty_Compiler.class.php on line 400
bool $is_verbose = false (line 118)

Verbosity flag.

When it's set to true, the client will produce debug output on every API call.

  • access: public
array $_userpwd = array() (line 109)

DBC account credentials

  • access: protected
Methods
Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Moscow' for 'MSK/4.0/no DST' instead in /usr/share/php/smarty/Smarty_Compiler.class.php on line 400
static method parse_json_response (line 139)

Parses JSON encoded response

  • access: public
static array parse_json_response (string $s)
  • string $s
static method parse_plain_response (line 127)

Parses URL query encoded responses

  • access: public
static array parse_plain_response (string $s)
  • string $s
Constructor __construct (line 274)
  • throws: DeathByCaptcha_RuntimeException When required extensions/functions not found
  • throws: DeathByCaptcha_RuntimeException On missing/empty DBC account credentials
  • access: public
DeathByCaptcha_Client __construct (string $username, string $password)
  • string $username: DBC account username
  • string $password: DBC account password

Redefined in descendants as:
close (line 186)

Closes opened connection (if any), as gracefully as possible

  • abstract:
  • access: public

Redefined in descendants as:
decode (line 253)

Tries to solve CAPTCHA by uploading it and polling for its status/text with arbitrary timeout. See DeathByCaptcha_Client::upload() for $captcha param details.

array|null decode ( $captcha, [int $timeout = self::DEFAULT_TIMEOUT])
  • int $timeout: Optional solving timeout (in seconds)
  • $captcha
get_balance (line 201)

Returns user's balance (in US cents)

float|null get_balance ()
get_captcha (line 212)

Returns CAPTCHA details

array|null get_captcha (int $cid)
  • int $cid: CAPTCHA ID

Redefined in descendants as:
get_text (line 221)

Returns CAPTCHA text

string|null get_text (int $cid)
  • int $cid: CAPTCHA ID
get_user (line 193)

Returns user details

array|null get_user ()

Redefined in descendants as:
report (line 232)

Reports an incorrectly solved CAPTCHA

  • abstract:
  • access: public
bool report (int $cid)
  • int $cid: CAPTCHA ID

Redefined in descendants as:
upload (line 241)

Uploads a CAPTCHA

  • return: Uploaded CAPTCHA details on success
  • abstract:
  • throws: DeathByCaptcha_InvalidCaptchaException On invalid CAPTCHA file
  • access: public
  • usedby: DeathByCaptcha_Client::decode()
array|null upload (string|array|resource $captcha)
  • string|array|resource $captcha: CAPTCHA image file name, vector of bytes, or file handle

Redefined in descendants as:
_is_valid_captcha (line 151)

Checks if CAPTCHA is valid (not empty)

  • throws: DeathByCaptcha_InvalidCaptchaException On invalid CAPTCHA images
  • access: protected
void _is_valid_captcha (string $img)
  • string $img: Raw CAPTCHA image
_load_captcha (line 162)
  • access: protected
void _load_captcha ( $captcha)
  • $captcha
Class Constants
Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Moscow' for 'MSK/4.0/no DST' instead in /usr/share/php/smarty/Smarty_Compiler.class.php on line 400
API_VERSION = 'DBC/PHP v4.1.1' (line 98)
DEFAULT_TIMEOUT = 60 (line 100)
POLLS_INTERVAL = 5 (line 101)
Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Moscow' for 'MSK/4.0/no DST' instead in /usr/share/php/smarty/Smarty_Compiler.class.php on line 400

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