Skip to content

Commit

Permalink
适配x2 (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
hanwenbo authored and evalor committed Apr 8, 2018
1 parent c502751 commit 56f4432
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 8 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,12 @@ composer require easyswoole/verifycode
组件本身提供了默认配置,即使不做任何设置也可以直接生成验证码,需要对验证码进行自定义配置可以使用组件提供的`Conf`类进行动态配置

```
// x1
use easySwoole\VerifyCode\Conf;
$Conf = new Conf();
// x2
use EasySwoole\VerifyCode\Conf;
$Conf = new Conf();
```

#### 设置字符集合
Expand Down Expand Up @@ -109,10 +113,10 @@ $VCode = new VerifyCode($Conf);
$VCode = new VerifyCode($Conf);
// 随机生成验证码
$Code = $VCode->DrawCode();
$Code = $VCode->DrawCode(); // x2 ->drawCode
// 生成指定验证码
$Code = $VCode->DrawCode('MyCode');
$Code = $VCode->DrawCode('MyCode'); // x2 ->drawCode
```

生成好验证码后结果是一个`Result`类,可以使用`getImageBody`获取验证码的图片内容,使用`getImageStr`获得验证码字符,`getMineType`获得验证码的Mine信息
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
"autoload": {
"psr-4": {
"easySwoole\\VerifyCode\\":"src"
"EasySwoole\\VerifyCode\\":"src"
}
}
}
4 changes: 2 additions & 2 deletions src/Conf.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
// | Welcome Join QQGroup 633921431
// +----------------------------------------------------------------------

namespace easySwoole\VerifyCode;
namespace EasySwoole\VerifyCode;

use Core\Component\Spl\SplBean;
use EasySwoole\Core\Component\Spl\SplBean;

/**
* 验证码配置文件
Expand Down
2 changes: 1 addition & 1 deletion src/MIME.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// | Welcome Join QQGroup 633921431
// +----------------------------------------------------------------------

namespace easySwoole\VerifyCode;
namespace EasySwoole\VerifyCode;

/**
* 验证码MIME类型
Expand Down
2 changes: 1 addition & 1 deletion src/Result.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// | Welcome Join QQGroup 633921431
// +----------------------------------------------------------------------

namespace easySwoole\VerifyCode;
namespace EasySwoole\VerifyCode;

/**
* 验证码结果类
Expand Down
2 changes: 1 addition & 1 deletion src/VerifyCode.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// | Welcome Join QQGroup 633921431
// +----------------------------------------------------------------------

namespace easySwoole\VerifyCode;
namespace EasySwoole\VerifyCode;

/**
* 验证码处理类
Expand Down

0 comments on commit 56f4432

Please sign in to comment.