* Split tmp file for cli.

This commit is contained in:
朱金勇
2023-11-15 06:57:37 +00:00
parent 7ff5670512
commit c405d9a1b1
2 changed files with 4 additions and 2 deletions
+2 -1
View File
@@ -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;
+2 -1
View File
@@ -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, '<?php die(); ?' . '>');
$fh = fopen($logFile, 'a');