mirror of
https://github.com/e107inc/e107.git
synced 2025-08-10 00:27:45 +02:00
Fixed XmlDependencies method.
This commit is contained in:
@@ -1810,53 +1810,49 @@ class e107plugin
|
|||||||
$mes = e107::getMessage();
|
$mes = e107::getMessage();
|
||||||
$error = array();
|
$error = array();
|
||||||
|
|
||||||
foreach ($tag as $dt => $dv)
|
foreach ($tag as $dt => $da)
|
||||||
{
|
{
|
||||||
if (isset($dv['@attributes']) && isset($dv['@attributes']['name']))
|
foreach ($da as $dv) {
|
||||||
{
|
if (isset($dv['@attributes']) && isset($dv['@attributes']['name'])) {
|
||||||
// echo "Check {$dt} dependency: {$dv['@attributes']['name']} version {$dv['@attributes']['min_version']}<br />";
|
// echo "Check {$dt} dependency: {$dv['@attributes']['name']} version {$dv['@attributes']['min_version']}<br />";
|
||||||
switch ($dt)
|
switch ($dt) {
|
||||||
{
|
case 'plugin':
|
||||||
case 'plugin':
|
if (!isset($pref['plug_installed'][$dv['@attributes']['name']])) { // Plugin not installed
|
||||||
if (!isset($pref['plug_installed'][$dv['@attributes']['name']]))
|
$canContinue = FALSE;
|
||||||
{ // Plugin not installed
|
$error[] = EPL_ADLAN_70 . $dv['@attributes']['name'];
|
||||||
$canContinue = FALSE;
|
}
|
||||||
$error[] = EPL_ADLAN_70.$dv['@attributes']['name'];
|
elseif (isset($dv['@attributes']['min_version']) && (version_compare($dv['@attributes']['min_version'], $pref['plug_installed'][$dv['@attributes']['name']], '<=') === FALSE)) {
|
||||||
}
|
$error[] = EPL_ADLAN_71 . $dv['@attributes']['name'] . EPL_ADLAN_72 . $dv['@attributes']['min_version'];
|
||||||
elseif (isset($dv['@attributes']['min_version']) && (version_compare($dv['@attributes']['min_version'], $pref['plug_installed'][$dv['@attributes']['name']], '<=') === FALSE))
|
$canContinue = FALSE;
|
||||||
{
|
}
|
||||||
$error[] = EPL_ADLAN_71.$dv['@attributes']['name'].EPL_ADLAN_72.$dv['@attributes']['min_version'];
|
break;
|
||||||
$canContinue = FALSE;
|
case 'extension':
|
||||||
}
|
if (!extension_loaded($dv['@attributes']['name'])) {
|
||||||
break;
|
$canContinue = FALSE;
|
||||||
case 'extension':
|
$error[] = EPL_ADLAN_73 . $dv['@attributes']['name'];
|
||||||
if (!extension_loaded($dv['@attributes']['name']))
|
}
|
||||||
{
|
elseif (isset($dv['@attributes']['min_version']) && (version_compare($dv['@attributes']['min_version'], phpversion($dv['@attributes']['name']), '<=') === FALSE)) {
|
||||||
$canContinue = FALSE;
|
$error[] = EPL_ADLAN_71 . $dv['@attributes']['name'] . EPL_ADLAN_72 . $dv['@attributes']['min_version'];
|
||||||
$error[] = EPL_ADLAN_73.$dv['@attributes']['name'];
|
$canContinue = FALSE;
|
||||||
}
|
}
|
||||||
elseif (isset($dv['@attributes']['min_version']) && (version_compare($dv['@attributes']['min_version'], phpversion($dv['@attributes']['name']), '<=') === FALSE))
|
break;
|
||||||
{
|
case 'php': // all should be lowercase
|
||||||
$error[] = EPL_ADLAN_71.$dv['@attributes']['name'].EPL_ADLAN_72.$dv['@attributes']['min_version'];
|
if (isset($dv['@attributes']['min_version']) && (version_compare($dv['@attributes']['min_version'], phpversion(), '<=') === FALSE)) {
|
||||||
$canContinue = FALSE;
|
$error[] = EPL_ADLAN_74 . $dv['@attributes']['min_version'];
|
||||||
}
|
$canContinue = FALSE;
|
||||||
break;
|
}
|
||||||
case 'php': // all should be lowercase
|
break;
|
||||||
if (isset($dv['@attributes']['min_version']) && (version_compare($dv['@attributes']['min_version'], phpversion(), '<=') === FALSE))
|
case 'mysql': // all should be lowercase
|
||||||
{
|
if (isset($dv['@attributes']['min_version']) && (version_compare($dv['@attributes']['min_version'], e107::getDb()
|
||||||
$error[] = EPL_ADLAN_74.$dv['@attributes']['min_version'];
|
->mySqlServerInfo(), '<=') === FALSE)
|
||||||
$canContinue = FALSE;
|
) {
|
||||||
}
|
$error[] = EPL_ADLAN_75 . $dv['@attributes']['min_version'];
|
||||||
break;
|
$canContinue = FALSE;
|
||||||
case 'mysql': // all should be lowercase
|
}
|
||||||
if (isset($dv['@attributes']['min_version']) && (version_compare($dv['@attributes']['min_version'], e107::getDb()->mySqlServerInfo(), '<=') === FALSE))
|
break;
|
||||||
{
|
default:
|
||||||
$error[] = EPL_ADLAN_75.$dv['@attributes']['min_version'];
|
echo "Unknown dependency: {$dt}<br />";
|
||||||
$canContinue = FALSE;
|
}
|
||||||
}
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
echo "Unknown dependency: {$dt}<br />";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user