Cleanup: Applied CGL
authorXavier Perseguers <typo3@perseguers.ch>
Tue, 27 Oct 2009 14:20:41 +0000 (14:20 +0000)
committerXavier Perseguers <typo3@perseguers.ch>
Tue, 27 Oct 2009 14:20:41 +0000 (14:20 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Extensions/dbal/trunk@25913 735d13b6-9817-0410-8766-e36946ffe9aa

typo3/sysext/dbal/ChangeLog
typo3/sysext/dbal/class.ux_db_list_extra.php
typo3/sysext/dbal/ext_localconf.php
typo3/sysext/dbal/ext_tables.php
typo3/sysext/dbal/mod1/index.php

index f664bc9..e31f78f 100644 (file)
@@ -2,6 +2,7 @@
 
        * Follow-up of changeset 25876: Using tx_dbal_sqlengine instead of t3lib_sqlengine for sample handlers
        * Created icons for extension and Debug module
+       * Cleanup: Applied CGL
 
 2009-10-26  Xavier Perseguers  <typo3@perseguers.ch>
 
index 2984c90..a97cc0e 100755 (executable)
@@ -43,6 +43,7 @@
  * @subpackage DBAL
  */
 class ux_localRecordList extends localRecordList {
+
        /**
         * Creates part of query for searching after a word ($this->searchString) fields in input table
         *
@@ -52,58 +53,56 @@ class ux_localRecordList extends localRecordList {
         * @param       string          Table, in which the fields are being searched.
         * @return      string          Returns part of WHERE-clause for searching, if applicable.
         */
-       function makeSearchString($table)       {
-               global $TCA;
-
+       function makeSearchString($table) {
                        // Make query, only if table is valid and a search string is actually defined:
-               if ($TCA[$table] && $this->searchString)        {
+               if ($GLOBALS['TCA'][$table] && $this->searchString) {
 
                                // Loading full table description - we need to traverse fields:
                        t3lib_div::loadTCA($table);
 
                                // Initialize field array:
-                       $sfields=array();
+                       $sfields = array();
                        $or = '';
 
                                // add the uid only if input is numeric, cast to int
-                       if(is_numeric($this->searchString)) {
-                               $queryPart = ' AND (uid='.(int)$this->searchString.' OR ';
+                       if (is_numeric($this->searchString)) {
+                               $queryPart = ' AND (uid=' . (int)$this->searchString . ' OR ';
                        } else {
                                $queryPart = ' AND (';
                        }
 
-                       if($GLOBALS['TYPO3_DB']->runningADOdbDriver('oci8')) {
-                               foreach($TCA[$table]['columns'] as $fieldName => $info) {
-                                       if ($GLOBALS['TYPO3_DB']->cache_fieldType[$table][$fieldName]['metaType'] == 'B') {
+                       if ($GLOBALS['TYPO3_DB']->runningADOdbDriver('oci8')) {
+                               foreach ($GLOBALS['TCA'][$table]['columns'] as $fieldName => $info) {
+                                       if ($GLOBALS['TYPO3_DB']->cache_fieldType[$table][$fieldName]['metaType'] === 'B') {
                                                // skip, LIKE is not supported on BLOB columns...
-                                       } elseif ($info['config']['type']=='text' || ($info['config']['type']=='input' && !preg_match('/date|time|int/',$info['config']['eval']))) {
-                                               $queryPart .= $or.$fieldName.' LIKE \'%'.$GLOBALS['TYPO3_DB']->quoteStr($this->searchString, $table).'%\'';
+                                       } elseif ($info['config']['type'] === 'text' || ($info['config']['type'] === 'input' && !preg_match('/date|time|int/', $info['config']['eval']))) {
+                                               $queryPart .= $or . $fieldName . ' LIKE \'%' . $GLOBALS['TYPO3_DB']->quoteStr($this->searchString, $table) . '%\'';
                                                $or = ' OR ';
                                        }
                                }
                        } else {
                                        // Traverse the configured columns and add all columns that can be searched
-                               foreach($TCA[$table]['columns'] as $fieldName => $info) {
-                                       if ($info['config']['type']=='text' || ($info['config']['type']=='input' && !preg_match('/date|time|int/',$info['config']['eval']))) {
-                                               $sfields[]=$fieldName;
+                               foreach ($GLOBALS['TCA'][$table]['columns'] as $fieldName => $info) {
+                                       if ($info['config']['type'] === 'text' || ($info['config']['type'] === 'input' && !preg_match('/date|time|int/', $info['config']['eval']))) {
+                                               $sfields[] = $fieldName;
                                        }
                                }
 
                                        // If search-fields were defined (and there always are) we create the query:
-                               if (count($sfields))    {
-                                       $like = ' LIKE \'%'.$GLOBALS['TYPO3_DB']->quoteStr($this->searchString, $table).'%\'';          // Free-text
-                                       $queryPart .= implode($like.' OR ',$sfields).$like;
+                               if (count($sfields)) {
+                                       $like = ' LIKE \'%'.$GLOBALS['TYPO3_DB']->quoteStr($this->searchString, $table) . '%\'';                // Free-text
+                                       $queryPart .= implode($like . ' OR ', $sfields) . $like;
                                }
                        }
 
                                // Return query:
-                       return $queryPart.')';
+                       return $queryPart . ')';
                }
        }
 }
 
 
-if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/dbal/class.ux_db_list_extra.php'])    {
+if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/dbal/class.ux_db_list_extra.php']) {
        include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/dbal/class.ux_db_list_extra.php']);
 }
 
index 051e1a0..8ee482c 100644 (file)
@@ -1,8 +1,10 @@
 <?php
-if (!defined ('TYPO3_MODE'))   die ('Access denied.');
+if (!defined('TYPO3_MODE')) {
+       die ('Access denied.');
+}
 
-$TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_db.php'] = t3lib_extMgm::extPath('dbal').'class.ux_t3lib_db.php';
-$TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_sqlparser.php'] = t3lib_extMgm::extPath('dbal').'class.ux_t3lib_sqlparser.php';
-$TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/class.db_list_extra.inc'] = t3lib_extMgm::extPath('dbal').'class.ux_db_list_extra.php';
+$TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_db.php'] = t3lib_extMgm::extPath('dbal') . 'class.ux_t3lib_db.php';
+$TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_sqlparser.php'] = t3lib_extMgm::extPath('dbal') . 'class.ux_t3lib_sqlparser.php';
+$TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/class.db_list_extra.inc'] = t3lib_extMgm::extPath('dbal') . 'class.ux_db_list_extra.php';
 
 ?>
index 3e031f5..bdf927a 100644 (file)
@@ -1,7 +1,9 @@
 <?php
-if (!defined ('TYPO3_MODE'))   die ('Access denied.');
+if (!defined('TYPO3_MODE')) {
+       die ('Access denied.');
+}
 
-if (TYPO3_MODE=='BE')  {
-       t3lib_extMgm::addModule('tools','txdbalM1','',t3lib_extMgm::extPath($_EXTKEY).'mod1/');
+if (TYPO3_MODE === 'BE') {
+       t3lib_extMgm::addModule('tools', 'txdbalM1', '', t3lib_extMgm::extPath($_EXTKEY) . 'mod1/');
 }
-?>
\ No newline at end of file
+?>
index 5cdcb90..907ca30 100644 (file)
  */
 
 unset($MCONF);
-require ('conf.php');
-require ($BACK_PATH.'init.php');
-require ($BACK_PATH.'template.php');
+require('conf.php');
+require($BACK_PATH . 'init.php');
+require($BACK_PATH . 'template.php');
 $LANG->includeLLFile('EXT:dbal/mod1/locallang.xml');
-$BE_USER->modAccess($MCONF,1);
+$BE_USER->modAccess($MCONF, 1);
 
 
 /**
@@ -52,9 +52,9 @@ class tx_dbal_module1 extends t3lib_SCbase {
         *
         * @return      void
         */
-       function menuConfig()   {
-               $this->MOD_MENU = Array (
-                       'function' => Array (
+       public function menuConfig() {
+               $this->MOD_MENU = array(
+                       'function' => array(
                                0 => $GLOBALS['LANG']->getLL('Debug_log'),
                                'info' => $GLOBALS['LANG']->getLL('Cached_info'),
                                'sqlcheck' => $GLOBALS['LANG']->getLL('SQL_check'),
@@ -68,16 +68,15 @@ class tx_dbal_module1 extends t3lib_SCbase {
         *
         * @return      void
         */
-       function main() {
-               global $BACK_PATH,$BE_USER;
+       public function main() {
 
                        // Clean up settings:
                $this->MOD_SETTINGS = t3lib_BEfunc::getModuleData($this->MOD_MENU, t3lib_div::_GP('SET'), $this->MCONF['name']);
 
-                       // Draw the header.
+                       // Draw the header
                $this->doc = t3lib_div::makeInstance('noDoc');
-               $this->doc->backPath = $BACK_PATH;
-               $this->doc->form='<form action="" method="post">';
+               $this->doc->backPath = $GLOBALS['BACK_PATH'];
+               $this->doc->form = '<form action="" method="post">';
 
                        // JavaScript
                $this->doc->JScode = $this->doc->wrapScriptTags('
@@ -88,13 +87,13 @@ class tx_dbal_module1 extends t3lib_SCbase {
                        ');
 
                        // DBAL page title:
-               $this->content.=$this->doc->startPage($GLOBALS['LANG']->getLL('title'));
-               $this->content.=$this->doc->header($GLOBALS['LANG']->getLL('title'));
-               $this->content.=$this->doc->spacer(5);
-               $this->content.=$this->doc->section('',$this->doc->funcMenu('',t3lib_BEfunc::getFuncMenu(0,'SET[function]',$this->MOD_SETTINGS['function'],$this->MOD_MENU['function'])));
+               $this->content .= $this->doc->startPage($GLOBALS['LANG']->getLL('title'));
+               $this->content .= $this->doc->header($GLOBALS['LANG']->getLL('title'));
+               $this->content .= $this->doc->spacer(5);
+               $this->content .= $this->doc->section('', $this->doc->funcMenu('', t3lib_BEfunc::getFuncMenu(0, 'SET[function]', $this->MOD_SETTINGS['function'], $this->MOD_MENU['function'])));
 
                        // Debug log:
-               switch($this->MOD_SETTINGS['function']) {
+               switch ($this->MOD_SETTINGS['function']) {
                        case 'info':
                                $this->content .= $this->doc->section($GLOBALS['LANG']->getLL('Cached_info'), $this->printCachedInfo());
                                break;
@@ -107,11 +106,11 @@ class tx_dbal_module1 extends t3lib_SCbase {
                }
 
                        // ShortCut
-               if ($BE_USER->mayMakeShortcut())        {
-                       $this->content.=$this->doc->spacer(20).$this->doc->section('',$this->doc->makeShortcutIcon('id',implode(',',array_keys($this->MOD_MENU)),$this->MCONF['name']));
+               if ($GLOBALS['BE_USER']->mayMakeShortcut()) {
+                       $this->content .= $this->doc->spacer(20) . $this->doc->section('', $this->doc->makeShortcutIcon('id', implode(',', array_keys($this->MOD_MENU)), $this->MCONF['name']));
                }
 
-               $this->content.=$this->doc->spacer(10);
+               $this->content .= $this->doc->spacer(10);
        }
 
        /**
@@ -119,11 +118,9 @@ class tx_dbal_module1 extends t3lib_SCbase {
         *
         * @return      string HTML output
         */
-       function printContent() {
-               global $SOBE;
-
-               $this->content.=$this->doc->middle();
-               $this->content.=$this->doc->endPage();
+       public function printContent()  {
+               $this->content .= $this->doc->middle();
+               $this->content .= $this->doc->endPage();
                echo $this->content;
        }
 
@@ -132,11 +129,11 @@ class tx_dbal_module1 extends t3lib_SCbase {
         *
         * @return string HTML output
         */
-       function printSqlCheck()        {
+       protected function printSqlCheck() {
                $input = t3lib_div::_GP('tx_dbal');
 
                $out = '
-                       <form name="sql_check" action="index.php" method="post" enctype="'.$GLOBALS['TYPO3_CONF_VARS']['SYS']['form_enctype'].'">
+                       <form name="sql_check" action="index.php" method="post" enctype="' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['form_enctype'] . '">
                        <script type="text/javascript">
 /*<![CDATA[*/
 function updateQryForm(s) {
@@ -199,26 +196,26 @@ function updateQryForm(s) {
            <tr class="tableheader bgColor5"><th colspan="2">Easy SQL check</th></tr>
            <tr><td colspan="2">
            <select name="tx_dbal[QUERY]"size="1" onchange="updateQryForm(this.options[this.selectedIndex].value)">
-            <option value="SELECT" '.($input['QUERY']=='SELECT'? 'selected="selected"' : '').'>SELECT</option>
-            <option value="INSERT" '.($input['QUERY']=='INSERT'? 'selected="selected"' : '').'>INSERT</option>
-            <option value="UPDATE" '.($input['QUERY']=='UPDATE'? 'selected="selected"' : '').'>UPDATE</option>
-            <option value="DELETE" '.($input['QUERY']=='DELETE' ? 'selected="selected"' : '').'>DELETE</option>
+            <option value="SELECT" ' . ($input['QUERY'] === 'SELECT' ? 'selected="selected"' : '') . '>SELECT</option>
+            <option value="INSERT" ' . ($input['QUERY'] === 'INSERT' ? 'selected="selected"' : '') . '>INSERT</option>
+            <option value="UPDATE" ' . ($input['QUERY'] === 'UPDATE' ? 'selected="selected"' : '') . '>UPDATE</option>
+            <option value="DELETE" ' . ($input['QUERY'] === 'DELETE' ? 'selected="selected"' : '') . '>DELETE</option>
            </select>
            </td></tr>
-           <tr id="tx-dbal-qryupdate" style="display:none;"><td></td><td><input name="tx_dbal[UPDATE]" value="'.$input['UPDATE'].'" type="text" size="30" maxsize="100" /></td></tr>
-           <tr id="tx-dbal-qryfields"><td></td><td><input name="tx_dbal[FIELDS]" value="'.$input['FIELDS'].'" type="text" size="30" maxsize="100" /></td></tr>
-           <tr id="tx-dbal-qryinsertvalues" style="display:none;"><td></td><td><textarea name="tx_dbal[INSERTVALUES]" cols="30" rows="4">'.$input['INSERTVALUES'].'</textarea></td></tr>
-           <tr id="tx-dbal-qryupdatevalues" style="display:none;"><th>SET</th><td><textarea name="tx_dbal[UPDATEVALUES]" cols="30" rows="4">'.$input['UPDATEVALUES'].'</textarea></td></tr>
-           <tr id="tx-dbal-qryfrom"><th>FROM</th><td><input name="tx_dbal[FROM]" value="'.$input['FROM'].'" type="text" size="30" maxsize="100" /></td></tr>
-           <tr id="tx-dbal-qryinto" style="display:none;"><th>INTO</th><td><input name="tx_dbal[INTO]" value="'.$input['INTO'].'" type="text" size="30" maxsize="100" /></td></tr>
-           <tr id="tx-dbal-qrywhere"><th>WHERE</th><td><input name="tx_dbal[WHERE]" value="'.$input['WHERE'].'" type="text" size="30" maxsize="100" /></td></tr>
-           <tr id="tx-dbal-qrygroup"><th>GROUP BY</th><td><input name="tx_dbal[GROUP]" value="'.$input['GROUP'].'" type="text" size="30" maxsize="100" /></td></tr>
-           <tr id="tx-dbal-qryorder"><th>ORDER BY</th><td><input name="tx_dbal[ORDER]" value="'.$input['ORDER'].'" type="text" size="30" maxsize="100" /></td></tr>
-           <tr id="tx-dbal-qrylimit"><th>LIMIT</th><td><input name="tx_dbal[LIMIT]" value="'.$input['LIMIT'].'" type="text" size="30" maxsize="100" /></td></tr>
+           <tr id="tx-dbal-qryupdate" style="display:none;"><td></td><td><input name="tx_dbal[UPDATE]" value="' . $input['UPDATE'] . '" type="text" size="30" maxsize="100" /></td></tr>
+           <tr id="tx-dbal-qryfields"><td></td><td><input name="tx_dbal[FIELDS]" value="' . $input['FIELDS'] . '" type="text" size="30" maxsize="100" /></td></tr>
+           <tr id="tx-dbal-qryinsertvalues" style="display:none;"><td></td><td><textarea name="tx_dbal[INSERTVALUES]" cols="30" rows="4">' . $input['INSERTVALUES'] . '</textarea></td></tr>
+           <tr id="tx-dbal-qryupdatevalues" style="display:none;"><th>SET</th><td><textarea name="tx_dbal[UPDATEVALUES]" cols="30" rows="4">' . $input['UPDATEVALUES'] . '</textarea></td></tr>
+           <tr id="tx-dbal-qryfrom"><th>FROM</th><td><input name="tx_dbal[FROM]" value="' . $input['FROM'] . '" type="text" size="30" maxsize="100" /></td></tr>
+           <tr id="tx-dbal-qryinto" style="display:none;"><th>INTO</th><td><input name="tx_dbal[INTO]" value="' . $input['INTO'] . '" type="text" size="30" maxsize="100" /></td></tr>
+           <tr id="tx-dbal-qrywhere"><th>WHERE</th><td><input name="tx_dbal[WHERE]" value="' . $input['WHERE'] . '" type="text" size="30" maxsize="100" /></td></tr>
+           <tr id="tx-dbal-qrygroup"><th>GROUP BY</th><td><input name="tx_dbal[GROUP]" value="' . $input['GROUP'] . '" type="text" size="30" maxsize="100" /></td></tr>
+           <tr id="tx-dbal-qryorder"><th>ORDER BY</th><td><input name="tx_dbal[ORDER]" value="' . $input['ORDER'] . '" type="text" size="30" maxsize="100" /></td></tr>
+           <tr id="tx-dbal-qrylimit"><th>LIMIT</th><td><input name="tx_dbal[LIMIT]" value="' . $input['LIMIT'] . '" type="text" size="30" maxsize="100" /></td></tr>
                        <tr><td></td><td style="text-align:right;"><input type="submit" value="CHECK" /></td></tr>
                        <script type="text/javascript">
 /*<![CDATA[*/
-updateQryForm(\''.$input['QUERY'].'\');
+updateQryForm(\'' . $input['QUERY'] . '\');
 /*]]>*/
                                </script>
                        ';
@@ -226,42 +223,42 @@ updateQryForm(\''.$input['QUERY'].'\');
                $out .= '<tr id="tx-dbal-result" class="bgColor4"><th>Result:</th><td>';
                switch($input['QUERY']) {
                        case 'SELECT':
-                               $qry = $GLOBALS['TYPO3_DB']->SELECTquery($input['FIELDS'],$input['FROM'],$input['WHERE'],$input['GROUP'],$input['ORDER'],$input['LIMIT']);
+                               $qry = $GLOBALS['TYPO3_DB']->SELECTquery($input['FIELDS'], $input['FROM'], $input['WHERE'], $input['GROUP'], $input['ORDER'], $input['LIMIT']);
                                break;
                        case 'INSERT':
-                               $qry = $GLOBALS['TYPO3_DB']->INSERTquery($input['INTO'],$this->createFieldsValuesArray($input['INSERTVALUES']));
+                               $qry = $GLOBALS['TYPO3_DB']->INSERTquery($input['INTO'], $this->createFieldsValuesArray($input['INSERTVALUES']));
                                break;
                        case 'UPDATE':
-                               $qry = $GLOBALS['TYPO3_DB']->UPDATEquery($input['UPDATE'],$input['WHERE'],$this->createFieldsValuesArray($input['UPDATEVALUES']));
+                               $qry = $GLOBALS['TYPO3_DB']->UPDATEquery($input['UPDATE'], $input['WHERE'], $this->createFieldsValuesArray($input['UPDATEVALUES']));
                                break;
                        case 'DELETE':
-                               $qry = $GLOBALS['TYPO3_DB']->DELETEquery($input['FROM'],$input['WHERE']);
+                               $qry = $GLOBALS['TYPO3_DB']->DELETEquery($input['FROM'], $input['WHERE']);
                                break;
                }
-               $out .= '<pre>'.htmlspecialchars($qry).'</pre></td></tr>';
+               $out .= '<pre>' . htmlspecialchars($qry) . '</pre></td></tr>';
 
                $out .= '
                        <tr class="tableheader bgColor5"><th colspan="2">RAW SQL check</th></tr>
-                       <tr><td colspan="2" style="text-align:right;"><textarea name="tx_dbal[RAWSQL]" cols="60" rows="5">'.$input['RAWSQL'].'</textarea><br /><input type="submit" value="CHECK" /></td></tr>';
-               if(!empty($input['RAWSQL'])) {
+                       <tr><td colspan="2" style="text-align:right;"><textarea name="tx_dbal[RAWSQL]" cols="60" rows="5">' . $input['RAWSQL'] . '</textarea><br /><input type="submit" value="CHECK" /></td></tr>';
+               if (!empty($input['RAWSQL'])) {
                        $out .= '<tr class="bgColor4">';
                        $parseResult = $GLOBALS['TYPO3_DB']->SQLparser->parseSQL($input['RAWSQL']);
-                       if (is_array($parseResult))     {
+                       if (is_array($parseResult)) {
                                $newQuery = $GLOBALS['TYPO3_DB']->SQLparser->compileSQL($parseResult);
                                $testResult = $GLOBALS['TYPO3_DB']->SQLparser->debug_parseSQLpartCompare($input['RAWSQL'], $newQuery);
-                               if (!is_array($testResult))     {
-                                       $out .= '<td colspan="2">'.$newQuery;
+                               if (!is_array($testResult)) {
+                                       $out .= '<td colspan="2">' . $newQuery;
                                } else {
-                                       $out .= '<td colspan="2">'.htmlspecialchars($testResult[0]).'</td></tr>
-                                       <tr><th>Error:</th><td style="border:2px solid #f00;">Input query did not match the parsed and recompiled query exactly (not observing whitespace):<br />'.htmlspecialchars($testResult[1]);
+                                       $out .= '<td colspan="2">' . htmlspecialchars($testResult[0]) . '</td></tr>
+                                       <tr><th>Error:</th><td style="border:2px solid #f00;">Input query did not match the parsed and recompiled query exactly (not observing whitespace):<br />' . htmlspecialchars($testResult[1]);
                                }
                        } else {
-                               $out .= '<th>Result:</th><td style="border:2px solid #f00;">'.$parseResult;
+                               $out .= '<th>Result:</th><td style="border:2px solid #f00;">' . $parseResult;
                        }
                        $out .='</td></tr>';
                }
 
-               $out .='</table></form>';
+               $out .= '</table></form>';
                return $out;
        }
 
@@ -274,11 +271,11 @@ updateQryForm(\''.$input['QUERY'].'\');
         * @param string $in String to parse into key/value array.
         * @return array Array created from the input string.
         */
-       function createFieldsValuesArray($in) {
+       protected function createFieldsValuesArray($in) {
                $ret = array();
-               $in = explode(chr(10),$in);
+               $in = explode(chr(10), $in);
                foreach ($in as $v) {
-                       $fv = explode('=',$v);
+                       $fv = explode('=', $v);
                        $ret[$fv[0]] = $fv[1];
                }
 
@@ -294,9 +291,9 @@ updateQryForm(\''.$input['QUERY'].'\');
         *
         * @return string       HTML output
         */
-       function printCachedInfo()      {
+       protected function printCachedInfo() {
                        // Get cmd:
-               if((string)t3lib_div::_GP('cmd') == 'clear') {
+               if ((string)t3lib_div::_GP('cmd') === 'clear') {
                        $GLOBALS['TYPO3_DB']->clearCachedFieldInfo();
                        $GLOBALS['TYPO3_DB']->cacheFieldInfo();
                }
@@ -304,10 +301,10 @@ updateQryForm(\''.$input['QUERY'].'\');
                $out = '<a name="autoincrement"></a><h2>auto_increment</h2>';
                $out .= '<table border="1" cellspacing="0"><tbody><tr><th>Table</th><th>Field</th></tr>';
                ksort($GLOBALS['TYPO3_DB']->cache_autoIncFields);
-               foreach($GLOBALS['TYPO3_DB']->cache_autoIncFields as $table => $field) {
+               foreach ($GLOBALS['TYPO3_DB']->cache_autoIncFields as $table => $field) {
                        $out .= '<tr>';
-                       $out .= '<td>'.$table.'</td>';
-                       $out .= '<td>'.$field.'</td>';
+                       $out .= '<td>' . $table . '</td>';
+                       $out .= '<td>' . $field . '</td>';
                        $out .= '</tr>';
                }
                $out .= '</tbody></table>';
@@ -316,10 +313,10 @@ updateQryForm(\''.$input['QUERY'].'\');
                $out .= '<a name="primarykeys"></a><h2>Primary keys</h2>';
                $out .= '<table border="1" cellspacing="0"><tbody><tr><th>Table</th><th>Field(s)</th></tr>';
                ksort($GLOBALS['TYPO3_DB']->cache_primaryKeys);
-               foreach($GLOBALS['TYPO3_DB']->cache_primaryKeys as $table => $field) {
+               foreach ($GLOBALS['TYPO3_DB']->cache_primaryKeys as $table => $field) {
                        $out .= '<tr>';
-                       $out .= '<td>'.$table.'</td>';
-                       $out .= '<td>'.$field.'</td>';
+                       $out .= '<td>' . $table . '</td>';
+                       $out .= '<td>' . $field . '</td>';
                        $out .= '</tr>';
                }
                $out .= '</tbody></table>';
@@ -328,15 +325,15 @@ updateQryForm(\''.$input['QUERY'].'\');
                $out .= '<a name="fieldtypes"></a><h2>Field types</h2>';
                $out .= '<table border="1" cellspacing="0"><tbody><tr><th colspan="5">Table</th></tr><tr><th>Field</th><th>Type</th><th><a href="#metatypes">Metatype</a></th><th>NOT NULL</th><th>Default</th></th></tr>';
                ksort($GLOBALS['TYPO3_DB']->cache_fieldType);
-               foreach($GLOBALS['TYPO3_DB']->cache_fieldType as $table => $fields) {
-                       $out .= '<th colspan="5">'.$table.'</th>';
+               foreach ($GLOBALS['TYPO3_DB']->cache_fieldType as $table => $fields) {
+                       $out .= '<th colspan="5">' . $table . '</th>';
                        foreach($fields as $field => $data) {
                                $out .= '<tr>';
-                               $out .= '<td>'.$field.'</td>';
-                               $out .= '<td>'.$data['type'].'</td>';
-                               $out .= '<td>'.$data['metaType'].'</td>';
-                               $out .= '<td>'.($data['notnull']?'NOT NULL':'').'</td>';
-                               $out .= '<td>'.$data['default'].'</td>';
+                               $out .= '<td>' . $field . '</td>';
+                               $out .= '<td>' . $data['type'] . '</td>';
+                               $out .= '<td>' . $data['metaType'] . '</td>';
+                               $out .= '<td>' . ($data['notnull'] ? 'NOT NULL' : '') . '</td>';
+                               $out .= '<td>' . $data['default'] . '</td>';
                                $out .= '</tr>';
                        }
                }
@@ -368,7 +365,7 @@ updateQryForm(\''.$input['QUERY'].'\');
                $menu = '<a href="index.php?cmd=clear">CLEAR DATA</a><hr />';
                $menu .= '<a href="#autoincrement">auto_increment</a> | <a href="#primarykeys">Primary keys</a> | <a href="#fieldtypes">Field types</a> | <a href="#metatypes">Metatype explanation</a><hr />';
 
-               return $menu.$out;
+               return $menu . $out;
        }
 
        /**
@@ -378,21 +375,21 @@ updateQryForm(\''.$input['QUERY'].'\');
         *
         * @return      string HTML content
         */
-       function printLogMgm()  {
+       protected function printLogMgm() {
 
                        // Disable debugging in any case...
                $GLOBALS['TYPO3_DB']->debug = FALSE;
 
                        // Get cmd:
                $cmd = (string)t3lib_div::_GP('cmd');
-               switch($cmd)    {
+               switch ($cmd) {
                        case 'flush':
-                               $res = $GLOBALS['TYPO3_DB']->exec_DELETEquery('tx_dbal_debuglog','');
-                               $res = $GLOBALS['TYPO3_DB']->exec_DELETEquery('tx_dbal_debuglog_where','');
+                               $res = $GLOBALS['TYPO3_DB']->exec_DELETEquery('tx_dbal_debuglog', '');
+                               $res = $GLOBALS['TYPO3_DB']->exec_DELETEquery('tx_dbal_debuglog_where', '');
                                $outStr = 'Log FLUSHED!';
                                break;
                        case 'joins':
-                               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('table_join,exec_time,query,script','tx_dbal_debuglog','table_join!=\'\'', 'table_join,script,exec_time,query');
+                               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('table_join,exec_time,query,script', 'tx_dbal_debuglog', 'table_join!=\'\'', 'table_join,script,exec_time,query');
 
                                        // Init vars in which to pick up the query result:
                                $tableIndex = array();
@@ -405,14 +402,14 @@ updateQryForm(\''.$input['QUERY'].'\');
                                                <td>Query</td>
                                        </tr>';
 
-                               while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))       {
+                               while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
                                        $tableArray = $GLOBALS['TYPO3_DB']->SQLparser->parseFromTables($row['table_join']);
 
                                                // Create table name index:
-                                       foreach($tableArray as $a)      {
-                                               foreach($tableArray as $b)      {
-                                                       if ($b['table']!=$a['table'])   {
-                                                               $tableIndex[$a['table']][$b['table']]=1;
+                                       foreach ($tableArray as $a) {
+                                               foreach ($tableArray as $b) {
+                                                       if ($b['table'] != $a['table']) {
+                                                               $tableIndex[$a['table']][$b['table']] = 1;
                                                        }
                                                }
                                        }
@@ -420,37 +417,37 @@ updateQryForm(\''.$input['QUERY'].'\');
                                                // Create output row
                                        $tRows[] = '
                                                <tr>
-                                                       <td>'.htmlspecialchars($row['exec_time']).'</td>
-                                                       <td>'.htmlspecialchars($row['table_join']).'</td>
-                                                       <td>'.htmlspecialchars($row['script']).'</td>
-                                                       <td>'.htmlspecialchars($row['query']).'</td>
+                                                       <td>' . htmlspecialchars($row['exec_time']) . '</td>
+                                                       <td>' . htmlspecialchars($row['table_join']) . '</td>
+                                                       <td>' . htmlspecialchars($row['script']) . '</td>
+                                                       <td>' . htmlspecialchars($row['query']) . '</td>
                                                </tr>';
                                }
 
                                        // Printing direct joins:
-                               $outStr.= '<h4>Direct joins:</h4>'.t3lib_div::view_array($tableIndex);
+                               $outStr .= '<h4>Direct joins:</h4>' . t3lib_div::view_array($tableIndex);
 
 
                                        // Printing total dependencies:
-                               foreach($tableIndex as $priTable => $a) {
-                                       foreach($tableIndex as $tableN => $v)   {
-                                               foreach($v as $tableP => $vv)   {
-                                                       if ($tableP == $priTable)       {
+                               foreach ($tableIndex as $priTable => $a) {
+                                       foreach ($tableIndex as $tableN => $v) {
+                                               foreach ($v as $tableP => $vv) {
+                                                       if ($tableP == $priTable) {
                                                                $tableIndex[$priTable] = array_merge($v, $a);
                                                        }
                                                }
                                        }
                                }
-                               $outStr.= '<h4>Total dependencies:</h4>'.t3lib_div::view_array($tableIndex);
+                               $outStr .= '<h4>Total dependencies:</h4>' . t3lib_div::view_array($tableIndex);
 
                                        // Printing data rows:
-                               $outStr.= '
-                                       <table border="1" cellspacing="0">'.implode('',$tRows).'
+                               $outStr .= '
+                                       <table border="1" cellspacing="0">' . implode('', $tRows) . '
                                        </table>';
                                break;
                        case 'errors':
 
-                               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('serdata,exec_time,query,script','tx_dbal_debuglog','errorFlag>0','','tstamp DESC');
+                               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('serdata,exec_time,query,script', 'tx_dbal_debuglog', 'errorFlag>0', '', 'tstamp DESC');
 
                                // Init vars in which to pick up the query result:
                                $tRows = array();
@@ -462,40 +459,40 @@ updateQryForm(\''.$input['QUERY'].'\');
                                                <td>Query</td>
                                        </tr>';
 
-                               while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))       {
+                               while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
                                        // Create output row
                                        $tRows[] = '
                                                <tr>
-                                                       <td>'.htmlspecialchars($row['exec_time']).'</td>
-                                                       <td>'.t3lib_div::view_array(unserialize($row['serdata'])).'</td>
-                                                       <td>'.htmlspecialchars($row['script']).'</td>
-                                                       <td>'.htmlspecialchars($row['query']).'</td>
+                                                       <td>' . htmlspecialchars($row['exec_time']) . '</td>
+                                                       <td>' . t3lib_div::view_array(unserialize($row['serdata'])) . '</td>
+                                                       <td>' . htmlspecialchars($row['script']) . '</td>
+                                                       <td>' . htmlspecialchars($row['query']) . '</td>
                                                </tr>';
                                }
 
                                // Printing data rows:
-                               $outStr.= '
-                                       <table border="1" cellspacing="0">'.implode('',$tRows).'
+                               $outStr .= '
+                                       <table border="1" cellspacing="0">' . implode('', $tRows) . '
                                        </table>';
                                break;
                        case 'parsing':
-                               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('query,serdata','tx_dbal_debuglog','errorFlag&2=2');
+                               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('query,serdata', 'tx_dbal_debuglog', 'errorFlag&2=2');
                                $tRows = array();
-                               while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))       {
+                               while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
                                        // Create output row
                                        $tRows[] = '
                                                <tr>
-                                                       <td>'.htmlspecialchars($row['query']).'</td>
+                                                       <td>' . htmlspecialchars($row['query']) . '</td>
                                                </tr>';
                                }
 
                                // Printing data rows:
-                               $outStr.= '
-                                       <table border="1" cellspacing="0">'.implode('',$tRows).'
+                               $outStr .= '
+                                       <table border="1" cellspacing="0">' . implode('', $tRows) . '
                                        </table>';
                                break;
                        case 'where':
-                               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('tstamp,script,tablename,whereclause','tx_dbal_debuglog_where','','','tstamp DESC');
+                               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('tstamp,script,tablename,whereclause', 'tx_dbal_debuglog_where', '', '', 'tstamp DESC');
                                $tRows = array();
                                $tRows[] = '
                                        <tr>
@@ -504,27 +501,27 @@ updateQryForm(\''.$input['QUERY'].'\');
                                                <td>Table</td>
                                                <td>WHERE clause</td>
                                        </tr>';
-                               while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))       {
+                               while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
                                        $tRows[] = '
                                                <tr>
-                                                       <td>'.t3lib_BEfunc::datetime($row['tstamp']).'</td>
-                                                       <td>'.htmlspecialchars($row['script']).'</td>
-                                                       <td>'.htmlspecialchars($row['tablename']).'</td>
-                                                               <td>'.str_replace(array('\'\'','""','IS NULL','IS NOT NULL'), array('<span style="background-color:#ff0000;color:#ffffff;padding:2px;font-weight:bold;">\'\'</span>','<span style="background-color:#ff0000;color:#ffffff;padding:2px;font-weight:bold;">""</span>','<span style="background-color:#00ff00;color:#ffffff;padding:2px;font-weight:bold;">IS NULL</span>','<span style="background-color:#00ff00;color:#ffffff;padding:2px;font-weight:bold;">IS NOT NULL</span>'), htmlspecialchars($row['whereclause'])).'</td>
+                                                       <td>' . t3lib_BEfunc::datetime($row['tstamp']) . '</td>
+                                                       <td>' . htmlspecialchars($row['script']) . '</td>
+                                                       <td>' . htmlspecialchars($row['tablename']) . '</td>
+                                                               <td>' . str_replace(array('\'\'', '""', 'IS NULL', 'IS NOT NULL'), array('<span style="background-color:#ff0000;color:#ffffff;padding:2px;font-weight:bold;">\'\'</span>', '<span style="background-color:#ff0000;color:#ffffff;padding:2px;font-weight:bold;">""</span>', '<span style="background-color:#00ff00;color:#ffffff;padding:2px;font-weight:bold;">IS NULL</span>', '<span style="background-color:#00ff00;color:#ffffff;padding:2px;font-weight:bold;">IS NOT NULL</span>'), htmlspecialchars($row['whereclause'])) . '</td>
                                                </tr>';
                                }
 
                                $outStr = '
-                                       <table border="1" cellspacing="0">'.implode('',$tRows).'
+                                       <table border="1" cellspacing="0">' . implode('', $tRows) . '
                                        </table>';
                                break;
                        default:
 
-                               // Look for request to view specific script exec:
+                                       // Look for request to view specific script exec:
                                $specTime = t3lib_div::_GP('specTime');
 
-                               if ($specTime)  {
-                                       $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('exec_time,errorFlag,table_join,serdata,query','tx_dbal_debuglog','tstamp='.(int)$specTime);
+                               if ($specTime) {
+                                       $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('exec_time,errorFlag,table_join,serdata,query', 'tx_dbal_debuglog', 'tstamp=' . (int)$specTime);
                                        $tRows = array();
                                        $tRows[] = '
                                                <tr>
@@ -534,18 +531,18 @@ updateQryForm(\''.$input['QUERY'].'\');
                                                        <td>Data</td>
                                                        <td>Query</td>
                                                </tr>';
-                                       while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
+                                       while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
                                                $tRows[] = '
                                                        <tr>
-                                                               <td>'.htmlspecialchars($row['exec_time']).'</td>
-                                                               <td>'.($row['errorFlag'] ? 1 : 0).'</td>
-                                                               <td>'.htmlspecialchars($row['table_join']).'</td>
-                                                               <td>'.t3lib_div::view_array(unserialize($row['serdata'])).'</td>
-                                                               <td>'.str_replace(array('\'\'','""','IS NULL','IS NOT NULL'), array('<span style="background-color:#ff0000;color:#ffffff;padding:2px;font-weight:bold;">\'\'</span>','<span style="background-color:#ff0000;color:#ffffff;padding:2px;font-weight:bold;">""</span>','<span style="background-color:#00ff00;color:#ffffff;padding:2px;font-weight:bold;">IS NULL</span>','<span style="background-color:#00ff00;color:#ffffff;padding:2px;font-weight:bold;">IS NOT NULL</span>'), htmlspecialchars($row['query'])).'</td>
+                                                               <td>' . htmlspecialchars($row['exec_time']) . '</td>
+                                                               <td>' . ($row['errorFlag'] ? 1 : 0) . '</td>
+                                                               <td>' . htmlspecialchars($row['table_join']) . '</td>
+                                                               <td>' . t3lib_div::view_array(unserialize($row['serdata'])) . '</td>
+                                                               <td>' . str_replace(array('\'\'', '""', 'IS NULL', 'IS NOT NULL'), array('<span style="background-color:#ff0000;color:#ffffff;padding:2px;font-weight:bold;">\'\'</span>', '<span style="background-color:#ff0000;color:#ffffff;padding:2px;font-weight:bold;">""</span>', '<span style="background-color:#00ff00;color:#ffffff;padding:2px;font-weight:bold;">IS NULL</span>', '<span style="background-color:#00ff00;color:#ffffff;padding:2px;font-weight:bold;">IS NOT NULL</span>'), htmlspecialchars($row['query'])) . '</td>
                                                        </tr>';
                                        }
                                } else {
-                                       $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('tstamp,script, SUM(exec_time) as calc_sum, count(*) AS qrycount, MAX(errorFlag) as error','tx_dbal_debuglog','','tstamp,script','tstamp DESC');
+                                       $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('tstamp,script, SUM(exec_time) as calc_sum, count(*) AS qrycount, MAX(errorFlag) as error', 'tx_dbal_debuglog', '', 'tstamp,script', 'tstamp DESC');
                                        $tRows = array();
                                        $tRows[] = '
                                                <tr>
@@ -555,19 +552,19 @@ updateQryForm(\''.$input['QUERY'].'\');
                                                        <td>Time (ms)</td>
                                                        <td>Script</td>
                                                </tr>';
-                                       while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))       {
+                                       while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
                                                $tRows[] = '
                                                        <tr>
-                                                               <td>'.t3lib_BEfunc::datetime($row['tstamp']).'</td>
-                                                               <td>'.htmlspecialchars($row['qrycount']).'</td>
-                                                               <td>'.($row['error'] ? '<strong style="color:#f00">ERR</strong>' : '').'</td>
-                                                               <td>'.htmlspecialchars($row['calc_sum']).'</td>
-                                                               <td><a href="index.php?specTime='.intval($row['tstamp']).'">'.htmlspecialchars($row['script']).'</a></td>
+                                                               <td>' . t3lib_BEfunc::datetime($row['tstamp']) . '</td>
+                                                               <td>' . htmlspecialchars($row['qrycount']) . '</td>
+                                                               <td>' . ($row['error'] ? '<strong style="color:#f00">ERR</strong>' : '') . '</td>
+                                                               <td>' . htmlspecialchars($row['calc_sum']) . '</td>
+                                                               <td><a href="index.php?specTime=' . intval($row['tstamp']) . '">' . htmlspecialchars($row['script']) . '</a></td>
                                                        </tr>';
                                        }
                                }
                                $outStr = '
-                                       <table border="1" cellspacing="0">'.implode('',$tRows).'
+                                       <table border="1" cellspacing="0">' . implode('', $tRows) . '
                                        </table>';
 
                                break;
@@ -581,14 +578,14 @@ updateQryForm(\''.$input['QUERY'].'\');
                                        <a href="index.php">LOG</a> -
                                        <a href="index.php?cmd=where">WHERE</a> -
 
-                                       <a href="'.htmlspecialchars(t3lib_div::linkThisScript()).'" target="tx_debuglog">[New window]</a>
+                                       <a href="' . htmlspecialchars(t3lib_div::linkThisScript()) . '" target="tx_debuglog">[New window]</a>
                                        <hr />
                ';
-               return $menu.$outStr;
+               return $menu . $outStr;
        }
 }
 
-if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/dbal/mod1/index.php'])        {
+if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/dbal/mod1/index.php']) {
        include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/dbal/mod1/index.php']);
 }