notafacil/zf3-coinhive-captcha 问题修复 & 功能扩展

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

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

notafacil/zf3-coinhive-captcha

Composer 安装命令:

composer require notafacil/zf3-coinhive-captcha

包简介

CoinHive Captcha module for Zend Framework 2 & 3 (ZF2 / ZF3)

README 文档

README

Simple way to use the coinhive.com captcha

Installation

with composer

Just add the following line to your requirements:

composer require notafacil/zf3-coinhive-captcha

and run

php composer.phar update

Since there are problems with the SSL-Cert if you use Adapter\Socket, please install php-curl!

Then activate the module in your application.config.php :

```php
return array(
    'modules' => array(
        // ...
        'CoinHiveCaptcha',
    ),
    // ...
);
```

Get your private-key

To use this service, you have to register at CoinHive using your CoinHive Account.

Usage

with Zend\From

Just add the following lines to your form creation:

$element = new \Zend\Captcha\Captcha('coinhive-captcha-token');
$element->setCaptcha(new CoinHiveCaptcha\CoinHiveCaptcha(array('secret_key' => 'YOUR_SECRET', 'public_key' => 'YOUR_PUBLIC_KEY', 'hashes' => 512)));
$form->add($element);

Remember to add this element to your validationChain as well.

It acts the same way as any other built-in captcha solution.

with ServiceManager

If you like to implement the view on your own, just use the Service\CoinHiveCaptchaService. It handles the whole communication between your code and the CoinHive API.

$recaptcha = $serviceLocator->get('CoinHiveCaptcha\Service\CoinHiveCaptchaService');

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-04-05

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固