From 9b8bd06b332b60ed0a11ac9d97cd4f26a817f363 Mon Sep 17 00:00:00 2001 From: cxdbz Date: Thu, 6 Jun 2019 19:31:46 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=87=E7=BA=A7Thinkphp=E5=88=B05127?= =?UTF-8?q?=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- composer.lock | 194 ++++++++++++++--- thinkphp/library/think/App.php | 12 +- thinkphp/library/think/Console.php | 13 +- thinkphp/library/think/Log.php | 6 +- thinkphp/library/think/Model.php | 2 +- thinkphp/library/think/Validate.php | 6 +- thinkphp/library/think/cache/Driver.php | 7 +- thinkphp/library/think/db/Connection.php | 50 +++-- thinkphp/library/think/db/Query.php | 17 +- .../library/think/exception/DbException.php | 2 +- thinkphp/library/think/facade/Config.php | 2 +- thinkphp/library/think/model/Collection.php | 6 +- thinkphp/library/think/model/Relation.php | 21 ++ .../library/think/model/concern/Attribute.php | 18 +- .../think/model/concern/Conversion.php | 84 ++++---- .../think/model/concern/RelationShip.php | 6 +- .../think/model/concern/SoftDelete.php | 3 +- .../library/think/model/relation/HasMany.php | 4 +- thinkphp/library/think/response/Redirect.php | 5 +- thinkphp/library/think/route/Rule.php | 17 +- thinkphp/library/think/route/RuleGroup.php | 2 +- thinkphp/library/think/route/RuleItem.php | 14 +- vendor/composer/ClassLoader.php | 2 +- vendor/composer/installed.json | 196 +++++++++++++++--- 24 files changed, 504 insertions(+), 185 deletions(-) diff --git a/composer.lock b/composer.lock index 0466d15f..263c4695 100644 --- a/composer.lock +++ b/composer.lock @@ -18,7 +18,13 @@ "type": "zip", "url": "https://api.github.com/repos/Bacon/BaconQrCode/zipball/5a91b62b9d37cee635bbf8d553f4546057250bee", "reference": "5a91b62b9d37cee635bbf8d553f4546057250bee", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "ext-iconv": "*", @@ -64,7 +70,13 @@ "type": "zip", "url": "https://api.github.com/repos/endroid/installer/zipball/2db0498b3a1cdb95db75309ea3087739f8017e62", "reference": "2db0498b3a1cdb95db75309ea3087739f8017e62", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "composer-plugin-api": "^1.1", @@ -109,7 +121,13 @@ "type": "zip", "url": "https://api.github.com/repos/endroid/qr-code/zipball/4752fc7cc7f658c17049919af33872e9b7d5e64d", "reference": "4752fc7cc7f658c17049919af33872e9b7d5e64d", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "bacon/bacon-qr-code": "^1.0.3", @@ -169,7 +187,13 @@ "type": "zip", "url": "https://api.github.com/repos/khanamiryan/php-qrcode-detector-decoder/zipball/a75482d3bc804e3f6702332bfda6cccbb0dfaa76", "reference": "a75482d3bc804e3f6702332bfda6cccbb0dfaa76", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "php": "^5.6|^7.0" @@ -219,7 +243,13 @@ "type": "zip", "url": "https://api.github.com/repos/MarkBaker/PHPComplex/zipball/1ea674a8308baf547cbcbd30c5fcd6d301b7c000", "reference": "1ea674a8308baf547cbcbd30c5fcd6d301b7c000", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "php": "^5.6.0|^7.0.0" @@ -314,7 +344,13 @@ "type": "zip", "url": "https://api.github.com/repos/myclabs/php-enum/zipball/550d2334d77f91b0816a5cbd6965272fe20146b8", "reference": "550d2334d77f91b0816a5cbd6965272fe20146b8", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "php": ">=5.4" @@ -358,7 +394,13 @@ "type": "zip", "url": "https://api.github.com/repos/ivanlanin/pclzip/zipball/19dd1de9d3f5fc4d7d70175b4c344dee329f45fd", "reference": "19dd1de9d3f5fc4d7d70175b4c344dee329f45fd", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", + "preferred": true + } + ] }, "type": "library", "autoload": { @@ -395,7 +437,13 @@ "type": "zip", "url": "https://api.github.com/repos/php4world/auth/zipball/e356cad8de77c3e27f78875685b309d561c0fa94", "reference": "e356cad8de77c3e27f78875685b309d561c0fa94", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "topthink/framework": "5.1.*" @@ -431,7 +479,13 @@ "type": "zip", "url": "https://api.github.com/repos/PHPOffice/Common/zipball/edb5d32b1e3400a35a5c91e2539ed6f6ce925e4d", "reference": "edb5d32b1e3400a35a5c91e2539ed6f6ce925e4d", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "pclzip/pclzip": "^2.8", @@ -486,7 +540,13 @@ "type": "zip", "url": "https://api.github.com/repos/PHPOffice/PhpSpreadsheet/zipball/2dfd06c59825914a1a325f2a2ed13634b9d8c411", "reference": "2dfd06c59825914a1a325f2a2ed13634b9d8c411", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "ext-ctype": "*", @@ -573,7 +633,13 @@ "type": "zip", "url": "https://api.github.com/repos/PHPOffice/PHPWord/zipball/dfa2f36cad2b632b7ab1c56473e4f5db9a7caf7f", "reference": "dfa2f36cad2b632b7ab1c56473e4f5db9a7caf7f", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "ext-xml": "*", @@ -682,7 +748,13 @@ "type": "zip", "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "php": ">=5.3.0" @@ -730,7 +802,13 @@ "type": "zip", "url": "https://api.github.com/repos/symfony/inflector/zipball/8da789363973920dd7df6753822810592138e5ba", "reference": "8da789363973920dd7df6753822810592138e5ba", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "php": "^7.1.3", @@ -788,7 +866,13 @@ "type": "zip", "url": "https://api.github.com/repos/symfony/options-resolver/zipball/31e5523373cb06163079ef46d0a2d507d70fe064", "reference": "31e5523373cb06163079ef46d0a2d507d70fe064", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "php": "^7.1.3" @@ -842,7 +926,13 @@ "type": "zip", "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e3d826245268269cd66f8326bd8bc066687b4a19", "reference": "e3d826245268269cd66f8326bd8bc066687b4a19", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "php": ">=5.3.3" @@ -900,7 +990,13 @@ "type": "zip", "url": "https://api.github.com/repos/symfony/property-access/zipball/10edb6c4b6f496a2ed40a788ebbd280b421985ae", "reference": "10edb6c4b6f496a2ed40a788ebbd280b421985ae", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "php": "^7.1.3", @@ -957,17 +1053,23 @@ }, { "name": "topthink/framework", - "version": "v5.1.35", + "version": "v5.1.37.1", "source": { "type": "git", "url": "https://github.com/top-think/framework.git", - "reference": "c53c0c6132022a87e8ee9c4109939eaf9a8a7adb" + "reference": "05eecd121d18d6705aaa10aa44fcdf7c14da4d0b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/top-think/framework/zipball/c53c0c6132022a87e8ee9c4109939eaf9a8a7adb", - "reference": "c53c0c6132022a87e8ee9c4109939eaf9a8a7adb", - "shasum": "" + "url": "https://api.github.com/repos/top-think/framework/zipball/05eecd121d18d6705aaa10aa44fcdf7c14da4d0b", + "reference": "05eecd121d18d6705aaa10aa44fcdf7c14da4d0b", + "shasum": "", + "mirrors": [ + { + "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "php": ">=5.6.0", @@ -1004,7 +1106,7 @@ "orm", "thinkphp" ], - "time": "2019-03-03T00:44:44+00:00" + "time": "2019-05-28T06:57:29+00:00" }, { "name": "topthink/think-captcha", @@ -1018,7 +1120,13 @@ "type": "zip", "url": "https://api.github.com/repos/top-think/think-captcha/zipball/54c8a51552f99ff9ea89ea9c272383a8f738ceee", "reference": "54c8a51552f99ff9ea89ea9c272383a8f738ceee", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "topthink/framework": "5.1.*" @@ -1057,7 +1165,13 @@ "type": "zip", "url": "https://api.github.com/repos/top-think/think-helper/zipball/0c99dc625b0d2d4124e1b6ca15a3ad6f0125963f", "reference": "0c99dc625b0d2d4124e1b6ca15a3ad6f0125963f", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", + "preferred": true + } + ] }, "type": "library", "autoload": { @@ -1093,7 +1207,13 @@ "type": "zip", "url": "https://api.github.com/repos/top-think/think-installer/zipball/f5400a12c60e513911aef41fe443fa6920952675", "reference": "f5400a12c60e513911aef41fe443fa6920952675", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "composer-plugin-api": "^1.0" @@ -1134,7 +1254,13 @@ "type": "zip", "url": "https://api.github.com/repos/top-think/think-migration/zipball/70c89850ca29c2eab988c7c3475d1d5331901bb8", "reference": "70c89850ca29c2eab988c7c3475d1d5331901bb8", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "topthink/framework": "5.1.*" @@ -1173,7 +1299,13 @@ "type": "zip", "url": "https://api.github.com/repos/whitehat101/apr1-md5/zipball/8b261c9fc0481b4e9fa9d01c6ca70867b5d5e819", "reference": "8b261c9fc0481b4e9fa9d01c6ca70867b5d5e819", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "php": ">=5.3.0" @@ -1217,7 +1349,13 @@ "type": "zip", "url": "https://api.github.com/repos/zendframework/zend-escaper/zipball/31d8aafae982f9568287cb4dce987e6aff8fd074", "reference": "31d8aafae982f9568287cb4dce987e6aff8fd074", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "php": "^5.6 || ^7.0" diff --git a/thinkphp/library/think/App.php b/thinkphp/library/think/App.php index e1703eb0..1fb9fbda 100644 --- a/thinkphp/library/think/App.php +++ b/thinkphp/library/think/App.php @@ -20,7 +20,7 @@ use think\route\Dispatch; */ class App extends Container { - const VERSION = '5.1.35 LTS'; + const VERSION = '5.1.37 LTS'; /** * 当前模块路径 @@ -179,6 +179,11 @@ class App extends Container $this->instance('app', $this); + // 加载环境变量配置文件 + if (is_file($this->rootPath . '.env')) { + $this->env->load($this->rootPath . '.env'); + } + $this->configExt = $this->env->get('config_ext', '.php'); // 加载惯例配置文件 @@ -196,11 +201,6 @@ class App extends Container 'vendor_path' => $this->rootPath . 'vendor' . DIRECTORY_SEPARATOR, ]); - // 加载环境变量配置文件 - if (is_file($this->rootPath . '.env')) { - $this->env->load($this->rootPath . '.env'); - } - $this->namespace = $this->env->get('app_namespace', $this->namespace); $this->env->set('app_namespace', $this->namespace); diff --git a/thinkphp/library/think/Console.php b/thinkphp/library/think/Console.php index d1212907..22f3e2c5 100644 --- a/thinkphp/library/think/Console.php +++ b/thinkphp/library/think/Console.php @@ -487,12 +487,17 @@ class Console public function getNamespaces() { $namespaces = []; - foreach ($this->commands as $command) { - $namespaces = array_merge($namespaces, $this->extractAllNamespaces($command->getName())); + foreach ($this->commands as $name => $command) { + if (is_string($command)) { + $namespaces = array_merge($namespaces, $this->extractAllNamespaces($name)); + } else { + $namespaces = array_merge($namespaces, $this->extractAllNamespaces($command->getName())); - foreach ($command->getAliases() as $alias) { - $namespaces = array_merge($namespaces, $this->extractAllNamespaces($alias)); + foreach ($command->getAliases() as $alias) { + $namespaces = array_merge($namespaces, $this->extractAllNamespaces($alias)); + } } + } return array_values(array_unique(array_filter($namespaces))); diff --git a/thinkphp/library/think/Log.php b/thinkphp/library/think/Log.php index 1a374962..8902e976 100644 --- a/thinkphp/library/think/Log.php +++ b/thinkphp/library/think/Log.php @@ -127,8 +127,10 @@ class Log implements LoggerInterface } if (PHP_SAPI == 'cli') { - // 命令行日志实时写入 - $this->write($msg, $type, true); + if (empty($this->config['level']) || in_array($type, $this->config['level'])) { + // 命令行日志实时写入 + $this->write($msg, $type, true); + } } else { $this->log[$type][] = $msg; } diff --git a/thinkphp/library/think/Model.php b/thinkphp/library/think/Model.php index 8e6ee412..65e543d9 100644 --- a/thinkphp/library/think/Model.php +++ b/thinkphp/library/think/Model.php @@ -571,7 +571,7 @@ abstract class Model implements \JsonSerializable, \ArrayAccess $this->autoRelationUpdate(); } - return false; + return true; } elseif ($this->autoWriteTimestamp && $this->updateTime && !isset($data[$this->updateTime])) { // 自动写入更新时间 $data[$this->updateTime] = $this->autoWriteTimestamp($this->updateTime); diff --git a/thinkphp/library/think/Validate.php b/thinkphp/library/think/Validate.php index c846f1f8..d4f6d236 100644 --- a/thinkphp/library/think/Validate.php +++ b/thinkphp/library/think/Validate.php @@ -519,7 +519,7 @@ class Validate if (isset($this->append[$field])) { // 追加额外的验证规则 - $rules = array_unique(array_merge($rules, $this->append[$field])); + $rules = array_unique(array_merge($rules, $this->append[$field]), SORT_REGULAR); } $i = 0; @@ -1514,12 +1514,12 @@ class Validate $scene = $this->currentScene; } + $this->only = $this->append = $this->remove = []; + if (empty($scene)) { return; } - $this->only = $this->append = $this->remove = []; - if (method_exists($this, 'scene' . $scene)) { call_user_func([$this, 'scene' . $scene]); } elseif (isset($this->scene[$scene])) { diff --git a/thinkphp/library/think/cache/Driver.php b/thinkphp/library/think/cache/Driver.php index f4c5dcbf..64216810 100644 --- a/thinkphp/library/think/cache/Driver.php +++ b/thinkphp/library/think/cache/Driver.php @@ -249,7 +249,6 @@ abstract class Driver { if ($this->tag) { $key = $this->getTagkey($this->tag); - $prev = $this->tag; $this->tag = null; if ($this->has($key)) { @@ -266,7 +265,6 @@ abstract class Driver } $this->set($key, $value, 0); - $this->tag = $prev; } } @@ -360,4 +358,9 @@ abstract class Driver { return $this->writeTimes; } + + public function __call($method, $args) + { + return call_user_func_array([$this->handler, $method], $args); + } } diff --git a/thinkphp/library/think/db/Connection.php b/thinkphp/library/think/db/Connection.php index af27fd62..d6b3c7ed 100644 --- a/thinkphp/library/think/db/Connection.php +++ b/thinkphp/library/think/db/Connection.php @@ -1246,22 +1246,14 @@ abstract class Connection * @access public * @param Query $query 查询对象 * @param string $field 字段名 - * @param bool $default 默认值 + * @param mixed $default 默认值 + * @param bool $one 是否返回一个值 * @return mixed */ - public function value(Query $query, $field, $default = null) + public function value(Query $query, $field, $default = null, $one = true) { $options = $query->getOptions(); - if (empty($options['fetch_sql']) && !empty($options['cache'])) { - $cache = $options['cache']; - $result = $this->getCacheData($query, $cache, null, $key); - - if (false !== $result) { - return $result; - } - } - if (isset($options['field'])) { $query->removeOption('field'); } @@ -1271,7 +1263,19 @@ abstract class Connection } $query->setOption('field', $field); - $query->setOption('limit', 1); + + if (empty($options['fetch_sql']) && !empty($options['cache'])) { + $cache = $options['cache']; + $result = $this->getCacheData($query, $cache, null, $key); + + if (false !== $result) { + return $result; + } + } + + if ($one) { + $query->setOption('limit', 1); + } // 生成查询SQL $sql = $this->builder->select($query); @@ -1320,7 +1324,7 @@ abstract class Connection $field = $aggregate . '(' . (!empty($distinct) ? 'DISTINCT ' : '') . $this->builder->parseKey($query, $field, true) . ') AS tp_' . strtolower($aggregate); - return $this->value($query, $field, 0); + return $this->value($query, $field, 0, false); } /** @@ -1335,16 +1339,6 @@ abstract class Connection { $options = $query->getOptions(); - if (empty($options['fetch_sql']) && !empty($options['cache'])) { - // 判断查询缓存 - $cache = $options['cache']; - $result = $this->getCacheData($query, $cache, null, $guid); - - if (false !== $result) { - return $result; - } - } - if (isset($options['field'])) { $query->removeOption('field'); } @@ -1362,6 +1356,16 @@ abstract class Connection $query->setOption('field', $field); + if (empty($options['fetch_sql']) && !empty($options['cache'])) { + // 判断查询缓存 + $cache = $options['cache']; + $result = $this->getCacheData($query, $cache, null, $guid); + + if (false !== $result) { + return $result; + } + } + // 生成查询SQL $sql = $this->builder->select($query); diff --git a/thinkphp/library/think/db/Query.php b/thinkphp/library/think/db/Query.php index dea5fa71..5b1785e4 100644 --- a/thinkphp/library/think/db/Query.php +++ b/thinkphp/library/think/db/Query.php @@ -1512,6 +1512,7 @@ class Query { if ($field instanceof $this) { $this->options['where'] = $field->getOptions('where'); + $this->bind($field->getBind(false)); return $this; } @@ -1527,7 +1528,7 @@ class Query } if ($field instanceof Expression) { - return $this->whereRaw($field, is_array($op) ? $op : []); + return $this->whereRaw($field, is_array($op) ? $op : [], $logic); } elseif ($strict) { // 使用严格模式查询 $where = [$field, $op, $condition, $logic]; @@ -1538,7 +1539,7 @@ class Query $where = $field; } elseif (is_string($field)) { if (preg_match('/[,=\<\'\"\(\s]/', $field)) { - return $this->whereRaw($field, $op); + return $this->whereRaw($field, $op, $logic); } elseif (is_string($op) && strtolower($op) == 'exp') { $bind = isset($param[2]) && is_array($param[2]) ? $param[2] : null; return $this->whereExp($field, $condition, $bind, $logic); @@ -2197,12 +2198,12 @@ class Query } /** - * 设置需要追加输出的属性 + * 设置需要附加的输出属性 * @access public - * @param array $append 需要追加的属性 + * @param array $append 属性列表 * @return $this */ - public function append(array $append) + public function append(array $append = []) { $this->options['append'] = $append; return $this; @@ -3355,13 +3356,13 @@ class Query // 输出属性控制 if (!empty($options['visible'])) { - $result->visible($options['visible']); + $result->visible($options['visible'], true); } elseif (!empty($options['hidden'])) { - $result->hidden($options['hidden']); + $result->hidden($options['hidden'], true); } if (!empty($options['append'])) { - $result->append($options['append']); + $result->append($options['append'], true); } // 关联查询 diff --git a/thinkphp/library/think/exception/DbException.php b/thinkphp/library/think/exception/DbException.php index 0f504257..6baafb51 100644 --- a/thinkphp/library/think/exception/DbException.php +++ b/thinkphp/library/think/exception/DbException.php @@ -26,7 +26,7 @@ class DbException extends Exception * @param string $sql * @param int $code */ - public function __construct($message, array $config, $sql, $code = 10500) + public function __construct($message, array $config = [], $sql = '', $code = 10500) { $this->message = $message; $this->code = $code; diff --git a/thinkphp/library/think/facade/Config.php b/thinkphp/library/think/facade/Config.php index 0421982a..824d2b6a 100644 --- a/thinkphp/library/think/facade/Config.php +++ b/thinkphp/library/think/facade/Config.php @@ -23,7 +23,7 @@ use think\Facade; * @method array set(mixed $name, mixed $value = null) static 设置配置参数 * @method array reset(string $name ='') static 重置配置参数 * @method void remove(string $name = '') static 移除配置 - * @method void setYaconf(mixed $$yaconf) static 设置开启Yaconf 或者指定配置文件名 + * @method void setYaconf(mixed $yaconf) static 设置开启Yaconf 或者指定配置文件名 */ class Config extends Facade { diff --git a/thinkphp/library/think/model/Collection.php b/thinkphp/library/think/model/Collection.php index 09b61a80..34ec067e 100644 --- a/thinkphp/library/think/model/Collection.php +++ b/thinkphp/library/think/model/Collection.php @@ -24,8 +24,10 @@ class Collection extends BaseCollection */ public function load($relation) { - $item = current($this->items); - $item->eagerlyResultSet($this->items, $relation); + if (!$this->isEmpty()) { + $item = current($this->items); + $item->eagerlyResultSet($this->items, $relation); + } return $this; } diff --git a/thinkphp/library/think/model/Relation.php b/thinkphp/library/think/model/Relation.php index c2b9adc7..ac6dd4cf 100644 --- a/thinkphp/library/think/model/Relation.php +++ b/thinkphp/library/think/model/Relation.php @@ -58,6 +58,16 @@ abstract class Relation return $this->query->getModel(); } + /** + * 获取当前的关联模型类的实例 + * @access public + * @return Query + */ + public function getQuery() + { + return $this->query; + } + /** * 设置当前关联为自关联 * @access public @@ -129,6 +139,17 @@ abstract class Relation } } + /** + * 更新数据 + * @access public + * @param array $data 更新数据 + * @return integer|string + */ + public function update(array $data = []) + { + return $this->query->update($data); + } + /** * 删除记录 * @access public diff --git a/thinkphp/library/think/model/concern/Attribute.php b/thinkphp/library/think/model/concern/Attribute.php index 0605478a..66627b38 100644 --- a/thinkphp/library/think/model/concern/Attribute.php +++ b/thinkphp/library/think/model/concern/Attribute.php @@ -327,9 +327,13 @@ trait Attribute $method = 'set' . Loader::parseName($name, 1) . 'Attr'; if (method_exists($this, $method)) { - $value = $this->$method($value, array_merge($this->data, $data)); + $origin = $this->data; + $value = $this->$method($value, array_merge($this->data, $data)); $this->set[$name] = true; + if (is_null($value) && $origin !== $this->data) { + return; + } } elseif (isset($this->type[$name])) { // 类型转换 $value = $this->writeTransform($value, $this->type[$name]); @@ -371,9 +375,7 @@ trait Attribute switch ($type) { case 'datetime': case 'date': - $format = !empty($param) ? $param : $this->dateFormat; - $format .= strpos($format, 'u') || false !== strpos($format, '\\') ? '' : '.u'; - $value = $this->formatDateTime($format); + $value = $this->formatDateTime('Y-m-d H:i:s.u'); break; case 'timestamp': case 'integer': @@ -386,8 +388,7 @@ trait Attribute 'date', 'timestamp', ])) { - $format = strpos($this->dateFormat, 'u') || false !== strpos($this->dateFormat, '\\') ? '' : '.u'; - $value = $this->formatDateTime($this->dateFormat . $format); + $value = $this->formatDateTime('Y-m-d H:i:s.u'); } else { $value = time(); } @@ -438,9 +439,8 @@ trait Attribute } break; case 'datetime': - $format = !empty($param) ? $param : $this->dateFormat; - $value = is_numeric($value) ? $value : strtotime($value); - $value = $this->formatDateTime($format, $value); + $value = is_numeric($value) ? $value : strtotime($value); + $value = $this->formatDateTime('Y-m-d H:i:s.u', $value); break; case 'object': if (is_object($value)) { diff --git a/thinkphp/library/think/model/concern/Conversion.php b/thinkphp/library/think/model/concern/Conversion.php index 73782da1..922d5b0e 100644 --- a/thinkphp/library/think/model/concern/Conversion.php +++ b/thinkphp/library/think/model/concern/Conversion.php @@ -130,38 +130,52 @@ trait Conversion */ public function toArray() { - $item = []; - $visible = []; - $hidden = []; + $item = []; + $hasVisible = false; + + foreach ($this->visible as $key => $val) { + if (is_string($val)) { + if (strpos($val, '.')) { + list($relation, $name) = explode('.', $val); + $this->visible[$relation][] = $name; + } else { + $this->visible[$val] = true; + $hasVisible = true; + } + unset($this->visible[$key]); + } + } + + foreach ($this->hidden as $key => $val) { + if (is_string($val)) { + if (strpos($val, '.')) { + list($relation, $name) = explode('.', $val); + $this->hidden[$relation][] = $name; + } else { + $this->hidden[$val] = true; + } + unset($this->hidden[$key]); + } + } // 合并关联数据 $data = array_merge($this->data, $this->relation); - // 过滤属性 - if (!empty($this->visible)) { - $array = $this->parseAttr($this->visible, $visible); - if (!empty($array)) { - $data = array_intersect_key($data, array_flip($array)); - } - } - - if (empty($array) && !empty($this->hidden)) { - $array = $this->parseAttr($this->hidden, $hidden); - $data = array_diff_key($data, array_flip($array)); - } - foreach ($data as $key => $val) { if ($val instanceof Model || $val instanceof ModelCollection) { // 关联模型对象 - if (isset($visible[$key])) { - $val->visible($visible[$key]); - } elseif (isset($hidden[$key])) { - $val->hidden($hidden[$key]); + if (isset($this->visible[$key]) && is_array($this->visible[$key])) { + $val->visible($this->visible[$key]); + } elseif (isset($this->hidden[$key]) && is_array($this->hidden[$key])) { + $val->hidden($this->hidden[$key]); } // 关联模型对象 - $item[$key] = $val->toArray(); - } else { - // 模型属性 + if (!isset($this->hidden[$key]) || true !== $this->hidden[$key]) { + $item[$key] = $val->toArray(); + } + } elseif (isset($this->visible[$key])) { + $item[$key] = $this->getAttr($key); + } elseif (!isset($this->hidden[$key]) && !$hasVisible) { $item[$key] = $this->getAttr($key); } } @@ -252,28 +266,4 @@ trait Conversion return $collection; } - /** - * 解析隐藏及显示属性 - * @access protected - * @param array $attrs 属性 - * @param array $result 结果集 - * @return array - */ - protected function parseAttr($attrs, &$result) - { - $array = []; - - foreach ($attrs as $key => $val) { - if (is_array($val)) { - $result[$key] = $val; - } elseif (strpos($val, '.')) { - list($key, $name) = explode('.', $val); - $result[$key][] = $name; - } else { - $array[] = $val; - } - } - - return $array; - } } diff --git a/thinkphp/library/think/model/concern/RelationShip.php b/thinkphp/library/think/model/concern/RelationShip.php index 38ad5d20..9ca709a5 100644 --- a/thinkphp/library/think/model/concern/RelationShip.php +++ b/thinkphp/library/think/model/concern/RelationShip.php @@ -204,7 +204,7 @@ trait RelationShip $relationResult = $this->$method(); if (isset($withRelationAttr[$relationName])) { - $relationResult->withAttr($withRelationAttr[$relationName]); + $relationResult->getQuery()->withAttr($withRelationAttr[$relationName]); } $this->relation[$relation] = $relationResult->getRelation($subRelation, $closure); @@ -248,7 +248,7 @@ trait RelationShip $relationResult = $this->$relation(); if (isset($withRelationAttr[$relationName])) { - $relationResult->withAttr($withRelationAttr[$relationName]); + $relationResult->getQuery()->withAttr($withRelationAttr[$relationName]); } $relationResult->eagerlyResultSet($resultSet, $relation, $subRelation, $closure, $join); @@ -290,7 +290,7 @@ trait RelationShip $relationResult = $this->$relation(); if (isset($withRelationAttr[$relationName])) { - $relationResult->withAttr($withRelationAttr[$relationName]); + $relationResult->getQuery()->withAttr($withRelationAttr[$relationName]); } $relationResult->eagerlyResult($result, $relation, $subRelation, $closure, $join); diff --git a/thinkphp/library/think/model/concern/SoftDelete.php b/thinkphp/library/think/model/concern/SoftDelete.php index 7dc96e12..679aa34c 100644 --- a/thinkphp/library/think/model/concern/SoftDelete.php +++ b/thinkphp/library/think/model/concern/SoftDelete.php @@ -235,7 +235,8 @@ trait SoftDelete $field = $this->getDeleteTimeField(true); if ($field) { - $query->useSoftDelete($field, $this->defaultSoftDelete); + $condition = is_null($this->defaultSoftDelete) ? ['null', ''] : ['=', $this->defaultSoftDelete]; + $query->useSoftDelete($field, $condition); } } } diff --git a/thinkphp/library/think/model/relation/HasMany.php b/thinkphp/library/think/model/relation/HasMany.php index d5a7d9d1..f97623b8 100644 --- a/thinkphp/library/think/model/relation/HasMany.php +++ b/thinkphp/library/think/model/relation/HasMany.php @@ -266,11 +266,11 @@ class HasMany extends Relation /** * 批量保存当前关联数据对象 * @access public - * @param array $dataSet 数据集 + * @param array|\think\Collection $dataSet 数据集 * @param boolean $replace 是否自动识别更新和写入 * @return array|false */ - public function saveAll(array $dataSet, $replace = true) + public function saveAll($dataSet, $replace = true) { $result = []; diff --git a/thinkphp/library/think/response/Redirect.php b/thinkphp/library/think/response/Redirect.php index 73729ce8..6b4f118a 100644 --- a/thinkphp/library/think/response/Redirect.php +++ b/thinkphp/library/think/response/Redirect.php @@ -87,11 +87,12 @@ class Redirect extends Response /** * 记住当前url后跳转 * @access public + * @param string $url 指定记住的url * @return $this */ - public function remember() + public function remember($url = null) { - $this->app['session']->set('redirect_url', $this->app['request']->url()); + $this->app['session']->set('redirect_url', $url ?: $this->app['request']->url()); return $this; } diff --git a/thinkphp/library/think/route/Rule.php b/thinkphp/library/think/route/Rule.php index f841ada6..996305f7 100644 --- a/thinkphp/library/think/route/Rule.php +++ b/thinkphp/library/think/route/Rule.php @@ -642,17 +642,26 @@ abstract class Rule protected function checkCrossDomain($request) { if (!empty($this->option['cross_domain'])) { - $header = [ - 'Access-Control-Allow-Origin' => '*', - 'Access-Control-Allow-Methods' => 'GET, POST, PATCH, PUT, DELETE', - 'Access-Control-Allow-Headers' => 'Authorization, Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since, X-Requested-With', + 'Access-Control-Allow-Credentials' => 'true', + 'Access-Control-Allow-Methods' => 'GET, POST, PATCH, PUT, DELETE', + 'Access-Control-Allow-Headers' => 'Authorization, Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since, X-Requested-With', ]; if (!empty($this->option['header'])) { $header = array_merge($header, $this->option['header']); } + if (!isset($header['Access-Control-Allow-Origin'])) { + $httpOrigin = $request->header('origin'); + + if ($httpOrigin && strpos(config('cookie.domain'), $httpOrigin)) { + $header['Access-Control-Allow-Origin'] = $httpOrigin; + } else { + $header['Access-Control-Allow-Origin'] = '*'; + } + } + $this->option['header'] = $header; if ($request->method(true) == 'OPTIONS') { diff --git a/thinkphp/library/think/route/RuleGroup.php b/thinkphp/library/think/route/RuleGroup.php index faad639a..5781d8cf 100644 --- a/thinkphp/library/think/route/RuleGroup.php +++ b/thinkphp/library/think/route/RuleGroup.php @@ -118,8 +118,8 @@ class RuleGroup extends Rule */ public function check($request, $url, $completeMatch = false) { + // 跨域OPTIONS请求 if ($dispatch = $this->checkCrossDomain($request)) { - // 跨域OPTIONS请求 return $dispatch; } diff --git a/thinkphp/library/think/route/RuleItem.php b/thinkphp/library/think/route/RuleItem.php index e4bddd90..a05d2deb 100644 --- a/thinkphp/library/think/route/RuleItem.php +++ b/thinkphp/library/think/route/RuleItem.php @@ -149,11 +149,6 @@ class RuleItem extends Rule */ public function checkRule($request, $url, $match = null, $completeMatch = false) { - if ($dispatch = $this->checkCrossDomain($request)) { - // 允许跨域 - return $dispatch; - } - // 检查参数有效性 if (!$this->checkOption($this->option, $request)) { return false; @@ -169,6 +164,15 @@ class RuleItem extends Rule } if (false !== $match) { + if (!empty($option['cross_domain'])) { + if ($dispatch = $this->checkCrossDomain($request)) { + // 允许跨域 + return $dispatch; + } + + $option['header'] = $this->option['header']; + } + // 检查前置行为 if (isset($option['before']) && false === $this->checkBefore($option['before'])) { return false; diff --git a/vendor/composer/ClassLoader.php b/vendor/composer/ClassLoader.php index fce8549f..95f7e097 100644 --- a/vendor/composer/ClassLoader.php +++ b/vendor/composer/ClassLoader.php @@ -279,7 +279,7 @@ class ClassLoader */ public function setApcuPrefix($apcuPrefix) { - $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null; + $this->apcuPrefix = function_exists('apcu_fetch') && ini_get('apc.enabled') ? $apcuPrefix : null; } /** diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 914558b9..428e82f5 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -12,7 +12,13 @@ "type": "zip", "url": "https://api.github.com/repos/Bacon/BaconQrCode/zipball/5a91b62b9d37cee635bbf8d553f4546057250bee", "reference": "5a91b62b9d37cee635bbf8d553f4546057250bee", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "ext-iconv": "*", @@ -60,7 +66,13 @@ "type": "zip", "url": "https://api.github.com/repos/endroid/installer/zipball/2db0498b3a1cdb95db75309ea3087739f8017e62", "reference": "2db0498b3a1cdb95db75309ea3087739f8017e62", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "composer-plugin-api": "^1.1", @@ -107,7 +119,13 @@ "type": "zip", "url": "https://api.github.com/repos/endroid/qr-code/zipball/4752fc7cc7f658c17049919af33872e9b7d5e64d", "reference": "4752fc7cc7f658c17049919af33872e9b7d5e64d", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "bacon/bacon-qr-code": "^1.0.3", @@ -169,7 +187,13 @@ "type": "zip", "url": "https://api.github.com/repos/khanamiryan/php-qrcode-detector-decoder/zipball/a75482d3bc804e3f6702332bfda6cccbb0dfaa76", "reference": "a75482d3bc804e3f6702332bfda6cccbb0dfaa76", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "php": "^5.6|^7.0" @@ -221,7 +245,13 @@ "type": "zip", "url": "https://api.github.com/repos/MarkBaker/PHPComplex/zipball/1ea674a8308baf547cbcbd30c5fcd6d301b7c000", "reference": "1ea674a8308baf547cbcbd30c5fcd6d301b7c000", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "php": "^5.6.0|^7.0.0" @@ -318,7 +348,13 @@ "type": "zip", "url": "https://api.github.com/repos/myclabs/php-enum/zipball/550d2334d77f91b0816a5cbd6965272fe20146b8", "reference": "550d2334d77f91b0816a5cbd6965272fe20146b8", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "php": ">=5.4" @@ -364,7 +400,13 @@ "type": "zip", "url": "https://api.github.com/repos/ivanlanin/pclzip/zipball/19dd1de9d3f5fc4d7d70175b4c344dee329f45fd", "reference": "19dd1de9d3f5fc4d7d70175b4c344dee329f45fd", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", + "preferred": true + } + ] }, "time": "2014-06-05T11:42:24+00:00", "type": "library", @@ -403,7 +445,13 @@ "type": "zip", "url": "https://api.github.com/repos/php4world/auth/zipball/e356cad8de77c3e27f78875685b309d561c0fa94", "reference": "e356cad8de77c3e27f78875685b309d561c0fa94", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "topthink/framework": "5.1.*" @@ -441,7 +489,13 @@ "type": "zip", "url": "https://api.github.com/repos/PHPOffice/Common/zipball/edb5d32b1e3400a35a5c91e2539ed6f6ce925e4d", "reference": "edb5d32b1e3400a35a5c91e2539ed6f6ce925e4d", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "pclzip/pclzip": "^2.8", @@ -498,7 +552,13 @@ "type": "zip", "url": "https://api.github.com/repos/PHPOffice/PhpSpreadsheet/zipball/2dfd06c59825914a1a325f2a2ed13634b9d8c411", "reference": "2dfd06c59825914a1a325f2a2ed13634b9d8c411", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "ext-ctype": "*", @@ -587,7 +647,13 @@ "type": "zip", "url": "https://api.github.com/repos/PHPOffice/PHPWord/zipball/dfa2f36cad2b632b7ab1c56473e4f5db9a7caf7f", "reference": "dfa2f36cad2b632b7ab1c56473e4f5db9a7caf7f", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "ext-xml": "*", @@ -698,7 +764,13 @@ "type": "zip", "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "php": ">=5.3.0" @@ -748,7 +820,13 @@ "type": "zip", "url": "https://api.github.com/repos/symfony/inflector/zipball/8da789363973920dd7df6753822810592138e5ba", "reference": "8da789363973920dd7df6753822810592138e5ba", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "php": "^7.1.3", @@ -808,7 +886,13 @@ "type": "zip", "url": "https://api.github.com/repos/symfony/options-resolver/zipball/31e5523373cb06163079ef46d0a2d507d70fe064", "reference": "31e5523373cb06163079ef46d0a2d507d70fe064", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "php": "^7.1.3" @@ -864,7 +948,13 @@ "type": "zip", "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e3d826245268269cd66f8326bd8bc066687b4a19", "reference": "e3d826245268269cd66f8326bd8bc066687b4a19", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "php": ">=5.3.3" @@ -924,7 +1014,13 @@ "type": "zip", "url": "https://api.github.com/repos/symfony/property-access/zipball/10edb6c4b6f496a2ed40a788ebbd280b421985ae", "reference": "10edb6c4b6f496a2ed40a788ebbd280b421985ae", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "php": "^7.1.3", @@ -982,18 +1078,24 @@ }, { "name": "topthink/framework", - "version": "v5.1.35", - "version_normalized": "5.1.35.0", + "version": "v5.1.37.1", + "version_normalized": "5.1.37.1", "source": { "type": "git", "url": "https://github.com/top-think/framework.git", - "reference": "c53c0c6132022a87e8ee9c4109939eaf9a8a7adb" + "reference": "05eecd121d18d6705aaa10aa44fcdf7c14da4d0b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/top-think/framework/zipball/c53c0c6132022a87e8ee9c4109939eaf9a8a7adb", - "reference": "c53c0c6132022a87e8ee9c4109939eaf9a8a7adb", - "shasum": "" + "url": "https://api.github.com/repos/top-think/framework/zipball/05eecd121d18d6705aaa10aa44fcdf7c14da4d0b", + "reference": "05eecd121d18d6705aaa10aa44fcdf7c14da4d0b", + "shasum": "", + "mirrors": [ + { + "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "php": ">=5.6.0", @@ -1008,7 +1110,7 @@ "sebastian/phpcpd": "2.*", "squizlabs/php_codesniffer": "2.*" }, - "time": "2019-03-03T00:44:44+00:00", + "time": "2019-05-28T06:57:29+00:00", "type": "think-framework", "installation-source": "dist", "notification-url": "https://packagist.org/downloads/", @@ -1046,7 +1148,13 @@ "type": "zip", "url": "https://api.github.com/repos/top-think/think-captcha/zipball/54c8a51552f99ff9ea89ea9c272383a8f738ceee", "reference": "54c8a51552f99ff9ea89ea9c272383a8f738ceee", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "topthink/framework": "5.1.*" @@ -1087,7 +1195,13 @@ "type": "zip", "url": "https://api.github.com/repos/top-think/think-helper/zipball/0c99dc625b0d2d4124e1b6ca15a3ad6f0125963f", "reference": "0c99dc625b0d2d4124e1b6ca15a3ad6f0125963f", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", + "preferred": true + } + ] }, "time": "2017-04-05T07:15:37+00:00", "type": "library", @@ -1125,7 +1239,13 @@ "type": "zip", "url": "https://api.github.com/repos/top-think/think-installer/zipball/f5400a12c60e513911aef41fe443fa6920952675", "reference": "f5400a12c60e513911aef41fe443fa6920952675", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "composer-plugin-api": "^1.0" @@ -1168,7 +1288,13 @@ "type": "zip", "url": "https://api.github.com/repos/top-think/think-migration/zipball/70c89850ca29c2eab988c7c3475d1d5331901bb8", "reference": "70c89850ca29c2eab988c7c3475d1d5331901bb8", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "topthink/framework": "5.1.*" @@ -1209,7 +1335,13 @@ "type": "zip", "url": "https://api.github.com/repos/whitehat101/apr1-md5/zipball/8b261c9fc0481b4e9fa9d01c6ca70867b5d5e819", "reference": "8b261c9fc0481b4e9fa9d01c6ca70867b5d5e819", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "php": ">=5.3.0" @@ -1255,7 +1387,13 @@ "type": "zip", "url": "https://api.github.com/repos/zendframework/zend-escaper/zipball/31d8aafae982f9568287cb4dce987e6aff8fd074", "reference": "31d8aafae982f9568287cb4dce987e6aff8fd074", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "php": "^5.6 || ^7.0"