fix: 修改 ini_set 第二参数为 string 类型

This commit is contained in:
邹景立 2026-03-03 21:39:29 +08:00
parent 94121a014a
commit 283aab3e0d
12 changed files with 20 additions and 19 deletions

View File

@ -17,6 +17,7 @@ declare(strict_types=1);
* | github 代码仓库https://github.com/zoujingli/ThinkAdmin * | github 代码仓库https://github.com/zoujingli/ThinkAdmin
* +---------------------------------------------------------------------- * +----------------------------------------------------------------------
*/ */
use think\admin\Exception;
use think\admin\extend\CodeExtend; use think\admin\extend\CodeExtend;
use think\admin\extend\HttpExtend; use think\admin\extend\HttpExtend;
use think\admin\Helper; use think\admin\Helper;
@ -250,7 +251,7 @@ if (!function_exists('sysconf')) {
* @param string $name 参数名称 * @param string $name 参数名称
* @param mixed $value 参数内容 * @param mixed $value 参数内容
* @return mixed * @return mixed
* @throws think\admin\Exception * @throws Exception
*/ */
function sysconf(string $name = '', $value = null) function sysconf(string $name = '', $value = null)
{ {
@ -266,7 +267,7 @@ if (!function_exists('sysdata')) {
* @param string $name 数据名称 * @param string $name 数据名称
* @param mixed $value 数据内容 * @param mixed $value 数据内容
* @return mixed * @return mixed
* @throws think\admin\Exception * @throws Exception
*/ */
function sysdata(string $name, $value = null) function sysdata(string $name, $value = null)
{ {
@ -320,7 +321,7 @@ if (!function_exists('sysqueue')) {
* @param array $data 任务附加数据 * @param array $data 任务附加数据
* @param int $rscript 任务类型(0单例,1多例) * @param int $rscript 任务类型(0单例,1多例)
* @param int $loops 循环等待时间 * @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 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 string $key 条件主键限制
* @param mixed $where 其它的where条件 * @param mixed $where 其它的where条件
* @return bool|int * @return bool|int
* @throws think\admin\Exception * @throws Exception
*/ */
function data_save($dbQuery, array $data, string $key = 'id', $where = []) function data_save($dbQuery, array $data, string $key = 'id', $where = [])
{ {
@ -415,9 +416,9 @@ if (!function_exists('down_file')) {
if (!function_exists('trace_file')) { if (!function_exists('trace_file')) {
/** /**
* 输出异常数据到文件. * 输出异常数据到文件.
* @param \Throwable $exception 支持 Exception ErrorPHP 7+ * @param Throwable $exception 支持 Exception ErrorPHP 7+
*/ */
function trace_file(\Throwable $exception): bool function trace_file(Throwable $exception): bool
{ {
$path = Library::$sapp->getRuntimePath() . 'trace'; $path = Library::$sapp->getRuntimePath() . 'trace';
if (!is_dir($path)) { if (!is_dir($path)) {
@ -425,13 +426,13 @@ if (!function_exists('trace_file')) {
} }
$name = substr($exception->getFile(), strlen(syspath())); $name = substr($exception->getFile(), strlen(syspath()));
$file = $path . DIRECTORY_SEPARATOR . date('Ymd_His_') . strtr($name, ['/' => '.', '\\' => '.']); $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); $class = get_class($exception);
return file_put_contents( return file_put_contents(
$file, $file,
"[CODE] {$exception->getCode()}" . PHP_EOL "[CODE] {$exception->getCode()}" . PHP_EOL
. "[INFO] {$exception->getMessage()}" . 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 . "[FILE] {$class} in {$name} line {$exception->getLine()}" . PHP_EOL
. '[TIME] ' . date('Y-m-d H:i:s') . PHP_EOL . PHP_EOL . '[TIME] ' . date('Y-m-d H:i:s') . PHP_EOL . PHP_EOL
. '[TRACE]' . PHP_EOL . $exception->getTraceAsString() . '[TRACE]' . PHP_EOL . $exception->getTraceAsString()

View File

@ -21,7 +21,7 @@ use think\admin\extend\PhinxExtend;
use think\migration\Migrator; use think\migration\Migrator;
@set_time_limit(0); @set_time_limit(0);
@ini_set('memory_limit', -1); @ini_set('memory_limit', '-1');
class InstallAccount20241010 extends Migrator class InstallAccount20241010 extends Migrator
{ {

View File

@ -21,7 +21,7 @@ use think\admin\extend\PhinxExtend;
use think\migration\Migrator; use think\migration\Migrator;
@set_time_limit(0); @set_time_limit(0);
@ini_set('memory_limit', -1); @ini_set('memory_limit', '-1');
/** /**
* 系统模块数据. * 系统模块数据.

View File

@ -24,7 +24,7 @@ use think\admin\model\SystemUser;
use think\migration\Migrator; use think\migration\Migrator;
@set_time_limit(0); @set_time_limit(0);
@ini_set('memory_limit', -1); @ini_set('memory_limit', '-1');
/** /**
* 系统模块数据. * 系统模块数据.

View File

@ -44,7 +44,7 @@ class InstallCenter20241010 extends Migrator
public function change() public function change()
{ {
set_time_limit(0); set_time_limit(0);
@ini_set('memory_limit', -1); @ini_set('memory_limit', '-1');
$this->insertMenu(); $this->insertMenu();
} }

View File

@ -21,7 +21,7 @@ use think\admin\extend\PhinxExtend;
use think\migration\Migrator; use think\migration\Migrator;
@set_time_limit(0); @set_time_limit(0);
@ini_set('memory_limit', -1); @ini_set('memory_limit', '-1');
class InstallPayment20241010 extends Migrator class InstallPayment20241010 extends Migrator
{ {

View File

@ -21,7 +21,7 @@ use think\admin\extend\PhinxExtend;
use think\migration\Migrator; use think\migration\Migrator;
@set_time_limit(0); @set_time_limit(0);
@ini_set('memory_limit', -1); @ini_set('memory_limit', '-1');
class InstallWechatService20241010 extends Migrator class InstallWechatService20241010 extends Migrator
{ {

View File

@ -21,7 +21,7 @@ use think\admin\extend\PhinxExtend;
use think\migration\Migrator; use think\migration\Migrator;
@set_time_limit(0); @set_time_limit(0);
@ini_set('memory_limit', -1); @ini_set('memory_limit', '-1');
class InstallWechat20241010 extends Migrator class InstallWechat20241010 extends Migrator
{ {

View File

@ -22,7 +22,7 @@ use think\admin\extend\PhinxExtend;
use think\migration\Migrator; use think\migration\Migrator;
@set_time_limit(0); @set_time_limit(0);
@ini_set('memory_limit', -1); @ini_set('memory_limit', '-1');
/** /**
* 系统模块数据. * 系统模块数据.

View File

@ -21,7 +21,7 @@ use think\admin\extend\PhinxExtend;
use think\migration\Migrator; use think\migration\Migrator;
@set_time_limit(0); @set_time_limit(0);
@ini_set('memory_limit', -1); @ini_set('memory_limit', '-1');
class InstallWemall20241010 extends Migrator class InstallWemall20241010 extends Migrator
{ {

View File

@ -20,7 +20,7 @@ declare(strict_types=1);
use think\migration\Migrator; use think\migration\Migrator;
@set_time_limit(0); @set_time_limit(0);
@ini_set('memory_limit', -1); @ini_set('memory_limit', '-1');
class FixWemallConstraints extends Migrator class FixWemallConstraints extends Migrator
{ {

View File

@ -21,7 +21,7 @@ use think\admin\extend\PhinxExtend;
use think\migration\Migrator; use think\migration\Migrator;
@set_time_limit(0); @set_time_limit(0);
@ini_set('memory_limit', -1); @ini_set('memory_limit', '-1');
class InstallWuma20241010 extends Migrator class InstallWuma20241010 extends Migrator
{ {