From 283aab3e0d6d4ad4345ed14dabd6dfb84a83f2f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E6=99=AF=E7=AB=8B?= Date: Tue, 3 Mar 2026 21:39:29 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=20ini=5Fset=20?= =?UTF-8?q?=E7=AC=AC=E4=BA=8C=E5=8F=82=E6=95=B0=E4=B8=BA=20string=20?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin/think-library/src/common.php | 17 +++++++++-------- .../20241010000005_install_account20241010.php | 2 +- .../20241010000001_install_admin20241010.php | 2 +- .../20241010000002_install_admin20241011.php | 2 +- .../20241010000004_install_center20241010.php | 2 +- .../20241010000006_install_payment20241010.php | 2 +- ...010000009_install_wechat_service20241010.php | 2 +- .../20241010000003_install_wechat20241010.php | 2 +- .../20241011000001_install_wechat20241011.php | 2 +- .../20241010000007_install_wemall20241010.php | 2 +- .../20241010000008_fix_wemall_constraints.php | 2 +- .../20241010000008_install_wuma20241010.php | 2 +- 12 files changed, 20 insertions(+), 19 deletions(-) diff --git a/plugin/think-library/src/common.php b/plugin/think-library/src/common.php index bcfec241c..fbacbb67d 100644 --- a/plugin/think-library/src/common.php +++ b/plugin/think-library/src/common.php @@ -17,6 +17,7 @@ declare(strict_types=1); * | github 代码仓库:https://github.com/zoujingli/ThinkAdmin * +---------------------------------------------------------------------- */ +use think\admin\Exception; use think\admin\extend\CodeExtend; use think\admin\extend\HttpExtend; use think\admin\Helper; @@ -250,7 +251,7 @@ if (!function_exists('sysconf')) { * @param string $name 参数名称 * @param mixed $value 参数内容 * @return mixed - * @throws think\admin\Exception + * @throws Exception */ function sysconf(string $name = '', $value = null) { @@ -266,7 +267,7 @@ if (!function_exists('sysdata')) { * @param string $name 数据名称 * @param mixed $value 数据内容 * @return mixed - * @throws think\admin\Exception + * @throws Exception */ function sysdata(string $name, $value = null) { @@ -320,7 +321,7 @@ if (!function_exists('sysqueue')) { * @param array $data 任务附加数据 * @param int $rscript 任务类型(0单例,1多例) * @param int $loops 循环等待时间 - * @throws think\admin\Exception + * @throws Exception */ function sysqueue(string $title, string $command, int $later = 0, array $data = [], int $rscript = 1, int $loops = 0): string { @@ -392,7 +393,7 @@ if (!function_exists('data_save')) { * @param string $key 条件主键限制 * @param mixed $where 其它的where条件 * @return bool|int - * @throws think\admin\Exception + * @throws Exception */ function data_save($dbQuery, array $data, string $key = 'id', $where = []) { @@ -415,9 +416,9 @@ if (!function_exists('down_file')) { if (!function_exists('trace_file')) { /** * 输出异常数据到文件. - * @param \Throwable $exception 支持 Exception 与 Error(PHP 7+) + * @param Throwable $exception 支持 Exception 与 Error(PHP 7+) */ - function trace_file(\Throwable $exception): bool + function trace_file(Throwable $exception): bool { $path = Library::$sapp->getRuntimePath() . 'trace'; if (!is_dir($path)) { @@ -425,13 +426,13 @@ if (!function_exists('trace_file')) { } $name = substr($exception->getFile(), strlen(syspath())); $file = $path . DIRECTORY_SEPARATOR . date('Ymd_His_') . strtr($name, ['/' => '.', '\\' => '.']); - $json = json_encode($exception instanceof think\admin\Exception ? $exception->getData() : [], 64 | 128 | 256); + $json = json_encode($exception instanceof Exception ? $exception->getData() : [], 64 | 128 | 256); $class = get_class($exception); return file_put_contents( $file, "[CODE] {$exception->getCode()}" . PHP_EOL . "[INFO] {$exception->getMessage()}" . PHP_EOL - . ($exception instanceof think\admin\Exception ? "[DATA] {$json}" . PHP_EOL : '') + . ($exception instanceof Exception ? "[DATA] {$json}" . PHP_EOL : '') . "[FILE] {$class} in {$name} line {$exception->getLine()}" . PHP_EOL . '[TIME] ' . date('Y-m-d H:i:s') . PHP_EOL . PHP_EOL . '[TRACE]' . PHP_EOL . $exception->getTraceAsString() diff --git a/plugin/think-plugs-account/stc/database/20241010000005_install_account20241010.php b/plugin/think-plugs-account/stc/database/20241010000005_install_account20241010.php index d4fe11aa9..2210f88dc 100644 --- a/plugin/think-plugs-account/stc/database/20241010000005_install_account20241010.php +++ b/plugin/think-plugs-account/stc/database/20241010000005_install_account20241010.php @@ -21,7 +21,7 @@ use think\admin\extend\PhinxExtend; use think\migration\Migrator; @set_time_limit(0); -@ini_set('memory_limit', -1); +@ini_set('memory_limit', '-1'); class InstallAccount20241010 extends Migrator { diff --git a/plugin/think-plugs-admin/stc/database/20241010000001_install_admin20241010.php b/plugin/think-plugs-admin/stc/database/20241010000001_install_admin20241010.php index 36ad426f8..04c2d9a42 100644 --- a/plugin/think-plugs-admin/stc/database/20241010000001_install_admin20241010.php +++ b/plugin/think-plugs-admin/stc/database/20241010000001_install_admin20241010.php @@ -21,7 +21,7 @@ use think\admin\extend\PhinxExtend; use think\migration\Migrator; @set_time_limit(0); -@ini_set('memory_limit', -1); +@ini_set('memory_limit', '-1'); /** * 系统模块数据. diff --git a/plugin/think-plugs-admin/stc/database/20241010000002_install_admin20241011.php b/plugin/think-plugs-admin/stc/database/20241010000002_install_admin20241011.php index 1742ce1aa..17af8cd60 100644 --- a/plugin/think-plugs-admin/stc/database/20241010000002_install_admin20241011.php +++ b/plugin/think-plugs-admin/stc/database/20241010000002_install_admin20241011.php @@ -24,7 +24,7 @@ use think\admin\model\SystemUser; use think\migration\Migrator; @set_time_limit(0); -@ini_set('memory_limit', -1); +@ini_set('memory_limit', '-1'); /** * 系统模块数据. diff --git a/plugin/think-plugs-center/stc/database/20241010000004_install_center20241010.php b/plugin/think-plugs-center/stc/database/20241010000004_install_center20241010.php index 97be9ebfe..375b07e29 100644 --- a/plugin/think-plugs-center/stc/database/20241010000004_install_center20241010.php +++ b/plugin/think-plugs-center/stc/database/20241010000004_install_center20241010.php @@ -44,7 +44,7 @@ class InstallCenter20241010 extends Migrator public function change() { set_time_limit(0); - @ini_set('memory_limit', -1); + @ini_set('memory_limit', '-1'); $this->insertMenu(); } diff --git a/plugin/think-plugs-payment/stc/database/20241010000006_install_payment20241010.php b/plugin/think-plugs-payment/stc/database/20241010000006_install_payment20241010.php index c14d80574..9cbc491ad 100644 --- a/plugin/think-plugs-payment/stc/database/20241010000006_install_payment20241010.php +++ b/plugin/think-plugs-payment/stc/database/20241010000006_install_payment20241010.php @@ -21,7 +21,7 @@ use think\admin\extend\PhinxExtend; use think\migration\Migrator; @set_time_limit(0); -@ini_set('memory_limit', -1); +@ini_set('memory_limit', '-1'); class InstallPayment20241010 extends Migrator { diff --git a/plugin/think-plugs-wechat-service/stc/database/20241010000009_install_wechat_service20241010.php b/plugin/think-plugs-wechat-service/stc/database/20241010000009_install_wechat_service20241010.php index cfce0ce3a..96e5aa78b 100644 --- a/plugin/think-plugs-wechat-service/stc/database/20241010000009_install_wechat_service20241010.php +++ b/plugin/think-plugs-wechat-service/stc/database/20241010000009_install_wechat_service20241010.php @@ -21,7 +21,7 @@ use think\admin\extend\PhinxExtend; use think\migration\Migrator; @set_time_limit(0); -@ini_set('memory_limit', -1); +@ini_set('memory_limit', '-1'); class InstallWechatService20241010 extends Migrator { diff --git a/plugin/think-plugs-wechat/stc/database/20241010000003_install_wechat20241010.php b/plugin/think-plugs-wechat/stc/database/20241010000003_install_wechat20241010.php index 7e85500f5..c25839d7f 100644 --- a/plugin/think-plugs-wechat/stc/database/20241010000003_install_wechat20241010.php +++ b/plugin/think-plugs-wechat/stc/database/20241010000003_install_wechat20241010.php @@ -21,7 +21,7 @@ use think\admin\extend\PhinxExtend; use think\migration\Migrator; @set_time_limit(0); -@ini_set('memory_limit', -1); +@ini_set('memory_limit', '-1'); class InstallWechat20241010 extends Migrator { diff --git a/plugin/think-plugs-wechat/stc/database/20241011000001_install_wechat20241011.php b/plugin/think-plugs-wechat/stc/database/20241011000001_install_wechat20241011.php index 28c9c7e8a..2672d6e17 100644 --- a/plugin/think-plugs-wechat/stc/database/20241011000001_install_wechat20241011.php +++ b/plugin/think-plugs-wechat/stc/database/20241011000001_install_wechat20241011.php @@ -22,7 +22,7 @@ use think\admin\extend\PhinxExtend; use think\migration\Migrator; @set_time_limit(0); -@ini_set('memory_limit', -1); +@ini_set('memory_limit', '-1'); /** * 系统模块数据. diff --git a/plugin/think-plugs-wemall/stc/database/20241010000007_install_wemall20241010.php b/plugin/think-plugs-wemall/stc/database/20241010000007_install_wemall20241010.php index 4a1a11ebc..1a2f4e456 100644 --- a/plugin/think-plugs-wemall/stc/database/20241010000007_install_wemall20241010.php +++ b/plugin/think-plugs-wemall/stc/database/20241010000007_install_wemall20241010.php @@ -21,7 +21,7 @@ use think\admin\extend\PhinxExtend; use think\migration\Migrator; @set_time_limit(0); -@ini_set('memory_limit', -1); +@ini_set('memory_limit', '-1'); class InstallWemall20241010 extends Migrator { diff --git a/plugin/think-plugs-wemall/stc/database/20241010000008_fix_wemall_constraints.php b/plugin/think-plugs-wemall/stc/database/20241010000008_fix_wemall_constraints.php index 4b0097fc2..14c1edb4d 100644 --- a/plugin/think-plugs-wemall/stc/database/20241010000008_fix_wemall_constraints.php +++ b/plugin/think-plugs-wemall/stc/database/20241010000008_fix_wemall_constraints.php @@ -20,7 +20,7 @@ declare(strict_types=1); use think\migration\Migrator; @set_time_limit(0); -@ini_set('memory_limit', -1); +@ini_set('memory_limit', '-1'); class FixWemallConstraints extends Migrator { diff --git a/plugin/think-plugs-wuma/stc/database/20241010000008_install_wuma20241010.php b/plugin/think-plugs-wuma/stc/database/20241010000008_install_wuma20241010.php index c39dae709..96c0b8e56 100644 --- a/plugin/think-plugs-wuma/stc/database/20241010000008_install_wuma20241010.php +++ b/plugin/think-plugs-wuma/stc/database/20241010000008_install_wuma20241010.php @@ -21,7 +21,7 @@ use think\admin\extend\PhinxExtend; use think\migration\Migrator; @set_time_limit(0); -@ini_set('memory_limit', -1); +@ini_set('memory_limit', '-1'); class InstallWuma20241010 extends Migrator {