1
0
Fork 0

QA, Removed old Sqlparser.php

Dieser Commit ist enthalten in:
DSB 2011-06-19 11:48:08 +00:00
Ursprung 06f53ae5f2
Commit 50aadc32c5
3 geänderte Dateien mit 3 neuen und 80 gelöschten Zeilen

Datei anzeigen

@ -161,7 +161,7 @@ class Msd_Sql_Parser
return strlen($sqlQuery);
}
return $nextSemicolon;
return $nextSemicolon;
}
while ($nextString < $nextSemicolon) {

Datei anzeigen

@ -17,4 +17,5 @@ require_once 'Msd/Exception.php';
* @subpackage SQL-Browser
*/
class Msd_Sql_Parser_Exception extends Msd_Exception
{ }
{
}

Datei anzeigen

@ -1,78 +0,0 @@
<?php
/**
* This file is part of MySQLDumper released under the GNU/GPL 2 license
* http://www.mysqldumper.net
*
* @package MySQLDumper
* @subpackage Sql
* @version SVN: $rev: 1207 $
* @author $Author$
*/
/**
* Sql Parser Class
*
* @package MySQLDumper
* @subpackage Sqlparser
*/
define('*', 'SQL_TOKEN');
class Msd_Sqlparser
{
/**
* @var array Array containing the parsed queries
*/
private $_queries = array();
/**
* @var string Input text to analyse
*/
private $_text = '';
/**
* @param string $text Text to be later parsed as sql
*/
public function __construct($text = '')
{
$this->addText($text);
}
/**
* Add text to internal text buffer
*
* @param string $text The text to add
* @return void
*/
public function addText($text)
{
$this->_text .= $text;
}
/**
* Parse added text as sql und split into queries
*
* @return void
*/
public function parse()
{
//TODO implement parser
return $this->_text;
$i=1;
$tokens = token_get_all('<?php '.$this->_text.'?>');
unset($tokens[0]);
unset($tokens[count($tokens)]);
//unset($tokens[count($tokens)]);
//unset($tokens[0]);
foreach ($tokens as $token) {
if (is_string($token)) {
// simple 1-character token
echo "<br>$i. $token";
} else {
// token array
list($token, $text) = $token;
echo "<br>$i. ". token_name($token)." => "
. htmlspecialchars($text);
}
$i++;
}
}
}