From 03063bc9c12230612abffe1f141b5da4f17ca250 Mon Sep 17 00:00:00 2001 From: toogee Date: Tue, 7 Jan 2020 14:29:33 +0800 Subject: [PATCH] bugs --- composer.lock | 18 +++--- config/database-1.php | 63 ------------------- config/view.php | 2 +- vendor/composer/installed.json | 20 +++--- .../src/Adapter/AbstractFtpAdapter.php | 4 ++ vendor/league/flysystem/src/Adapter/Ftp.php | 22 ++++--- .../src/ConnectionErrorException.php | 9 +++ .../src/ConnectionRuntimeException.php | 9 +++ vendor/league/flysystem/src/Exception.php | 2 +- .../flysystem/src/FilesystemException.php | 7 +++ .../src/FilesystemNotFoundException.php | 2 +- .../flysystem/src/InvalidRootException.php | 9 +++ .../flysystem/src/NotSupportedException.php | 2 +- .../flysystem/src/RootViolationException.php | 2 +- vendor/services.php | 2 +- .../think-orm/src/db/PDOConnection.php | 7 ++- .../think-orm/src/model/concern/Attribute.php | 2 +- 17 files changed, 80 insertions(+), 102 deletions(-) delete mode 100644 config/database-1.php create mode 100644 vendor/league/flysystem/src/ConnectionErrorException.php create mode 100644 vendor/league/flysystem/src/ConnectionRuntimeException.php create mode 100644 vendor/league/flysystem/src/FilesystemException.php create mode 100644 vendor/league/flysystem/src/InvalidRootException.php diff --git a/composer.lock b/composer.lock index 611e647..687e778 100644 --- a/composer.lock +++ b/composer.lock @@ -8,16 +8,16 @@ "packages": [ { "name": "league/flysystem", - "version": "1.0.62", + "version": "1.0.63", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem.git", - "reference": "14dd5d7dff5fbc29ca9a2a53ff109760e40d91a0" + "reference": "8132daec326565036bc8e8d1876f77ec183a7bd6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/14dd5d7dff5fbc29ca9a2a53ff109760e40d91a0", - "reference": "14dd5d7dff5fbc29ca9a2a53ff109760e40d91a0", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/8132daec326565036bc8e8d1876f77ec183a7bd6", + "reference": "8132daec326565036bc8e8d1876f77ec183a7bd6", "shasum": "", "mirrors": [ { @@ -94,7 +94,7 @@ "sftp", "storage" ], - "time": "2019-12-29T14:46:55+00:00" + "time": "2020-01-04T16:30:31+00:00" }, { "name": "league/flysystem-cached-adapter", @@ -722,12 +722,12 @@ "source": { "type": "git", "url": "https://github.com/top-think/think-orm.git", - "reference": "444277e2acff186a8066a8a42912ebea01d948c5" + "reference": "9caecd97608c937059fc09550b41af2557471d35" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/top-think/think-orm/zipball/444277e2acff186a8066a8a42912ebea01d948c5", - "reference": "444277e2acff186a8066a8a42912ebea01d948c5", + "url": "https://api.github.com/repos/top-think/think-orm/zipball/9caecd97608c937059fc09550b41af2557471d35", + "reference": "9caecd97608c937059fc09550b41af2557471d35", "shasum": "", "mirrors": [ { @@ -765,7 +765,7 @@ "database", "orm" ], - "time": "2019-12-28T13:25:27+00:00" + "time": "2020-01-04T04:00:06+00:00" }, { "name": "topthink/think-template", diff --git a/config/database-1.php b/config/database-1.php deleted file mode 100644 index dcff575..0000000 --- a/config/database-1.php +++ /dev/null @@ -1,63 +0,0 @@ - Env::get('database.driver', 'mysql'), - - // 自定义时间查询规则 - 'time_query_rule' => [], - - // 自动写入时间戳字段 - // true为自动识别类型 false关闭 - // 字符串则明确指定时间字段类型 支持 int timestamp datetime date - 'auto_timestamp' => true, - - // 时间字段取出后的默认时间格式 - 'datetime_format' => 'Y-m-d H:i:s', - - // 数据库连接配置信息 - 'connections' => [ - 'mysql' => [ - // 数据库类型 - 'type' => Env::get('database.type', 'mysql'), - // 服务器地址 - 'hostname' => Env::get('database.hostname', '127.0.0.1'), - // 数据库名 - 'database' => Env::get('database.database', ''), - // 用户名 - 'username' => Env::get('database.username', 'root'), - // 密码 - 'password' => Env::get('database.password', ''), - // 端口 - 'hostport' => Env::get('database.hostport', '3306'), - // 数据库连接参数 - 'params' => [], - // 数据库编码默认采用utf8 - 'charset' => Env::get('database.charset', 'utf8'), - // 数据库表前缀 - 'prefix' => Env::get('database.prefix', ''), - - // 数据库部署方式:0 集中式(单一服务器),1 分布式(主从服务器) - 'deploy' => 0, - // 数据库读写是否分离 主从式有效 - 'rw_separate' => false, - // 读写分离后 主服务器数量 - 'master_num' => 1, - // 指定从服务器序号 - 'slave_no' => '', - // 是否严格检查字段是否存在 - 'fields_strict' => true, - // 是否需要断线重连 - 'break_reconnect' => false, - // 监听SQL - 'trigger_sql' => true, - // 开启字段缓存 - 'fields_cache' => false, - // 字段缓存路径 - 'schema_cache_path' => app()->getRuntimePath() . 'schema' . DIRECTORY_SEPARATOR, - ], - - // 更多的数据库配置信息 - ], -]; \ No newline at end of file diff --git a/config/view.php b/config/view.php index 7499b1d..fc8d018 100644 --- a/config/view.php +++ b/config/view.php @@ -7,7 +7,7 @@ return [ // 模板引擎类型使用Think 'type' => 'Think', // 默认模板渲染规则 1 解析为小写+下划线 2 全部转换小写 3 保持操作方法 - 'auto_rule' => 3, + 'auto_rule' => 2, // 模板目录名 'view_dir_name' => 'view', // 模板后缀 diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 430cce1..839d3cf 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -1,17 +1,17 @@ [ { "name": "league/flysystem", - "version": "1.0.62", - "version_normalized": "1.0.62.0", + "version": "1.0.63", + "version_normalized": "1.0.63.0", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem.git", - "reference": "14dd5d7dff5fbc29ca9a2a53ff109760e40d91a0" + "reference": "8132daec326565036bc8e8d1876f77ec183a7bd6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/14dd5d7dff5fbc29ca9a2a53ff109760e40d91a0", - "reference": "14dd5d7dff5fbc29ca9a2a53ff109760e40d91a0", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/8132daec326565036bc8e8d1876f77ec183a7bd6", + "reference": "8132daec326565036bc8e8d1876f77ec183a7bd6", "shasum": "", "mirrors": [ { @@ -47,7 +47,7 @@ "spatie/flysystem-dropbox": "Allows you to use Dropbox storage", "srmklive/flysystem-dropbox-v2": "Allows you to use Dropbox storage for PHP 5 applications" }, - "time": "2019-12-29T14:46:55+00:00", + "time": "2020-01-04T16:30:31+00:00", "type": "library", "extra": { "branch-alias": { @@ -954,12 +954,12 @@ "source": { "type": "git", "url": "https://github.com/top-think/think-orm.git", - "reference": "a343dbb39fc51a09e78a68e7968dc8e8060c4a66" + "reference": "9caecd97608c937059fc09550b41af2557471d35" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/top-think/think-orm/zipball/a343dbb39fc51a09e78a68e7968dc8e8060c4a66", - "reference": "a343dbb39fc51a09e78a68e7968dc8e8060c4a66", + "url": "https://api.github.com/repos/top-think/think-orm/zipball/9caecd97608c937059fc09550b41af2557471d35", + "reference": "9caecd97608c937059fc09550b41af2557471d35", "shasum": "", "mirrors": [ { @@ -975,7 +975,7 @@ "psr/simple-cache": "^1.0", "topthink/think-helper": "^3.1" }, - "time": "2020-01-01T12:36:51+00:00", + "time": "2020-01-04T04:00:06+00:00", "type": "library", "installation-source": "dist", "autoload": { diff --git a/vendor/league/flysystem/src/Adapter/AbstractFtpAdapter.php b/vendor/league/flysystem/src/Adapter/AbstractFtpAdapter.php index 578b491..fb8aa49 100644 --- a/vendor/league/flysystem/src/Adapter/AbstractFtpAdapter.php +++ b/vendor/league/flysystem/src/Adapter/AbstractFtpAdapter.php @@ -557,6 +557,10 @@ abstract class AbstractFtpAdapter extends AbstractAdapter */ protected function normalizePermissions($permissions) { + if (is_numeric($permissions)) { + return $permissions & 0777; + } + // remove the type identifier $permissions = substr($permissions, 1); diff --git a/vendor/league/flysystem/src/Adapter/Ftp.php b/vendor/league/flysystem/src/Adapter/Ftp.php index c984824..cdaf711 100644 --- a/vendor/league/flysystem/src/Adapter/Ftp.php +++ b/vendor/league/flysystem/src/Adapter/Ftp.php @@ -6,9 +6,11 @@ use ErrorException; use League\Flysystem\Adapter\Polyfill\StreamedCopyTrait; use League\Flysystem\AdapterInterface; use League\Flysystem\Config; +use League\Flysystem\ConnectionErrorException; +use League\Flysystem\ConnectionRuntimeException; +use League\Flysystem\InvalidRootException; use League\Flysystem\Util; use League\Flysystem\Util\MimeType; -use RuntimeException; class Ftp extends AbstractFtpAdapter { @@ -135,7 +137,7 @@ class Ftp extends AbstractFtpAdapter } if ( ! $this->connection) { - throw new RuntimeException('Could not connect to host: ' . $this->getHost() . ', port:' . $this->getPort()); + throw new ConnectionRuntimeException('Could not connect to host: ' . $this->getHost() . ', port:' . $this->getPort()); } $this->login(); @@ -153,7 +155,7 @@ class Ftp extends AbstractFtpAdapter if ($this->utf8) { $response = ftp_raw($this->connection, "OPTS UTF8 ON"); if (substr($response[0], 0, 3) !== '200') { - throw new RuntimeException( + throw new ConnectionRuntimeException( 'Could not set UTF-8 mode for connection: ' . $this->getHost() . '::' . $this->getPort() ); } @@ -163,7 +165,7 @@ class Ftp extends AbstractFtpAdapter /** * Set the connections to passive mode. * - * @throws RuntimeException + * @throws ConnectionRuntimeException */ protected function setConnectionPassiveMode() { @@ -172,7 +174,7 @@ class Ftp extends AbstractFtpAdapter } if ( ! ftp_pasv($this->connection, $this->passive)) { - throw new RuntimeException( + throw new ConnectionRuntimeException( 'Could not set passive mode for connection: ' . $this->getHost() . '::' . $this->getPort() ); } @@ -187,7 +189,7 @@ class Ftp extends AbstractFtpAdapter $connection = $this->connection; if ($root && ! ftp_chdir($connection, $root)) { - throw new RuntimeException('Root is invalid or does not exist: ' . $this->getRoot()); + throw new InvalidRootException('Root is invalid or does not exist: ' . $this->getRoot()); } // Store absolute path for further reference. @@ -200,7 +202,7 @@ class Ftp extends AbstractFtpAdapter /** * Login. * - * @throws RuntimeException + * @throws ConnectionRuntimeException */ protected function login() { @@ -215,7 +217,7 @@ class Ftp extends AbstractFtpAdapter if ( ! $isLoggedIn) { $this->disconnect(); - throw new RuntimeException( + throw new ConnectionRuntimeException( 'Could not login with connection: ' . $this->getHost() . '::' . $this->getPort( ) . ', username: ' . $this->getUsername() ); @@ -526,7 +528,7 @@ class Ftp extends AbstractFtpAdapter * * @return bool * - * @throws ErrorException + * @throws ConnectionErrorException */ public function isConnected() { @@ -534,7 +536,7 @@ class Ftp extends AbstractFtpAdapter return is_resource($this->connection) && ftp_rawlist($this->connection, $this->getRoot()) !== false; } catch (ErrorException $e) { if (strpos($e->getMessage(), 'ftp_rawlist') === false) { - throw $e; + throw new ConnectionErrorException($e->getMessage()); } return false; diff --git a/vendor/league/flysystem/src/ConnectionErrorException.php b/vendor/league/flysystem/src/ConnectionErrorException.php new file mode 100644 index 0000000..adb651d --- /dev/null +++ b/vendor/league/flysystem/src/ConnectionErrorException.php @@ -0,0 +1,9 @@ + 'think\\captcha\\CaptchaService', diff --git a/vendor/topthink/think-orm/src/db/PDOConnection.php b/vendor/topthink/think-orm/src/db/PDOConnection.php index 482e759..0d23b83 100644 --- a/vendor/topthink/think-orm/src/db/PDOConnection.php +++ b/vendor/topthink/think-orm/src/db/PDOConnection.php @@ -906,7 +906,8 @@ abstract class PDOConnection extends Connection implements ConnectionInterface return 0; } - $query->parseOptions(); + $options = $query->parseOptions(); + $replace = !empty($options['replace']); if (0 === $limit && count($dataSet) >= 5000) { $limit = 1000; @@ -921,7 +922,7 @@ abstract class PDOConnection extends Connection implements ConnectionInterface $count = 0; foreach ($array as $item) { - $sql = $this->builder->insertAll($query, $item); + $sql = $this->builder->insertAll($query, $item, $replace); $count += $this->execute($query, $sql, $query->getBind()); } @@ -935,7 +936,7 @@ abstract class PDOConnection extends Connection implements ConnectionInterface return $count; } - $sql = $this->builder->insertAll($query, $dataSet); + $sql = $this->builder->insertAll($query, $dataSet, $replace); return $this->execute($query, $sql, $query->getBind()); } diff --git a/vendor/topthink/think-orm/src/model/concern/Attribute.php b/vendor/topthink/think-orm/src/model/concern/Attribute.php index a02dc3f..9e4367b 100644 --- a/vendor/topthink/think-orm/src/model/concern/Attribute.php +++ b/vendor/topthink/think-orm/src/model/concern/Attribute.php @@ -424,7 +424,7 @@ trait Attribute break; case 'datetime': $value = is_numeric($value) ? $value : strtotime($value); - $value = $this->formatDateTime('Y-m-d H:i:s.u', $value); + $value = $this->formatDateTime('Y-m-d H:i:s.u', $value, true); break; case 'object': if (is_object($value)) {