Index: t3lib/class.t3lib_sqlparser.php =================================================================== --- t3lib/class.t3lib_sqlparser.php (revision 6279) +++ t3lib/class.t3lib_sqlparser.php (working copy) @@ -126,7 +126,7 @@ * @return array Result array with all the parts in - or error message string * @see compileSQL(), debug_testSQL() */ - function parseSQL($parseString) { + public function parseSQL($parseString) { // Prepare variables: $parseString = $this->trimSQL($parseString); $this->parse_error = ''; @@ -189,7 +189,7 @@ * @return mixed Returns array with components of SELECT query on success, otherwise an error message string. * @see compileSELECT() */ - function parseSELECT($parseString) { + protected function parseSELECT($parseString) { // Removing SELECT: $parseString = $this->trimSQL($parseString); @@ -258,7 +258,7 @@ * @return mixed Returns array with components of UPDATE query on success, otherwise an error message string. * @see compileUPDATE() */ - function parseUPDATE($parseString) { + protected function parseUPDATE($parseString) { // Removing UPDATE $parseString = $this->trimSQL($parseString); @@ -312,7 +312,7 @@ * @return mixed Returns array with components of INSERT query on success, otherwise an error message string. * @see compileINSERT() */ - function parseINSERT($parseString) { + protected function parseINSERT($parseString) { // Removing INSERT $parseString = $this->trimSQL($parseString); @@ -372,7 +372,7 @@ * @return mixed Returns array with components of DELETE query on success, otherwise an error message string. * @see compileDELETE() */ - function parseDELETE($parseString) { + protected function parseDELETE($parseString) { // Removing DELETE $parseString = $this->trimSQL($parseString); @@ -410,7 +410,7 @@ * @return mixed Returns array with components of EXPLAIN query on success, otherwise an error message string. * @see parseSELECT() */ - function parseEXPLAIN($parseString) { + protected function parseEXPLAIN($parseString) { // Removing EXPLAIN $parseString = $this->trimSQL($parseString); @@ -432,7 +432,7 @@ * @return mixed Returns array with components of CREATE TABLE query on success, otherwise an error message string. * @see compileCREATETABLE() */ - function parseCREATETABLE($parseString) { + protected function parseCREATETABLE($parseString) { // Removing CREATE TABLE $parseString = $this->trimSQL($parseString); @@ -511,7 +511,7 @@ * @return mixed Returns array with components of ALTER TABLE query on success, otherwise an error message string. * @see compileALTERTABLE() */ - function parseALTERTABLE($parseString) { + protected function parseALTERTABLE($parseString) { // Removing ALTER TABLE $parseString = $this->trimSQL($parseString); @@ -580,7 +580,7 @@ * @param string SQL string starting with DROP TABLE * @return mixed Returns array with components of DROP TABLE query on success, otherwise an error message string. */ - function parseDROPTABLE($parseString) { + protected function parseDROPTABLE($parseString) { // Removing DROP TABLE $parseString = $this->trimSQL($parseString); @@ -613,7 +613,7 @@ * @param string SQL string starting with CREATE DATABASE * @return mixed Returns array with components of CREATE DATABASE query on success, otherwise an error message string. */ - function parseCREATEDATABASE($parseString) { + protected function parseCREATEDATABASE($parseString) { // Removing CREATE DATABASE $parseString = $this->trimSQL($parseString); @@ -667,7 +667,7 @@ * @return array If successful parsing, returns an array, otherwise an error string. * @see compileFieldList() */ - function parseFieldList(&$parseString, $stopRegex='') { + public function parseFieldList(&$parseString, $stopRegex = '') { $stack = array(); // Contains the parsed content @@ -788,7 +788,7 @@ * @return array If successful parsing, returns an array, otherwise an error string. * @see compileFromTables() */ - function parseFromTables(&$parseString, $stopRegex='') { + public function parseFromTables(&$parseString, $stopRegex = '') { // Prepare variables: $parseString = $this->trimSQL($parseString); @@ -886,7 +886,7 @@ * @param string Regular expressing to STOP parsing, eg. '^(GROUP BY|ORDER BY|LIMIT)([[:space:]]*)' * @return mixed If successful parsing, returns an array, otherwise an error string. */ - function parseWhereClause(&$parseString, $stopRegex='') { + public function parseWhereClause(&$parseString, $stopRegex = '') { // Prepare variables: $parseString = $this->trimSQL($parseString); @@ -1005,7 +1005,7 @@ * @param string Regular expressing to STOP parsing, eg. '^(GROUP BY|ORDER BY|LIMIT)([[:space:]]*)' * @return mixed If successful parsing, returns an array, otherwise an error string. */ - function parseFieldDef(&$parseString, $stopRegex='') { + public function parseFieldDef(&$parseString, $stopRegex = '') { // Prepare variables: $parseString = $this->trimSQL($parseString); $this->lastStopKeyWord = ''; @@ -1068,7 +1068,7 @@ * @param boolean If set the full match of the regex is stripped of the beginning of the string! * @return string The value of the first parenthesis level of the REGEX. */ - function nextPart(&$parseString,$regex,$trimAll=FALSE) { + protected function nextPart(&$parseString, $regex, $trimAll = FALSE) { $reg = array(); if (preg_match('/'.$regex.'/i',$parseString.' ', $reg)) { // Adding space char because [[:space:]]+ is often a requirement in regex's $parseString = ltrim(substr($parseString,strlen($reg[$trimAll?0:1]))); @@ -1083,7 +1083,7 @@ * @param string The comparator used before. If "NOT IN" or "IN" then the value is expected to be a list of values. Otherwise just an integer (un-quoted) or string (quoted) * @return mixed The value (string/integer). Otherwise an array with error message in first key (0) */ - function getValue(&$parseString,$comparator='') { + protected function getValue(&$parseString, $comparator = '') { $value = ''; if (t3lib_div::inList('NOTIN,IN,_LIST',strtoupper(str_replace(array(' ',"\n","\r","\t"),'',$comparator)))) { // List of values: @@ -1141,7 +1141,7 @@ * @param string The quote used; input either " or ' * @return string The value, passed through stripslashes() ! */ - function getValueInQuotes(&$parseString,$quote) { + protected function getValueInQuotes(&$parseString, $quote) { $parts = explode($quote,substr($parseString,1)); $buffer = ''; @@ -1166,7 +1166,7 @@ * @param string Input string * @return string Output string */ - function parseStripslashes($str) { + protected function parseStripslashes($str) { $search = array('\\\\', '\\\'', '\\"', '\0', '\n', '\r', '\Z'); $replace = array('\\', '\'', '"', "\x00", "\x0a", "\x0d", "\x1a"); @@ -1180,7 +1180,7 @@ * @param string Input string * @return string Output string */ - function compileAddslashes($str) { + protected function compileAddslashes($str) { return $str; $search = array('\\', '\'', '"', "\x00", "\x0a", "\x0d", "\x1a"); $replace = array('\\\\', '\\\'', '\\"', '\0', '\n', '\r', '\Z'); @@ -1195,7 +1195,7 @@ * @param string Remaining query to parse. * @return string Error message. */ - function parseError($msg,$restQuery) { + protected function parseError($msg, $restQuery) { $this->parse_error = 'SQL engine parse ERROR: '.$msg.': near "'.substr($restQuery,0,50).'"'; return $this->parse_error; } @@ -1209,7 +1209,7 @@ * @param string Input string * @return string Output string */ - function trimSQL($str) { + protected function trimSQL($str) { return trim(rtrim($str, "; \r\n\t")).' '; } @@ -1237,7 +1237,7 @@ * @return string SQL query * @see parseSQL() */ - function compileSQL($components) { + public function compileSQL($components) { switch($components['type']) { case 'SELECT': $query = $this->compileSELECT($components); @@ -1275,7 +1275,7 @@ * @return string SQL SELECT query * @see parseSELECT() */ - function compileSELECT($components) { + protected function compileSELECT($components) { // Initialize: $where = $this->compileWhereClause($components['WHERE']); @@ -1306,7 +1306,7 @@ * @return string SQL UPDATE query * @see parseUPDATE() */ - function compileUPDATE($components) { + protected function compileUPDATE($components) { // Where clause: $where = $this->compileWhereClause($components['WHERE']); @@ -1334,7 +1334,7 @@ * @return string SQL INSERT query * @see parseINSERT() */ - function compileINSERT($components) { + protected function compileINSERT($components) { if ($components['VALUES_ONLY']) { // Initialize: @@ -1374,7 +1374,7 @@ * @return string SQL DELETE query * @see parseDELETE() */ - function compileDELETE($components) { + protected function compileDELETE($components) { // Where clause: $where = $this->compileWhereClause($components['WHERE']); @@ -1394,7 +1394,7 @@ * @return string SQL CREATE TABLE query * @see parseCREATETABLE() */ - function compileCREATETABLE($components) { + protected function compileCREATETABLE($components) { // Create fields and keys: $fieldsKeys = array(); @@ -1427,7 +1427,7 @@ * @return string SQL ALTER TABLE query * @see parseALTERTABLE() */ - function compileALTERTABLE($components) { + protected function compileALTERTABLE($components) { // Make query: $query = 'ALTER TABLE '.$components['TABLE'].' '.$components['action'].' '.($components['FIELD']?$components['FIELD']:$components['KEY']); @@ -1480,7 +1480,7 @@ * @return string Select field string * @see parseFieldList() */ - function compileFieldList($selectFields) { + public function compileFieldList($selectFields) { // Prepare buffer variable: $outputParts = array(); @@ -1522,7 +1522,7 @@ * @return string Table name string * @see parseFromTables() */ - function compileFromTables($tablesArray) { + public function compileFromTables($tablesArray) { // Prepare buffer variable: $outputParts = array(); @@ -1568,7 +1568,7 @@ * @return string WHERE clause as string. * @see explodeWhereClause() */ - function compileWhereClause($clauseArray) { + public function compileWhereClause($clauseArray) { // Prepare buffer variable: $output=''; @@ -1622,7 +1622,7 @@ * @param array Field definition parts * @return string Field definition string */ - function compileFieldCfg($fieldCfg) { + protected function compileFieldCfg($fieldCfg) { // Set type: $cfg = $fieldCfg['fieldType']; @@ -1671,7 +1671,7 @@ * @param string SQL string to verify parsability of * @return mixed Returns array with string 1 and 2 if error, otherwise false */ - function debug_parseSQLpart($part,$str) { + public function debug_parseSQLpart($part, $str) { $retVal = false; switch($part) { @@ -1696,7 +1696,7 @@ * @param boolean If true, the strings are compared insensitive to case * @return mixed Returns array with string 1 and 2 if error, otherwise false */ - function debug_parseSQLpartCompare($str,$newStr,$caseInsensitive=FALSE) { + public function debug_parseSQLpartCompare($str, $newStr, $caseInsensitive = FALSE) { if ($caseInsensitive) { $str1 = strtoupper($str); $str2 = strtoupper($newStr); @@ -1729,7 +1729,7 @@ * @param string SQL query * @return string Query if all is well, otherwise exit. */ - function debug_testSQL($SQLquery) { + public function debug_testSQL($SQLquery) { // Getting result array: $parseResult = $this->parseSQL($SQLquery);