sabirov/yii2-anti-captcha-v2 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

sabirov/yii2-anti-captcha-v2

Composer 安装命令:

composer require sabirov/yii2-anti-captcha-v2

包简介

работа с anti-captcha.com через API v.2

README 文档

README

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist sabirov/yii2-anti-captcha-v2 "*"

or add

"sabirov/yii2-anti-captcha-v2": "*"

to the require section of your composer.json file.

Usage

Refer to the Official Documentation

ImageToTextTask : solve usual image captcha

A simple example :

use Sabirov\AntiCaptcha\ImageToText;

$anticaptcha = new ImageToText();
$anticaptcha->setVerboseMode(true); // chatty mode ON
$anticaptcha->setKey( 'YourСlientKey' );
$anticaptcha->setFile( '/path/to/image' );

if ( ! $anticaptcha->createTask() ) {
    $anticaptcha->debout( "API v2 send failed - " . $anticaptcha->getErrorMessage(), "red" );

    return false;
}

$taskId = $anticaptcha->getTaskId();

if ( ! $anticaptcha->waitForResult() ) {
	$anticaptcha->debout( "could not solve captcha", "red" );
	$anticaptcha->debout( $anticaptcha->getErrorMessage() );
} else {
	echo "\nhash result: " . $captcha_result . "\n\n";
}

Object structure:

Property Set property Type Required Default value Purpose
body setFile($fileName) String Yes - in the set function to pass the absolute path to the image
phrase setPhraseFlag($value) Boolean No false false - no requirements true - worker must enter an answer with at least one "space"
case setCaseFlag($value) Boolean No false false - no requirements true - worker will see a special mark telling that answer must be entered with case sensitivity.
numeric setNumericFlag($value) Integer No 0 0 - no requirements 1 - only number are allowed 2 - any letters are allowed except numbers
math setMathFlag($value) Boolean No false false - no requirements true - worker will see a special mark telling that answer must be calculated
minLength setMinLengthFlag($value) Integer No 0 0 - no requirements >1 - defines minimum length of the answer
maxLength setMaxLengthFlag($value) Integer No 0 0 - no requirements >1 - defines maximum length of the answer

NoCaptchaTask : Google Recaptcha puzzle solving

Refer to the Official Documentation

NoCaptchaTaskProxyless : Google Recaptcha puzzle solving without proxies

A simple example :

use Sabirov\AntiCaptcha\NoCaptchaProxyless;

$anticaptcha = new NoCaptchaProxyless();
$anticaptcha->setVerboseMode(true); // chatty mode ON
$anticaptcha->setKey( 'YourСlientKey' );
$anticaptcha->setWebsiteURL( 'https://www.instagram.com/' );
$anticaptcha->setWebsiteKey( '6LebnxwUAAAAAGm3yH06pfqQtcMH0AYDwlsXnh-u' );

if ( ! $anticaptcha->createTask() ) {
	$anticaptcha->debout( "API v2 send failed - " . $anticaptcha->getErrorMessage(), "red" );
	return false;
}

$taskId = $anticaptcha->getTaskId();

if ( ! $anticaptcha->waitForResult() ) {
	$anticaptcha->debout( "could not solve captcha", "red" );
	$anticaptcha->debout( $anticaptcha->getErrorMessage() );
	return false;
} else {
	echo "\nhash result: " . $anticaptcha->getTaskSolution() . "\n\n";
}

Object structure:

Property Set property Type Required Purpose
websiteURL setWebsiteURL( $value ) String Yes Address of target web page
websiteKey setWebsiteKey( $value ) String Yes Recaptcha website key
websiteSToken setWebsiteSToken( $value ) String No Secret token for previous version of Recaptcha (now deprecated). In most cases websites use newer version and this token is not required.

统计信息

  • 总下载量: 5.68k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-04-11

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固