diff --git a/controllers/StockApiController.php b/controllers/StockApiController.php index c84301f3..29ed95d0 100644 --- a/controllers/StockApiController.php +++ b/controllers/StockApiController.php @@ -119,9 +119,9 @@ class StockApiController extends BaseApiController $result = null; - $fp = fopen('/www/data/sql.log', 'a'); - fwrite($fp, "???executing api consume product"); - $time_start = microtime(true); + #$fp = fopen('/www/data/sql.log', 'a'); + #fwrite($fp, "???executing api consume product"); + #$time_start = microtime(true); try { @@ -166,8 +166,8 @@ class StockApiController extends BaseApiController { $result = $this->GenericErrorResponse($response, $ex->getMessage()); } - fwrite($fp, "???API Consume product - Total execution time in seconds: " . round((microtime(true) - $time_start),6) . "\n"); - fclose($fp); + #fwrite($fp, "???API Consume product - Total execution time in seconds: " . round((microtime(true) - $time_start),6) . "\n"); + #fclose($fp); return $result; } diff --git a/controllers/StockController.php b/controllers/StockController.php index 9802fa0d..25a3f9c3 100644 --- a/controllers/StockController.php +++ b/controllers/StockController.php @@ -11,9 +11,9 @@ class StockController extends BaseController public function __construct(\Slim\Container $container) { - $fp = fopen('/www/data/sql.log', 'a'); - fwrite($fp, "!!!constructing StockController\n"); - fclose($fp); + #$fp = fopen('/www/data/sql.log', 'a'); + #fwrite($fp, "!!!constructing StockController\n"); + #fclose($fp); parent::__construct($container); $this->StockService = new StockService(); $this->UserfieldsService = new UserfieldsService(); diff --git a/services/DatabaseService.php b/services/DatabaseService.php index 69d859aa..148cc978 100644 --- a/services/DatabaseService.php +++ b/services/DatabaseService.php @@ -21,9 +21,9 @@ class PDOWrap public function __call($name,$pars){ $result = null; - $fp = fopen('/www/data/sql.log', 'a'); - fwrite($fp, "PDO::".$name." called with arguments:- ".implode( ", ", $pars)."\n"); - $time_start = microtime(true); + #$fp = fopen('/www/data/sql.log', 'a'); + #fwrite($fp, "PDO::".$name." called with arguments:- ".implode( ", ", $pars)."\n"); + #$time_start = microtime(true); if(in_array($name, array("exec","query"))) { fwrite($fp, array_values($pars)[0] . "\n"); @@ -31,8 +31,8 @@ class PDOWrap }else{ $result = call_user_func_array([$this->instance,$name],$pars); } - fwrite($fp, "Total execution time in seconds: " . round((microtime(true) - $time_start),6) . "\n"); - fclose($fp); + #fwrite($fp, "Total execution time in seconds: " . round((microtime(true) - $time_start),6) . "\n"); + #fclose($fp); return $result; } } @@ -77,16 +77,16 @@ class DatabaseService if (self::$DbConnectionRaw == null) #if ($this->DbConnectionRaw == null) { - $fp = fopen('/www/data/sql.log', 'a'); - fwrite($fp, "+++Creating new PDO object\n"); - $time_start = microtime(true); + #$fp = fopen('/www/data/sql.log', 'a'); + #fwrite($fp, "+++Creating new PDO object\n"); + #$time_start = microtime(true); $pdo = new PDOWrap('sqlite:' . $this->GetDbFilePath()); $pdo->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION); self::$DbConnectionRaw = $pdo; #$this->DbConnectionRaw = $pdo; - fwrite($fp, "+++Total execution time in seconds: " . round((microtime(true) - $time_start),6) . "\n"); - fwrite($fp, "+++object created\n"); - fclose($fp); + #fwrite($fp, "+++Total execution time in seconds: " . round((microtime(true) - $time_start),6) . "\n"); + #fwrite($fp, "+++object created\n"); + #fclose($fp); } return self::$DbConnectionRaw; @@ -103,14 +103,14 @@ class DatabaseService if (self::$DbConnection == null) #if ($this->DbConnection == null) { - $fp = fopen('/www/data/sql.log', 'a'); - fwrite($fp, "---creating new LessQL::Database object\n"); - $time_start = microtime(true); + #$fp = fopen('/www/data/sql.log', 'a'); + #fwrite($fp, "---creating new LessQL::Database object\n"); + #$time_start = microtime(true); self::$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, "---object created\n"); - fclose($fp); + #fwrite($fp, "---Total execution time in seconds: " . round((microtime(true) - $time_start),6) . "\n"); + #fwrite($fp, "---object created\n"); + #fclose($fp); } return self::$DbConnection;