cors/friendly-captcha-bundle

CORS - 友好验证码包

v1.0.3 2023-02-24 06:47 UTC

This package is auto-updated.

Last update: 2024-09-24 09:57:28 UTC


README

CI

此包为 Symfony 提供了简单的 friendlycaptcha.com 表单字段。

安装

步骤 1: 使用 composer 并启用 Bundle

要使用 Composer 安装 CORSFriendlyCaptchaBundle,只需在终端中输入

php composer.phar require cors/friendly-captcha-bundle

现在,Composer 将自动下载所有必要的文件,并为您安装它们。接下来,您需要更新您的 AppKernel.php 文件,并注册新的 Bundle

<?php

// in AppKernel::registerBundles()
$bundles = array(
    // ...
    new CORS\Bundle\FriendlyCaptchaBundle\CORSFriendlyCaptchaBundle(),
    // ...
);

步骤 2: 配置 Bundle

cors_friendly_captcha:
    sitekey: here_is_your_sitekey
    secret: here_is_your_secret
    use_eu_endpoints: true|false

可选:更改端点

cors_friendly_captcha:
  puzzle: 
    endpoint: https://api.friendlycaptcha.com/api/v1/puzzle
    eu_endpoint: https://eu-api.friendlycaptcha.eu/api/v1/puzzle
  validation: 
    endpoint: https://api.friendlycaptcha.com/api/v1/siteverify
    eu_endpoint: https://eu-api.friendlycaptcha.eu/api/v1/siteverify