[TASK] CGL violations DoubleQuoteUsageNotRequired in indexed_search/
authorRoland Waldner <most.wanted@gmx.at>
Fri, 1 Jun 2012 10:58:44 +0000 (12:58 +0200)
committerGeorg Ringer <mail@ringerge.org>
Fri, 1 Jun 2012 13:19:49 +0000 (15:19 +0200)
There are violations against the CGL rule "DoubleQuoteUsageNotRequired" in
/typo3/typo3/sysext/indexed_search/.

These will be reduced.

Change-Id: I61072f26f9faa63065f6e92929d05d354a7f2c44
Resolves: #37675
Releases: 6.0
Reviewed-on: http://review.typo3.org/11788
Reviewed-by: Georg Ringer
Tested-by: Georg Ringer
typo3/sysext/indexed_search/class.crawler.php
typo3/sysext/indexed_search/ext_tables.php
typo3/sysext/indexed_search/mod/index.php

index 30b0dc3..ee0e12b 100755 (executable)
@@ -709,12 +709,12 @@ class tx_indexedsearch_crawler {
        function getUidRootLineForClosestTemplate($id) {
                global $TYPO3_CONF_VARS;
 
-               $tmpl = t3lib_div::makeInstance("t3lib_tsparser_ext");
+               $tmpl = t3lib_div::makeInstance('t3lib_tsparser_ext');
                $tmpl->tt_track = 0;    // Do not log time-performance information
                $tmpl->init();
 
                                // Gets the rootLine
-               $sys_page = t3lib_div::makeInstance("t3lib_pageSelect");
+               $sys_page = t3lib_div::makeInstance('t3lib_pageSelect');
                $rootLine = $sys_page->getRootLine($id);
                $tmpl->runThroughTemplates($rootLine,0);        // This generates the constants/config + hierarchy info for the template.
 
index 44ab7cc..879679a 100755 (executable)
@@ -27,10 +27,10 @@ if (TYPO3_MODE=='BE')    {
                'LLL:EXT:indexed_search/locallang.php:mod_indexed_search'
        );
        t3lib_extMgm::insertModuleFunction(
-               "web_info",
-               "tx_indexedsearch_modfunc2",
-               t3lib_extMgm::extPath($_EXTKEY)."modfunc2/class.tx_indexedsearch_modfunc2.php",
-               "LLL:EXT:indexed_search/locallang.php:mod2_indexed_search"
+               'web_info',
+               'tx_indexedsearch_modfunc2',
+               t3lib_extMgm::extPath($_EXTKEY).'modfunc2/class.tx_indexedsearch_modfunc2.php',
+               'LLL:EXT:indexed_search/locallang.php:mod2_indexed_search'
        );
 }
 
index 36f26ac..9a1391d 100755 (executable)
@@ -201,7 +201,7 @@ class SC_mod_tools_isearch_index {
         * @return      [type]          ...
         */
        function getRecordsNumbers() {
-               $tables=explode(",","index_phash,index_words,index_rel,index_grlist,index_section,index_fulltext");
+               $tables=explode(',', 'index_phash,index_words,index_rel,index_grlist,index_section,index_fulltext');
                $recList=array();
                foreach ($tables as $t) {
                        $recList[] = array(
@@ -219,7 +219,7 @@ class SC_mod_tools_isearch_index {
         * @return      [type]          ...
         */
        function tableHead($str) {
-               return "<strong>".$str.":&nbsp;&nbsp;&nbsp;</strong>";
+               return '<strong>' . $str . ':&nbsp;&nbsp;&nbsp;</strong>';
        }
 
        /**
@@ -236,11 +236,11 @@ class SC_mod_tools_isearch_index {
                while($row = $GLOBALS['TYPO3_DB']->sql_fetch_row($res)) {
                        $items[] = $row;
                }
-               $recList[] = array($this->tableHead("TYPO3 pages"), count($items));
+               $recList[] = array($this->tableHead('TYPO3 pages'), count($items));
 
                        // TYPO3 pages:
                $recList[] = array(
-                       $this->tableHead("TYPO3 pages, raw"),
+                       $this->tableHead('TYPO3 pages, raw'),
                        $GLOBALS['TYPO3_DB']->exec_SELECTcountRows('phash', 'index_phash', 'data_page_id<>0')
                );
 
@@ -248,11 +248,11 @@ class SC_mod_tools_isearch_index {
                $items = array();
                $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('count(*),phash', 'index_phash', 'data_filename<>\'\'', 'phash_grouping');
                $row = $GLOBALS['TYPO3_DB']->sql_fetch_row($res);
-               $recList[] = array($this->tableHead("External files"), $row[0]);
+               $recList[] = array($this->tableHead('External files'), $row[0]);
 
                        // External files
                $recList[] = array(
-                       $this->tableHead("External files, raw"),
+                       $this->tableHead('External files, raw'),
                        $GLOBALS['TYPO3_DB']->exec_SELECTcountRows('phash', 'index_phash', 'data_filename<>\'\'')
                );
 
@@ -266,61 +266,61 @@ class SC_mod_tools_isearch_index {
         */
        function getPhashT3pages() {
                $recList[]=array(
-                       $this->tableHead("id/type"),
-                       $this->tableHead("Title"),
-                       $this->tableHead("Size"),
-                       $this->tableHead("Words"),
-                       $this->tableHead("mtime"),
-                       $this->tableHead("Indexed"),
-                       $this->tableHead("Updated"),
-                       $this->tableHead("Parsetime"),
-                       $this->tableHead("#sec/gr/full"),
-                       $this->tableHead("#sub"),
-                       $this->tableHead("Lang"),
-                       $this->tableHead("cHash"),
-                       $this->tableHead("phash")
+                       $this->tableHead('id/type'),
+                       $this->tableHead('Title'),
+                       $this->tableHead('Size'),
+                       $this->tableHead('Words'),
+                       $this->tableHead('mtime'),
+                       $this->tableHead('Indexed'),
+                       $this->tableHead('Updated'),
+                       $this->tableHead('Parsetime'),
+                       $this->tableHead('#sec/gr/full'),
+                       $this->tableHead('#sub'),
+                       $this->tableHead('Lang'),
+                       $this->tableHead('cHash'),
+                       $this->tableHead('phash')
                );
 
                        // TYPO3 pages, unique
                $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('count(*) AS pcount,index_phash.*', 'index_phash', 'data_page_id<>0', 'phash_grouping,phash,cHashParams,data_filename,data_page_id,data_page_reg1,data_page_type,data_page_mp,gr_list,item_type,item_title,item_description,item_mtime,tstamp,item_size,contentHash,crdate,parsetime,sys_language_uid,item_crdate,externalUrl,recordUid,freeIndexUid,freeIndexSetId', 'data_page_id');
                while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
 
-                       $cHash = count(unserialize($row["cHashParams"])) ? $this->formatCHash(unserialize($row["cHashParams"])) : "";
-                       $grListRec = $this->getGrlistRecord($row["phash"]);
+                       $cHash = count(unserialize($row['cHashParams'])) ? $this->formatCHash(unserialize($row['cHashParams'])) : '';
+                       $grListRec = $this->getGrlistRecord($row['phash']);
                        $recList[] = array(
-                               $row["data_page_id"].($row["data_page_type"]?"/".$row["data_page_type"]:""),
-                               htmlentities(t3lib_div::fixed_lgd_cs($row["item_title"],30)),
-                               t3lib_div::formatSize($row["item_size"]),
-                               $this->getNumberOfWords($row["phash"]),
-                               t3lib_BEfunc::datetime($row["item_mtime"]),
-                               t3lib_BEfunc::datetime($row["crdate"]),
-                               ($row["tstamp"]!=$row["crdate"] ? t3lib_BEfunc::datetime($row["tstamp"]) : ""),
-                               $row["parsetime"],
-                               $this->getNumberOfSections($row["phash"])."/".$grListRec[0]["pcount"]."/".$this->getNumberOfFulltext($row["phash"]),
-                               $row["pcount"]."/".$this->formatFeGroup($grListRec),
-                               $row["sys_language_uid"],
+                               $row['data_page_id'].($row['data_page_type'] ? '/'.$row['data_page_type'] : ''),
+                               htmlentities(t3lib_div::fixed_lgd_cs($row['item_title'], 30)),
+                               t3lib_div::formatSize($row['item_size']),
+                               $this->getNumberOfWords($row['phash']),
+                               t3lib_BEfunc::datetime($row['item_mtime']),
+                               t3lib_BEfunc::datetime($row['crdate']),
+                               ($row['tstamp']!=$row['crdate'] ? t3lib_BEfunc::datetime($row['tstamp']) : ''),
+                               $row['parsetime'],
+                               $this->getNumberOfSections($row['phash']).'/'.$grListRec[0]['pcount'].'/'.$this->getNumberOfFulltext($row['phash']),
+                               $row['pcount'].'/'.$this->formatFeGroup($grListRec),
+                               $row['sys_language_uid'],
                                $cHash,
-                               $row["phash"]
+                               $row['phash']
                        );
 
-                       if ($row["pcount"]>1) {
+                       if ($row['pcount']>1) {
                                $res2 = $GLOBALS['TYPO3_DB']->exec_SELECTquery('index_phash.*', 'index_phash', 'phash_grouping='.intval($row['phash_grouping']).' AND phash<>'.intval($row['phash']));
                                while($row2 = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res2)) {
-                                       $grListRec = $this->getGrlistRecord($row2["phash"]);
+                                       $grListRec = $this->getGrlistRecord($row2['phash']);
                                        $recList[] = array(
-                                               "",
-                                               "",
-                                               t3lib_div::formatSize($row2["item_size"]),
-                                               $this->getNumberOfWords($row2["phash"]),
-                                               t3lib_BEfunc::datetime($row2["item_mtime"]),
-                                               t3lib_BEfunc::datetime($row2["crdate"]),
-                                               ($row2["tstamp"]!=$row2["crdate"] ? t3lib_BEfunc::datetime($row2["tstamp"]) : ""),
-                                               $row2["parsetime"],
-                                               $this->getNumberOfSections($row2["phash"])."/".$grListRec[0]["pcount"]."/".$this->getNumberOfFulltext($row2["phash"]),
-                                               "-/".$this->formatFeGroup($grListRec),
-                                               "",
-                                               "",
-                                               $row2["phash"]
+                                               '',
+                                               '',
+                                               t3lib_div::formatSize($row2['item_size']),
+                                               $this->getNumberOfWords($row2['phash']),
+                                               t3lib_BEfunc::datetime($row2['item_mtime']),
+                                               t3lib_BEfunc::datetime($row2['crdate']),
+                                               ($row2['tstamp']!=$row2['crdate'] ? t3lib_BEfunc::datetime($row2['tstamp']) : ''),
+                                               $row2['parsetime'],
+                                               $this->getNumberOfSections($row2['phash']).'/'.$grListRec[0]['pcount'].'/'.$this->getNumberOfFulltext($row2['phash']),
+                                               '-/'.$this->formatFeGroup($grListRec),
+                                               '',
+                                               '',
+                                               $row2['phash']
                                        );
                                }
                        }
@@ -335,59 +335,59 @@ class SC_mod_tools_isearch_index {
         */
        function getPhashExternalDocs() {
                $recList[]=array(
-                       $this->tableHead("Filename"),
-                       $this->tableHead("Size"),
-                       $this->tableHead("Words"),
-                       $this->tableHead("mtime"),
-                       $this->tableHead("Indexed"),
-                       $this->tableHead("Updated"),
-                       $this->tableHead("Parsetime"),
-                       $this->tableHead("#sec/gr/full"),
-                       $this->tableHead("#sub"),
-                       $this->tableHead("cHash"),
-                       $this->tableHead("phash"),
-                       $this->tableHead("Path")
+                       $this->tableHead('Filename'),
+                       $this->tableHead('Size'),
+                       $this->tableHead('Words'),
+                       $this->tableHead('mtime'),
+                       $this->tableHead('Indexed'),
+                       $this->tableHead('Updated'),
+                       $this->tableHead('Parsetime'),
+                       $this->tableHead('#sec/gr/full'),
+                       $this->tableHead('#sub'),
+                       $this->tableHead('cHash'),
+                       $this->tableHead('phash'),
+                       $this->tableHead('Path')
                );
 
                        // TYPO3 pages, unique
                $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('count(*) AS pcount,index_phash.*', 'index_phash', 'item_type<>\'0\'', 'phash_grouping,phash,cHashParams,data_filename,data_page_id,data_page_reg1,data_page_type,data_page_mp,gr_list,item_type,item_title,item_description,item_mtime,tstamp,item_size,contentHash,crdate,parsetime,sys_language_uid,item_crdate,externalUrl,recordUid,freeIndexUid,freeIndexSetId', 'item_type');
                while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
 
-                       $cHash = count(unserialize($row["cHashParams"])) ? $this->formatCHash(unserialize($row["cHashParams"])) : "";
-                       $grListRec = $this->getGrlistRecord($row["phash"]);
+                       $cHash = count(unserialize($row['cHashParams'])) ? $this->formatCHash(unserialize($row['cHashParams'])) : '';
+                       $grListRec = $this->getGrlistRecord($row['phash']);
                        $recList[]=array(
-                               htmlentities(t3lib_div::fixed_lgd_cs($row["item_title"],30)),
-                               t3lib_div::formatSize($row["item_size"]),
-                               $this->getNumberOfWords($row["phash"]),
-                               t3lib_BEfunc::datetime($row["item_mtime"]),
-                               t3lib_BEfunc::datetime($row["crdate"]),
-                               ($row["tstamp"]!=$row["crdate"] ? t3lib_BEfunc::datetime($row["tstamp"]) : ""),
+                               htmlentities(t3lib_div::fixed_lgd_cs($row['item_title'], 30)),
+                               t3lib_div::formatSize($row['item_size']),
+                               $this->getNumberOfWords($row['phash']),
+                               t3lib_BEfunc::datetime($row['item_mtime']),
+                               t3lib_BEfunc::datetime($row['crdate']),
+                               ($row['tstamp']!=$row['crdate'] ? t3lib_BEfunc::datetime($row['tstamp']) : ''),
                                $row["parsetime"],
-                               $this->getNumberOfSections($row["phash"])."/".$grListRec[0]["pcount"]."/".$this->getNumberOfFulltext($row["phash"]),
-                               $row["pcount"],
+                               $this->getNumberOfSections($row['phash']).'/'.$grListRec[0]['pcount'].'/'.$this->getNumberOfFulltext($row['phash']),
+                               $row['pcount'],
                                $cHash,
-                               $row["phash"],
-                               htmlentities(t3lib_div::fixed_lgd_cs($row["data_filename"],100))
+                               $row['phash'],
+                               htmlentities(t3lib_div::fixed_lgd_cs($row['data_filename'], 100))
                        );
 
-                       if ($row["pcount"]>1) {
+                       if ($row['pcount']>1) {
                                $res2 = $GLOBALS['TYPO3_DB']->exec_SELECTquery('index_phash.*', 'index_phash', 'phash_grouping='.intval($row['phash_grouping']).' AND phash<>'.intval($row['phash']));
                                while($row2 = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res2)) {
-                                       $cHash = count(unserialize($row2["cHashParams"])) ? $this->formatCHash(unserialize($row2["cHashParams"])) : "";
-                                       $grListRec = $this->getGrlistRecord($row2["phash"]);
+                                       $cHash = count(unserialize($row2['cHashParams'])) ? $this->formatCHash(unserialize($row2['cHashParams'])) : '';
+                                       $grListRec = $this->getGrlistRecord($row2['phash']);
                                        $recList[]=array(
-                                               "",
-                                               "",
-                                               $this->getNumberOfWords($row2["phash"]),
-                                               "",
-                                               t3lib_BEfunc::datetime($row2["crdate"]),
-                                               ($row2["tstamp"]!=$row2["crdate"] ? t3lib_BEfunc::datetime($row2["tstamp"]) : ""),
-                                               $row2["parsetime"],
-                                               $this->getNumberOfSections($row2["phash"])."/".$grListRec[0]["pcount"]."/".$this->getNumberOfFulltext($row2["phash"]),
-                                               "",
+                                               '',
+                                               '',
+                                               $this->getNumberOfWords($row2['phash']),
+                                               '',
+                                               t3lib_BEfunc::datetime($row2['crdate']),
+                                               ($row2['tstamp']!=$row2['crdate'] ? t3lib_BEfunc::datetime($row2['tstamp']) : ''),
+                                               $row2['parsetime'],
+                                               $this->getNumberOfSections($row2['phash']).'/'.$grListRec[0]['pcount'].'/'.$this->getNumberOfFulltext($row2['phash']),
+                                               '',
                                                $cHash,
-                                               $row2["phash"],
-                                               ""
+                                               $row2['phash'],
+                                               ''
                                        );
                                }
                        }
@@ -404,10 +404,10 @@ class SC_mod_tools_isearch_index {
        function formatFeGroup($fegroup_recs) {
                $str = array();
                foreach ($fegroup_recs as $row) {
-                       $str[] = $row["gr_list"]=="0,-1" ? "NL" : $row["gr_list"];
+                       $str[] = $row['gr_list']=='0,-1' ? 'NL' : $row['gr_list'];
                }
                arsort($str);
-               return implode("|",$str);
+               return implode('|', $str);
        }
 
        /**
@@ -482,11 +482,11 @@ class SC_mod_tools_isearch_index {
 
                // Types:
                $Itypes = array(
-                       "html" => 1,
-                       "htm" => 1,
-                       "pdf" => 2,
-                       "doc" => 3,
-                       "txt" => 4
+                       'html' => 1,
+                       'htm' => 1,
+                       'pdf' => 2,
+                       'doc' => 3,
+                       'txt' => 4
                );
 
                $revTypes=array_flip($Itypes);
@@ -495,7 +495,7 @@ class SC_mod_tools_isearch_index {
                $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('count(*),item_type', 'index_phash', '', 'item_type', 'item_type');
                while($row = $GLOBALS['TYPO3_DB']->sql_fetch_row($res)) {
                        $iT = $row[1];
-                       $recList[] = array($this->tableHead($revTypes[$iT] . ' (' . $iT . ')'), $this->countUniqueTypes($iT)."/".$row[0]);
+                       $recList[] = array($this->tableHead($revTypes[$iT] . ' (' . $iT . ')'), $this->countUniqueTypes($iT).'/'.$row[0]);
                }
 
                return $recList;
@@ -519,7 +519,7 @@ class SC_mod_tools_isearch_index {
 }
 
 // Make instance:
-$SOBE = t3lib_div::makeInstance("SC_mod_tools_isearch_index");
+$SOBE = t3lib_div::makeInstance('SC_mod_tools_isearch_index');
 $SOBE->init();
 $SOBE->main();
 $SOBE->printContent();