Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Revert "1、强化日志信息:记录所有提交的参数,增加每次请求的唯一值,以及记录每次请求的IP等信息;2、修改pgsql数据库默认连接…
…端口为5432"
  • Loading branch information
phalapi authored Jun 13, 2019
commit 4236aa6704729a48c8fdedfa91364e74f829cb91
2 changes: 1 addition & 1 deletion vendor/phalapi/kernal/src/Database/NotORMDatabase.php
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ protected function createPDOBy($dbCfg) {
$dsn = sprintf('pgsql:dbname=%s;host=%s;port=%d',
$dbCfg['name'],
isset($dbCfg['host']) ? $dbCfg['host'] : 'localhost',
isset($dbCfg['port']) ? $dbCfg['port'] : 5432
isset($dbCfg['port']) ? $dbCfg['port'] : 3306
);
}

Expand Down
5 changes: 1 addition & 4 deletions vendor/phalapi/kernal/src/Logger/FileLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,9 @@ public function log($type, $msg, $data) {
$this->init();

$msgArr = array();
$msgArr[] = \PhalApi_Tool::getClientIp(); //客户端IP
$msgArr[] = date($this->dateFormat, time());
$msgArr[] = strtoupper($type);
if (!empty($msg)) $msgArr[] = str_replace(PHP_EOL, '\n', $msg);
$msgArr[] = $_REQUEST['service'];
$msgArr[] = $_REQUEST['unique'];
$msgArr[] = str_replace(PHP_EOL, '\n', $msg);
if ($data !== NULL) {
$isGreaterThan540 = version_compare(PHP_VERSION, '5.4.0' , '>=');
$msgArr[] = is_array($data)
Expand Down
2 changes: 0 additions & 2 deletions vendor/phalapi/kernal/src/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,6 @@ public function __construct($data = NULL) {
$this->request = $_REQUEST;
$this->cookie = $_COOKIE;

$_REQUEST['unique'] = date("is").substr(microtime(), 2, 6); //追加微秒时间数参数到request(用于定义唯一值)
DI()->logger->log('parameter', null, ' '.json_encode($this->request,JSON_UNESCAPED_UNICODE)); //记录所有请求参数日志
@list($this->namespace, $this->apiName, $this->actionName) = explode('.', $this->getService());
}

Expand Down