[更新]修改加载机制及别名

This commit is contained in:
Anyon 2018-05-25 17:05:54 +08:00
parent 0606e872e6
commit 0d9ba1b5f1
16 changed files with 101 additions and 95 deletions

View File

@ -16,6 +16,7 @@ namespace app\admin\controller;
use controller\BasicAdmin; use controller\BasicAdmin;
use service\LogService; use service\LogService;
use service\WechatService;
/** /**
* 后台参数配置控制器 * 后台参数配置控制器

View File

@ -92,7 +92,7 @@ class Fans extends BasicAdmin
{ {
try { try {
$openids = $this->_getActionOpenids(); $openids = $this->_getActionOpenids();
WechatService::user()->batchBlackList($openids); WechatService::WeChatUser()->batchBlackList($openids);
Db::name($this->table)->whereIn('openid', $openids)->setField('is_black', '1'); Db::name($this->table)->whereIn('openid', $openids)->setField('is_black', '1');
} catch (\Exception $e) { } catch (\Exception $e) {
$this->error("设置黑名单失败,请稍候再试!"); $this->error("设置黑名单失败,请稍候再试!");
@ -113,7 +113,7 @@ class Fans extends BasicAdmin
$fans = Db::name('WechatFans')->where(['id' => $fans_id])->find(); $fans = Db::name('WechatFans')->where(['id' => $fans_id])->find();
empty($fans) && $this->error('需要操作的数据不存在!'); empty($fans) && $this->error('需要操作的数据不存在!');
try { try {
$wechat = WechatService::tags(); $wechat = WechatService::WeChatTags();
foreach (explode(',', $fans['tagid_list']) as $tagid) { foreach (explode(',', $fans['tagid_list']) as $tagid) {
is_numeric($tagid) && $wechat->batchUntagging([$fans['openid']], $tagid); is_numeric($tagid) && $wechat->batchUntagging([$fans['openid']], $tagid);
} }
@ -136,7 +136,7 @@ class Fans extends BasicAdmin
empty($tagid) && $this->error('没有可能操作的标签ID'); empty($tagid) && $this->error('没有可能操作的标签ID');
try { try {
$openids = $this->_getActionOpenids(); $openids = $this->_getActionOpenids();
WechatService::tags()->batchTagging($openids, $tagid); WechatService::WeChatTags()->batchTagging($openids, $tagid);
} catch (\Exception $e) { } catch (\Exception $e) {
$this->error("设置粉丝标签失败, 请稍候再试! " . $e->getMessage()); $this->error("设置粉丝标签失败, 请稍候再试! " . $e->getMessage());
} }
@ -152,7 +152,7 @@ class Fans extends BasicAdmin
empty($tagid) && $this->error('没有可能操作的标签ID'); empty($tagid) && $this->error('没有可能操作的标签ID');
try { try {
$openids = $this->_getActionOpenids(); $openids = $this->_getActionOpenids();
WechatService::tags()->batchUntagging($openids, $tagid); WechatService::WeChatTags()->batchUntagging($openids, $tagid);
} catch (\Exception $e) { } catch (\Exception $e) {
$this->error("删除粉丝标签失败, 请稍候再试! "); $this->error("删除粉丝标签失败, 请稍候再试! ");
} }

View File

@ -89,7 +89,7 @@ class FansBlock extends BasicAdmin
{ {
$openids = $this->_getActionOpenids(); $openids = $this->_getActionOpenids();
try { try {
WechatService::user()->batchUnblackList($openids); WechatService::WeChatUser()->batchUnblackList($openids);
Db::name($this->table)->whereIn('openid', $openids)->setField('is_black', '0'); Db::name($this->table)->whereIn('openid', $openids)->setField('is_black', '0');
} catch (\Exception $e) { } catch (\Exception $e) {
$this->error("设备黑名单失败,请稍候再试!" . $e->getMessage()); $this->error("设备黑名单失败,请稍候再试!" . $e->getMessage());

View File

@ -49,7 +49,7 @@ class Keys extends BasicAdmin
{ {
// 关键字二维码显示 // 关键字二维码显示
if ($this->request->get('action') === 'qrc') { if ($this->request->get('action') === 'qrc') {
$wechat = WechatService::qrcode(); $wechat = WechatService::WeChatQrcode();
$result = $wechat->create($this->request->get('keys', '')); $result = $wechat->create($this->request->get('keys', ''));
$this->redirect($wechat->url($result['ticket'])); $this->redirect($wechat->url($result['ticket']));
} }

View File

@ -91,7 +91,7 @@ class Menu extends BasicAdmin
if (empty($post['data'])) { if (empty($post['data'])) {
try { try {
Db::name($this->table)->where('1=1')->delete(); Db::name($this->table)->where('1=1')->delete();
WechatService::menu()->delete(); WechatService::WeChatMenu()->delete();
} catch (\Exception $e) { } catch (\Exception $e) {
$this->error('删除取消微信菜单失败,请稍候再试!' . $e->getMessage()); $this->error('删除取消微信菜单失败,请稍候再试!' . $e->getMessage());
} }
@ -121,7 +121,7 @@ class Menu extends BasicAdmin
public function cancel() public function cancel()
{ {
try { try {
WechatService::menu()->delete(); WechatService::WeChatMenu()->delete();
} catch (\Exception $e) { } catch (\Exception $e) {
$this->error('菜单取消失败'); $this->error('菜单取消失败');
} }
@ -174,7 +174,7 @@ class Menu extends BasicAdmin
} }
unset($menu['type']); unset($menu['type']);
} }
WechatService::menu()->create(['button' => $menus]); WechatService::WeChatMenu()->create(['button' => $menus]);
} }
} }

View File

@ -14,7 +14,6 @@
namespace app\wechat\controller; namespace app\wechat\controller;
use app\wechat\controller\api\Tools;
use app\wechat\service\MediaService; use app\wechat\service\MediaService;
use controller\BasicAdmin; use controller\BasicAdmin;
use service\DataService; use service\DataService;
@ -258,7 +257,7 @@ class News extends BasicAdmin
$data['filter'] = ['is_to_all' => false, 'tag_id' => join(',', $post['fans_tags'])]; $data['filter'] = ['is_to_all' => false, 'tag_id' => join(',', $post['fans_tags'])];
$data['mpnews'] = ['media_id' => $newsinfo['media_id']]; $data['mpnews'] = ['media_id' => $newsinfo['media_id']];
} }
if (WechatService::custom()->massSendAll($data)) { if (WechatService::WeChatCustom()->massSendAll($data)) {
LogService::write('微信管理', "图文[{$news_id}]推送成功"); LogService::write('微信管理', "图文[{$news_id}]推送成功");
$this->success('微信图文推送成功!', ''); $this->success('微信图文推送成功!', '');
} }
@ -284,7 +283,7 @@ class News extends BasicAdmin
return "<img{$matches[1]}src=\"{$src}\"{$matches[3]}/>"; return "<img{$matches[1]}src=\"{$src}\"{$matches[3]}/>";
}, $article['content']); }, $article['content']);
} }
$wechat = WechatService::media(); $wechat = WechatService::WeChatMedia();
// 如果已经上传过,先删除之前的历史记录 // 如果已经上传过,先删除之前的历史记录
!empty($news['media_id']) && $wechat->delMaterial($news['media_id']); !empty($news['media_id']) && $wechat->delMaterial($news['media_id']);
// 上传图文到微信服务器 // 上传图文到微信服务器

View File

@ -74,7 +74,7 @@ class Tags extends BasicAdmin
if (Db::name($this->table)->where('name', $name)->count() > 0) { if (Db::name($this->table)->where('name', $name)->count() > 0) {
$this->error('粉丝标签标签名已经存在, 请使用其它标签名!'); $this->error('粉丝标签标签名已经存在, 请使用其它标签名!');
} }
$wechat = WechatService::tags(); $wechat = WechatService::WeChatTags();
if (false === ($result = $wechat->createTags($name)) && isset($result['tag'])) { if (false === ($result = $wechat->createTags($name)) && isset($result['tag'])) {
$this->error("添加粉丝标签失败. "); $this->error("添加粉丝标签失败. ");
} }
@ -110,7 +110,7 @@ class Tags extends BasicAdmin
$this->error('标签已经存在, 使用其它名称再试!'); $this->error('标签已经存在, 使用其它名称再试!');
} }
try { try {
WechatService::tags()->updateTags($id, $name); WechatService::WeChatTags()->updateTags($id, $name);
DataService::save($this->table, ['id' => $id, 'name' => $name], 'id'); DataService::save($this->table, ['id' => $id, 'name' => $name], 'id');
} catch (\Exception $e) { } catch (\Exception $e) {
$this->error('编辑标签失败, 请稍后再试!' . $e->getMessage()); $this->error('编辑标签失败, 请稍后再试!' . $e->getMessage());
@ -128,7 +128,7 @@ class Tags extends BasicAdmin
*/ */
public function del() public function del()
{ {
$wechat = WechatService::tags(); $wechat = WechatService::WeChatTags();
foreach (explode(',', $this->request->post('id', '')) as $id) { foreach (explode(',', $this->request->post('id', '')) as $id) {
if ($wechat->deleteTags($id)) { if ($wechat->deleteTags($id)) {
Db::name('WechatFansTags')->where(['id' => $id])->delete(); Db::name('WechatFansTags')->where(['id' => $id])->delete();

View File

@ -74,7 +74,7 @@ class Push
*/ */
public function notify() public function notify()
{ {
$wechat = WechatService::receive(); $wechat = WechatService::WeChatReceive();
$this->openid = $wechat->getOpenid(); $this->openid = $wechat->getOpenid();
$this->receive = $wechat->getReceive(); $this->receive = $wechat->getReceive();
$this->appid = WechatService::getAppid(); $this->appid = WechatService::getAppid();
@ -251,7 +251,7 @@ class Push
$msgData = ['touser' => $this->openid, 'msgtype' => $type, "{$type}" => $data]; $msgData = ['touser' => $this->openid, 'msgtype' => $type, "{$type}" => $data];
switch (strtolower(sysconf('wechat_type'))) { switch (strtolower(sysconf('wechat_type'))) {
case 'api': // 参数对接直接回复XML来实现消息回复 case 'api': // 参数对接直接回复XML来实现消息回复
$wechat = WechatService::receive(); $wechat = WechatService::WeChatReceive();
switch (strtolower($type)) { switch (strtolower($type)) {
case 'text': case 'text':
return $wechat->text($data['content'])->reply([], true); return $wechat->text($data['content'])->reply([], true);
@ -272,7 +272,7 @@ class Push
return 'success'; return 'success';
} }
case 'thr': // 第三方平台,使用客服消息来实现 case 'thr': // 第三方平台,使用客服消息来实现
return WechatService::custom()->send($msgData); return WechatService::WeChatCustom()->send($msgData);
default: default:
return 'success'; return 'success';
} }
@ -313,7 +313,7 @@ class Push
protected function updateFansinfo($subscribe = true) protected function updateFansinfo($subscribe = true)
{ {
if ($subscribe) { if ($subscribe) {
$userInfo = WechatService::user()->getUserInfo($this->openid); $userInfo = WechatService::WeChatUser()->getUserInfo($this->openid);
$userInfo['subscribe'] = intval($subscribe); $userInfo['subscribe'] = intval($subscribe);
FansService::set($userInfo); FansService::set($userInfo);
} else { } else {

View File

@ -28,6 +28,7 @@ class Tools extends BasicAdmin
/** /**
* 网页授权测试 * 网页授权测试
* @return string * @return string
* @throws \WeChat\Exceptions\InvalidResponseException
* @throws \think\Exception * @throws \think\Exception
* @throws \think\exception\PDOException * @throws \think\exception\PDOException
*/ */

View File

@ -77,7 +77,7 @@ class FansService
*/ */
public static function sync($next_openid = '') public static function sync($next_openid = '')
{ {
$wechat = WechatService::user(); $wechat = WechatService::WeChatUser();
$result = $wechat->getUserList($next_openid); $result = $wechat->getUserList($next_openid);
if (empty($result['data']['openid'])) { if (empty($result['data']['openid'])) {
return false; return false;
@ -106,7 +106,7 @@ class FansService
*/ */
public static function syncBlack($next_openid = '') public static function syncBlack($next_openid = '')
{ {
$wechat = WechatService::user(); $wechat = WechatService::WeChatUser();
$result = $wechat->getBlackList($next_openid); $result = $wechat->getBlackList($next_openid);
foreach (array_chunk($result['data']['openid'], 100) as $openids) { foreach (array_chunk($result['data']['openid'], 100) as $openids) {
$info = $wechat->getBatchUserInfo($openids); $info = $wechat->getBatchUserInfo($openids);

View File

@ -67,7 +67,7 @@ class MediaService
if (($media_url = Db::name('WechatNewsImage')->where($map)->value('media_url'))) { if (($media_url = Db::name('WechatNewsImage')->where($map)->value('media_url'))) {
return $media_url; return $media_url;
} }
$info = WechatService::media()->uploadImg(self::getServerPath($local_url)); $info = WechatService::WeChatMedia()->uploadImg(self::getServerPath($local_url));
if (strtolower(sysconf('wechat_type')) === 'thr') { if (strtolower(sysconf('wechat_type')) === 'thr') {
WechatService::wechat()->rmFile($local_url); WechatService::wechat()->rmFile($local_url);
} }
@ -93,7 +93,7 @@ class MediaService
if (($media_id = Db::name('WechatNewsMedia')->where($map)->value('media_id'))) { if (($media_id = Db::name('WechatNewsMedia')->where($map)->value('media_id'))) {
return $media_id; return $media_id;
} }
$result = WechatService::media()->addMaterial(self::getServerPath($local_url), $type, $video_info); $result = WechatService::WeChatMedia()->addMaterial(self::getServerPath($local_url), $type, $video_info);
if (strtolower(sysconf('wechat_type')) === 'thr') { if (strtolower(sysconf('wechat_type')) === 'thr') {
WechatService::wechat()->rmFile($local_url); WechatService::wechat()->rmFile($local_url);
} }

View File

@ -36,7 +36,7 @@ class TagsService
*/ */
public static function syncTagsByOpenid($openid) public static function syncTagsByOpenid($openid)
{ {
$tagsid = WechatService::tags()->getUserTagId($openid); $tagsid = WechatService::WeChatTags()->getUserTagId($openid);
if (!is_array($tagsid)) { if (!is_array($tagsid)) {
return false; return false;
} }
@ -55,7 +55,7 @@ class TagsService
public static function sync() public static function sync()
{ {
$appid = WechatService::getAppid(); $appid = WechatService::getAppid();
$result = WechatService::tags()->getTags(); $result = WechatService::WeChatTags()->getTags();
Db::name('WechatFansTags')->where(['appid' => $appid])->delete(); Db::name('WechatFansTags')->where(['appid' => $appid])->delete();
foreach (array_chunk($result['tags'], 100) as $list) { foreach (array_chunk($result['tags'], 100) as $list) {
foreach ($list as &$vo) { foreach ($list as &$vo) {

View File

@ -24,41 +24,57 @@ use think\Exception;
* @author Anyon <zoujingli@qq.com> * @author Anyon <zoujingli@qq.com>
* @date 2017/03/22 15:32 * @date 2017/03/22 15:32
* *
* @method \WeChat\Card card() static 卡券管理 * ----- WeChat -----
* @method \WeChat\Custom custom() static 客服消息处理 * @method \WeChat\Card WeChatCard() static 微信卡券管理
* @method \WeChat\Limit limit() static 接口调用频次限制 * @method \WeChat\Custom WeChatCustom() static 微信客服消息
* @method \WeChat\Media media() static 微信素材管理 * @method \WeChat\Limit WeChatLimit() static 接口调用频次限制
* @method \WeChat\Menu menu() static 微信素材管理 * @method \WeChat\Media WeChatMedia() static 微信素材管理
* @method \WeChat\Oauth oauth() static 微信网页授权 * @method \WeChat\Menu WeChatMenu() static 微信菜单管理
* @method \WeChat\Pay pay() static 微信支付商户 * @method \WeChat\Oauth WeChatOauth() static 微信网页授权
* @method \WeChat\Product product() static 商店管理 * @method \WeChat\Pay WeChatPay() static 微信支付商户
* @method \WeChat\Qrcode qrcode() static 二维码管理 * @method \WeChat\Product WeChatProduct() static 微信商店管理
* @method \WeChat\Receive receive() static 公众号推送管理 * @method \WeChat\Qrcode WeChatQrcode() static 微信二维码管理
* @method \WeChat\Scan scan() static 扫一扫接入管理 * @method \WeChat\Receive WeChatReceive() static 微信推送管理
* @method \WeChat\Script script() static 微信前端支持 * @method \WeChat\Scan WeChatScan() static 微信扫一扫接入管理
* @method \WeChat\Shake shake() static 揺一揺周边 * @method \WeChat\Script WeChatScript() static 微信前端支持
* @method \WeChat\Tags tags() static 用户标签管理 * @method \WeChat\Shake WeChatShake() static 微信揺一揺周边
* @method \WeChat\Template template() static 模板消息 * @method \WeChat\Tags WeChatTags() static 微信用户标签管理
* @method \WeChat\User user() static 微信粉丝管理 * @method \WeChat\Template WeChatTemplate() static 微信模板消息
* @method \WeChat\Wifi wifi() static 门店WIFI管理 * @method \WeChat\User WeChatUser() static 微信粉丝管理
* --- 小程序SDK加载 开始 --- * @method \WeChat\Wifi WeChatWifi() static 微信门店WIFI管理
* @method \WeMini\Account miniAccount() static 小程序账号管理 *
* @method \WeMini\Basic miniBasic() static 小程序基础信息设置 * ----- WeMini -----
* @method \WeMini\Code miniCode() static 小程序代码管理 * @method \WeMini\Account WeMiniAccount() static 小程序账号管理
* @method \WeMini\Domain miniDomain() static 小程序域名管理 * @method \WeMini\Basic WeMiniBasic() static 小程序基础信息设置
* @method \WeMini\Tester minitester() static 小程序成员管理 * @method \WeMini\Code WeMiniCode() static 小程序代码管理
* @method \WeMini\User miniUser() static 小程序帐号管理 * @method \WeMini\Domain WeMiniDomain() static 小程序域名管理
* @method \WeMini\Crypt miniCrypt() static 小程序数据加密处理管理 * @method \WeMini\Tester WeMinitester() static 小程序成员管理
* @method \WeMini\Plugs miniPlugs() static 小程序插件管理 * @method \WeMini\User WeMiniUser() static 小程序帐号管理
* @method \WeMini\Poi miniPoi() static 小程地址管理 * --------------------
* @method \WeMini\Qrcode miniQrcode() static 小程二维码管理 * @method \WeMini\Crypt WeMiniCrypt() static 小程序数据加密处理
* @method \WeMini\Template miniTemplate() static 小程序模板消息 * @method \WeMini\Plugs WeMiniPlugs() static 小程序插件管理
* @method \WeMini\Total miniTotal() static 小程序数据接口 * @method \WeMini\Poi WeMiniPoi() static 小程序地址管理
* --- 小程序SDK加载 结束 --- * @method \WeMini\Qrcode WeMiniQrcode() static 小程序二维码管理
* @method void wechat() static 第三方微信工具 * @method \WeMini\Template WeMiniTemplate() static 小程序模板消息支持
* @method void config() static 第三方配置工具 * @method \WeMini\Total WeMiniTotal() static 小程序数据接口
*
* ----- WePay -----
* @method \WePay\Bill WePayBill() static 微信商户账单及评论
* @method \WePay\Order WePayOrder() static 微信商户订单
* @method \WePay\Refund WePayRefund() static 微信商户退款
* @method \WePay\Coupon WePayCoupon() static 微信商户代金券
* @method \WePay\Redpack WePayRedpack() static 微信红包支持
* @method \WePay\Transfers WePayTransfers() static 微信商户打款到零钱
* @method \WePay\TransfersBank WePayTransFresBank() static 微信商户打款到银行卡
*
* ----- WeOpen -----
* @method \WeOpen\Login login() static 第三方微信登录 * @method \WeOpen\Login login() static 第三方微信登录
* @method \WeOpen\Service service() static 第三方服务 * @method \WeOpen\Service service() static 第三方服务
*
* ----- ThinkService -----
* @method mixed wechat() static 第三方微信工具
* @method mixed config() static 第三方配置工具
*
*/ */
class WechatService class WechatService
{ {
@ -69,22 +85,6 @@ class WechatService
*/ */
private static $type = 'WeChat'; private static $type = 'WeChat';
/**
* 切换接口为服务号模式
*/
public static function setWeChatState()
{
self::$type = 'WeChat';
}
/**
* 切换接口为小程序模式
*/
public static function setWeMiniState()
{
self::$type = 'WeMini';
}
/** /**
* 获取微信实例ID * 获取微信实例ID
* @param string $name 实例对象名称 * @param string $name 实例对象名称
@ -141,7 +141,7 @@ class WechatService
$signUrl = is_null($url) ? app('request')->url(true) : $url; $signUrl = is_null($url) ? app('request')->url(true) : $url;
switch (strtolower(sysconf('wechat_type'))) { switch (strtolower(sysconf('wechat_type'))) {
case 'api': case 'api':
return WechatService::script()->getJsSign($signUrl); return WechatService::WeChatScript()->getJsSign($signUrl);
case 'thr': case 'thr':
return WechatService::wechat()->jsSign($signUrl); return WechatService::wechat()->jsSign($signUrl);
default: default:
@ -155,6 +155,7 @@ class WechatService
* @param int $fullMode 授权公众号模式 * @param int $fullMode 授权公众号模式
* @param bool $isRedirect 是否进行跳转 * @param bool $isRedirect 是否进行跳转
* @return array * @return array
* @throws \WeChat\Exceptions\InvalidResponseException
* @throws \think\Exception * @throws \think\Exception
* @throws \think\exception\PDOException * @throws \think\exception\PDOException
*/ */
@ -168,7 +169,7 @@ class WechatService
} }
switch (strtolower(sysconf('wechat_type'))) { switch (strtolower(sysconf('wechat_type'))) {
case 'api': case 'api':
$wechat = self::oauth(); $wechat = self::WeChatOauth();
if (request()->get('state') !== $appid) { if (request()->get('state') !== $appid) {
$snsapi = empty($fullMode) ? 'snsapi_base' : 'snsapi_userinfo'; $snsapi = empty($fullMode) ? 'snsapi_base' : 'snsapi_userinfo';
$param = (strpos($url, '?') !== false ? '&' : '?') . 'rcode=' . encode($url); $param = (strpos($url, '?') !== false ? '&' : '?') . 'rcode=' . encode($url);
@ -226,19 +227,23 @@ class WechatService
/** /**
* 魔术静态方法实现对象 * 魔术静态方法实现对象
* @param string $name * @param string $name 方法类名
* @param array $arguments * @param array $arguments 调用参数
* @return SoapService * @return SoapService
* @throws \think\Exception * @throws \think\Exception
* @throws \think\exception\PDOException * @throws \think\exception\PDOException
*/ */
public static function __callStatic($name, $arguments) public static function __callStatic($name, $arguments)
{ {
if (substr($name, 0, 4) === 'mini') { if (substr($name, 0, 6) === 'WeMini') {
self::setWeMiniState(); self::$type = 'WeMini';
$name = substr($name, 4); $name = substr($name, 6);
} else { } elseif (substr($name, 0, 6) === 'WeChat') {
self::setWeChatState(); self::$type = 'WeChat';
$name = substr($name, 6);
} elseif (substr($name, 0, 5) === 'WePay') {
self::$type = 'WePay';
$name = substr($name, 5);
} }
return self::instance($name); return self::instance($name);
} }

2
vendor/autoload.php vendored
View File

@ -4,4 +4,4 @@
require_once __DIR__ . '/composer/autoload_real.php'; require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInit6588b91efff19d88b158b1c18209b5f4::getLoader(); return ComposerAutoloaderInit484ec88015be4f45ec888a71837712e4::getLoader();

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer // autoload_real.php @generated by Composer
class ComposerAutoloaderInit6588b91efff19d88b158b1c18209b5f4 class ComposerAutoloaderInit484ec88015be4f45ec888a71837712e4
{ {
private static $loader; private static $loader;
@ -19,15 +19,15 @@ class ComposerAutoloaderInit6588b91efff19d88b158b1c18209b5f4
return self::$loader; return self::$loader;
} }
spl_autoload_register(array('ComposerAutoloaderInit6588b91efff19d88b158b1c18209b5f4', 'loadClassLoader'), true, true); spl_autoload_register(array('ComposerAutoloaderInit484ec88015be4f45ec888a71837712e4', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(); self::$loader = $loader = new \Composer\Autoload\ClassLoader();
spl_autoload_unregister(array('ComposerAutoloaderInit6588b91efff19d88b158b1c18209b5f4', 'loadClassLoader')); spl_autoload_unregister(array('ComposerAutoloaderInit484ec88015be4f45ec888a71837712e4', 'loadClassLoader'));
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
if ($useStaticLoader) { if ($useStaticLoader) {
require_once __DIR__ . '/autoload_static.php'; require_once __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit6588b91efff19d88b158b1c18209b5f4::getInitializer($loader)); call_user_func(\Composer\Autoload\ComposerStaticInit484ec88015be4f45ec888a71837712e4::getInitializer($loader));
} else { } else {
$map = require __DIR__ . '/autoload_namespaces.php'; $map = require __DIR__ . '/autoload_namespaces.php';
foreach ($map as $namespace => $path) { foreach ($map as $namespace => $path) {
@ -48,19 +48,19 @@ class ComposerAutoloaderInit6588b91efff19d88b158b1c18209b5f4
$loader->register(true); $loader->register(true);
if ($useStaticLoader) { if ($useStaticLoader) {
$includeFiles = Composer\Autoload\ComposerStaticInit6588b91efff19d88b158b1c18209b5f4::$files; $includeFiles = Composer\Autoload\ComposerStaticInit484ec88015be4f45ec888a71837712e4::$files;
} else { } else {
$includeFiles = require __DIR__ . '/autoload_files.php'; $includeFiles = require __DIR__ . '/autoload_files.php';
} }
foreach ($includeFiles as $fileIdentifier => $file) { foreach ($includeFiles as $fileIdentifier => $file) {
composerRequire6588b91efff19d88b158b1c18209b5f4($fileIdentifier, $file); composerRequire484ec88015be4f45ec888a71837712e4($fileIdentifier, $file);
} }
return $loader; return $loader;
} }
} }
function composerRequire6588b91efff19d88b158b1c18209b5f4($fileIdentifier, $file) function composerRequire484ec88015be4f45ec888a71837712e4($fileIdentifier, $file)
{ {
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
require $file; require $file;

View File

@ -4,7 +4,7 @@
namespace Composer\Autoload; namespace Composer\Autoload;
class ComposerStaticInit6588b91efff19d88b158b1c18209b5f4 class ComposerStaticInit484ec88015be4f45ec888a71837712e4
{ {
public static $files = array ( public static $files = array (
'1cfd2761b63b0a29ed23657ea394cb2d' => __DIR__ . '/..' . '/topthink/think-captcha/src/helper.php', '1cfd2761b63b0a29ed23657ea394cb2d' => __DIR__ . '/..' . '/topthink/think-captcha/src/helper.php',
@ -302,9 +302,9 @@ class ComposerStaticInit6588b91efff19d88b158b1c18209b5f4
public static function getInitializer(ClassLoader $loader) public static function getInitializer(ClassLoader $loader)
{ {
return \Closure::bind(function () use ($loader) { return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit6588b91efff19d88b158b1c18209b5f4::$prefixLengthsPsr4; $loader->prefixLengthsPsr4 = ComposerStaticInit484ec88015be4f45ec888a71837712e4::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit6588b91efff19d88b158b1c18209b5f4::$prefixDirsPsr4; $loader->prefixDirsPsr4 = ComposerStaticInit484ec88015be4f45ec888a71837712e4::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit6588b91efff19d88b158b1c18209b5f4::$classMap; $loader->classMap = ComposerStaticInit484ec88015be4f45ec888a71837712e4::$classMap;
}, null, ClassLoader::class); }, null, ClassLoader::class);
} }