mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-02-11 09:35:00 +00:00
also check for dependencies on other extensions
This commit is contained in:
parent
4dbe07871c
commit
2fb96d94bf
|
@ -47,24 +47,40 @@ class SeedDMS_View_ExtensionMgr extends SeedDMS_Bootstrap_Style {
|
|||
print "</tr></thead>\n";
|
||||
$errmsgs = array();
|
||||
foreach($GLOBALS['EXT_CONF'] as $extname=>$extconf) {
|
||||
$errmsgs = array();
|
||||
if(!isset($extconf['disable']) || $extconf['disable'] == false) {
|
||||
/* check dependency on specific seeddms version */
|
||||
if(isset($extconf['constraints']['depends']['seeddms'])) {
|
||||
$tmp = explode('-', $extconf['constraints']['depends']['seeddms'], 2);
|
||||
if(cmpVersion($tmp[0], $version->version()) > 0 || ($tmp[1] && cmpVersion($tmp[1], $version->version()) < 0))
|
||||
$errmsgs[] = sprintf("Incorrect SeedDMS version (needs version %s)", $extconf['constraints']['depends']['seeddms']);
|
||||
} else {
|
||||
if(!isset($extconf['constraints']['depends']['seeddms']))
|
||||
$errmsgs[] = "Missing dependency on SeedDMS";
|
||||
if(!isset($extconf['constraints']['depends']['php']))
|
||||
$errmsgs[] = "Missing dependency on PHP";
|
||||
|
||||
if(isset($extconf['constraints']['depends'])) {
|
||||
foreach($extconf['constraints']['depends'] as $dkey=>$dval) {
|
||||
switch($dkey) {
|
||||
case 'seeddms':
|
||||
$tmp = explode('-', $dval, 2);
|
||||
if(cmpVersion($tmp[0], $version->version()) > 0 || ($tmp[1] && cmpVersion($tmp[1], $version->version()) < 0))
|
||||
$errmsgs[] = sprintf("Incorrect SeedDMS version (needs version %s)", $extconf['constraints']['depends']['seeddms']);
|
||||
break;
|
||||
case 'php':
|
||||
$tmp = explode('-', $dval, 2);
|
||||
if(cmpVersion($tmp[0], phpversion()) > 0 || ($tmp[1] && cmpVersion($tmp[1], phpversion()) < 0))
|
||||
$errmsgs[] = sprintf("Incorrect PHP version (needs version %s)", $extconf['constraints']['depends']['php']);
|
||||
break;
|
||||
default:
|
||||
$tmp = explode('-', $dval, 2);
|
||||
if(isset($GLOBALS['EXT_CONF'][$dkey]['version'])) {
|
||||
if(cmpVersion($tmp[0], $GLOBALS['EXT_CONF'][$dkey]['version']) > 0 || ($tmp[1] && cmpVersion($tmp[1], $GLOBALS['EXT_CONF'][$dkey]['version']) < 0))
|
||||
$errmsgs[] = sprintf("Incorrect version of extension '%s' (needs version '%s' but provides '%s')", $dkey, $dval, $GLOBALS['EXT_CONF'][$dkey]['version']);
|
||||
} else {
|
||||
$errmsgs[] = sprintf("Missing extension or version for '%s'", $dkey);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* check dependency on specific php version */
|
||||
if(isset($extconf['constraints']['depends']['php'])) {
|
||||
$tmp = explode('-', $extconf['constraints']['depends']['php'], 2);
|
||||
if(cmpVersion($tmp[0], phpversion()) > 0 || ($tmp[1] && cmpVersion($tmp[1], phpversion()) < 0))
|
||||
$errmsgs[] = sprintf("Incorrect PHP version (needs version %s)", $extconf['constraints']['depends']['php']);
|
||||
} else {
|
||||
$errmsgs[] = "Missing dependency on PHP";
|
||||
}
|
||||
if($errmsgs)
|
||||
echo "<tr class=\"error\">";
|
||||
else
|
||||
|
@ -77,7 +93,7 @@ class SeedDMS_View_ExtensionMgr extends SeedDMS_Bootstrap_Style {
|
|||
echo "</td>";
|
||||
echo "<td>".$extconf['title']."<br /><small>".$extconf['description']."</small>";
|
||||
if($errmsgs)
|
||||
echo "<div><img src=\"".$this->getImgPath("attention.gif")."\"> ".implode('<br />', $errmsgs)."</div>";
|
||||
echo "<div><img src=\"".$this->getImgPath("attention.gif")."\"> ".implode('<br /><img src="'.$this->getImgPath("attention.gif").'"> ', $errmsgs)."</div>";
|
||||
echo "</td>";
|
||||
echo "<td>".$extconf['version']."<br /><small>".$extconf['releasedate']."</small></td>";
|
||||
echo "<td><a href=\"mailto:".$extconf['author']['email']."\">".$extconf['author']['name']."</a><br /><small>".$extconf['author']['company']."</small></td>";
|
||||
|
|
Loading…
Reference in New Issue
Block a user