Download the PHP package barrett/captcha without Composer

On this page you can find all versions of the php package barrett/captcha. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package captcha

Barrett-captcha

验证码扩展库

使用

一、安装

composer require barrett/captcha

二、初始化配置

引入本扩展库后,在实例化时可以传递配置参数,用于处理不同的场景。

配置表如下

参数名 参数类型 默认值 说明
key string Barrett 验证码加密key
destroy Boolean true 验证成功后是否销毁
expire integer 1800 验证码过期时间(s)
length integer 5 验证码长度
setZh Boolean false 使用中文验证码
width integer 180 图片验证码默认宽度
height integer 50 图片验证码默认高度
fontSize integer 20 验证码字体大小(px)
fontTtf string 验证码字体,不设置随机获取
useImgBg Boolean false 使用背景图片
useCurve Boolean true 是否画混淆曲线
useNoise Boolean true 是否添加杂点
bg array [243, 251, 254] 背景颜色

二、创建验证码

本扩展目前支持:图形验证码、数字验证码(短信用)两种,使用方法如下:

创建图形验证码

创建短信验证码

验证码效验

如输出结果异常请检查页面头部信息是否正常!如:Content-type:image/png 是否设置

三、场景标识

用例:客户更改已绑定的手机号,需要在同一个页面生成两个验证码(原手机验证码、新手机验证码)。 1.原手机创建验证码加入唯一场景标识:

2.新手机创建验证码同样加入唯一场景标识:

3.当用户提交数据时则根据唯一场景标识来检测对应场景的验证码是否正确,而不会出现相同页面多次调用后不能效验的问题。


All versions of captcha with dependencies

PHP Build Version
Package Version
No informations.
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package barrett/captcha contains the following files

Loading the files please wait ....