From c405d9a1b1dff64fd1eb3f9839ddefafe90fbcb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E9=87=91=E5=8B=87?= Date: Wed, 15 Nov 2023 06:57:37 +0000 Subject: [PATCH] * Split tmp file for cli. --- framework/base/router.class.php | 3 ++- module/common/model.php | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/framework/base/router.class.php b/framework/base/router.class.php index 9958027df1..88fb2f4e51 100644 --- a/framework/base/router.class.php +++ b/framework/base/router.class.php @@ -2023,7 +2023,8 @@ class baseRouter if(empty($extFiles) and empty($hookFiles) and empty($apiFiles)) return $mainTargetFile; /* 计算合并之后的targetFile路径。Compute the merged target file path. */ - $extTargetPrefix = $this->config->edition . DS . $this->config->vision . DS; + $runMode = PHP_SAPI == 'cli' ? '_cli' : ''; + $extTargetPrefix = $this->config->edition . $runMode . DS . $this->config->vision . DS; if($siteExtended and !empty($this->siteCode)) $extTargetPrefix .= $this->siteCode[0] . DS . $this->siteCode; $mergedTargetDir = $this->getTmpRoot() . $class . DS . $extTargetPrefix; diff --git a/module/common/model.php b/module/common/model.php index ac4cda03df..39f1f4b1bc 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -3144,7 +3144,8 @@ EOF; if($log or $app->config->debug) { - $logFile = $app->getLogRoot() . 'saas.'. date('Ymd') . '.log.php'; + $runMode = PHP_SAPI == 'cli' ? '_cli' : ''; + $logFile = $app->getLogRoot() . 'saas' . $runMode . '.' . date('Ymd') . '.log.php'; if(!file_exists($logFile)) file_put_contents($logFile, ''); $fh = fopen($logFile, 'a');