Project

General

Profile

Bug #15950 » bug_3069.diff

Administrator Admin, 2006-10-11 20:43

View differences:

typo3/mod/tools/em/class.em_index.php (Arbeitskopie)
$emConf['constraints']['depends'] = $this->stringToDep($emConf['dependencies']);
if(strlen($emConf['PHP_version'])) {
$versionRange = $this->splitVersionRange($emConf['PHP_version']);
if(version_compare($versionRange[0],'3.0.0','<')) $versionRange[0] = '3.0.0';
if(version_compare($versionRange[1],'3.0.0','<')) $versionRange[1] = '';
if ($versionRange[0] && version_compare($versionRange[0],'3.0.0','<')) $versionRange[0] = '3.0.0';
if ($versionRange[1] && version_compare($versionRange[1],'3.0.0','<')) $versionRange[1] = '';
$emConf['constraints']['depends']['php'] = implode('-',$versionRange);
}
if(strlen($emConf['TYPO3_version'])) {
$versionRange = $this->splitVersionRange($emConf['TYPO3_version']);
if(version_compare($versionRange[0],'3.5.0','<')) $versionRange[0] = '3.5.0';
if(version_compare($versionRange[1],'3.5.0','<')) $versionRange[1] = '';
if ($versionRange[0] && version_compare($versionRange[0],'3.5.0','<')) $versionRange[0] = '3.5.0';
if ($versionRange[1] && version_compare($versionRange[1],'3.5.0','<')) $versionRange[1] = '';
$emConf['constraints']['depends']['typo3'] = implode('-',$versionRange);
}
}
......
// sanity check for version numbers, intentionally only checks php and typo3
if(isset($emConf['constraints']['depends']) && isset($emConf['constraints']['depends']['php'])) {
$versionRange = $this->splitVersionRange($emConf['constraints']['depends']['php']);
if(version_compare($versionRange[0],'3.0.0','<')) $versionRange[0] = '3.0.0';
if(version_compare($versionRange[1],'3.0.0','<')) $versionRange[1] = '';
if ($versionRange[0] && version_compare($versionRange[0],'3.0.0','<')) $versionRange[0] = '3.0.0';
if ($versionRange[1] && version_compare($versionRange[1],'3.0.0','<')) $versionRange[1] = '';
$emConf['constraints']['depends']['php'] = implode('-',$versionRange);
}
if(isset($emConf['constraints']['depends']) && isset($emConf['constraints']['depends']['typo3'])) {
$versionRange = $this->splitVersionRange($emConf['constraints']['depends']['typo3']);
if(version_compare($versionRange[0],'3.5.0','<')) $versionRange[0] = '3.0.0';
if(version_compare($versionRange[1],'3.5.0','<')) $versionRange[1] = '';
if ($versionRange[0] && version_compare($versionRange[0],'3.5.0','<')) $versionRange[0] = '3.0.0';
if ($versionRange[1] && version_compare($versionRange[1],'3.5.0','<')) $versionRange[1] = '';
$emConf['constraints']['depends']['typo3'] = implode('-',$versionRange);
}
......
* @param string $ver A string with a version range.
* @return array
*/
function splitVersionRange($ver) {
function splitVersionRange($ver) {
$versionRange = array();
if(strstr($ver, '-')) $versionRange = explode('-', $ver, 2);
else {
if (strstr($ver, '-')) {
$versionRange = explode('-', $ver, 2);
} else {
$versionRange[0] = $ver;
$versionRange[1] = '';
}
......
if(!$depV) continue;
$versionRange = $this->splitVersionRange($depV);
$phpv = strstr(PHP_VERSION,'-') ? substr(PHP_VERSION,0,strpos(PHP_VERSION,'-')) : PHP_VERSION; // Linux distributors like to add suffixes, like in 5.1.2-1. Those must be ignored!
if($versionRange[0] && version_compare($phpv,$versionRange[0],'<')) {
if ($versionRange[0] && version_compare($phpv,$versionRange[0],'<')) {
$msg[] = '<br />The running PHP version ('.$phpv.') is lower than required ('.$versionRange[0].')';
$msg[] = '&nbsp;&nbsp;&nbsp;&nbsp;<input type="checkbox" value="1" name="depsolver[ignore]['.$depK.']" /> Ignore this version requirement';
$depError = true;
continue;
} elseif($versionRange[1] && version_compare($phpv,$versionRange[1],'>')) {
} elseif ($versionRange[1] && version_compare($phpv,$versionRange[1],'>')) {
$msg[] = '<br />The running PHP version ('.$phpv.') is higher than allowed ('.$versionRange[1].')';
$msg[] = '&nbsp;&nbsp;&nbsp;&nbsp;<input type="checkbox" value="1" name="depsolver[ignore]['.$depK.']" /> Ignore this version requirement';
$depError = true;
......
} elseif($depK == 'typo3') {
if(!$depV) continue;
$versionRange = $this->splitVersionRange($depV);
if($versionRange[0] && version_compare(TYPO3_version,$versionRange[0],'<')) {
if ($versionRange[0] && version_compare(TYPO3_version,$versionRange[0],'<')) {
$msg[] = '<br />The running TYPO3 version ('.TYPO3_version.') is lower than required ('.$versionRange[0].')';
$msg[] = '&nbsp;&nbsp;&nbsp;&nbsp;<input type="checkbox" value="1" name="depsolver[ignore]['.$depK.']" /> Ignore this version requirement';
$depError = true;
continue;
} elseif($versionRange[1] && version_compare(TYPO3_version,$versionRange[1],'>')) {
} elseif ($versionRange[1] && version_compare(TYPO3_version,$versionRange[1],'>')) {
$msg[] = '<br />The running TYPO3 version ('.TYPO3_version.') is higher than allowed ('.$versionRange[1].')';
$msg[] = '&nbsp;&nbsp;&nbsp;&nbsp;<input type="checkbox" value="1" name="depsolver[ignore]['.$depK.']" /> Ignore this version requirement';
$depError = true;
continue;
}
} elseif (strlen($depK) && !t3lib_extMgm::isLoaded($depK)) { // strlen check for braindead empty dependencies coming from extensions...
} elseif (strlen($depK) && !t3lib_extMgm::isLoaded($depK)) { // strlen check for braindead empty dependencies coming from extensions...
if(!isset($instExtInfo[$depK])) {
$msg[] = '<br />Extension "'.$depK.'" was not available in the system. Please import it from the TYPO3 Extension Repository.';
$msg[] = '&nbsp;&nbsp;&nbsp;&nbsp;<img src="'.$GLOBALS['BACK_PATH'].'gfx/import.gif" width="12" height="12" title="Import this extension to \'local\' dir typo3conf/ext/ from online repository." alt="" />&nbsp;<a href="index.php?CMD[importExt]='.$depK.'&CMD[loc]=L&CMD[standAlone]=1" target="_blank">Import now (opens a new window)</a>';
......
$depError = true;
} else {
$versionRange = $this->splitVersionRange($depV);
if($versionRange[0] && version_compare($instExtInfo[$depK]['EM_CONF']['version'],$versionRange[0],'<')) {
if ($versionRange[0] && version_compare($instExtInfo[$depK]['EM_CONF']['version'],$versionRange[0],'<')) {
$msg[] = '<br />The running version of extension "'.$depK.'" ('.$instExtInfo[$depK]['EM_CONF']['version'].') is lower than required ('.$versionRange[0].')';
$msg[] = '&nbsp;&nbsp;&nbsp;&nbsp;<input type="checkbox" value="1" name="depsolver[ignore]['.$depK.']" /> Ignore this version requirement';
$depError = true;
continue;
} elseif($versionRange[1] && version_compare($instExtInfo[$depK]['EM_CONF']['version'],$versionRange[1],'>')) {
} elseif ($versionRange[1] && version_compare($instExtInfo[$depK]['EM_CONF']['version'],$versionRange[1],'>')) {
$msg[] = '<br />The running version of extension "'.$depK.'" ('.$instExtInfo[$depK]['EM_CONF']['version'].') is higher than allowed ('.$versionRange[1].')';
$msg[] = '&nbsp;&nbsp;&nbsp;&nbsp;<input type="checkbox" value="1" name="depsolver[ignore]['.$depK.']" /> Ignore this version requirement';
$depError = true;
(2-2/3)