Skip to content

Commit

Permalink
把strategy文件夹名恢复成adapter
Browse files Browse the repository at this point in the history
  • Loading branch information
cmpan committed Sep 7, 2017
1 parent 82d5d6d commit 48fbf72
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ $cfg = [
'distortLevel' => 0,// 验证码扭曲级别(0-9),0为不扭曲,如果启用,建议为验证码字体大小/6
];
$capt = new \wf\captcha\strategy\GDSimple($cfg);
$capt = new \wf\captcha\adapter\GDSimple($cfg);
$secId = 'login';
$capt->render($secId);
Expand Down Expand Up @@ -63,7 +63,7 @@ if (!\wf\captcha\Code::check(@$_POST['secode'], $secId)) {
return [
'srv' => [
'captcha' => [
'class' => '\wf\captcha\strategy\GDSimple',
'class' => '\wf\captcha\adapter\GDSimple',
'gradient' => 32, // 文字倾斜度范围
'fontSize' => 30, // 验证码字体大小(px)
'length' => 4, // 验证码位数
Expand All @@ -80,7 +80,7 @@ return [
return [
'srv' => [
'captcha' => [
'class' => '\wf\captcha\strategy\GDSafety',
'class' => '\wf\captcha\adapter\GDSafety',
'expire' => 3000, // 验证码过期时间(s)
'gradient' => 20, // 文字倾斜度范围
'length' => 4, // 验证码位数
Expand All @@ -93,7 +93,7 @@ return [
return [
'srv' => [
'captcha' => [
'class' => '\wf\captcha\strategy\GD',
'class' => '\wf\captcha\adapter\GD',
'expire' => 3000, // 验证码过期时间(s)
'useBgImg' => false, // 是否使用背景图片
'useCurve' => false, // 是否画混淆曲线
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"captcha",
"anti robot"
],
"version" : "0.6.0",
"version" : "0.7.0",
"time" : "2017-06-26 16:10:00",
"require" : {
"php" : ">=5.5.0",
Expand Down
6 changes: 3 additions & 3 deletions lib/strategy/GD.php → lib/adapter/GD.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @copyright Copyright (c) 2008-2017 Windwork Team. (http://www.windwork.org)
* @license http://opensource.org/licenses/MIT
*/
namespace wf\captcha\strategy;
namespace wf\captcha\adapter;

/**
* 验证码(GD库实现)
Expand All @@ -16,15 +16,15 @@
* 可配置的属性都是一些简单直观的变量,我就不用弄一堆的setter/getter了
*
* usage:
* $capt = \wf\captcha\strategy\GD($cfg);
* $capt = \wf\captcha\adapter\GD($cfg);
* $capt->entry();
*
* 验证码对比校验
* if (!\wf\captcha\Code::check(@$_POST['secode'], $id)) {
* print 'error secode';
* }
*
* @package wf.captcha.strategy
* @package wf.captcha.adapter
* @author cmm <[email protected]>
* @link http://docs.windwork.org/manual/wf.captcha.html
* @since 1.0.0
Expand Down
6 changes: 3 additions & 3 deletions lib/strategy/GDSimple.php → lib/adapter/GDSimple.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace wf\captcha\strategy;
namespace wf\captcha\adapter;

/**
* 验证码(GD库实现)
Expand All @@ -9,15 +9,15 @@
* 可配置的属性都是一些简单直观的变量,我就不用弄一堆的setter/getter了
*
* usage:
* $capt = \wf\captcha\strategy\GDSimple($cfg);
* $capt = \wf\captcha\adapter\GDSimple($cfg);
* $capt->entry();
*
* 验证码对比校验
* if (!\wf\captcha\Captcha::check(@$_POST['secode'], $id)) {
* print 'error secode';
* }
*
* @package wf.captcha.strategy
* @package wf.captcha.adapter
* @author cm <[email protected]>
*/
class GDSimple implements \wf\captcha\CaptchaInterface
Expand Down
4 changes: 2 additions & 2 deletions test/testGD.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
require_once '../lib/CaptchaInterface.php';
require_once '../lib/Exception.php';
require_once '../lib/Code.php';
require_once '../lib/strategy/GD.php';
require_once '../lib/adapter/GD.php';

$capt = new \wf\captcha\strategy\GD();
$capt = new \wf\captcha\adapter\GD();
$capt->render('login');

// 验证码对比校验
Expand Down
4 changes: 2 additions & 2 deletions test/testGDSimple.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
require_once '../lib/CaptchaInterface.php';
require_once '../lib/Exception.php';
require_once '../lib/Code.php';
require_once '../lib/strategy/GDSimple.php';
require_once '../lib/adapter/GDSimple.php';

$capt = new \wf\captcha\strategy\GDSimple();
$capt = new \wf\captcha\adapter\GDSimple();
$capt->render('login');

// 验证码对比校验
Expand Down

0 comments on commit 48fbf72

Please sign in to comment.