From: Alexander Ebert Date: Thu, 23 Feb 2012 22:53:20 +0000 (+0100) Subject: Package requirements are now properly checked X-Git-Tag: 2.0.0_Beta_1~1312 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e0431d96a1384ad98a985db34baaab5120e0047f;p=GitHub%2FWoltLab%2FWCF.git Package requirements are now properly checked --- diff --git a/wcfsetup/install/files/lib/system/package/PackageInstallationNodeBuilder.class.php b/wcfsetup/install/files/lib/system/package/PackageInstallationNodeBuilder.class.php index 5e54ede90c..502e2eace7 100644 --- a/wcfsetup/install/files/lib/system/package/PackageInstallationNodeBuilder.class.php +++ b/wcfsetup/install/files/lib/system/package/PackageInstallationNodeBuilder.class.php @@ -414,7 +414,25 @@ class PackageInstallationNodeBuilder { $requiredPackages = $this->installation->getArchive()->getOpenRequirements(); foreach ($requiredPackages as $packageName => $package) { if (!isset($package['file'])) { - // ignore requirements which are not to be installed + // package is installed but version does not match + if ($package['packageID']) { + // get package version + $sql = "SELECT packageVersion + FROM wcf".WCF_N."_package + WHERE packageID = ?"; + $statement = WCF::getDB()->prepareStatement($sql); + $statement->execute(array($package['packageID'])); + $row = $statement->fetchArray(); + + throw new SystemException("Package '".$this->installation->getArchive()->getPackageInfo('packageName')."' requires the package '".$packageName."' in version '".$package['minversion']."', but '".$row['packageVersion']."' is installed."); + } + + // package is required but not installed + if (!$package['packageID']) { + throw new SystemException("Package '".$this->installation->getArchive()->getPackageInfo('packageName')."' requires the package '".$packageName."', but it is neither installed nor shipped."); + } + + // ignore requirements which are not to be installed, but are already available continue; }