From 56f4432ed2483d23f52c948c7d23baa0cb340617 Mon Sep 17 00:00:00 2001 From: hanwenbo <9476400@qq.com> Date: Sun, 8 Apr 2018 14:43:42 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=82=E9=85=8Dx2=20(#3)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 8 ++++++-- composer.json | 2 +- src/Conf.php | 4 ++-- src/MIME.php | 2 +- src/Result.php | 2 +- src/VerifyCode.php | 2 +- 6 files changed, 12 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 4c48163..10af049 100644 --- a/README.md +++ b/README.md @@ -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(); ``` #### 设置字符集合 @@ -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信息 \ No newline at end of file diff --git a/composer.json b/composer.json index 6858656..c5083dd 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,7 @@ }, "autoload": { "psr-4": { - "easySwoole\\VerifyCode\\":"src" + "EasySwoole\\VerifyCode\\":"src" } } } diff --git a/src/Conf.php b/src/Conf.php index 5bbea68..3ea5f2a 100644 --- a/src/Conf.php +++ b/src/Conf.php @@ -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; /** * 验证码配置文件 diff --git a/src/MIME.php b/src/MIME.php index 12ad6b8..ae28d94 100644 --- a/src/MIME.php +++ b/src/MIME.php @@ -7,7 +7,7 @@ // | Welcome Join QQGroup 633921431 // +---------------------------------------------------------------------- -namespace easySwoole\VerifyCode; +namespace EasySwoole\VerifyCode; /** * 验证码MIME类型 diff --git a/src/Result.php b/src/Result.php index b6df9c8..268412b 100644 --- a/src/Result.php +++ b/src/Result.php @@ -7,7 +7,7 @@ // | Welcome Join QQGroup 633921431 // +---------------------------------------------------------------------- -namespace easySwoole\VerifyCode; +namespace EasySwoole\VerifyCode; /** * 验证码结果类 diff --git a/src/VerifyCode.php b/src/VerifyCode.php index c4de800..5599ff7 100644 --- a/src/VerifyCode.php +++ b/src/VerifyCode.php @@ -7,7 +7,7 @@ // | Welcome Join QQGroup 633921431 // +---------------------------------------------------------------------- -namespace easySwoole\VerifyCode; +namespace EasySwoole\VerifyCode; /** * 验证码处理类