Skip to content
Permalink
Browse files

Add Connection::disableQueryLogging().

  • Loading branch information...
ADmad committed Nov 1, 2018
1 parent 2ca0486 commit 5fe3e0c16aa625d7aa310132892eef4a7e7ec99f
@@ -875,6 +875,18 @@ public function enableQueryLogging($value)
return $this;
}
/**
* Disable query logging
*
* @return $this
*/
public function disableQueryLogging()
{
$this->_logQueries = false;
return $this;
}
/**
* Check if query logging is enabled.
*
@@ -26,6 +26,7 @@
* @method \Cake\Database\StatementInterface prepare($sql)
* @method \Cake\Database\StatementInterface execute($query, $params = [], array $types = [])
* @method $this enableQueryLogging($value)
* @method $this disableQueryLogging()
* @method bool isQueryLoggingEnabled()
* @method string quote($value, $type = null)
*/
@@ -402,7 +402,7 @@ protected function _runOperation($fixtures, $operation)
if ($logQueries && !$this->_debug) {
if ($newMethods) {
$db->enableQueryLogging(false);
$db->disableQueryLogging();
} else {
$db->logQueries(false);
}
@@ -965,7 +965,7 @@ public function testEnableQueryLogging()
$this->connection->enableQueryLogging(true);
$this->assertTrue($this->connection->isQueryLoggingEnabled());
$this->connection->enableQueryLogging(false);
$this->connection->disableQueryLogging();
$this->assertFalse($this->connection->isQueryLoggingEnabled());
}

0 comments on commit 5fe3e0c

Please sign in to comment.
You can’t perform that action at this time.