[更新]ComposerUpdate

This commit is contained in:
Anyon 2018-07-16 10:46:33 +08:00
parent 631e3d19b9
commit 4ec997ad2f
10 changed files with 98 additions and 34 deletions

View File

@ -783,7 +783,7 @@ class Request
{ {
if ($origin) { if ($origin) {
// 获取原始请求类型 // 获取原始请求类型
return $this->isCli() ? 'GET' : $this->server('REQUEST_METHOD'); return $this->server('REQUEST_METHOD') ?: 'GET';
} elseif (!$this->method) { } elseif (!$this->method) {
if (isset($_POST[$this->config['var_method']])) { if (isset($_POST[$this->config['var_method']])) {
$this->method = strtoupper($_POST[$this->config['var_method']]); $this->method = strtoupper($_POST[$this->config['var_method']]);
@ -792,7 +792,7 @@ class Request
} elseif ($this->server('HTTP_X_HTTP_METHOD_OVERRIDE')) { } elseif ($this->server('HTTP_X_HTTP_METHOD_OVERRIDE')) {
$this->method = strtoupper($this->server('HTTP_X_HTTP_METHOD_OVERRIDE')); $this->method = strtoupper($this->server('HTTP_X_HTTP_METHOD_OVERRIDE'));
} else { } else {
$this->method = $this->isCli() ? 'GET' : $this->server('REQUEST_METHOD'); $this->method = $this->server('REQUEST_METHOD') ?: 'GET';
} }
} }

View File

@ -103,6 +103,16 @@ class Session
} }
} }
/**
* 设置已经初始化
* @access public
* @return void
*/
public function inited()
{
$this->init = true;
}
/** /**
* session初始化 * session初始化
* @access public * @access public

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 ComposerAutoloaderInitd745dea77639476f6520b2640352c179::getLoader(); return ComposerAutoloaderInita50785d4573eb0507f755f9262e3b8fc::getLoader();

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer // autoload_real.php @generated by Composer
class ComposerAutoloaderInitd745dea77639476f6520b2640352c179 class ComposerAutoloaderInita50785d4573eb0507f755f9262e3b8fc
{ {
private static $loader; private static $loader;
@ -19,15 +19,15 @@ class ComposerAutoloaderInitd745dea77639476f6520b2640352c179
return self::$loader; return self::$loader;
} }
spl_autoload_register(array('ComposerAutoloaderInitd745dea77639476f6520b2640352c179', 'loadClassLoader'), true, true); spl_autoload_register(array('ComposerAutoloaderInita50785d4573eb0507f755f9262e3b8fc', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(); self::$loader = $loader = new \Composer\Autoload\ClassLoader();
spl_autoload_unregister(array('ComposerAutoloaderInitd745dea77639476f6520b2640352c179', 'loadClassLoader')); spl_autoload_unregister(array('ComposerAutoloaderInita50785d4573eb0507f755f9262e3b8fc', '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\ComposerStaticInitd745dea77639476f6520b2640352c179::getInitializer($loader)); call_user_func(\Composer\Autoload\ComposerStaticInita50785d4573eb0507f755f9262e3b8fc::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 ComposerAutoloaderInitd745dea77639476f6520b2640352c179
$loader->register(true); $loader->register(true);
if ($useStaticLoader) { if ($useStaticLoader) {
$includeFiles = Composer\Autoload\ComposerStaticInitd745dea77639476f6520b2640352c179::$files; $includeFiles = Composer\Autoload\ComposerStaticInita50785d4573eb0507f755f9262e3b8fc::$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) {
composerRequired745dea77639476f6520b2640352c179($fileIdentifier, $file); composerRequirea50785d4573eb0507f755f9262e3b8fc($fileIdentifier, $file);
} }
return $loader; return $loader;
} }
} }
function composerRequired745dea77639476f6520b2640352c179($fileIdentifier, $file) function composerRequirea50785d4573eb0507f755f9262e3b8fc($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 ComposerStaticInitd745dea77639476f6520b2640352c179 class ComposerStaticInita50785d4573eb0507f755f9262e3b8fc
{ {
public static $files = array ( public static $files = array (
'1cfd2761b63b0a29ed23657ea394cb2d' => __DIR__ . '/..' . '/topthink/think-captcha/src/helper.php', '1cfd2761b63b0a29ed23657ea394cb2d' => __DIR__ . '/..' . '/topthink/think-captcha/src/helper.php',
@ -303,9 +303,9 @@ class ComposerStaticInitd745dea77639476f6520b2640352c179
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 = ComposerStaticInitd745dea77639476f6520b2640352c179::$prefixLengthsPsr4; $loader->prefixLengthsPsr4 = ComposerStaticInita50785d4573eb0507f755f9262e3b8fc::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInitd745dea77639476f6520b2640352c179::$prefixDirsPsr4; $loader->prefixDirsPsr4 = ComposerStaticInita50785d4573eb0507f755f9262e3b8fc::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInitd745dea77639476f6520b2640352c179::$classMap; $loader->classMap = ComposerStaticInita50785d4573eb0507f755f9262e3b8fc::$classMap;
}, null, ClassLoader::class); }, null, ClassLoader::class);
} }

View File

@ -10,7 +10,7 @@
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://files.phpcomposer.com/files/top-think/think-installer/f5400a12c60e513911aef41fe443fa6920952675.zip", "url": "https://api.github.com/repos/top-think/think-installer/zipball/f5400a12c60e513911aef41fe443fa6920952675",
"reference": "f5400a12c60e513911aef41fe443fa6920952675", "reference": "f5400a12c60e513911aef41fe443fa6920952675",
"shasum": "" "shasum": ""
}, },
@ -53,7 +53,7 @@
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://files.phpcomposer.com/files/zoujingli/ip2region/0a55d6c1ab6b4cbaa204824557aa950aaaefda0e.zip", "url": "https://api.github.com/repos/zoujingli/ip2region/zipball/0a55d6c1ab6b4cbaa204824557aa950aaaefda0e",
"reference": "0a55d6c1ab6b4cbaa204824557aa950aaaefda0e", "reference": "0a55d6c1ab6b4cbaa204824557aa950aaaefda0e",
"shasum": "" "shasum": ""
}, },
@ -87,17 +87,17 @@
}, },
{ {
"name": "zoujingli/wechat-developer", "name": "zoujingli/wechat-developer",
"version": "v1.1.12", "version": "v1.1.13",
"version_normalized": "1.1.12.0", "version_normalized": "1.1.13.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/zoujingli/WeChatDeveloper.git", "url": "https://github.com/zoujingli/WeChatDeveloper.git",
"reference": "9957f449f7109f7b30574120aaed4c46a9ddd8fb" "reference": "39682a047e5c8f9c66107924dfed4e2080e97eb4"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://files.phpcomposer.com/files/zoujingli/WeChatDeveloper/9957f449f7109f7b30574120aaed4c46a9ddd8fb.zip", "url": "https://api.github.com/repos/zoujingli/WeChatDeveloper/zipball/39682a047e5c8f9c66107924dfed4e2080e97eb4",
"reference": "9957f449f7109f7b30574120aaed4c46a9ddd8fb", "reference": "39682a047e5c8f9c66107924dfed4e2080e97eb4",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -105,7 +105,7 @@
"ext-openssl": "*", "ext-openssl": "*",
"php": ">=5.4" "php": ">=5.4"
}, },
"time": "2018-06-13T09:04:11+00:00", "time": "2018-07-11T02:02:41+00:00",
"type": "library", "type": "library",
"installation-source": "dist", "installation-source": "dist",
"autoload": { "autoload": {
@ -150,7 +150,7 @@
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://files.phpcomposer.com/files/zoujingli/WeOpenDeveloper/32aa04ad346790cd6ac7672c888e22e15cb007fe.zip", "url": "https://api.github.com/repos/zoujingli/WeOpenDeveloper/zipball/32aa04ad346790cd6ac7672c888e22e15cb007fe",
"reference": "32aa04ad346790cd6ac7672c888e22e15cb007fe", "reference": "32aa04ad346790cd6ac7672c888e22e15cb007fe",
"shasum": "" "shasum": ""
}, },
@ -196,12 +196,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/top-think/framework.git", "url": "https://github.com/top-think/framework.git",
"reference": "8c4a90c1214c07d2eae15b25d763348bc084ec2b" "reference": "833fcaf0f29f23bdceaae655f64d10c18b9bf562"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://files.phpcomposer.com/files/top-think/framework/8c4a90c1214c07d2eae15b25d763348bc084ec2b.zip", "url": "https://api.github.com/repos/top-think/framework/zipball/833fcaf0f29f23bdceaae655f64d10c18b9bf562",
"reference": "8c4a90c1214c07d2eae15b25d763348bc084ec2b", "reference": "833fcaf0f29f23bdceaae655f64d10c18b9bf562",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -217,7 +217,7 @@
"sebastian/phpcpd": "2.*", "sebastian/phpcpd": "2.*",
"squizlabs/php_codesniffer": "2.*" "squizlabs/php_codesniffer": "2.*"
}, },
"time": "2018-07-01T15:34:18+00:00", "time": "2018-07-02T05:29:17+00:00",
"type": "think-framework", "type": "think-framework",
"installation-source": "dist", "installation-source": "dist",
"notification-url": "https://packagist.org/downloads/", "notification-url": "https://packagist.org/downloads/",
@ -253,7 +253,7 @@
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://files.phpcomposer.com/files/top-think/think-captcha/54c8a51552f99ff9ea89ea9c272383a8f738ceee.zip", "url": "https://api.github.com/repos/top-think/think-captcha/zipball/54c8a51552f99ff9ea89ea9c272383a8f738ceee",
"reference": "54c8a51552f99ff9ea89ea9c272383a8f738ceee", "reference": "54c8a51552f99ff9ea89ea9c272383a8f738ceee",
"shasum": "" "shasum": ""
}, },
@ -294,7 +294,7 @@
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://files.phpcomposer.com/files/qiniu/php-sdk/305ce1c1c0c71f794661fe45a96facf61ef96c5d.zip", "url": "https://api.github.com/repos/qiniu/php-sdk/zipball/305ce1c1c0c71f794661fe45a96facf61ef96c5d",
"reference": "305ce1c1c0c71f794661fe45a96facf61ef96c5d", "reference": "305ce1c1c0c71f794661fe45a96facf61ef96c5d",
"shasum": "" "shasum": ""
}, },
@ -347,7 +347,7 @@
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://files.phpcomposer.com/files/symfony/options-resolver/cc5e98ed91688a22a7162a8800096356f9076b1d.zip", "url": "https://api.github.com/repos/symfony/options-resolver/zipball/cc5e98ed91688a22a7162a8800096356f9076b1d",
"reference": "cc5e98ed91688a22a7162a8800096356f9076b1d", "reference": "cc5e98ed91688a22a7162a8800096356f9076b1d",
"shasum": "" "shasum": ""
}, },
@ -403,7 +403,7 @@
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://files.phpcomposer.com/files/endroid/qr-code/c9644bec2a9cc9318e98d1437de3c628dcd1ef93.zip", "url": "https://api.github.com/repos/endroid/qr-code/zipball/c9644bec2a9cc9318e98d1437de3c628dcd1ef93",
"reference": "c9644bec2a9cc9318e98d1437de3c628dcd1ef93", "reference": "c9644bec2a9cc9318e98d1437de3c628dcd1ef93",
"shasum": "" "shasum": ""
}, },
@ -465,7 +465,7 @@
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://files.phpcomposer.com/files/aliyun/aliyun-oss-php-sdk/e69f57916678458642ac9d2fd341ae78a56996c8.zip", "url": "https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/zipball/e69f57916678458642ac9d2fd341ae78a56996c8",
"reference": "e69f57916678458642ac9d2fd341ae78a56996c8", "reference": "e69f57916678458642ac9d2fd341ae78a56996c8",
"shasum": "" "shasum": ""
}, },

View File

@ -34,6 +34,41 @@ WeChatDeveloper 为开源项目,允许把它用于任何地方,不受任何
* Gitee 托管地址https://gitee.com/zoujingli/WeChatDeveloper * Gitee 托管地址https://gitee.com/zoujingli/WeChatDeveloper
* GitHub 托管地址https://github.com/zoujingli/WeChatDeveloper * GitHub 托管地址https://github.com/zoujingli/WeChatDeveloper
ClassMap
--
|文件名|类名|描述|类型|加载 ①|
|---|---|---|---|---|
| Card.php | WeChat\Card | 微信卡券接口支持 | 认证服务号 | \We::WeChatCard() |
| Custom.php | WeChat\Custom | 微信客服消息接口支持 | 认证服务号 | \We::WeChatCustom() |
| Media.php | WeChat\Media | 微信媒体素材接口支持 | 认证服务号 | \We::WeChatMedia() |
| Oauth.php | WeChat\Oauth | 微信网页授权消息类接口 | 认证服务号 | \We::WeChatOauth() |
| Pay.php | WeChat\Pay | 微信支付类接口 | 认证服务号 | \We::WeChatPay() |
| Product.php | WeChat\Product | 微信商店类接口 | 认证服务号 | \We::WeChatProduct() |
| Qrcode.php | WeChat\Qrcode | 微信二维码接口支持 | 认证服务号 | \We::WeChatQrcode() |
| Receive.php | WeChat\Receive | 微信推送事件消息处理支持 | 认证服务号 | \We::WeChatReceive() |
| Scan.php | WeChat\Scan | 微信扫一扫接口支持 | 认证服务号 | \We::WeChatScan() |
| Script.php | WeChat\Script | 微信前端JSSDK支持 | 认证服务号 | \We::WeChatScript() |
| Shake.php | WeChat\Shake | 微信蓝牙设备揺一揺接口 | 认证服务号 | \We::WeChatShake() |
| Tags.php | WeChat\Tags | 微信粉丝标签接口支持 | 认证服务号 | \We::WeChatTags() |
| Template.php | WeChat\Template | 微信模板消息接口支持 | 认证服务号 | \We::WeChatTemplate() |
| User.php | WeChat\User | 微信粉丝管理接口支持 | 认证服务号 | \We::WeChatCard() |
| Wifi.php | WeChat\Wifi | 微信门店WIFI管理支持 | 认证服务号 | \We::WeChatWifi() |
| Bill.php | WePay\Bill | 微信商户账单及评论 | 微信支付 | \We::WePayBill() |
| Coupon.php | WePay\Coupon | 微信商户代金券 | 微信支付 | \We::WePayCoupon() |
| Order.php | WePay\Order | 微信商户订单 | 微信支付 | \We::WePayOrder() |
| Redpack.php | WePay\Redpack | 微信红包支持 | 微信支付 | \We::WePayRedpack() |
| Refund.php | WePay\Refund | 微信商户退款 | 微信支付 | \We::WePayRefund() |
| Transfers.php | WePay\Transfers | 微信商户打款到零钱 | 微信支付 | \We::WePayTransfers() |
| TransfersBank.php | WePay\TransfersBank | 微信商户打款到银行卡 | 微信支付 | \We::WePayTransfersBank() |
| Crypt.php | WeMini\Crypt | 微信小程序数据加密处理 | 微信小程序 | \We::WeMiniCrypt() |
| Plugs.php | WeMini\Plugs | 微信小程序插件管理 | 微信小程序 | \We::WeMiniPlugs() |
| Poi.php | WeMini\Poi | 微信小程序地址管理 | 微信小程序 | \We::WeMiniPoi() |
| Qrcode.php | WeMini\Qrcode | 微信小程序二维码管理 | 微信小程序 | \We::WeMiniCrypt() |
| Template.php | WeMini\Template | 微信小程序模板消息支持 | 微信小程序 | \We::WeMiniTemplate() |
| Total.php | WeMini\Total | 微信小程序数据接口 | 微信小程序 | \We::WeMiniTotal() |
Install Install
-- --

View File

@ -120,6 +120,22 @@ class BasicPay
return $this->callPostApi($url, ['long_url' => $longUrl]); return $this->callPostApi($url, ['long_url' => $longUrl]);
} }
/**
* 数组直接转xml数据输出
* @param array $data
* @param bool $isReturn
* @return string
*/
public function toXml(array $data, $isReturn = false)
{
$xml = Tools::arr2xml($data);
if ($isReturn) {
return $xml;
}
echo $xml;
}
/** /**
* 以Post请求接口 * 以Post请求接口
* @param string $url 请求 * @param string $url 请求

View File

@ -143,7 +143,10 @@ class Tools
*/ */
public static function xml2arr($xml) public static function xml2arr($xml)
{ {
return json_decode(self::arr2json(simplexml_load_string($xml, 'SimpleXMLElement', LIBXML_NOCDATA)), true); $entity = libxml_disable_entity_loader(true);
$data = (array)simplexml_load_string($xml, 'SimpleXMLElement', LIBXML_NOCDATA);
libxml_disable_entity_loader($entity);
return json_decode(self::arr2json($data), true);
} }
/** /**

View File

@ -53,7 +53,7 @@ class TransfersBank extends BasicPay
if (!isset($options['amount'])) { if (!isset($options['amount'])) {
throw new InvalidArgumentException('Missing Options -- [amount]'); throw new InvalidArgumentException('Missing Options -- [amount]');
} }
isset($options['desc']) && $this->config['desc'] = $options['desc']; isset($options['desc']) && $this->params->set('desc', $options['desc']);
$this->params->offsetUnset('appid'); $this->params->offsetUnset('appid');
return $this->callPostApi('https://api.mch.weixin.qq.com/mmpaysptrans/pay_bank', [ return $this->callPostApi('https://api.mch.weixin.qq.com/mmpaysptrans/pay_bank', [
'amount' => $options['amount'], 'amount' => $options['amount'],