10 * @license http://www.gnu.org/licenses/agpl.html GNU AGPL v3
11 * @link http://cweiske.de/php-sqllint.htm
16 * Textual output, easily readable by humans.
19 * @package PHP-SQLlint
21 * @license http://www.gnu.org/licenses/agpl.html GNU AGPL v3
22 * @link http://www.emacswiki.org/emacs/CreatingYourOwnCompileErrorRegexp
24 class Renderer_Text implements Renderer
27 * Begin syntax check output rendering
29 * @param string $filename Path to the SQL file
33 public function startRendering($filename)
35 echo "Checking SQL syntax of " . $filename . "\n";
39 * Show the error to the user.
41 * @param string $msg Error message
42 * @param string $token Character which caused the error
43 * @param integer $line Line at which the error occured
44 * @param integer $col Column at which the error occured
48 public function displayError($msg, $token, $line, $col)
52 . ' at "' . $this->niceToken($token) . '":'
58 * Finish syntax check output rendering; no syntax errors found
62 public function finishOk()
68 * Convert the token string to a readable one, especially special
69 * characters like newline and tabs
71 * @param string $str String with possibly special characters
73 * @return string Escaped string
75 protected function niceToken($str)