*/
class Renderer_Text implements Renderer
{
+ protected $fileshown = false;
+ protected $filename = null;
+
/**
* Begin syntax check output rendering
*
*/
public function startRendering($filename)
{
- echo "Checking SQL syntax of " . $filename . "\n";
+ $this->filename = $filename;
+ $this->fileshown = false;
+ }
+
+
+ protected function showFile()
+ {
+ if ($this->fileshown) {
+ return;
+ }
+
+ echo "Checking SQL syntax of " . $this->filename . "\n";
+ $this->fileshown = true;
}
/**
*/
public function displayError($msg, $token, $line, $col)
{
+ $this->showFile();
echo ' Line ' . $line
. ', col ' . $col
. ' at "' . $this->niceToken($token) . '":'
*/
public function finishOk()
{
- echo " OK\n";
+ if ($this->fileshown) {
+ echo " OK\n";
+ }
}
/**