Api Impruvement
This commit is contained in:
parent
24072cb582
commit
8ab0b043f9
6
api.php
6
api.php
@ -31,6 +31,7 @@ if (!$restAcess){
|
|||||||
|
|
||||||
//Log
|
//Log
|
||||||
$logManager = new LogManager();
|
$logManager = new LogManager();
|
||||||
|
$apiLogManager = new LogManager('./app/logs/api/'. date("Y-m-d").'.log');
|
||||||
|
|
||||||
//DB Conector
|
//DB Conector
|
||||||
Db::connect (DBHOST, DBUSER, DBPASS, DBNAME);
|
Db::connect (DBHOST, DBUSER, DBPASS, DBNAME);
|
||||||
@ -39,8 +40,9 @@ Db::connect (DBHOST, DBUSER, DBPASS, DBNAME);
|
|||||||
$json = file_get_contents('php://input');
|
$json = file_get_contents('php://input');
|
||||||
$obj = json_decode($json, true);
|
$obj = json_decode($json, true);
|
||||||
|
|
||||||
if (defined(DEBUGMOD) && DEBUGMOD == 1) {
|
//Log RAW api request
|
||||||
$logManager->write("[API] request body\n" . json_encode($obj, JSON_PRETTY_PRINT), LogRecordType::INFO);
|
if (API_DEBUGMOD == 1) {
|
||||||
|
$apiLogManager->write("[API] request body\n" . json_encode($obj, JSON_PRETTY_PRINT), LogRecordType::INFO);
|
||||||
}
|
}
|
||||||
|
|
||||||
//zabespecit proti Ddosu
|
//zabespecit proti Ddosu
|
||||||
|
Loading…
Reference in New Issue
Block a user