Permalink
Browse files

Improve memory consumption in devel environments: only execute DebugM…

…ysql::setDebug when we are in debugMode = true
  • Loading branch information...
obokaman-com committed Sep 19, 2017
1 parent f1385ad commit e99ef7be83375ce20b7fc5049cfeb3028ec1980c
Showing with 7 additions and 2 deletions.
  1. +6 −1 src/Sifo/Debug/Mysql.php
  2. +1 −1 src/Sifo/Mysql.php
View
@@ -206,7 +206,7 @@ class DebugMysql extends Mysql
* Singleton static method.
*
* @param string $profile The database server to connect to.
* @return Db
* @return DebugMysql
*/
static public function getInstance( $profile = 'default' )
{
@@ -277,6 +277,11 @@ public function __call( $method, $arguments )
*/
public static function setDebug( $statement, $query_time, $context, $resultset, $db_params, $pdo = null )
{
if (false == Domains::getInstance()->getDebugMode())
{
return;
}
if ( $resultset !== false )
{
$error = $resultset->errorInfo();
View
@@ -166,7 +166,7 @@ public function __construct( $profile )
* Singleton static method.
*
* @param string $profile The database server to connect to.
* @return Db
* @return Mysql
*/
static public function getInstance( $profile = 'default' )
{

0 comments on commit e99ef7b

Please sign in to comment.