Shieldon\Firewall\Captcha\ImageCaptcha
array
$config -
設定值。void
$config = [
'word_length' => 6,
];
$captchaInstance = new \Shieldon\Captcha\ImageCaptcha($config);
$shieldon->setCaptcha($captchaInstance);
預設設定值:
鍵 | 類型 | 值 |
---|---|---|
img_width | int | 250 |
img_height | int | 50 |
word_length | int | 8 |
font_spacing | int | 10 |
pool | string | 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ |
colors | array | 參見下方的 顏色 設定值。 |
顏色設定值:
鍵 | 類型 | 值 |
---|---|---|
background | array | [255, 255, 255] |
border | array | [153, 200, 255] |
text | array | [51, 153, 255] |
grid | array | [153, 200, 255] |
範例:
$defaults = [
'img_width' => 250,
'img_height' => 50,
'word_length' => 8,
'font_spacing' => 10,
'pool' => '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ',
'colors' => [
'background' => [255, 255, 255],
'border' => [153, 200, 255],
'text' => [51, 153, 255],
'grid' => [153, 200, 255]
]
];