mirror of
https://github.com/grocy/grocy.git
synced 2026-04-07 21:26:16 +02:00
comment out debug printing to log file
This commit is contained in:
parent
72f60bc321
commit
1659e151a7
|
|
@ -119,9 +119,9 @@ class StockApiController extends BaseApiController
|
||||||
|
|
||||||
$result = null;
|
$result = null;
|
||||||
|
|
||||||
$fp = fopen('/www/data/sql.log', 'a');
|
#$fp = fopen('/www/data/sql.log', 'a');
|
||||||
fwrite($fp, "???executing api consume product");
|
#fwrite($fp, "???executing api consume product");
|
||||||
$time_start = microtime(true);
|
#$time_start = microtime(true);
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
@ -166,8 +166,8 @@ class StockApiController extends BaseApiController
|
||||||
{
|
{
|
||||||
$result = $this->GenericErrorResponse($response, $ex->getMessage());
|
$result = $this->GenericErrorResponse($response, $ex->getMessage());
|
||||||
}
|
}
|
||||||
fwrite($fp, "???API Consume product - Total execution time in seconds: " . round((microtime(true) - $time_start),6) . "\n");
|
#fwrite($fp, "???API Consume product - Total execution time in seconds: " . round((microtime(true) - $time_start),6) . "\n");
|
||||||
fclose($fp);
|
#fclose($fp);
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,9 +11,9 @@ class StockController extends BaseController
|
||||||
|
|
||||||
public function __construct(\Slim\Container $container)
|
public function __construct(\Slim\Container $container)
|
||||||
{
|
{
|
||||||
$fp = fopen('/www/data/sql.log', 'a');
|
#$fp = fopen('/www/data/sql.log', 'a');
|
||||||
fwrite($fp, "!!!constructing StockController\n");
|
#fwrite($fp, "!!!constructing StockController\n");
|
||||||
fclose($fp);
|
#fclose($fp);
|
||||||
parent::__construct($container);
|
parent::__construct($container);
|
||||||
$this->StockService = new StockService();
|
$this->StockService = new StockService();
|
||||||
$this->UserfieldsService = new UserfieldsService();
|
$this->UserfieldsService = new UserfieldsService();
|
||||||
|
|
|
||||||
|
|
@ -21,9 +21,9 @@ class PDOWrap
|
||||||
public function __call($name,$pars){
|
public function __call($name,$pars){
|
||||||
$result = null;
|
$result = null;
|
||||||
|
|
||||||
$fp = fopen('/www/data/sql.log', 'a');
|
#$fp = fopen('/www/data/sql.log', 'a');
|
||||||
fwrite($fp, "PDO::".$name." called with arguments:- ".implode( ", ", $pars)."\n");
|
#fwrite($fp, "PDO::".$name." called with arguments:- ".implode( ", ", $pars)."\n");
|
||||||
$time_start = microtime(true);
|
#$time_start = microtime(true);
|
||||||
if(in_array($name, array("exec","query")))
|
if(in_array($name, array("exec","query")))
|
||||||
{
|
{
|
||||||
fwrite($fp, array_values($pars)[0] . "\n");
|
fwrite($fp, array_values($pars)[0] . "\n");
|
||||||
|
|
@ -31,8 +31,8 @@ class PDOWrap
|
||||||
}else{
|
}else{
|
||||||
$result = call_user_func_array([$this->instance,$name],$pars);
|
$result = call_user_func_array([$this->instance,$name],$pars);
|
||||||
}
|
}
|
||||||
fwrite($fp, "Total execution time in seconds: " . round((microtime(true) - $time_start),6) . "\n");
|
#fwrite($fp, "Total execution time in seconds: " . round((microtime(true) - $time_start),6) . "\n");
|
||||||
fclose($fp);
|
#fclose($fp);
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -77,16 +77,16 @@ class DatabaseService
|
||||||
if (self::$DbConnectionRaw == null)
|
if (self::$DbConnectionRaw == null)
|
||||||
#if ($this->DbConnectionRaw == null)
|
#if ($this->DbConnectionRaw == null)
|
||||||
{
|
{
|
||||||
$fp = fopen('/www/data/sql.log', 'a');
|
#$fp = fopen('/www/data/sql.log', 'a');
|
||||||
fwrite($fp, "+++Creating new PDO object\n");
|
#fwrite($fp, "+++Creating new PDO object\n");
|
||||||
$time_start = microtime(true);
|
#$time_start = microtime(true);
|
||||||
$pdo = new PDOWrap('sqlite:' . $this->GetDbFilePath());
|
$pdo = new PDOWrap('sqlite:' . $this->GetDbFilePath());
|
||||||
$pdo->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION);
|
$pdo->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION);
|
||||||
self::$DbConnectionRaw = $pdo;
|
self::$DbConnectionRaw = $pdo;
|
||||||
#$this->DbConnectionRaw = $pdo;
|
#$this->DbConnectionRaw = $pdo;
|
||||||
fwrite($fp, "+++Total execution time in seconds: " . round((microtime(true) - $time_start),6) . "\n");
|
#fwrite($fp, "+++Total execution time in seconds: " . round((microtime(true) - $time_start),6) . "\n");
|
||||||
fwrite($fp, "+++object created\n");
|
#fwrite($fp, "+++object created\n");
|
||||||
fclose($fp);
|
#fclose($fp);
|
||||||
}
|
}
|
||||||
|
|
||||||
return self::$DbConnectionRaw;
|
return self::$DbConnectionRaw;
|
||||||
|
|
@ -103,14 +103,14 @@ class DatabaseService
|
||||||
if (self::$DbConnection == null)
|
if (self::$DbConnection == null)
|
||||||
#if ($this->DbConnection == null)
|
#if ($this->DbConnection == null)
|
||||||
{
|
{
|
||||||
$fp = fopen('/www/data/sql.log', 'a');
|
#$fp = fopen('/www/data/sql.log', 'a');
|
||||||
fwrite($fp, "---creating new LessQL::Database object\n");
|
#fwrite($fp, "---creating new LessQL::Database object\n");
|
||||||
$time_start = microtime(true);
|
#$time_start = microtime(true);
|
||||||
self::$DbConnection = new \LessQL\Database($this->GetDbConnectionRaw());
|
self::$DbConnection = new \LessQL\Database($this->GetDbConnectionRaw());
|
||||||
#$this->DbConnection = new \LessQL\Database($this->GetDbConnectionRaw());
|
#$this->DbConnection = new \LessQL\Database($this->GetDbConnectionRaw());
|
||||||
fwrite($fp, "---Total execution time in seconds: " . round((microtime(true) - $time_start),6) . "\n");
|
#fwrite($fp, "---Total execution time in seconds: " . round((microtime(true) - $time_start),6) . "\n");
|
||||||
fwrite($fp, "---object created\n");
|
#fwrite($fp, "---object created\n");
|
||||||
fclose($fp);
|
#fclose($fp);
|
||||||
}
|
}
|
||||||
|
|
||||||
return self::$DbConnection;
|
return self::$DbConnection;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user