mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-04-06 03:58:04 +08:00
ComposerUpdate
This commit is contained in:
parent
26fa3b6da0
commit
4e8d63c811
2
vendor/composer/autoload_classmap.php
vendored
2
vendor/composer/autoload_classmap.php
vendored
@ -454,7 +454,7 @@ return array(
|
|||||||
'think\\facade\\Db' => $vendorDir . '/topthink/think-orm/src/facade/Db.php',
|
'think\\facade\\Db' => $vendorDir . '/topthink/think-orm/src/facade/Db.php',
|
||||||
'think\\facade\\Env' => $vendorDir . '/topthink/framework/src/think/facade/Env.php',
|
'think\\facade\\Env' => $vendorDir . '/topthink/framework/src/think/facade/Env.php',
|
||||||
'think\\facade\\Event' => $vendorDir . '/topthink/framework/src/think/facade/Event.php',
|
'think\\facade\\Event' => $vendorDir . '/topthink/framework/src/think/facade/Event.php',
|
||||||
'think\\facade\\Facade' => $vendorDir . '/topthink/think-orm/src/facade/Db.php',
|
'think\\facade\\Facade' => $vendorDir . '/topthink/think-template/src/facade/Template.php',
|
||||||
'think\\facade\\Filesystem' => $vendorDir . '/topthink/framework/src/think/facade/Filesystem.php',
|
'think\\facade\\Filesystem' => $vendorDir . '/topthink/framework/src/think/facade/Filesystem.php',
|
||||||
'think\\facade\\Lang' => $vendorDir . '/topthink/framework/src/think/facade/Lang.php',
|
'think\\facade\\Lang' => $vendorDir . '/topthink/framework/src/think/facade/Lang.php',
|
||||||
'think\\facade\\Log' => $vendorDir . '/topthink/framework/src/think/facade/Log.php',
|
'think\\facade\\Log' => $vendorDir . '/topthink/framework/src/think/facade/Log.php',
|
||||||
|
1
vendor/composer/autoload_files.php
vendored
1
vendor/composer/autoload_files.php
vendored
@ -7,5 +7,6 @@ $baseDir = dirname($vendorDir);
|
|||||||
|
|
||||||
return array(
|
return array(
|
||||||
'9b552a3cc426e3287cc811caefa3cf53' => $vendorDir . '/topthink/think-helper/src/helper.php',
|
'9b552a3cc426e3287cc811caefa3cf53' => $vendorDir . '/topthink/think-helper/src/helper.php',
|
||||||
|
'35fab96057f1bf5e7aba31a8a6d5fdde' => $vendorDir . '/topthink/think-orm/stubs/load_stubs.php',
|
||||||
'8dafcc6956460bc297e00381fed53e11' => $vendorDir . '/zoujingli/think-library/src/common.php',
|
'8dafcc6956460bc297e00381fed53e11' => $vendorDir . '/zoujingli/think-library/src/common.php',
|
||||||
);
|
);
|
||||||
|
3
vendor/composer/autoload_static.php
vendored
3
vendor/composer/autoload_static.php
vendored
@ -8,6 +8,7 @@ class ComposerStaticInit4f89fd0e0503ccf740f2fa5757825d7b
|
|||||||
{
|
{
|
||||||
public static $files = array (
|
public static $files = array (
|
||||||
'9b552a3cc426e3287cc811caefa3cf53' => __DIR__ . '/..' . '/topthink/think-helper/src/helper.php',
|
'9b552a3cc426e3287cc811caefa3cf53' => __DIR__ . '/..' . '/topthink/think-helper/src/helper.php',
|
||||||
|
'35fab96057f1bf5e7aba31a8a6d5fdde' => __DIR__ . '/..' . '/topthink/think-orm/stubs/load_stubs.php',
|
||||||
'8dafcc6956460bc297e00381fed53e11' => __DIR__ . '/..' . '/zoujingli/think-library/src/common.php',
|
'8dafcc6956460bc297e00381fed53e11' => __DIR__ . '/..' . '/zoujingli/think-library/src/common.php',
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -577,7 +578,7 @@ class ComposerStaticInit4f89fd0e0503ccf740f2fa5757825d7b
|
|||||||
'think\\facade\\Db' => __DIR__ . '/..' . '/topthink/think-orm/src/facade/Db.php',
|
'think\\facade\\Db' => __DIR__ . '/..' . '/topthink/think-orm/src/facade/Db.php',
|
||||||
'think\\facade\\Env' => __DIR__ . '/..' . '/topthink/framework/src/think/facade/Env.php',
|
'think\\facade\\Env' => __DIR__ . '/..' . '/topthink/framework/src/think/facade/Env.php',
|
||||||
'think\\facade\\Event' => __DIR__ . '/..' . '/topthink/framework/src/think/facade/Event.php',
|
'think\\facade\\Event' => __DIR__ . '/..' . '/topthink/framework/src/think/facade/Event.php',
|
||||||
'think\\facade\\Facade' => __DIR__ . '/..' . '/topthink/think-orm/src/facade/Db.php',
|
'think\\facade\\Facade' => __DIR__ . '/..' . '/topthink/think-template/src/facade/Template.php',
|
||||||
'think\\facade\\Filesystem' => __DIR__ . '/..' . '/topthink/framework/src/think/facade/Filesystem.php',
|
'think\\facade\\Filesystem' => __DIR__ . '/..' . '/topthink/framework/src/think/facade/Filesystem.php',
|
||||||
'think\\facade\\Lang' => __DIR__ . '/..' . '/topthink/framework/src/think/facade/Lang.php',
|
'think\\facade\\Lang' => __DIR__ . '/..' . '/topthink/framework/src/think/facade/Lang.php',
|
||||||
'think\\facade\\Log' => __DIR__ . '/..' . '/topthink/framework/src/think/facade/Log.php',
|
'think\\facade\\Log' => __DIR__ . '/..' . '/topthink/framework/src/think/facade/Log.php',
|
||||||
|
21
vendor/composer/installed.json
vendored
21
vendor/composer/installed.json
vendored
@ -656,17 +656,17 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "topthink/think-orm",
|
"name": "topthink/think-orm",
|
||||||
"version": "v2.0.37",
|
"version": "v2.0.38",
|
||||||
"version_normalized": "2.0.37.0",
|
"version_normalized": "2.0.38.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/top-think/think-orm.git",
|
"url": "https://github.com/top-think/think-orm.git",
|
||||||
"reference": "8a2225c3533f5ccae4a77d4988ed4c5523284871"
|
"reference": "48e01bd25fdd51afee95343a4381fabc5a9cb764"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/top-think/think-orm/zipball/8a2225c3533f5ccae4a77d4988ed4c5523284871",
|
"url": "https://api.github.com/repos/top-think/think-orm/zipball/48e01bd25fdd51afee95343a4381fabc5a9cb764",
|
||||||
"reference": "8a2225c3533f5ccae4a77d4988ed4c5523284871",
|
"reference": "48e01bd25fdd51afee95343a4381fabc5a9cb764",
|
||||||
"shasum": "",
|
"shasum": "",
|
||||||
"mirrors": [
|
"mirrors": [
|
||||||
{
|
{
|
||||||
@ -677,6 +677,7 @@
|
|||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"ext-json": "*",
|
"ext-json": "*",
|
||||||
|
"ext-pdo": "*",
|
||||||
"php": ">=7.1.0",
|
"php": ">=7.1.0",
|
||||||
"psr/log": "~1.0",
|
"psr/log": "~1.0",
|
||||||
"psr/simple-cache": "^1.0",
|
"psr/simple-cache": "^1.0",
|
||||||
@ -685,14 +686,16 @@
|
|||||||
"require-dev": {
|
"require-dev": {
|
||||||
"phpunit/phpunit": "^7|^8|^9.5"
|
"phpunit/phpunit": "^7|^8|^9.5"
|
||||||
},
|
},
|
||||||
"time": "2021-02-18T02:01:00+00:00",
|
"time": "2021-02-24T00:54:36+00:00",
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"installation-source": "dist",
|
"installation-source": "dist",
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
"think\\": "src"
|
"think\\": "src"
|
||||||
},
|
},
|
||||||
"files": []
|
"files": [
|
||||||
|
"stubs/load_stubs.php"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
"license": [
|
"license": [
|
||||||
@ -860,7 +863,7 @@
|
|||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://gitee.com/zoujingli/ThinkLibrary",
|
"url": "https://gitee.com/zoujingli/ThinkLibrary",
|
||||||
"reference": "1f6500135bacf0b7ef7dcaa1115494e73ab92b90"
|
"reference": "41fdf9bfc855798bf9bec0384c2c97248ec6e23a"
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"ext-curl": "*",
|
"ext-curl": "*",
|
||||||
@ -870,7 +873,7 @@
|
|||||||
"ext-mbstring": "*",
|
"ext-mbstring": "*",
|
||||||
"topthink/framework": "^6.0"
|
"topthink/framework": "^6.0"
|
||||||
},
|
},
|
||||||
"time": "2021-02-22T10:20:05+00:00",
|
"time": "2021-02-23T07:09:05+00:00",
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"extra": {
|
"extra": {
|
||||||
"think": {
|
"think": {
|
||||||
|
2
vendor/services.php
vendored
2
vendor/services.php
vendored
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
// This file is automatically generated at:2021-02-23 15:11:03
|
// This file is automatically generated at:2021-02-25 10:41:43
|
||||||
declare (strict_types = 1);
|
declare (strict_types = 1);
|
||||||
return array (
|
return array (
|
||||||
0 => 'think\\admin\\Library',
|
0 => 'think\\admin\\Library',
|
||||||
|
5
vendor/topthink/think-orm/composer.json
vendored
5
vendor/topthink/think-orm/composer.json
vendored
@ -15,6 +15,7 @@
|
|||||||
"require": {
|
"require": {
|
||||||
"php": ">=7.1.0",
|
"php": ">=7.1.0",
|
||||||
"ext-json": "*",
|
"ext-json": "*",
|
||||||
|
"ext-pdo": "*",
|
||||||
"psr/simple-cache": "^1.0",
|
"psr/simple-cache": "^1.0",
|
||||||
"psr/log": "~1.0",
|
"psr/log": "~1.0",
|
||||||
"topthink/think-helper":"^3.1"
|
"topthink/think-helper":"^3.1"
|
||||||
@ -26,7 +27,9 @@
|
|||||||
"psr-4": {
|
"psr-4": {
|
||||||
"think\\": "src"
|
"think\\": "src"
|
||||||
},
|
},
|
||||||
"files": []
|
"files": [
|
||||||
|
"stubs/load_stubs.php"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"autoload-dev": {
|
"autoload-dev": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
|
3
vendor/topthink/think-orm/src/Model.php
vendored
3
vendor/topthink/think-orm/src/Model.php
vendored
@ -456,6 +456,9 @@ abstract class Model implements JsonSerializable, ArrayAccess, Arrayable, Jsonab
|
|||||||
if ($this->exists) {
|
if ($this->exists) {
|
||||||
$this->data = $this->db()->find($this->getKey())->getData();
|
$this->data = $this->db()->find($this->getKey())->getData();
|
||||||
$this->origin = $this->data;
|
$this->origin = $this->data;
|
||||||
|
$this->get = [];
|
||||||
|
$this->set = [];
|
||||||
|
$this->readDataType();
|
||||||
|
|
||||||
if ($relation) {
|
if ($relation) {
|
||||||
$this->relation = [];
|
$this->relation = [];
|
||||||
|
104
vendor/topthink/think-orm/src/db/PDOConnection.php
vendored
104
vendor/topthink/think-orm/src/db/PDOConnection.php
vendored
@ -18,9 +18,14 @@ use PDOStatement;
|
|||||||
use think\db\exception\BindParamException;
|
use think\db\exception\BindParamException;
|
||||||
use think\db\exception\DbException;
|
use think\db\exception\DbException;
|
||||||
use think\db\exception\PDOException;
|
use think\db\exception\PDOException;
|
||||||
|
use think\Model;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 数据库连接基础类
|
* 数据库连接基础类
|
||||||
|
* @property PDO[] $links
|
||||||
|
* @property PDO $linkID
|
||||||
|
* @property PDO $linkRead
|
||||||
|
* @property PDO $linkWrite
|
||||||
*/
|
*/
|
||||||
abstract class PDOConnection extends Connection
|
abstract class PDOConnection extends Connection
|
||||||
{
|
{
|
||||||
@ -169,6 +174,26 @@ abstract class PDOConnection extends Connection
|
|||||||
'Error writing data to the connection',
|
'Error writing data to the connection',
|
||||||
'Resource deadlock avoided',
|
'Resource deadlock avoided',
|
||||||
'failed with errno',
|
'failed with errno',
|
||||||
|
'child connection forced to terminate due to client_idle_limit',
|
||||||
|
'query_wait_timeout',
|
||||||
|
'reset by peer',
|
||||||
|
'Physical connection is not usable',
|
||||||
|
'TCP Provider: Error code 0x68',
|
||||||
|
'ORA-03114',
|
||||||
|
'Packets out of order. Expected',
|
||||||
|
'Adaptive Server connection failed',
|
||||||
|
'Communication link failure',
|
||||||
|
'connection is no longer usable',
|
||||||
|
'Login timeout expired',
|
||||||
|
'SQLSTATE[HY000] [2002] Connection refused',
|
||||||
|
'running with the --read-only option so it cannot execute this statement',
|
||||||
|
'The connection is broken and recovery is not possible. The connection is marked by the client driver as unrecoverable. No attempt was made to restore the connection.',
|
||||||
|
'SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Try again',
|
||||||
|
'SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name or service not known',
|
||||||
|
'SQLSTATE[HY000]: General error: 7 SSL SYSCALL error: EOF detected',
|
||||||
|
'SQLSTATE[HY000] [2002] Connection timed out',
|
||||||
|
'SSL: Connection timed out',
|
||||||
|
'SQLSTATE[HY000]: General error: 1105 The last transaction was aborted due to Seamless Scaling. Please retry.',
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -580,7 +605,7 @@ abstract class PDOConnection extends Connection
|
|||||||
/**
|
/**
|
||||||
* 获取PDO对象
|
* 获取PDO对象
|
||||||
* @access public
|
* @access public
|
||||||
* @return \PDO|false
|
* @return PDO|false
|
||||||
*/
|
*/
|
||||||
public function getPdo()
|
public function getPdo()
|
||||||
{
|
{
|
||||||
@ -594,12 +619,13 @@ abstract class PDOConnection extends Connection
|
|||||||
/**
|
/**
|
||||||
* 执行查询 使用生成器返回数据
|
* 执行查询 使用生成器返回数据
|
||||||
* @access public
|
* @access public
|
||||||
* @param BaseQuery $query 查询对象
|
* @param BaseQuery $query 查询对象
|
||||||
* @param string $sql sql指令
|
* @param string $sql sql指令
|
||||||
* @param array $bind 参数绑定
|
* @param array $bind 参数绑定
|
||||||
* @param \think\Model $model 模型对象实例
|
* @param Model|null $model 模型对象实例
|
||||||
* @param array $condition 查询条件
|
* @param null $condition 查询条件
|
||||||
* @return \Generator
|
* @return \Generator
|
||||||
|
* @throws DbException
|
||||||
*/
|
*/
|
||||||
public function getCursor(BaseQuery $query, string $sql, array $bind = [], $model = null, $condition = null)
|
public function getCursor(BaseQuery $query, string $sql, array $bind = [], $model = null, $condition = null)
|
||||||
{
|
{
|
||||||
@ -618,12 +644,11 @@ abstract class PDOConnection extends Connection
|
|||||||
/**
|
/**
|
||||||
* 执行查询 返回数据集
|
* 执行查询 返回数据集
|
||||||
* @access public
|
* @access public
|
||||||
* @param string $sql sql指令
|
* @param string $sql sql指令
|
||||||
* @param array $bind 参数绑定
|
* @param array $bind 参数绑定
|
||||||
* @param bool $master 主库读取
|
* @param bool $master 主库读取
|
||||||
* @return array
|
* @return array
|
||||||
* @throws BindParamException
|
* @throws DbException
|
||||||
* @throws \PDOException
|
|
||||||
*/
|
*/
|
||||||
public function query(string $sql, array $bind = [], bool $master = false): array
|
public function query(string $sql, array $bind = [], bool $master = false): array
|
||||||
{
|
{
|
||||||
@ -636,8 +661,7 @@ abstract class PDOConnection extends Connection
|
|||||||
* @param string $sql sql指令
|
* @param string $sql sql指令
|
||||||
* @param array $bind 参数绑定
|
* @param array $bind 参数绑定
|
||||||
* @return int
|
* @return int
|
||||||
* @throws BindParamException
|
* @throws DbException
|
||||||
* @throws \PDOException
|
|
||||||
*/
|
*/
|
||||||
public function execute(string $sql, array $bind = []): int
|
public function execute(string $sql, array $bind = []): int
|
||||||
{
|
{
|
||||||
@ -647,15 +671,12 @@ abstract class PDOConnection extends Connection
|
|||||||
/**
|
/**
|
||||||
* 执行查询 返回数据集
|
* 执行查询 返回数据集
|
||||||
* @access protected
|
* @access protected
|
||||||
* @param BaseQuery $query 查询对象
|
* @param BaseQuery $query 查询对象
|
||||||
* @param mixed $sql sql指令
|
* @param mixed $sql sql指令
|
||||||
* @param array $bind 参数绑定
|
* @param array $bind 参数绑定
|
||||||
* @param bool $master 主库读取
|
* @param bool $master 主库读取
|
||||||
* @return array
|
* @return array
|
||||||
* @throws BindParamException
|
* @throws DbException
|
||||||
* @throws \PDOException
|
|
||||||
* @throws \Exception
|
|
||||||
* @throws \Throwable
|
|
||||||
*/
|
*/
|
||||||
protected function pdoQuery(BaseQuery $query, $sql, array $bind = [], bool $master = null): array
|
protected function pdoQuery(BaseQuery $query, $sql, array $bind = [], bool $master = null): array
|
||||||
{
|
{
|
||||||
@ -703,6 +724,7 @@ abstract class PDOConnection extends Connection
|
|||||||
* @access public
|
* @access public
|
||||||
* @param BaseQuery $query 查询对象
|
* @param BaseQuery $query 查询对象
|
||||||
* @return \PDOStatement
|
* @return \PDOStatement
|
||||||
|
* @throws DbException
|
||||||
*/
|
*/
|
||||||
public function pdo(BaseQuery $query): PDOStatement
|
public function pdo(BaseQuery $query): PDOStatement
|
||||||
{
|
{
|
||||||
@ -721,10 +743,7 @@ abstract class PDOConnection extends Connection
|
|||||||
* @param bool $master 是否在主服务器读操作
|
* @param bool $master 是否在主服务器读操作
|
||||||
* @param bool $procedure 是否为存储过程调用
|
* @param bool $procedure 是否为存储过程调用
|
||||||
* @return PDOStatement
|
* @return PDOStatement
|
||||||
* @throws BindParamException
|
* @throws DbException
|
||||||
* @throws \PDOException
|
|
||||||
* @throws \Exception
|
|
||||||
* @throws \Throwable
|
|
||||||
*/
|
*/
|
||||||
public function getPDOStatement(string $sql, array $bind = [], bool $master = false, bool $procedure = false): PDOStatement
|
public function getPDOStatement(string $sql, array $bind = [], bool $master = false, bool $procedure = false): PDOStatement
|
||||||
{
|
{
|
||||||
@ -759,9 +778,17 @@ abstract class PDOConnection extends Connection
|
|||||||
|
|
||||||
return $this->PDOStatement;
|
return $this->PDOStatement;
|
||||||
} catch (\Throwable | \Exception $e) {
|
} catch (\Throwable | \Exception $e) {
|
||||||
if ($this->reConnectTimes < 4 && $this->isBreak($e)) {
|
if ($this->transTimes > 0) {
|
||||||
++$this->reConnectTimes;
|
// 事务活动中时不应该进行重试,应直接中断执行,防止造成污染。
|
||||||
return $this->close()->getPDOStatement($sql, $bind, $master, $procedure);
|
if ($this->isBreak($e)) {
|
||||||
|
// 尝试对事务计数进行重置
|
||||||
|
$this->transTimes = 0;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if ($this->reConnectTimes < 4 && $this->isBreak($e)) {
|
||||||
|
++$this->reConnectTimes;
|
||||||
|
return $this->close()->getPDOStatement($sql, $bind, $master, $procedure);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($e instanceof \PDOException) {
|
if ($e instanceof \PDOException) {
|
||||||
@ -780,10 +807,7 @@ abstract class PDOConnection extends Connection
|
|||||||
* @param array $bind 参数绑定
|
* @param array $bind 参数绑定
|
||||||
* @param bool $origin 是否原生查询
|
* @param bool $origin 是否原生查询
|
||||||
* @return int
|
* @return int
|
||||||
* @throws BindParamException
|
* @throws DbException
|
||||||
* @throws \PDOException
|
|
||||||
* @throws \Exception
|
|
||||||
* @throws \Throwable
|
|
||||||
*/
|
*/
|
||||||
protected function pdoExecute(BaseQuery $query, string $sql, array $bind = [], bool $origin = false): int
|
protected function pdoExecute(BaseQuery $query, string $sql, array $bind = [], bool $origin = false): int
|
||||||
{
|
{
|
||||||
@ -815,6 +839,13 @@ abstract class PDOConnection extends Connection
|
|||||||
return $this->numRows;
|
return $this->numRows;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param BaseQuery $query
|
||||||
|
* @param string $sql
|
||||||
|
* @param array $bind
|
||||||
|
* @return PDOStatement
|
||||||
|
* @throws DbException
|
||||||
|
*/
|
||||||
protected function queryPDOStatement(BaseQuery $query, string $sql, array $bind = []): PDOStatement
|
protected function queryPDOStatement(BaseQuery $query, string $sql, array $bind = []): PDOStatement
|
||||||
{
|
{
|
||||||
$options = $query->getOptions();
|
$options = $query->getOptions();
|
||||||
@ -1416,12 +1447,16 @@ abstract class PDOConnection extends Connection
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
$this->reConnectTimes = 0;
|
$this->reConnectTimes = 0;
|
||||||
} catch (\Exception $e) {
|
} catch (\Throwable | \Exception $e) {
|
||||||
if ($this->reConnectTimes < 4 && $this->isBreak($e)) {
|
if ($this->transTimes === 1 && $this->reConnectTimes < 4 && $this->isBreak($e)) {
|
||||||
--$this->transTimes;
|
--$this->transTimes;
|
||||||
++$this->reConnectTimes;
|
++$this->reConnectTimes;
|
||||||
$this->close()->startTrans();
|
$this->close()->startTrans();
|
||||||
} else {
|
} else {
|
||||||
|
if ($this->isBreak($e)) {
|
||||||
|
// 尝试对事务计数进行重置
|
||||||
|
$this->transTimes = 0;
|
||||||
|
}
|
||||||
throw $e;
|
throw $e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1431,7 +1466,7 @@ abstract class PDOConnection extends Connection
|
|||||||
* 用于非自动提交状态下面的查询提交
|
* 用于非自动提交状态下面的查询提交
|
||||||
* @access public
|
* @access public
|
||||||
* @return void
|
* @return void
|
||||||
* @throws PDOException
|
* @throws \PDOException
|
||||||
*/
|
*/
|
||||||
public function commit(): void
|
public function commit(): void
|
||||||
{
|
{
|
||||||
@ -1448,7 +1483,7 @@ abstract class PDOConnection extends Connection
|
|||||||
* 事务回滚
|
* 事务回滚
|
||||||
* @access public
|
* @access public
|
||||||
* @return void
|
* @return void
|
||||||
* @throws PDOException
|
* @throws \PDOException
|
||||||
*/
|
*/
|
||||||
public function rollback(): void
|
public function rollback(): void
|
||||||
{
|
{
|
||||||
@ -1535,6 +1570,7 @@ abstract class PDOConnection extends Connection
|
|||||||
$this->linkWrite = null;
|
$this->linkWrite = null;
|
||||||
$this->linkRead = null;
|
$this->linkRead = null;
|
||||||
$this->links = [];
|
$this->links = [];
|
||||||
|
$this->transTimes = 0;
|
||||||
|
|
||||||
$this->free();
|
$this->free();
|
||||||
|
|
||||||
|
@ -34,6 +34,9 @@ use function is_array;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Mongo数据库驱动
|
* Mongo数据库驱动
|
||||||
|
* @property Manager[] $links
|
||||||
|
* @property Manager $linkRead
|
||||||
|
* @property Manager $linkWrite
|
||||||
*/
|
*/
|
||||||
class Mongo extends Connection
|
class Mongo extends Connection
|
||||||
{
|
{
|
||||||
|
@ -12,99 +12,33 @@ declare (strict_types = 1);
|
|||||||
|
|
||||||
namespace think\db\exception;
|
namespace think\db\exception;
|
||||||
|
|
||||||
use Exception;
|
use think\Exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Database相关异常处理类
|
* Database相关异常处理类
|
||||||
*/
|
*/
|
||||||
if (class_exists('think\Exception')) {
|
class DbException extends Exception
|
||||||
class DbException extends \think\Exception
|
{
|
||||||
|
/**
|
||||||
|
* DbException constructor.
|
||||||
|
* @access public
|
||||||
|
* @param string $message
|
||||||
|
* @param array $config
|
||||||
|
* @param string $sql
|
||||||
|
* @param int $code
|
||||||
|
*/
|
||||||
|
public function __construct(string $message, array $config = [], string $sql = '', int $code = 10500)
|
||||||
{
|
{
|
||||||
/**
|
$this->message = $message;
|
||||||
* DbException constructor.
|
$this->code = $code;
|
||||||
* @access public
|
|
||||||
* @param string $message
|
|
||||||
* @param array $config
|
|
||||||
* @param string $sql
|
|
||||||
* @param int $code
|
|
||||||
*/
|
|
||||||
public function __construct(string $message, array $config = [], string $sql = '', int $code = 10500)
|
|
||||||
{
|
|
||||||
$this->message = $message;
|
|
||||||
$this->code = $code;
|
|
||||||
|
|
||||||
$this->setData('Database Status', [
|
$this->setData('Database Status', [
|
||||||
'Error Code' => $code,
|
'Error Code' => $code,
|
||||||
'Error Message' => $message,
|
'Error Message' => $message,
|
||||||
'Error SQL' => $sql,
|
'Error SQL' => $sql,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
unset($config['username'], $config['password']);
|
unset($config['username'], $config['password']);
|
||||||
$this->setData('Database Config', $config);
|
$this->setData('Database Config', $config);
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
|
|
||||||
class DbException extends Exception
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* DbException constructor.
|
|
||||||
* @access public
|
|
||||||
* @param string $message
|
|
||||||
* @param array $config
|
|
||||||
* @param string $sql
|
|
||||||
* @param int $code
|
|
||||||
*/
|
|
||||||
public function __construct(string $message, array $config = [], string $sql = '', int $code = 10500)
|
|
||||||
{
|
|
||||||
$this->message = $message;
|
|
||||||
$this->code = $code;
|
|
||||||
|
|
||||||
$this->setData('Database Status', [
|
|
||||||
'Error Code' => $code,
|
|
||||||
'Error Message' => $message,
|
|
||||||
'Error SQL' => $sql,
|
|
||||||
]);
|
|
||||||
|
|
||||||
unset($config['username'], $config['password']);
|
|
||||||
$this->setData('Database Config', $config);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 保存异常页面显示的额外Debug数据
|
|
||||||
* @var array
|
|
||||||
*/
|
|
||||||
protected $data = [];
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 设置异常额外的Debug数据
|
|
||||||
* 数据将会显示为下面的格式
|
|
||||||
*
|
|
||||||
* Exception Data
|
|
||||||
* --------------------------------------------------
|
|
||||||
* Label 1
|
|
||||||
* key1 value1
|
|
||||||
* key2 value2
|
|
||||||
* Label 2
|
|
||||||
* key1 value1
|
|
||||||
* key2 value2
|
|
||||||
*
|
|
||||||
* @param string $label 数据分类,用于异常页面显示
|
|
||||||
* @param array $data 需要显示的数据,必须为关联数组
|
|
||||||
*/
|
|
||||||
final protected function setData($label, array $data)
|
|
||||||
{
|
|
||||||
$this->data[$label] = $data;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取异常额外Debug数据
|
|
||||||
* 主要用于输出到异常页面便于调试
|
|
||||||
* @return array 由setData设置的Debug数据
|
|
||||||
*/
|
|
||||||
final public function getData()
|
|
||||||
{
|
|
||||||
return $this->data;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
57
vendor/topthink/think-orm/src/facade/Db.php
vendored
57
vendor/topthink/think-orm/src/facade/Db.php
vendored
@ -11,62 +11,7 @@
|
|||||||
|
|
||||||
namespace think\facade;
|
namespace think\facade;
|
||||||
|
|
||||||
if (class_exists('think\Facade')) {
|
use think\Facade;
|
||||||
class Facade extends \think\Facade
|
|
||||||
{}
|
|
||||||
} else {
|
|
||||||
class Facade
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* 始终创建新的对象实例
|
|
||||||
* @var bool
|
|
||||||
*/
|
|
||||||
protected static $alwaysNewInstance;
|
|
||||||
|
|
||||||
protected static $instance;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取当前Facade对应类名
|
|
||||||
* @access protected
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
protected static function getFacadeClass()
|
|
||||||
{}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建Facade实例
|
|
||||||
* @static
|
|
||||||
* @access protected
|
|
||||||
* @param bool $newInstance 是否每次创建新的实例
|
|
||||||
* @return object
|
|
||||||
*/
|
|
||||||
protected static function createFacade(bool $newInstance = false)
|
|
||||||
{
|
|
||||||
$class = static::getFacadeClass() ?: 'think\DbManager';
|
|
||||||
|
|
||||||
if (static::$alwaysNewInstance) {
|
|
||||||
$newInstance = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($newInstance) {
|
|
||||||
return new $class();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!self::$instance) {
|
|
||||||
self::$instance = new $class();
|
|
||||||
}
|
|
||||||
|
|
||||||
return self::$instance;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// 调用实际类的方法
|
|
||||||
public static function __callStatic($method, $params)
|
|
||||||
{
|
|
||||||
return call_user_func_array([static::createFacade(), $method], $params);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see \think\DbManager
|
* @see \think\DbManager
|
||||||
|
@ -94,6 +94,12 @@ trait Attribute
|
|||||||
*/
|
*/
|
||||||
protected $strict = true;
|
protected $strict = true;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取器数据
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
private $get = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改器执行记录
|
* 修改器执行记录
|
||||||
* @var array
|
* @var array
|
||||||
@ -266,7 +272,7 @@ trait Attribute
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取对象原始数据 如果不存在指定字段返回false
|
* 获取当前对象数据 如果不存在指定字段返回false
|
||||||
* @access public
|
* @access public
|
||||||
* @param string $name 字段名 留空获取全部
|
* @param string $name 字段名 留空获取全部
|
||||||
* @return mixed
|
* @return mixed
|
||||||
@ -479,8 +485,12 @@ trait Attribute
|
|||||||
{
|
{
|
||||||
// 检测属性获取器
|
// 检测属性获取器
|
||||||
$fieldName = $this->getRealFieldName($name);
|
$fieldName = $this->getRealFieldName($name);
|
||||||
$method = 'get' . Str::studly($name) . 'Attr';
|
|
||||||
|
|
||||||
|
if (array_key_exists($fieldName, $this->get)) {
|
||||||
|
return $this->get[$fieldName];
|
||||||
|
}
|
||||||
|
|
||||||
|
$method = 'get' . Str::studly($name) . 'Attr';
|
||||||
if (isset($this->withAttr[$fieldName])) {
|
if (isset($this->withAttr[$fieldName])) {
|
||||||
if ($relation) {
|
if ($relation) {
|
||||||
$value = $this->getRelationValue($relation);
|
$value = $this->getRelationValue($relation);
|
||||||
@ -504,6 +514,8 @@ trait Attribute
|
|||||||
$this->relation[$name] = $value;
|
$this->relation[$name] = $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$this->get[$fieldName] = $value;
|
||||||
|
|
||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -516,9 +528,9 @@ trait Attribute
|
|||||||
{
|
{
|
||||||
foreach ($this->data as $key => $value) {
|
foreach ($this->data as $key => $value) {
|
||||||
if (isset($this->type[$key])) {
|
if (isset($this->type[$key])) {
|
||||||
$this->data[$key] = $this->readTransform($value, $this->type[$key]);
|
$this->get[$key] = $this->readTransform($value, $this->type[$key]);
|
||||||
} elseif ($this->autoWriteTimestamp && in_array($key, [$this->createTime, $this->updateTime])) {
|
} elseif ($this->autoWriteTimestamp && in_array($key, [$this->createTime, $this->updateTime])) {
|
||||||
$this->data[$key] = $this->getTimestampValue($value);
|
$this->get[$key] = $this->getTimestampValue($value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
59
vendor/topthink/think-orm/stubs/Exception.php
vendored
Normal file
59
vendor/topthink/think-orm/stubs/Exception.php
vendored
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
<?php
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | Author: liu21st <liu21st@gmail.com>
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
declare (strict_types=1);
|
||||||
|
|
||||||
|
namespace think;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 异常基础类
|
||||||
|
* @package think
|
||||||
|
*/
|
||||||
|
class Exception extends \Exception
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 保存异常页面显示的额外Debug数据
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
protected $data = [];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置异常额外的Debug数据
|
||||||
|
* 数据将会显示为下面的格式
|
||||||
|
*
|
||||||
|
* Exception Data
|
||||||
|
* --------------------------------------------------
|
||||||
|
* Label 1
|
||||||
|
* key1 value1
|
||||||
|
* key2 value2
|
||||||
|
* Label 2
|
||||||
|
* key1 value1
|
||||||
|
* key2 value2
|
||||||
|
*
|
||||||
|
* @access protected
|
||||||
|
* @param string $label 数据分类,用于异常页面显示
|
||||||
|
* @param array $data 需要显示的数据,必须为关联数组
|
||||||
|
*/
|
||||||
|
final protected function setData(string $label, array $data)
|
||||||
|
{
|
||||||
|
$this->data[$label] = $data;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取异常额外Debug数据
|
||||||
|
* 主要用于输出到异常页面便于调试
|
||||||
|
* @access public
|
||||||
|
* @return array 由setData设置的Debug数据
|
||||||
|
*/
|
||||||
|
final public function getData()
|
||||||
|
{
|
||||||
|
return $this->data;
|
||||||
|
}
|
||||||
|
}
|
65
vendor/topthink/think-orm/stubs/Facade.php
vendored
Normal file
65
vendor/topthink/think-orm/stubs/Facade.php
vendored
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
<?php
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | Author: liu21st <liu21st@gmail.com>
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace think;
|
||||||
|
|
||||||
|
class Facade
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 始终创建新的对象实例
|
||||||
|
* @var bool
|
||||||
|
*/
|
||||||
|
protected static $alwaysNewInstance;
|
||||||
|
|
||||||
|
protected static $instance;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取当前Facade对应类名
|
||||||
|
* @access protected
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
protected static function getFacadeClass()
|
||||||
|
{}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建Facade实例
|
||||||
|
* @static
|
||||||
|
* @access protected
|
||||||
|
* @param bool $newInstance 是否每次创建新的实例
|
||||||
|
* @return object
|
||||||
|
*/
|
||||||
|
protected static function createFacade(bool $newInstance = false)
|
||||||
|
{
|
||||||
|
$class = static::getFacadeClass() ?: 'think\DbManager';
|
||||||
|
|
||||||
|
if (static::$alwaysNewInstance) {
|
||||||
|
$newInstance = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($newInstance) {
|
||||||
|
return new $class();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!self::$instance) {
|
||||||
|
self::$instance = new $class();
|
||||||
|
}
|
||||||
|
|
||||||
|
return self::$instance;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// 调用实际类的方法
|
||||||
|
public static function __callStatic($method, $params)
|
||||||
|
{
|
||||||
|
return call_user_func_array([static::createFacade(), $method], $params);
|
||||||
|
}
|
||||||
|
}
|
9
vendor/topthink/think-orm/stubs/load_stubs.php
vendored
Normal file
9
vendor/topthink/think-orm/stubs/load_stubs.php
vendored
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
if (!\class_exists('think\Exception')) {
|
||||||
|
require __DIR__ . '/Exception.php';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!\class_exists('think\Facade')) {
|
||||||
|
require __DIR__ . '/Facade.php';
|
||||||
|
}
|
@ -100,8 +100,8 @@ class Library extends Service
|
|||||||
if (($origin = $request->header('origin', '*')) !== '*') {
|
if (($origin = $request->header('origin', '*')) !== '*') {
|
||||||
$header['Access-Control-Allow-Origin'] = $origin;
|
$header['Access-Control-Allow-Origin'] = $origin;
|
||||||
$header['Access-Control-Allow-Methods'] = 'GET,PUT,POST,PATCH,DELETE';
|
$header['Access-Control-Allow-Methods'] = 'GET,PUT,POST,PATCH,DELETE';
|
||||||
$header['Access-Control-Allow-Headers'] = 'Authorization,Content-Type,If-Match,If-Modified-Since,If-None-Match,If-Unmodified-Since,X-Requested-With,Api-Type,Api-Token,User-Form-Token,User-Token,Token';
|
$header['Access-Control-Allow-Headers'] = 'Authorization,Content-Type,If-Match,If-Modified-Since,If-None-Match,If-Unmodified-Since,X-Requested-With,Api-Name,Api-Type,Api-Token,User-Form-Token,User-Token,Token';
|
||||||
$header['Access-Control-Expose-Headers'] = 'Api-Type,Api-Token,User-Form-Token,User-Token,Token';
|
$header['Access-Control-Expose-Headers'] = 'Api-Name,Api-Type,Api-Token,User-Form-Token,User-Token,Token';
|
||||||
$header['Access-Control-Allow-Credentials'] = 'true';
|
$header['Access-Control-Allow-Credentials'] = 'true';
|
||||||
}
|
}
|
||||||
// 访问模式及访问权限检查
|
// 访问模式及访问权限检查
|
||||||
|
Loading…
x
Reference in New Issue
Block a user