mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
fixes #4850
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7122 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
b05185f08a
commit
288db81884
2 changed files with 186 additions and 192 deletions
|
@ -495,14 +495,14 @@ class DboSource extends DataSource {
|
||||||
$sql = substr($sql, 0, 200) . '[...]';
|
$sql = substr($sql, 0, 200) . '[...]';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (($error) || Configure::read() > 1) {
|
if ($error && Configure::read() > 0) {
|
||||||
e("<p style = \"text-align:left\"><b>Query:</b> {$sql} ");
|
e("<p style = \"text-align:left\"><b>Query:</b> {$sql} ");
|
||||||
if ($error) {
|
if ($error) {
|
||||||
trigger_error("<span style = \"color:Red;text-align:left\"><b>SQL Error:</b> {$this->error}</span>", E_USER_WARNING);
|
trigger_error("<span style = \"color:Red;text-align:left\"><b>SQL Error:</b> {$this->error}</span>", E_USER_WARNING);
|
||||||
} else {
|
} else {
|
||||||
e("<small>[Aff:{$this->affected} Num:{$this->numRows} Took:{$this->took}ms]</small>");
|
e("<small>[Aff:{$this->affected} Num:{$this->numRows} Took:{$this->took}ms]</small>");
|
||||||
}
|
}
|
||||||
print ('</p>');
|
e('</p>');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -3444,12 +3444,6 @@ class DboSourceTest extends CakeTestCase {
|
||||||
$oldDebug = Configure::read('debug');
|
$oldDebug = Configure::read('debug');
|
||||||
Configure::write('debug', 2);
|
Configure::write('debug', 2);
|
||||||
|
|
||||||
$this->testDb->error = false;
|
|
||||||
ob_start();
|
|
||||||
$this->testDb->showQuery('Query 3');
|
|
||||||
$contents = ob_get_contents();
|
|
||||||
ob_end_clean();
|
|
||||||
$this->assertPattern('/Query 3/s', $contents);
|
|
||||||
|
|
||||||
$this->testDb->error = true;
|
$this->testDb->error = true;
|
||||||
$this->expectError();
|
$this->expectError();
|
||||||
|
|
Loading…
Reference in a new issue