Commit 6f895ba4 authored by Markus Sommer's avatar Markus Sommer Committed by Thomas Löffler

[TASK] CGL Fix

parent 99917543
This diff is collapsed.
...@@ -36,7 +36,9 @@ class tx_ter_tcaLabel ...@@ -36,7 +36,9 @@ class tx_ter_tcaLabel
} }
$result = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow( $result = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow(
'extensionkey', 'tx_ter_extensions', 'uid=' . (int)$params['row']['uid'] 'extensionkey',
'tx_ter_extensions',
'uid=' . (int)$params['row']['uid']
); );
if (!empty($result['extensionkey'])) { if (!empty($result['extensionkey'])) {
...@@ -45,5 +47,4 @@ class tx_ter_tcaLabel ...@@ -45,5 +47,4 @@ class tx_ter_tcaLabel
$params['title'] = (int)$params['row']['uid']; $params['title'] = (int)$params['row']['uid'];
} }
} }
} }
...@@ -73,7 +73,6 @@ class tx_ter_buildextensionindex ...@@ -73,7 +73,6 @@ class tx_ter_buildextensionindex
} }
} }
} }
} }
$pluginObj = new tx_ter_buildextensionindex(); $pluginObj = new tx_ter_buildextensionindex();
......
...@@ -4,5 +4,3 @@ ...@@ -4,5 +4,3 @@
define('TYPO3_MOD_PATH', '../typo3conf/ext/ter/cli/'); define('TYPO3_MOD_PATH', '../typo3conf/ext/ter/cli/');
$BACK_PATH = '../../../../typo3/'; $BACK_PATH = '../../../../typo3/';
$MCONF['name'] = '_CLI_ter'; $MCONF['name'] = '_CLI_ter';
?>
#! /usr/bin/php -q #! /usr/bin/php -q
<?php <?php
die ('Access denied'); die('Access denied');
// Defining circumstances for CLI mode: // Defining circumstances for CLI mode:
define('TYPO3_cliMode', true); define('TYPO3_cliMode', true);
...@@ -12,7 +12,9 @@ require(dirname(PATH_thisScript) . '/' . $BACK_PATH . 'init.php'); ...@@ -12,7 +12,9 @@ require(dirname(PATH_thisScript) . '/' . $BACK_PATH . 'init.php');
$res = $TYPO3_DB->exec_SELECTquery( $res = $TYPO3_DB->exec_SELECTquery(
'uid, uploadcomment', 'tx_ter_extensiondetails', '1' 'uid, uploadcomment',
'tx_ter_extensiondetails',
'1'
); );
$counter = 0; $counter = 0;
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
* Keep off - never ever use this at TYPO3.org again ... * Keep off - never ever use this at TYPO3.org again ...
*/ */
die ('Better not ...'); die('Better not ...');
// Defining circumstances for CLI mode: // Defining circumstances for CLI mode:
define('TYPO3_cliMode', true); define('TYPO3_cliMode', true);
...@@ -35,7 +35,11 @@ $extensionsPID = 1320; ...@@ -35,7 +35,11 @@ $extensionsPID = 1320;
writeExtensionIndexfile(); writeExtensionIndexfile();
$res = $TYPO3_DB->exec_SELECTquery( $res = $TYPO3_DB->exec_SELECTquery(
'*', 'tx_extrep_keytable', 'hidden=0 AND deleted=0', '', 'extension_key ASC' '*',
'tx_extrep_keytable',
'hidden=0 AND deleted=0',
'',
'extension_key ASC'
); );
$startTime = time(); $startTime = time();
...@@ -45,7 +49,9 @@ while ($extensionKeyRow = $TYPO3_DB->sql_fetch_assoc($res)) { ...@@ -45,7 +49,9 @@ while ($extensionKeyRow = $TYPO3_DB->sql_fetch_assoc($res)) {
$extensionKeyCounter++; $extensionKeyCounter++;
$res2 = $TYPO3_DB->exec_SELECTquery( $res2 = $TYPO3_DB->exec_SELECTquery(
'username', 'fe_users', 'uid = ' . $extensionKeyRow['owner_fe_user'] 'username',
'fe_users',
'uid = ' . $extensionKeyRow['owner_fe_user']
); );
$feUsersRow = $TYPO3_DB->sql_fetch_assoc($res2); $feUsersRow = $TYPO3_DB->sql_fetch_assoc($res2);
$accountData['username'] = $feUsersRow['username']; $accountData['username'] = $feUsersRow['username'];
...@@ -53,7 +59,6 @@ while ($extensionKeyRow = $TYPO3_DB->sql_fetch_assoc($res)) { ...@@ -53,7 +59,6 @@ while ($extensionKeyRow = $TYPO3_DB->sql_fetch_assoc($res)) {
echo('importing ' . str_pad($extensionKeyRow['extension_key'] . ' (' . $feUsersRow['username'] . ')', 40, ' ')); echo('importing ' . str_pad($extensionKeyRow['extension_key'] . ' (' . $feUsersRow['username'] . ')', 40, ' '));
if (intval($extensionKeyRow['members_only'])) { if (intval($extensionKeyRow['members_only'])) {
$newExtensionKeyRow = [ $newExtensionKeyRow = [
'tstamp' => $extensionKeyRow['tstamp'], 'tstamp' => $extensionKeyRow['tstamp'],
'crdate' => $extensionKeyRow['crdate'], 'crdate' => $extensionKeyRow['crdate'],
...@@ -67,12 +72,14 @@ while ($extensionKeyRow = $TYPO3_DB->sql_fetch_assoc($res)) { ...@@ -67,12 +72,14 @@ while ($extensionKeyRow = $TYPO3_DB->sql_fetch_assoc($res)) {
]; ];
$TYPO3_DB->exec_INSERTquery( $TYPO3_DB->exec_INSERTquery(
'tx_ter_extensionkeys', $newExtensionKeyRow 'tx_ter_extensionkeys',
$newExtensionKeyRow
); );
} else { } else {
$res2 = $TYPO3_DB->exec_SELECTquery( $res2 = $TYPO3_DB->exec_SELECTquery(
'*', 'tx_extrep_repository', 'extension_uid = ' . $extensionKeyRow['uid'] '*',
'tx_extrep_repository',
'extension_uid = ' . $extensionKeyRow['uid']
); );
$versionOfExtension = 1; $versionOfExtension = 1;
...@@ -118,17 +125,21 @@ function getExtensionDataFromRepositoryRow($extensionKeyRow, $extensionVersionRo ...@@ -118,17 +125,21 @@ function getExtensionDataFromRepositoryRow($extensionKeyRow, $extensionVersionRo
// *** DEPENDENCIES // *** DEPENDENCIES
$typo3VersionMax = $extensionVersionRow['emconf_TYPO3_version_max'] > 0 ? versionConv( $typo3VersionMax = $extensionVersionRow['emconf_TYPO3_version_max'] > 0 ? versionConv(
$extensionVersionRow['emconf_TYPO3_version_max'], 1 $extensionVersionRow['emconf_TYPO3_version_max'],
1
) : ''; ) : '';
$typo3VersionMin = $extensionVersionRow['emconf_TYPO3_version_min'] > 0 ? versionConv( $typo3VersionMin = $extensionVersionRow['emconf_TYPO3_version_min'] > 0 ? versionConv(
$extensionVersionRow['emconf_TYPO3_version_min'], 1 $extensionVersionRow['emconf_TYPO3_version_min'],
1
) : ''; ) : '';
$phpVersionMax = $extensionVersionRow['emconf_PHP_version_max'] > 0 ? versionConv( $phpVersionMax = $extensionVersionRow['emconf_PHP_version_max'] > 0 ? versionConv(
$extensionVersionRow['emconf_PHP_version_max'], 1 $extensionVersionRow['emconf_PHP_version_max'],
1
) : ''; ) : '';
$phpVersionMin = $extensionVersionRow['emconf_PHP_version_min'] > 0 ? versionConv( $phpVersionMin = $extensionVersionRow['emconf_PHP_version_min'] > 0 ? versionConv(
$extensionVersionRow['emconf_PHP_version_min'], 1 $extensionVersionRow['emconf_PHP_version_min'],
1
) : ''; ) : '';
$typo3VersionRange = (strlen($typo3VersionMin) && strlen($typo3VersionMax)) ? $typo3VersionMin . '-' . $typo3VersionMax : ''; $typo3VersionRange = (strlen($typo3VersionMin) && strlen($typo3VersionMax)) ? $typo3VersionMin . '-' . $typo3VersionMax : '';
...@@ -222,7 +233,7 @@ function writeExtensionAndIconFile(&$extensionData, $filesData) ...@@ -222,7 +233,7 @@ function writeExtensionAndIconFile(&$extensionData, $filesData)
foreach ($extensionData['technicalData']['dependencies'] as $dependencyArr) { foreach ($extensionData['technicalData']['dependencies'] as $dependencyArr) {
switch ($dependencyArr['extensionKey']) { switch ($dependencyArr['extensionKey']) {
case 'typo3' : case 'typo3':
$typo3Version = $dependencyArr['versionRange']; $typo3Version = $dependencyArr['versionRange'];
break; break;
case 'php': case 'php':
...@@ -304,7 +315,8 @@ function writeExtensionAndIconFile(&$extensionData, $filesData) ...@@ -304,7 +315,8 @@ function writeExtensionAndIconFile(&$extensionData, $filesData)
} }
list ($majorVersion, $minorVersion, $devVersion) = \TYPO3\CMS\Core\Utility\GeneralUtility::intExplode( list ($majorVersion, $minorVersion, $devVersion) = \TYPO3\CMS\Core\Utility\GeneralUtility::intExplode(
'.', $extensionData['version'] '.',
$extensionData['version']
); );
$t3xFileName = strtolower( $t3xFileName = strtolower(
$extensionData['extensionKey'] $extensionData['extensionKey']
...@@ -340,9 +352,10 @@ function writeExtensionInfoToDB($accountData, $extensionData, $filesData, $exten ...@@ -340,9 +352,10 @@ function writeExtensionInfoToDB($accountData, $extensionData, $filesData, $exten
// Add extension key to key table if we are processing the first version of the extension: // Add extension key to key table if we are processing the first version of the extension:
if ($versionOfExtension == 1) { if ($versionOfExtension == 1) {
$res = $TYPO3_DB->exec_SELECTquery( $res = $TYPO3_DB->exec_SELECTquery(
'*', 'tx_extrep_keytable', 'extension_key = "' . $extensionData['extensionKey'] . '"' '*',
'tx_extrep_keytable',
'extension_key = "' . $extensionData['extensionKey'] . '"'
); );
$oldExtensionKeyRow = $TYPO3_DB->sql_fetch_assoc($res); $oldExtensionKeyRow = $TYPO3_DB->sql_fetch_assoc($res);
...@@ -359,7 +372,8 @@ function writeExtensionInfoToDB($accountData, $extensionData, $filesData, $exten ...@@ -359,7 +372,8 @@ function writeExtensionInfoToDB($accountData, $extensionData, $filesData, $exten
]; ];
$TYPO3_DB->exec_INSERTquery( $TYPO3_DB->exec_INSERTquery(
'tx_ter_extensionkeys', $extensionKeyRow 'tx_ter_extensionkeys',
$extensionKeyRow
); );
} }
...@@ -424,7 +438,6 @@ function writeExtensionInfoToDB($accountData, $extensionData, $filesData, $exten ...@@ -424,7 +438,6 @@ function writeExtensionInfoToDB($accountData, $extensionData, $filesData, $exten
]; ];
$TYPO3_DB->exec_INSERTquery('tx_ter_extensiondetails', $extensionDetailsRow); $TYPO3_DB->exec_INSERTquery('tx_ter_extensiondetails', $extensionDetailsRow);
} }
/** /**
...@@ -490,15 +503,18 @@ function writeExtensionIndexfile() ...@@ -490,15 +503,18 @@ function writeExtensionIndexfile()
global $TYPO3_DB; global $TYPO3_DB;
if (!@is_dir($GLOBALS['repositoryDir'])) { if (!@is_dir($GLOBALS['repositoryDir'])) {
throw new tx_ter_exception_internalServerError ( throw new tx_ter_exception_internalServerError(
'Extension repository directory does not exist.', TX_TER_ERROR_GENERAL_EXTREPDIRDOESNTEXIST 'Extension repository directory does not exist.',
TX_TER_ERROR_GENERAL_EXTREPDIRDOESNTEXIST
); );
} }
$trackTime = microtime(); $trackTime = microtime();
$res = $TYPO3_DB->exec_SELECTquery( $res = $TYPO3_DB->exec_SELECTquery(
'uid,tstamp,extensionkey,version,title,description,state,category,t3xfilemd5', 'tx_ter_extensions', '1' 'uid,tstamp,extensionkey,version,title,description,state,category,t3xfilemd5',
'tx_ter_extensions',
'1'
); );
// Read the extension records from the DB: // Read the extension records from the DB:
...@@ -506,14 +522,17 @@ function writeExtensionIndexfile() ...@@ -506,14 +522,17 @@ function writeExtensionIndexfile()
$extensionsTotalDownloadsArr = []; $extensionsTotalDownloadsArr = [];
while ($row = $TYPO3_DB->sql_fetch_assoc($res)) { while ($row = $TYPO3_DB->sql_fetch_assoc($res)) {
$res2 = $TYPO3_DB->exec_SELECTquery( $res2 = $TYPO3_DB->exec_SELECTquery(
'ownerusername,downloadcounter', 'tx_ter_extensionkeys', 'extensionkey="' . $row['extensionkey'] . '"' 'ownerusername,downloadcounter',
'tx_ter_extensionkeys',
'extensionkey="' . $row['extensionkey'] . '"'
); );
$extensionKeyRow = $TYPO3_DB->sql_fetch_assoc($res2); $extensionKeyRow = $TYPO3_DB->sql_fetch_assoc($res2);
$row['ownerusername'] = $extensionKeyRow['ownerusername']; $row['ownerusername'] = $extensionKeyRow['ownerusername'];
$extensionsTotalDownloadsArr[$row['extensionkey']] = $extensionKeyRow['downloadcounter']; $extensionsTotalDownloadsArr[$row['extensionkey']] = $extensionKeyRow['downloadcounter'];
$res2 = $TYPO3_DB->exec_SELECTquery( $res2 = $TYPO3_DB->exec_SELECTquery(
'lastuploaddate,uploadcomment,dependencies,authorname,authoremail,authorcompany', 'tx_ter_extensiondetails', 'lastuploaddate,uploadcomment,dependencies,authorname,authoremail,authorcompany',
'tx_ter_extensiondetails',
'extensionuid=' . $row['uid'] 'extensionuid=' . $row['uid']
); );
$detailsRow = $TYPO3_DB->sql_fetch_assoc($res2); $detailsRow = $TYPO3_DB->sql_fetch_assoc($res2);
...@@ -524,19 +543,19 @@ function writeExtensionIndexfile() ...@@ -524,19 +543,19 @@ function writeExtensionIndexfile()
} }
// Prepare the DOM object: // Prepare the DOM object:
$dom = new DOMDocument ('1.0', 'utf-8'); $dom = new DOMDocument('1.0', 'utf-8');
$dom->formatOutput = false; $dom->formatOutput = false;
$extensionsObj = $dom->appendChild(new DOMElement('extensions')); $extensionsObj = $dom->appendChild(new DOMElement('extensions'));
// Create the nested XML structure: // Create the nested XML structure:
foreach ($extensionsAndVersionsArr as $extensionKey => $extensionVersionsArr) { foreach ($extensionsAndVersionsArr as $extensionKey => $extensionVersionsArr) {
$extensionObj = $extensionsObj->appendChild(new DOMElement('extension')); $extensionObj = $extensionsObj->appendChild(new DOMElement('extension'));
$extensionObj->appendChild(new DOMAttr ('extensionkey', $extensionKey)); $extensionObj->appendChild(new DOMAttr('extensionkey', $extensionKey));
$extensionObj->appendChild(new DOMElement ('downloadcounter', xmlentities($extensionsTotalDownloadsArr[$extensionKey]))); $extensionObj->appendChild(new DOMElement('downloadcounter', xmlentities($extensionsTotalDownloadsArr[$extensionKey])));
foreach ($extensionVersionsArr as $versionNumber => $extensionVersionArr) { foreach ($extensionVersionsArr as $versionNumber => $extensionVersionArr) {
$versionObj = $extensionObj->appendChild(new DOMElement('version')); $versionObj = $extensionObj->appendChild(new DOMElement('version'));
$versionObj->appendChild(new DOMAttr ('version', $versionNumber)); $versionObj->appendChild(new DOMAttr('version', $versionNumber));
$versionObj->appendChild(new DOMElement('title', xmlentities($extensionVersionArr['title']))); $versionObj->appendChild(new DOMElement('title', xmlentities($extensionVersionArr['title'])));
$versionObj->appendChild(new DOMElement('description', xmlentities($extensionVersionArr['description']))); $versionObj->appendChild(new DOMElement('description', xmlentities($extensionVersionArr['description'])));
...@@ -561,7 +580,7 @@ function writeExtensionIndexfile() ...@@ -561,7 +580,7 @@ function writeExtensionIndexfile()
// Write XML data to disc: // Write XML data to disc:
$fh = fopen($GLOBALS['repositoryDir'] . 'cli-extensions.xml.gz', 'wb'); $fh = fopen($GLOBALS['repositoryDir'] . 'cli-extensions.xml.gz', 'wb');
if (!$fh) { if (!$fh) {
throw new tx_ter_exception_internalServerError ( throw new tx_ter_exception_internalServerError(
'Write error while writing extensions index file: ' . $GLOBALS['repositoryDir'] . 'extensions.xml', 'Write error while writing extensions index file: ' . $GLOBALS['repositoryDir'] . 'extensions.xml',
TX_TER_ERROR_UPLOADEXTENSION_WRITEERRORWHILEWRITINGEXTENSIONSINDEX TX_TER_ERROR_UPLOADEXTENSION_WRITEERRORWHILEWRITINGEXTENSIONSINDEX
); );
...@@ -570,8 +589,6 @@ function writeExtensionIndexfile() ...@@ -570,8 +589,6 @@ function writeExtensionIndexfile()
fclose($fh); fclose($fh);
#\TYPO3\CMS\Core\Utility\GeneralUtility::devLog('extensions','ter',0,$extensionsArr); #\TYPO3\CMS\Core\Utility\GeneralUtility::devLog('extensions','ter',0,$extensionsArr);
} }
/** /**
......
...@@ -66,46 +66,114 @@ $output->outputText(chr(10) . 'TER extension download logfile analyzer $Id$' . c ...@@ -66,46 +66,114 @@ $output->outputText(chr(10) . 'TER extension download logfile analyzer $Id$' . c
$options = [ $options = [
'pathToTER' => $input->registerOption( 'pathToTER' => $input->registerOption(
new ezcConsoleOption( new ezcConsoleOption(
't', 'terdirectory', ezcConsoleInput::TYPE_STRING, '/fileadmin/ter/', false, 'Relative path to the TER directory.', 't',
'terdirectory',
ezcConsoleInput::TYPE_STRING,
'/fileadmin/ter/',
false,
'Relative path to the TER directory.',
'Relative path to the TER directory. This directory must appear directly after the "GET" keyword in the access log files!', 'Relative path to the TER directory. This directory must appear directly after the "GET" keyword in the access log files!',
[], [], true, false, false [],
[],
true,
false,
false
) )
), ),
'username' => $input->registerOption( 'username' => $input->registerOption(
new ezcConsoleOption( new ezcConsoleOption(
'u', 'username', ezcConsoleInput::TYPE_STRING, null, false, 'TER mirror username.', 'u',
'A username of the TYPO3.org account which is member of the usergroup TER Mirrors.', [], [], true, true, false 'username',
ezcConsoleInput::TYPE_STRING,
null,
false,
'TER mirror username.',
'A username of the TYPO3.org account which is member of the usergroup TER Mirrors.',
[],
[],
true,
true,
false
) )
), ),
'password' => $input->registerOption( 'password' => $input->registerOption(
new ezcConsoleOption( new ezcConsoleOption(
'p', 'password', ezcConsoleInput::TYPE_STRING, null, false, 'TER mirror password.', 'p',
'The password of the TYPO3.org account which is member of the usergroup TER Mirrors.', [], [], true, true, false 'password',
ezcConsoleInput::TYPE_STRING,
null,
false,
'TER mirror password.',
'The password of the TYPO3.org account which is member of the usergroup TER Mirrors.',
[],
[],
true,
true,
false
) )
), ),
'logfile' => $input->registerOption( 'logfile' => $input->registerOption(
new ezcConsoleOption( new ezcConsoleOption(
'l', 'logfile', ezcConsoleInput::TYPE_STRING, null, false, 'Path and filename of the logfile.', 'l',
'Full path and filename of the Apache access logfile tracking extension downloads.', [], [], true, true, false 'logfile',
ezcConsoleInput::TYPE_STRING,
null,
false,
'Path and filename of the logfile.',
'Full path and filename of the Apache access logfile tracking extension downloads.',
[],
[],
true,
true,
false
) )
), ),
'WSDLURI' => $input->registerOption( 'WSDLURI' => $input->registerOption(
new ezcConsoleOption( new ezcConsoleOption(
'w', 'wsdl', ezcConsoleInput::TYPE_STRING, 'http://repositories.typo3.org/wsdl/tx_ter_wsdl.php', false, 'WSDL URI', 'w',
'wsdl',
ezcConsoleInput::TYPE_STRING,
'http://repositories.typo3.org/wsdl/tx_ter_wsdl.php',
false,
'WSDL URI',
'The URI of the WSDL definition of the TER SOAP service. Use http://ter.dev.robertlemke.de/wsdl/tx_ter_wsdl.php for testing.', 'The URI of the WSDL definition of the TER SOAP service. Use http://ter.dev.robertlemke.de/wsdl/tx_ter_wsdl.php for testing.',
[], [], true, false, false [],
[],
true,
false,
false
) )
), ),
'dryrun' => $input->registerOption( 'dryrun' => $input->registerOption(
new ezcConsoleOption( new ezcConsoleOption(
'd', 'dry-run', ezcConsoleInput::TYPE_NONE, null, false, 'Dry run', 'd',
'dry-run',
ezcConsoleInput::TYPE_NONE,
null,
false,
'Dry run',
'Dry run: The log file will be analyzed but the results are not uploaded to the TER. Instead the SOAP connection will be tested.', 'Dry run: The log file will be analyzed but the results are not uploaded to the TER. Instead the SOAP connection will be tested.',
[], [], false, false, false [],
[],
false,
false,
false
) )
), ),
'help' => $input->registerOption( 'help' => $input->registerOption(
new ezcConsoleOption( new ezcConsoleOption(
'h', 'help', ezcConsoleInput::TYPE_NONE, null, false, 'Help', 'Display a little help.', [], [], false, false, true 'h',
'help',
ezcConsoleInput::TYPE_NONE,
null,
false,
'Help',
'Display a little help.',
[],
[],
false,
false,
true
) )
) )
]; ];
...@@ -152,7 +220,6 @@ while (!feof($fp)) { ...@@ -152,7 +220,6 @@ while (!feof($fp)) {
// Consider only non-empty lines that contain a t3x entry // Consider only non-empty lines that contain a t3x entry
if (!empty($line) && strpos($line, 't3x') !== false) { if (!empty($line) && strpos($line, 't3x') !== false) {
// Extract the actual extension key and version number // Extract the actual extension key and version number
$matches = []; $matches = [];
...@@ -166,7 +233,6 @@ while (!feof($fp)) { ...@@ -166,7 +233,6 @@ while (!feof($fp)) {
$trailingLogData = explode(' ', substr($matches[2], strpos($matches[2], '"'))); $trailingLogData = explode(' ', substr($matches[2], strpos($matches[2], '"')));
$returnCode = $trailingLogData[1]; $returnCode = $trailingLogData[1];
if ($returnCode == '200') { if ($returnCode == '200') {
// Split string on last dash to get extension key and version number // Split string on last dash to get extension key and version number
$extensionKey = substr($matches[1], 0, strrpos($matches[1], '_')); $extensionKey = substr($matches[1], 0, strrpos($matches[1], '_'));
......
...@@ -25,13 +25,15 @@ require(dirname(PATH_thisScript) . '/' . $BACK_PATH . 'init.php'); ...@@ -25,13 +25,15 @@ require(dirname(PATH_thisScript) . '/' . $BACK_PATH . 'init.php');
$res = $TYPO3_DB->exec_SELECTquery( $res = $TYPO3_DB->exec_SELECTquery(
'extensionkey,version', 'tx_ter_extensions', '1' 'extensionkey,version',
'tx_ter_extensions',
'1'
); );
while ($extensionRow = $TYPO3_DB->sql_fetch_assoc($res)) { while ($extensionRow = $TYPO3_DB->sql_fetch_assoc($res)) {
$res2 = $TYPO3_DB->exec_SELECTquery( $res2 = $TYPO3_DB->exec_SELECTquery(
'rating', 'tx_terfe_reviewratings', 'rating',
'tx_terfe_reviewratings',
'extensionkey="' . $extensionRow['extensionkey'] . '" AND version="' . $extensionRow['version'] . '"' 'extensionkey="' . $extensionRow['extensionkey'] . '" AND version="' . $extensionRow['version'] . '"'