+ add zin and zui3 files.

This commit is contained in:
sunhao
2023-07-25 17:42:27 +08:00
parent b92acecc1a
commit e97ab9686b
234 changed files with 82310 additions and 178 deletions
+45
View File
@@ -0,0 +1,45 @@
<?php
declare(strict_types=1);
/**
* The debug helpers file of zin of ZenTaoPMS.
*
* @copyright Copyright 2023 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
* @author Hao Sun <sunhao@easycorp.ltd>
* @package zin
* @version $Id
* @link https://www.zentao.net
*/
namespace zin\utils;
$logs = array();
function log($type, $msg = null, $file)
{
global $config;
if(!$config->debug) return;
if($msg === null)
{
$msg = $type;
$type = 'i';
}
if(is_array($msg))
{
$msgLines = array();
foreach($msg as $m) $msgLines[] = strval($m);
$msg = implode(' ', $msgLines);
}
else
{
$msg = strval($msg);
}
$logs[] = array(array('type' => strtolower($type), 'msg' => $msg));
}
function logInfo($msg, $file = null) {log('i', $msg, $file);};
function logWarn($msg, $file = null) {log('w', $msg, $file);};
function logError($msg, $file = null) {log('e', $msg, $file);};