cgsmith/zf1-recaptcha-2
Composer 安装命令:
composer require cgsmith/zf1-recaptcha-2
包简介
A quick package to assist with using Google reCAPTCHA version 2 with ZF1
关键字:
README 文档
README
ZF1 ships with Google reCAPTCHA version 1. Now that version 2 is available you will probably want to use an up-to-date element for your Zend Framework installations.
Installation
Composer Install
"require": {
"cgsmith/zf1-recaptcha-2": "~1.0"
}
Usage
Install the latest version (1.0.1) and setup your plugins and form abstract with the following information:
- On your application.ini or where you want
recaptcha.sitekey = "YOUR SITE KEY GIVEN BY GOOGLE" recaptcha.secretkey = "YOUR SECRET KEY GIVEN BY GOOGLE"
- In your bootstrap:
public function _initView() { $view = new Zend_View(); $view->addHelperPath( APPLICATION_PATH . '/../vendor/cgsmith/zf1-recaptcha-2/src/Cgsmith/View/Helper', 'Cgsmith\\View\\Helper\\' ); Zend_Controller_Action_HelperBroker::addHelper(new Zend_Controller_Action_Helper_ViewRenderer($view)); return $view; } public function _initRecaptcha() { $config = \Zend_Registry::get('application'); $params = $config->recaptcha->toArray(); $params['messageTemplates'] = [ \Cgsmith\Validate\Recaptcha::INVALID_CAPTCHA => 'The captcha was invalid', // set custom/translated message \Cgsmith\Validate\Recaptcha::CAPTCHA_EMPTY => 'The captcha must be completed' ]; \Zend_Registry::set('recaptcha', $params); }
- Below is what you would setup in your form.
<?php // create your element $this->addElement(new \Cgsmith\Form\Element\Recaptcha());
- On your controller, after "validate the post data"
if($form->isValid($_POST)) { $values = $form->getValues(); unset($values['g-recaptcha-response']); // Your business logic must be here }
About
Requirements
- ZF1 reCAPTCHA2 works with PHP 5.5 or above.
Submitting bugs and feature requests
Bugs and feature request are tracked on GitHub
Author
Chris Smith - chris@cgsmith.net - http://twitter.com/cgsmith105
License
ZF1 reCAPTCHA2 is licensed under the MIT License - see the LICENSE file for details
cgsmith/zf1-recaptcha-2 适用场景与选型建议
cgsmith/zf1-recaptcha-2 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 160.98k 次下载、GitHub Stars 达 8, 最近一次更新时间为 2015 年 03 月 31 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「zend」 「recaptcha」 「google」 「ZF1」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 cgsmith/zf1-recaptcha-2 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 cgsmith/zf1-recaptcha-2 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 cgsmith/zf1-recaptcha-2 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Client library for reCAPTCHA with proxy support, a free service that protects websites from spam and abuse.
Diese Contao 4 Erweiterung stellt Google reCAPTCHA V2 in Form eines neuen Formularfeldes im Formulargenerator bereit. This extension provides Google reCAPTCHA V2 in the form of a new form field in the form generator of Contao Open Source CMS.
A simple and easy to use Google ReCaptcha v3 package for Laravel
Polyfill for mb_ereg(), mb_eregi(), mb_ereg_match(), and mb_ereg_replace*() functions; primary use case is for mbstring on Windows 7.4+
Zend Framework 1 Http package
Zend Framework 1 Soap package
统计信息
- 总下载量: 160.98k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 9
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-03-31