Fixed bug #16445: Performance Tuning: Replace exec_SELECTgetRows with exec_SELECTgetS...
authorChristian Kuhn <lolli@schwarzbu.ch>
Fri, 26 Nov 2010 18:07:50 +0000 (18:07 +0000)
committerChristian Kuhn <lolli@schwarzbu.ch>
Fri, 26 Nov 2010 18:07:50 +0000 (18:07 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@9652 709f56b5-9817-0410-a4d7-c38de5d9e867

24 files changed:
ChangeLog
t3lib/cache/backend/class.t3lib_cache_backend_dbbackend.php
t3lib/class.t3lib_befunc.php
t3lib/class.t3lib_page.php
t3lib/class.t3lib_refindex.php
t3lib/class.t3lib_userauthgroup.php
t3lib/tree/tca/class.t3lib_tree_tca_databasetreedataprovider.php
tests/t3lib/cache/backend/t3lib_cache_backend_dbbackendTest.php
typo3/alt_doc.php
typo3/class.db_list.inc
typo3/sysext/cms/class.tx_cms_be_layout.php
typo3/sysext/cms/layout/class.tx_cms_layout.php
typo3/sysext/cms/tslib/class.tslib_content.php
typo3/sysext/cms/tslib/class.tslib_fe.php
typo3/sysext/em/classes/database/class.tx_em_database.php
typo3/sysext/impexp/app/index.php
typo3/sysext/indexed_search/class.crawler.php
typo3/sysext/indexed_search/modfunc1/class.tx_indexedsearch_modfunc1.php
typo3/sysext/indexed_search/pi/class.tx_indexedsearch.php
typo3/sysext/openid/sv1/class.tx_openid_store.php
typo3/sysext/openid/sv1/class.tx_openid_sv1.php
typo3/sysext/rsaauth/sv1/storage/class.tx_rsaauth_split_storage.php
typo3/sysext/version/cm1/index.php
typo3/sysext/version/ws/class.wslib_gui.php

index bdee1ce..2b7c2e9 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -9,6 +9,7 @@
 
 2010-11-26  Christian Kuhn  <lolli@schwarzbu.ch>
 
+       * Fixed bug #16445: Performance Tuning: Replace exec_SELECTgetRows with exec_SELECTgetSingleRow whenever a single record is expected (Thanks to Jo Hasenau)
        * Fixed bug #16317: [scheduler] Valid values generated from cron command does not contain integers only (Thanks to Marcus Krause)
 
 2010-11-25  Christian Kuhn  <lolli@schwarzbu.ch>
index 639d9b6..7fd434a 100644 (file)
@@ -171,15 +171,15 @@ class t3lib_cache_backend_DbBackend extends t3lib_cache_backend_AbstractBackend
        public function get($entryIdentifier) {
                $cacheEntry = false;
 
-               $cacheEntries = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
+               $cacheEntry = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow(
                        'content',
                        $this->cacheTable,
                        'identifier = ' . $GLOBALS['TYPO3_DB']->fullQuoteStr($entryIdentifier, $this->cacheTable) . ' '
                        . 'AND (crdate + lifetime >= ' . $GLOBALS['EXEC_TIME'] . ' OR lifetime = 0)'
                );
 
-               if (count($cacheEntries) == 1) {
-                       $cacheEntry = $cacheEntries[0]['content'];
+               if (is_array($cacheEntry)) {
+                       $cacheEntry = $cacheEntry['content'];
                }
 
                if ($this->compression && strlen($cacheEntry)) {
index 48ce41d..2a7dd27 100644 (file)
@@ -4099,7 +4099,7 @@ final class t3lib_BEfunc {
                        if ($workspace !== 0 && $TCA[$table] && $TCA[$table]['ctrl']['versioningWS']) {
 
                                        // Select workspace version of record:
-                               $rows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
+                               $row = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow(
                                        $fields,
                                        $table,
                                                'pid=-1 AND
@@ -4108,8 +4108,8 @@ final class t3lib_BEfunc {
                                                                self::deleteClause($table)
                                );
 
-                               if (is_array($rows[0])) {
-                                       return $rows[0];
+                               if (is_array($row)) {
+                                       return $row;
                                }
                        }
                }
@@ -4288,7 +4288,7 @@ final class t3lib_BEfunc {
                if ($workspace !== 0 && $TCA[$table] && (int) $TCA[$table]['ctrl']['versioningWS'] >= 2) {
 
                                // Select workspace version of record:
-                       $rows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
+                       $row = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow(
                                $fields,
                                $table,
                                        'pid!=-1 AND
@@ -4298,8 +4298,8 @@ final class t3lib_BEfunc {
                                                        self::deleteClause($table)
                        );
 
-                       if (is_array($rows[0])) {
-                               return $rows[0];
+                       if (is_array($row)) {
+                               return $row;
                        }
                }
 
index d0d6b2a..5275ce9 100644 (file)
@@ -1324,7 +1324,7 @@ class t3lib_pageSelect {
                        if (($table == 'pages' || (int) $TCA[$table]['ctrl']['versioningWS'] >= 2) && $workspace !== 0) {
 
                                        // Select workspace version of record:
-                               $rows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
+                               $row = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow(
                                        $fields,
                                        $table,
                                        'pid!=-1 AND
@@ -1334,8 +1334,8 @@ class t3lib_pageSelect {
                                        $this->deleteClause($table)
                                );
 
-                               if (is_array($rows[0])) {
-                                       return $rows[0];
+                               if (is_array($row)) {
+                                       return $row;
                                }
                        }
                }
@@ -1366,7 +1366,7 @@ class t3lib_pageSelect {
                        }
 
                                // Select workspace version of record, only testing for deleted.
-                       list($newrow) = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
+                       $newrow = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow(
                                $fields,
                                $table,
                                'pid=-1 AND
@@ -1377,7 +1377,7 @@ class t3lib_pageSelect {
 
                                // If version found, check if it could have been selected with enableFields on as well:
                        if (is_array($newrow)) {
-                               if ($bypassEnableFieldsCheck || $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
+                               if ($bypassEnableFieldsCheck || $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow(
                                        'uid',
                                        $table,
                                        'pid=-1 AND
@@ -1391,7 +1391,7 @@ class t3lib_pageSelect {
                                }
                        } else {
                                        // OK, so no workspace version was found. Then check if online version can be selected with full enable fields and if so, return 1:
-                               if ($bypassEnableFieldsCheck || $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
+                               if ($bypassEnableFieldsCheck || $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow(
                                        'uid',
                                        $table,
                                        'uid=' . intval($uid) . $enFields
@@ -1421,11 +1421,8 @@ class t3lib_pageSelect {
                }
                else {
                        if ($wsid > 0) {
-                               $ws = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('*', 'sys_workspace', 'uid=' . intval($wsid) . ' AND deleted=0'); // No $TCA yet!
-                               if (count($ws)) {
-                                       $ws = $ws[0];
-                               }
-                               else {
+                               $ws = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow('*', 'sys_workspace', 'uid=' . intval($wsid) . ' AND deleted=0'); // No $TCA yet!
+                               if (!is_array($ws)) {
                                        return FALSE;
                                }
                        }
index 70f9108..d64df94 100644 (file)
@@ -184,7 +184,7 @@ class t3lib_refindex {
 
                if (isset($TCA[$table])) {
                                // Get raw record from DB:
-                       list($record) = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('*', $table, 'uid=' . intval($uid));
+                       $record = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow('*', $table, 'uid=' . intval($uid));
 
                        if (is_array($record)) {
 
@@ -623,7 +623,7 @@ class t3lib_refindex {
                if (($GLOBALS['BE_USER']->workspace === 0 && $GLOBALS['BE_USER']->isAdmin()) || $bypassWorkspaceAdminCheck) {
 
                                // Get current index from Database:
-                       list($refRec) = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
+                       $refRec = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow(
                                '*',
                                'sys_refindex',
                                'hash=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($hash, 'sys_refindex')
@@ -634,7 +634,7 @@ class t3lib_refindex {
                                if ($GLOBALS['TCA'][$refRec['tablename']]) {
 
                                                // Get that record from database:
-                                       list($record) = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('*', $refRec['tablename'], 'uid=' . intval($refRec['recuid']));
+                                       $record = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow('*', $refRec['tablename'], 'uid=' . intval($refRec['recuid']));
 
                                        if (is_array($record)) {
 
index 0898d27..9d6c265 100644 (file)
@@ -1635,7 +1635,7 @@ class t3lib_userAuthGroup extends t3lib_userAuth {
                                        $wsRec = array('uid' => $wsRec);
                                break;
                                default:
-                                       list($wsRec) = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
+                                       $wsRec = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow(
                                                $fields,
                                                'sys_workspace',
                                                'pid=0 AND uid=' . intval($wsRec) .
index 5d38e22..5849cc8 100644 (file)
@@ -282,11 +282,11 @@ class t3lib_tree_Tca_DatabaseTreeDataProvider extends t3lib_tree_Tca_AbstractTca
        protected function getChildrenOf(t3lib_tree_Node $node, $level) {
                $nodeData = NULL;
                if ($node->getId() !== 0) {
-                       $nodeData = current($GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
-                                                                       '*',
-                                                                       $this->tableName,
-                                                                       'uid=' . $node->getId()
-                                                               ));
+                       $nodeData = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow(
+                               '*',
+                               $this->tableName,
+                               'uid=' . $node->getId()
+                       );
                }
                if ($nodeData == NULL) {
                        $nodeData = array(
index 85b02f7..2e9e12b 100644 (file)
@@ -165,7 +165,7 @@ class t3lib_cache_backend_DbBackendTest extends tx_phpunit_testcase {
                $this->backend->setCache($cache);
                $this->backend->set($entryIdentifier, $data);
 
-               $entriesFound = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
+               $entryFound = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow(
                        '*',
                        $this->testingCacheTable,
                        'identifier = \'' . $entryIdentifier . '\''
@@ -173,7 +173,7 @@ class t3lib_cache_backend_DbBackendTest extends tx_phpunit_testcase {
 
                $this->assertEquals(
                        $data,
-                       $entriesFound[0]['content'],
+                       $entryFound['content'],
                        'The original and the retrieved data don\'t match.'
                );
        }
@@ -266,13 +266,13 @@ class t3lib_cache_backend_DbBackendTest extends tx_phpunit_testcase {
 
                $this->backend->set($entryIdentifier, $data);
 
-               $entry = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
+               $entry = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow(
                        'content',
                        $this->testingCacheTable,
                        'identifier = \'' . $entryIdentifier . '\''
                );
 
-               $this->assertEquals($data, @gzuncompress($entry[0]['content']), 'Original and compressed data don\'t match');
+               $this->assertEquals($data, @gzuncompress($entry['content']), 'Original and compressed data don\'t match');
        }
 
        /**
@@ -296,13 +296,13 @@ class t3lib_cache_backend_DbBackendTest extends tx_phpunit_testcase {
 
                $this->backend->set($entryIdentifier, $data);
 
-               $entry = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
+               $entry = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow(
                        'content',
                        $this->testingCacheTable,
                        'identifier = \'' . $entryIdentifier . '\''
                );
 
-               $this->assertGreaterThan(0, substr_count($entry[0]['content'], $data), 'Plaintext data not found');
+               $this->assertGreaterThan(0, substr_count($entry['content'], $data), 'Plaintext data not found');
        }
 
        /**
@@ -690,15 +690,15 @@ class t3lib_cache_backend_DbBackendTest extends tx_phpunit_testcase {
                $this->backend->setCache($cache);
                $this->backend->set($entryIdentifier, $data, array(), 0);
 
-               $entriesFound = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
+               $entryFound = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow(
                        '*',
                        $this->testingCacheTable,
                        ''
                );
 
-               $this->assertTrue(is_array($entriesFound), 'entriesFound is not an array.');
+               $this->assertTrue(is_array($entryFound), 'entriesFound is not an array.');
 
-               $retrievedData = $entriesFound[0]['content'];
+               $retrievedData = $entryFound['content'];
                $this->assertEquals($data, $retrievedData, 'The original and the retrieved data don\'t match.');
        }
 }
index 3582773..a3d3097 100644 (file)
@@ -1178,7 +1178,7 @@ class SC_alt_doc {
                list($table,$orig_uid,$language) = explode(':',$justLocalized);
 
                if ($TCA[$table] && $TCA[$table]['ctrl']['languageField'] && $TCA[$table]['ctrl']['transOrigPointerField'])     {
-                       list($localizedRecord) = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
+                       $localizedRecord = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow(
                                        'uid',
                                        $table,
                                        $TCA[$table]['ctrl']['languageField'].'='.intval($language).' AND '.
index 8c3d75d..b155ad8 100644 (file)
@@ -816,7 +816,7 @@ class recordList extends t3lib_recordList {
                list($table,$orig_uid,$language) = explode(':',$justLocalized);
 
                if ($TCA[$table] && $TCA[$table]['ctrl']['languageField'] && $TCA[$table]['ctrl']['transOrigPointerField'])     {
-                       list($localizedRecord) = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
+                       $localizedRecord = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow(
                                        'uid',
                                        $table,
                                        $TCA[$table]['ctrl']['languageField'].'='.intval($language).' AND '.
index 03fbc38..4c12486 100644 (file)
@@ -65,8 +65,7 @@ class tx_cms_be_layout {
                $rootline = t3lib_BEfunc::BEgetRootLine($id);
                $backendLayoutUid = null;
                for ($i = count($rootline); $i > 0; $i--) {
-                       $res = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('uid,be_layout,be_layout_next_level', 'pages', 'uid=' . intval($rootline[$i]['uid']));
-                       $page = $res[0];
+                       $page = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow('uid, be_layout, be_layout_next_level', 'pages', 'uid=' . intval($rootline[$i]['uid']));
                        if (intval($page['be_layout_next_level']) > 0 && $page['uid'] != $id) {
                                $backendLayoutUid = intval($page['be_layout_next_level']);
                                break;
@@ -79,9 +78,8 @@ class tx_cms_be_layout {
                }
                $backendLayout = null;
                if ($backendLayoutUid) {
-                       $res = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('*', 'be_layouts', 'uid=' . $backendLayoutUid);
-                       if ($res) {
-                               $backendLayout = $res[0];
+                       $backendLayout = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow('*', 'be_layouts', 'uid=' . $backendLayoutUid);
+                       if ($backendLayout) {
                                $parser = t3lib_div::makeInstance('t3lib_TSparser');
                                $parser->parse($backendLayout['config']);
                                $backendLayout['__config'] = $parser->setup;
index 80acf5e..8293b0b 100755 (executable)
@@ -401,8 +401,7 @@ class tx_cms_layout extends recordList {
                $rootline = t3lib_BEfunc::BEgetRootLine($id);
                $backendLayoutUid = null;
                for ($i = count($rootline); $i > 0; $i--) {
-                       $res = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('uid,be_layout,be_layout_next_level', 'pages', 'uid=' . intval($rootline[$i]['uid']));
-                       $page = $res[0];
+                       $page = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow('uid, be_layout, be_layout_next_level', 'pages', 'uid=' . intval($rootline[$i]['uid']));
                        if (intval($page['be_layout_next_level']) > 0 && $page['uid'] != $id) {
                                $backendLayoutUid = intval($page['be_layout_next_level']);
                                break;
index 4e89976..5725881 100644 (file)
@@ -6908,7 +6908,7 @@ class tslib_cObj {
                                );
                                $requestHash = md5(serialize($parameters));
 
-                               list ($cacheEntry) = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
+                               $cacheEntry = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow(
                                        'treelist',
                                        'cache_treelist',
                                        'md5hash = \'' . $requestHash . '\' AND ( expires > ' . $GLOBALS['EXEC_TIME'] .
index d8a4d22..712cc26 100644 (file)
                        }
 
                                // Look for keyword configuration record:
-                       list($previewData) = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
+                       $previewData = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow(
                                '*',
                                'sys_preview',
                                'keyword='.$GLOBALS['TYPO3_DB']->fullQuoteStr($inputCode, 'sys_preview').
index 732235e..714893f 100644 (file)
@@ -236,9 +236,9 @@ final class tx_em_Database {
         * @param   int  $uid  repository UID
         */
        public function getRepositoryByUID($uid) {
-               $row = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('*', self::TABLE_REPOSITORY, 'uid=' . intval($uid));
+               $row = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow('*', self::TABLE_REPOSITORY, 'uid=' . intval($uid));
 
-               return $row[0];
+               return $row;
        }
 
        /**
index 7c5dba7..9a4f430 100755 (executable)
@@ -1515,7 +1515,7 @@ class SC_mod_tools_log_index extends t3lib_SCbase {
         * @return      array           Preset record, if any (otherwise false)
         */
        function getPreset($uid)        {
-               list($preset) = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('*','tx_impexp_presets','uid='.intval($uid));
+               $preset = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow('*', 'tx_impexp_presets', 'uid=' . intval($uid));
                return $preset;
        }
 
index a14311d..15026ea 100755 (executable)
@@ -221,7 +221,7 @@ class tx_indexedsearch_crawler {
                if ($params['indexConfigUid'])  {
 
                                // Load the indexing configuration record:
-                       list($cfgRec) = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
+                       $cfgRec = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow(
                                '*',
                                'index_config',
                                'uid='.intval($params['indexConfigUid'])
index d936678..c1f18ae 100755 (executable)
@@ -467,14 +467,14 @@ class tx_indexedsearch_modfunc1 extends t3lib_extobjbase {
                                $lines[] = '<td>'.$cmdLinks.'</td>';
 
                                        // Query:
-                               $ftrows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
+                               $ftrow = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow(
                                                        '*',
                                                        'index_fulltext',
                                                        'phash = '.intval($row['phash'])
                                                );
                                $lines[] = '<td style="white-space: normal;">'.
-                                                       htmlspecialchars(t3lib_div::fixed_lgd_cs($this->utf8_to_currentCharset($ftrows[0]['fulltextdata']),3000)).
-                                                       '<hr/><em>Size: '.strlen($ftrows[0]['fulltextdata']).'</em>'.
+                                                       htmlspecialchars(t3lib_div::fixed_lgd_cs($this->utf8_to_currentCharset($ftrow['fulltextdata']), 3000)) .
+                                                       '<hr/><em>Size: ' . strlen($ftrow['fulltextdata']) . '</em>' .
                                                        '</td>';
 
                                        // Query:
@@ -623,12 +623,11 @@ class tx_indexedsearch_modfunc1 extends t3lib_extobjbase {
                $content = '';
 
                        // Selects the result row:
-               $ftrows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
+               $phashRecord = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow(
                                        '*',
                                        'index_phash',
                                        'phash = '.intval($phash)
                                );
-               $phashRecord = $ftrows[0];
 
                        // If found, display:
                if (is_array($phashRecord))     {
@@ -1175,7 +1174,7 @@ class tx_indexedsearch_modfunc1 extends t3lib_extobjbase {
        function reindexPhash($phash, $pageId)  {
 
                        // Query:
-               list($resultRow) = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
+               $resultRow = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow(
                                        'ISEC.*, IP.*',
                                        'index_phash IP, index_section ISEC',
                                        'IP.phash = ISEC.phash
index 72c2afd..6d07cab 100755 (executable)
@@ -537,7 +537,7 @@ class tx_indexedsearch extends tslib_pibase {
                                // Create header if we are searching more than one indexing configuration:
                        if (count($indexCfgs)>1)        {
                                if ($freeIndexUid>0)    {
-                                       list($indexCfgRec) = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('title','index_config','uid='.intval($freeIndexUid).$this->cObj->enableFields('index_config'));
+                                       $indexCfgRec = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow('title', 'index_config', 'uid=' . intval($freeIndexUid) . $this->cObj->enableFields('index_config'));
                                        $titleString = $indexCfgRec['title'];
                                } else {
                                        $titleString = $this->pi_getLL('opt_freeIndexUid_header_'.$freeIndexUid);
@@ -1026,7 +1026,7 @@ class tx_indexedsearch extends tslib_pibase {
                if ($freeIndexUid>=0)   {
 
                                // First, look if the freeIndexUid is a meta configuration:
-                       list($indexCfgRec) = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('indexcfgs','index_config','type=5 AND uid='.intval($freeIndexUid).$this->cObj->enableFields('index_config'));
+                       $indexCfgRec = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow('indexcfgs', 'index_config', 'type=5 AND uid=' . intval($freeIndexUid) . $this->cObj->enableFields('index_config'));
                        if (is_array($indexCfgRec))     {
                                $refs = t3lib_div::trimExplode(',',$indexCfgRec['indexcfgs']);
                                $list = array(-99);     // Default value to protect against empty array.
@@ -1034,7 +1034,7 @@ class tx_indexedsearch extends tslib_pibase {
                                        list($table,$uid) = t3lib_div::revExplode('_',$ref,2);
                                        switch ($table) {
                                                case 'index_config':
-                                                       list($idxRec) = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('uid','index_config','uid='.intval($uid).$this->cObj->enableFields('index_config'));
+                                                       $idxRec = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow('uid', 'index_config', 'uid=' . intval($uid) . $this->cObj->enableFields('index_config'));
                                                        if ($idxRec)    $list[] = $uid;
                                                break;
                                                case 'pages':
@@ -2168,10 +2168,10 @@ class tx_indexedsearch extends tslib_pibase {
                        } else { // ... otherwise, get flag from sys_language record:
 
                                        // Get sys_language record
-                               $rowDat = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('*', 'sys_language', 'uid='.intval($row['sys_language_uid']).' '.$this->cObj->enableFields('sys_language'));
+                               $rowDat = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow('*', 'sys_language', 'uid=' . intval($row['sys_language_uid']) . ' ' . $this->cObj->enableFields('sys_language'));
 
                                        // Flag code:
-                               $flag = $rowDat[0]['flag'];
+                               $flag = $rowDat['flag'];
                                if ($flag)      {
 
 // FIXME not all flags from typo3/gfx/flags are available in media/flags/
@@ -2183,7 +2183,7 @@ class tx_indexedsearch extends tslib_pibase {
 #                                      $imgInfo = @getimagesize(PATH_site.$file);
 
                                        if (is_array($imgInfo)) {
-                                               $output = '<img src="'.$file.'" '.$imgInfo[3].' title="'.htmlspecialchars($rowDat[0]['title']).'" alt="'.htmlspecialchars($rowDat[0]['title']).'" />';
+                                               $output = '<img src="' . $file . '" ' . $imgInfo[3] . ' title="' . htmlspecialchars($rowDat['title']) . '" alt="' . htmlspecialchars($rowDat['title']) . '" />';
                                                return $output;
                                        }
                                }
index b9252b7..b433c6c 100644 (file)
@@ -97,7 +97,7 @@ class tx_openid_store extends Auth_OpenID_OpenIDStore {
                else {
                        $sort = 'tstamp DESC';
                }
-               list($row) = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('uid,content',
+               $row = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow('uid, content',
                        self::ASSOCIATION_TABLE_NAME, $where, '', $sort, '1');
 
                $result = null;
@@ -187,7 +187,7 @@ class tx_openid_store extends Auth_OpenID_OpenIDStore {
                        $GLOBALS['TYPO3_DB']->fullQuoteStr($serverUrl, self::ASSOCIATION_TABLE_NAME),
                        $GLOBALS['TYPO3_DB']->fullQuoteStr($association->handle, self::ASSOCIATION_TABLE_NAME),
                        time());
-               list($row) = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
+               $row = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow(
                        'COUNT(*) as assocCount', self::ASSOCIATION_TABLE_NAME, $where);
                return ($row['assocCount'] > 0);
        }
index 1a2a97c..db7bf0d 100644 (file)
@@ -305,7 +305,7 @@ class tx_openid_sv1 extends t3lib_svbase {
        protected function getUserRecord($openIDIdentifier) {
                $record = null;
                if ($openIDIdentifier) {
-                       list($record) = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('*',
+                       $record = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow('*',
                                $this->authenticationInformation['db_user']['table'],
                                'tx_openid_openid=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($openIDIdentifier, $this->authenticationInformation['db_user']['table']) .
                                        $this->authenticationInformation['db_user']['check_pid_clause'] .
index 97b37de..8eb60f0 100644 (file)
@@ -68,8 +68,8 @@ class tx_rsaauth_split_storage extends tx_rsaauth_abstract_storage {
                        $GLOBALS['TYPO3_DB']->exec_DELETEquery('tx_rsaauth_keys',
                                                'crdate<' . ($GLOBALS['EXEC_TIME'] - 30 * 60));
 
-                       // Get our value
-                       list($row) = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('key_value',
+                               // Get our value
+                       $row = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow('key_value',
                                'tx_rsaauth_keys', 'uid=' . $keyId);
                        if (is_array($row)) {
                                $result = $keyPart1 . $row['key_value'];
index 8445f04..87d7bc7 100755 (executable)
@@ -1134,7 +1134,7 @@ class tx_version_cm1 extends t3lib_SCbase {
                                        $this->formatWorkspace_cache[$wsid] = '';       // Does not output anything for ONLINE because it might confuse people to think that the elemnet IS online which is not the case - only that it exists as an offline version in the online workspace...
                                break;
                                default:
-                                       list($titleRec) = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('title','sys_workspace','uid='.intval($wsid).t3lib_BEfunc::deleteClause('sys_workspace'));
+                                       $titleRec = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow('title', 'sys_workspace', 'uid=' . intval($wsid) . t3lib_BEfunc::deleteClause('sys_workspace'));
                                        $this->formatWorkspace_cache[$wsid] = '['.$wsid.'] '.$titleRec['title'];
                                break;
                        }
index ec8223c..f60d464 100644 (file)
@@ -647,7 +647,7 @@ class wslib_gui {
                                        $this->formatWorkspace_cache[$wsid] = '';       // Does not output anything for ONLINE because it might confuse people to think that the elemnet IS online which is not the case - only that it exists as an offline version in the online workspace...
                                        break;
                                default:
-                                       list($titleRec) = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('title','sys_workspace','uid='.intval($wsid).t3lib_BEfunc::deleteClause('sys_workspace'));
+                                       $titleRec = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow('title', 'sys_workspace', 'uid=' . intval($wsid) . t3lib_BEfunc::deleteClause('sys_workspace'));
                                        $this->formatWorkspace_cache[$wsid] = '['.$wsid.'] '.$titleRec['title'];
                                        break;
                        }