diff --git a/vendor/autoload.php b/vendor/autoload.php index 16d2c4774..1dbeab3a7 100644 --- a/vendor/autoload.php +++ b/vendor/autoload.php @@ -4,4 +4,4 @@ require_once __DIR__ . '/composer/autoload_real.php'; -return ComposerAutoloaderInitf87766a7411e551cf24d607cb3736291::getLoader(); +return ComposerAutoloaderInitde40dbadcc666977486255074dc624e9::getLoader(); diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index 278e7debf..6057f60dc 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInitf87766a7411e551cf24d607cb3736291 +class ComposerAutoloaderInitde40dbadcc666977486255074dc624e9 { private static $loader; @@ -19,15 +19,15 @@ class ComposerAutoloaderInitf87766a7411e551cf24d607cb3736291 return self::$loader; } - spl_autoload_register(array('ComposerAutoloaderInitf87766a7411e551cf24d607cb3736291', 'loadClassLoader'), true, true); + spl_autoload_register(array('ComposerAutoloaderInitde40dbadcc666977486255074dc624e9', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(); - spl_autoload_unregister(array('ComposerAutoloaderInitf87766a7411e551cf24d607cb3736291', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderInitde40dbadcc666977486255074dc624e9', 'loadClassLoader')); $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); if ($useStaticLoader) { require_once __DIR__ . '/autoload_static.php'; - call_user_func(\Composer\Autoload\ComposerStaticInitf87766a7411e551cf24d607cb3736291::getInitializer($loader)); + call_user_func(\Composer\Autoload\ComposerStaticInitde40dbadcc666977486255074dc624e9::getInitializer($loader)); } else { $map = require __DIR__ . '/autoload_namespaces.php'; foreach ($map as $namespace => $path) { @@ -48,19 +48,19 @@ class ComposerAutoloaderInitf87766a7411e551cf24d607cb3736291 $loader->register(true); if ($useStaticLoader) { - $includeFiles = Composer\Autoload\ComposerStaticInitf87766a7411e551cf24d607cb3736291::$files; + $includeFiles = Composer\Autoload\ComposerStaticInitde40dbadcc666977486255074dc624e9::$files; } else { $includeFiles = require __DIR__ . '/autoload_files.php'; } foreach ($includeFiles as $fileIdentifier => $file) { - composerRequiref87766a7411e551cf24d607cb3736291($fileIdentifier, $file); + composerRequirede40dbadcc666977486255074dc624e9($fileIdentifier, $file); } return $loader; } } -function composerRequiref87766a7411e551cf24d607cb3736291($fileIdentifier, $file) +function composerRequirede40dbadcc666977486255074dc624e9($fileIdentifier, $file) { if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { require $file; diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index a9ed920c2..379126b2e 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -4,7 +4,7 @@ namespace Composer\Autoload; -class ComposerStaticInitf87766a7411e551cf24d607cb3736291 +class ComposerStaticInitde40dbadcc666977486255074dc624e9 { public static $files = array ( '1cfd2761b63b0a29ed23657ea394cb2d' => __DIR__ . '/..' . '/topthink/think-captcha/src/helper.php', @@ -287,9 +287,9 @@ class ComposerStaticInitf87766a7411e551cf24d607cb3736291 public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInitf87766a7411e551cf24d607cb3736291::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInitf87766a7411e551cf24d607cb3736291::$prefixDirsPsr4; - $loader->classMap = ComposerStaticInitf87766a7411e551cf24d607cb3736291::$classMap; + $loader->prefixLengthsPsr4 = ComposerStaticInitde40dbadcc666977486255074dc624e9::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInitde40dbadcc666977486255074dc624e9::$prefixDirsPsr4; + $loader->classMap = ComposerStaticInitde40dbadcc666977486255074dc624e9::$classMap; }, null, ClassLoader::class); } diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index d82d817a6..0aa518660 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -133,12 +133,12 @@ "source": { "type": "git", "url": "https://github.com/zoujingli/WeOpenDeveloper.git", - "reference": "a6739da337a0c0b6e2da8103b353a42044b4a0c7" + "reference": "21273dc11c4fb3de4ab07d74a696bf0e4661cea3" }, "dist": { "type": "zip", - "url": "https://files.phpcomposer.com/files/zoujingli/WeOpenDeveloper/a6739da337a0c0b6e2da8103b353a42044b4a0c7.zip", - "reference": "a6739da337a0c0b6e2da8103b353a42044b4a0c7", + "url": "https://files.phpcomposer.com/files/zoujingli/WeOpenDeveloper/21273dc11c4fb3de4ab07d74a696bf0e4661cea3.zip", + "reference": "21273dc11c4fb3de4ab07d74a696bf0e4661cea3", "shasum": "" }, "require": { @@ -147,7 +147,7 @@ "php": ">=5.4", "zoujingli/wechat-developer": "^1.0" }, - "time": "2018-05-12T14:10:32+00:00", + "time": "2018-05-23T07:08:07+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -272,8 +272,8 @@ }, { "name": "symfony/options-resolver", - "version": "v3.4.9", - "version_normalized": "3.4.9.0", + "version": "v3.4.10", + "version_normalized": "3.4.10.0", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", diff --git a/vendor/zoujingli/weopen-developer/WeOpen/Service.php b/vendor/zoujingli/weopen-developer/WeOpen/Service.php index b220adbe5..312daca22 100644 --- a/vendor/zoujingli/weopen-developer/WeOpen/Service.php +++ b/vendor/zoujingli/weopen-developer/WeOpen/Service.php @@ -88,8 +88,8 @@ class Service public function getComponentAccessToken() { $cache = 'wechat_component_access_token'; - if (($component_access_token = Tools::getCache($cache))) { - return $component_access_token; + if (($componentAccessToken = Tools::getCache($cache))) { + return $componentAccessToken; } $data = [ 'component_appid' => $this->config->get('component_appid'), @@ -107,17 +107,17 @@ class Service /** * 获取授权方的帐号基本信息 - * @param string $authorizer_appid 授权公众号或小程序的appid + * @param string $authorizerAppid 授权公众号或小程序的appid * @return array * @throws InvalidResponseException * @throws \WeChat\Exceptions\LocalCacheException */ - public function getAuthorizerInfo($authorizer_appid) + public function getAuthorizerInfo($authorizerAppid) { - $component_access_token = $this->getComponentAccessToken(); - $url = "https://api.weixin.qq.com/cgi-bin/component/api_get_authorizer_info?component_access_token={$component_access_token}"; + $componentAccessToken = $this->getComponentAccessToken(); + $url = "https://api.weixin.qq.com/cgi-bin/component/api_get_authorizer_info?component_access_token={$componentAccessToken}"; $data = [ - 'authorizer_appid' => $authorizer_appid, + 'authorizer_appid' => $authorizerAppid, 'component_appid' => $this->config->get('component_appid'), ]; $result = $this->httpPostForJson($url, $data); @@ -129,21 +129,21 @@ class Service /** * 设置授权方的选项信息 - * @param string $authorizer_appid 授权公众号或小程序的appid - * @param string $option_name 选项名称 - * @param string $option_value 设置的选项值 + * @param string $authorizerAppid 授权公众号或小程序的appid + * @param string $optionName 选项名称 + * @param string $optionValue 设置的选项值 * @return array * @throws InvalidResponseException * @throws \WeChat\Exceptions\LocalCacheException */ - public function setAuthorizerOption($authorizer_appid, $option_name, $option_value) + public function setAuthorizerOption($authorizerAppid, $optionName, $optionValue) { - $component_access_token = $this->getComponentAccessToken(); - $url = "https://api.weixin.qq.com/cgi-bin/component/ api_set_authorizer_option?component_access_token={$component_access_token}"; + $componentAccessToken = $this->getComponentAccessToken(); + $url = "https://api.weixin.qq.com/cgi-bin/component/api_set_authorizer_option?component_access_token={$componentAccessToken}"; $result = $this->httpPostForJson($url, [ - 'option_name' => $option_name, - 'option_value' => $option_value, - 'authorizer_appid' => $authorizer_appid, + 'option_name' => $optionName, + 'option_value' => $optionValue, + 'authorizer_appid' => $authorizerAppid, 'component_appid' => $this->config->get('component_appid'), ]); return $result; @@ -157,8 +157,8 @@ class Service */ public function getPreauthCode() { - $component_access_token = $this->getComponentAccessToken(); - $url = "https://api.weixin.qq.com/cgi-bin/component/api_create_preauthcode?component_access_token={$component_access_token}"; + $componentAccessToken = $this->getComponentAccessToken(); + $url = "https://api.weixin.qq.com/cgi-bin/component/api_create_preauthcode?component_access_token={$componentAccessToken}"; $result = $this->httpPostForJson($url, ['component_appid' => $this->config->get('component_appid')]); if (empty($result['pre_auth_code'])) { throw new InvalidResponseException('GetPreauthCode Faild.', '0', $result); @@ -168,67 +168,67 @@ class Service /** * 获取授权回跳地址 - * @param string $redirect_uri 回调URI - * @param integer $auth_type 要授权的帐号类型 + * @param string $redirectUri 回调URI + * @param integer $authType 要授权的帐号类型 * @return bool * @throws InvalidResponseException * @throws \WeChat\Exceptions\LocalCacheException */ - public function getAuthRedirect($redirect_uri, $auth_type = 3) + public function getAuthRedirect($redirectUri, $authType = 3) { - $redirect_uri = urlencode($redirect_uri); - $pre_auth_code = $this->getPreauthCode(); - $component_appid = $this->config->get('component_appid'); - return "https://mp.weixin.qq.com/cgi-bin/componentloginpage?component_appid={$component_appid}&pre_auth_code={$pre_auth_code}&redirect_uri={$redirect_uri}&auth_type={$auth_type}"; + $redirectUri = urlencode($redirectUri); + $preAuthCode = $this->getPreauthCode(); + $componentAppid = $this->config->get('component_appid'); + return "https://mp.weixin.qq.com/cgi-bin/componentloginpage?component_appid={$componentAppid}&pre_auth_code={$preAuthCode}&redirect_uri={$redirectUri}&auth_type={$authType}"; } /** * 使用授权码换取公众号或小程序的接口调用凭据和授权信息 - * @param null $auth_code 授权码 + * @param null $authCode 授权码 * @return bool|array * @throws InvalidResponseException * @throws \WeChat\Exceptions\LocalCacheException */ - public function getQueryAuthorizerInfo($auth_code = null) + public function getQueryAuthorizerInfo($authCode = null) { - if (is_null($auth_code) && isset($_GET['auth_code'])) { - $auth_code = $_GET['auth_code']; + if (is_null($authCode) && isset($_GET['auth_code'])) { + $authCode = $_GET['auth_code']; } - if (empty($auth_code)) { + if (empty($authCode)) { return false; } - $component_access_token = $this->getComponentAccessToken(); - $url = "https://api.weixin.qq.com/cgi-bin/component/api_query_auth?component_access_token={$component_access_token}"; + $componentAccessToken = $this->getComponentAccessToken(); + $url = "https://api.weixin.qq.com/cgi-bin/component/api_query_auth?component_access_token={$componentAccessToken}"; $data = [ + 'authorization_code' => $authCode, 'component_appid' => $this->config->get('component_appid'), - 'authorization_code' => $auth_code, ]; $result = $this->httpPostForJson($url, $data); if (empty($result['authorization_info'])) { throw new InvalidResponseException($result['errmsg'], $result['errcode'], $data); } - $authorizer_appid = $result['authorization_info']['authorizer_appid']; - $authorizer_access_token = $result['authorization_info']['authorizer_access_token']; + $authorizerAppid = $result['authorization_info']['authorizer_appid']; + $authorizerAccessToken = $result['authorization_info']['authorizer_access_token']; // 缓存授权公众号访问 ACCESS_TOKEN - Tools::setCache("{$authorizer_appid}_access_token", $authorizer_access_token, 7000); + Tools::setCache("{$authorizerAppid}_access_token", $authorizerAccessToken, 7000); return $result['authorization_info']; } /** * 获取(刷新)授权公众号的令牌 - * @param string $authorizer_appid 授权公众号或小程序的appid - * @param string $authorizer_refresh_token 授权方的刷新令牌 + * @param string $authorizerAppid 授权公众号或小程序的appid + * @param string $authorizerRefreshToken 授权方的刷新令牌 * @return array * @throws InvalidResponseException * @throws \WeChat\Exceptions\LocalCacheException */ - public function refreshAccessToken($authorizer_appid, $authorizer_refresh_token) + public function refreshAccessToken($authorizerAppid, $authorizerRefreshToken) { - $component_access_token = $this->getComponentAccessToken(); - $url = "https://api.weixin.qq.com/cgi-bin/component/api_authorizer_token?component_access_token={$component_access_token}"; + $componentAccessToken = $this->getComponentAccessToken(); + $url = "https://api.weixin.qq.com/cgi-bin/component/api_authorizer_token?component_access_token={$componentAccessToken}"; $data = [ - 'authorizer_appid' => $authorizer_appid, - 'authorizer_refresh_token' => $authorizer_refresh_token, + 'authorizer_appid' => $authorizerAppid, + 'authorizer_refresh_token' => $authorizerRefreshToken, 'component_appid' => $this->config->get('component_appid'), ]; $result = $this->httpPostForJson($url, $data); @@ -236,39 +236,39 @@ class Service throw new InvalidResponseException($result['errmsg'], $result['errcode'], $data); } // 缓存授权公众号访问 ACCESS_TOKEN - Tools::setCache("{$authorizer_appid}_access_token", $result['authorizer_access_token'], 7000); + Tools::setCache("{$authorizerAppid}_access_token", $result['authorizer_access_token'], 7000); return $result; } /** * oauth 授权跳转接口 - * @param string $authorizer_appid 授权公众号或小程序的appid - * @param string $redirect_uri 回调地址 + * @param string $authorizerAppid 授权公众号或小程序的appid + * @param string $redirectUri 回调地址 * @param string $scope snsapi_userinfo|snsapi_base * @return string */ - public function getOauthRedirect($authorizer_appid, $redirect_uri, $scope = 'snsapi_userinfo') + public function getOauthRedirect($authorizerAppid, $redirectUri, $scope = 'snsapi_userinfo') { - $redirect_url = urlencode($redirect_uri); - $component_appid = $this->config->get('component_appid'); - return "https://open.weixin.qq.com/connect/oauth2/authorize?appid={$authorizer_appid}&redirect_uri={$redirect_url}&response_type=code&scope={$scope}&state={$authorizer_appid}&component_appid={$component_appid}#wechat_redirect"; + $redirectUri = urlencode($redirectUri); + $componentAppid = $this->config->get('component_appid'); + return "https://open.weixin.qq.com/connect/oauth2/authorize?appid={$authorizerAppid}&redirect_uri={$redirectUri}&response_type=code&scope={$scope}&state={$authorizerAppid}&component_appid={$componentAppid}#wechat_redirect"; } /** * 通过code获取AccessToken - * @param string $authorizer_appid 授权公众号或小程序的appid + * @param string $authorizerAppid 授权公众号或小程序的appid * @return bool|array * @throws InvalidResponseException * @throws \WeChat\Exceptions\LocalCacheException */ - public function getOauthAccessToken($authorizer_appid) + public function getOauthAccessToken($authorizerAppid) { if (empty($_GET['code'])) { return false; } - $component_appid = $this->config->get('component_appid'); - $component_access_token = $this->getComponentAccessToken(); - $url = "https://api.weixin.qq.com/sns/oauth2/component/access_token?appid={$authorizer_appid}&code={$_GET['code']}&grant_type=authorization_code&component_appid={$component_appid}&component_access_token={$component_access_token}"; + $componentAppid = $this->config->get('component_appid'); + $componentAccessToken = $this->getComponentAccessToken(); + $url = "https://api.weixin.qq.com/sns/oauth2/component/access_token?appid={$authorizerAppid}&code={$_GET['code']}&grant_type=authorization_code&component_appid={$componentAppid}&component_access_token={$componentAccessToken}"; return $this->httpGetForJson($url); } @@ -282,38 +282,34 @@ class Service */ public function getAuthorizerList($count = 500, $offset = 0) { - $component_appid = $this->config->get('component_appid'); - $component_access_token = $this->getComponentAccessToken(); - $url = "https://api.weixin.qq.com/cgi-bin/component/api_get_authorizer_list?component_access_token={$component_access_token}"; - return $this->httpPostForJson($url, [ - 'count' => $count, - 'offset' => $offset, - 'component_appid' => $component_appid, - ]); + $componentAppid = $this->config->get('component_appid'); + $componentAccessToken = $this->getComponentAccessToken(); + $url = "https://api.weixin.qq.com/cgi-bin/component/api_get_authorizer_list?component_access_token={$componentAccessToken}"; + return $this->httpPostForJson($url, ['count' => $count, 'offset' => $offset, 'component_appid' => $componentAppid]); } /** * 创建指定授权公众号接口实例 * @param string $name 需要加载的接口实例名称 - * @param string $authorizer_appid 授权公众号的appid + * @param string $authorizerAppid 授权公众号的appid * @param string $type 加载SDK类型 WeChat|WeMini * @return \WeChat\Card|\WeChat\Custom|\WeChat\Media|\WeChat\Menu|\WeChat\Oauth|\WeChat\Pay|\WeChat\Product|\WeChat\Qrcode|\WeChat\Receive|\WeChat\Scan|\WeChat\Script|\WeChat\Shake|\WeChat\Tags|\WeChat\Template|\WeChat\User|\WeChat\Wifi */ - public function instance($name, $authorizer_appid, $type = 'WeChat') + public function instance($name, $authorizerAppid, $type = 'WeChat') { $className = "{$type}\\" . ucfirst(strtolower($name)); - return new $className($this->getConfig($authorizer_appid)); + return new $className($this->getConfig($authorizerAppid)); } /** * 获取授权公众号配置参数 - * @param string $authorizer_appid 授权公众号的appid + * @param string $authorizerAppid 授权公众号的appid * @return array */ - public function getConfig($authorizer_appid) + public function getConfig($authorizerAppid) { $config = $this->config->get(); - $config['appid'] = $authorizer_appid; + $config['appid'] = $authorizerAppid; $config['token'] = $this->config->get('component_token'); $config['appsecret'] = $this->config->get('component_appsecret'); $config['encodingaeskey'] = $this->config->get('component_encodingaeskey');