options to fine tune captcha image: max_front_lines, max_behind_lines
This commit is contained in:
parent
19142f30e4
commit
2d8d9f3b5f
|
@ -39,6 +39,8 @@ class Configuration implements ConfigurationInterface
|
|||
->scalarNode('whitelist_key')->defaultValue('captcha_whitelist_key')->end()
|
||||
->scalarNode('humanity')->defaultValue(0)->end()
|
||||
->scalarNode('distortion')->defaultValue(true)->end()
|
||||
->scalarNode('max_front_lines')->defaultValue(null)->end()
|
||||
->scalarNode('max_behind_lines')->defaultValue(null)->end()
|
||||
->end()
|
||||
;
|
||||
|
||||
|
|
|
@ -95,6 +95,9 @@ class CaptchaGenerator
|
|||
{
|
||||
$this->builder->setDistortion($options['distortion']);
|
||||
|
||||
$this->builder->setMaxFrontLines($options['max_front_lines']);
|
||||
$this->builder->setMaxBehindLines($options['max_behind_lines']);
|
||||
|
||||
$fingerprint = isset($options['fingerprint']) ? $options['fingerprint'] : null;
|
||||
|
||||
$content = $this->builder->build(
|
||||
|
|
|
@ -136,6 +136,8 @@ You can define the following configuration options globally or on the CaptchaTyp
|
|||
* **reload**: adds a link to reload the code
|
||||
* **humanity**: number of extra forms that the user can submit after a correct validation, if set to a value different of 0, only 1 over (1+humanity) forms will contain a CAPTCHA (default=0, i.e each form will contain the CAPTCHA)
|
||||
* **distortion**: enable or disable the distortion on the image (default=true, enabled)
|
||||
* **max_front_lines**, **max_behind_lines**: the maximum number of lines to draw on top/behind the image. `0` will draw no lines; `null` will use the default algorithm (the
|
||||
number of lines depends on the size of the image). (default=null)
|
||||
|
||||
Example :
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
],
|
||||
"require": {
|
||||
"php": ">=5.3.0",
|
||||
"gregwar/captcha": "v1.0.1"
|
||||
"gregwar/captcha": "v1.0.2"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-0": {
|
||||
|
|
Loading…
Reference in New Issue