From 490ef79995fadfaf45930005a5fc411c8f0b19ff Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Sun, 30 Dec 2012 16:49:39 +0100 Subject: [PATCH] Fixes errors in Package class --- .../files/lib/data/package/Package.class.php | 43 +++++++++---------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/wcfsetup/install/files/lib/data/package/Package.class.php b/wcfsetup/install/files/lib/data/package/Package.class.php index 27378dcd94..c818c725d6 100644 --- a/wcfsetup/install/files/lib/data/package/Package.class.php +++ b/wcfsetup/install/files/lib/data/package/Package.class.php @@ -21,22 +21,6 @@ use wcf\util\StringUtil; * @category Community Framework */ class Package extends DatabaseObject { - /** - * @see wcf\data\DatabaseObject::$databaseTableName - */ - protected static $databaseTableName = 'package'; - - /** - * @see wcf\data\DatabaseObject::$databaseTableIndexName - */ - protected static $databaseTableIndexName = 'packageID'; - - /** - * package requirements - * @var array - */ - protected static $requirements = null; - /** * list of packages that this package requires * @var array @@ -55,15 +39,31 @@ class Package extends DatabaseObject { */ protected $requiredPackages = null; + /** + * @see wcf\data\DatabaseObject::$databaseTableName + */ + protected static $databaseTableName = 'package'; + + /** + * @see wcf\data\DatabaseObject::$databaseTableIndexName + */ + protected static $databaseTableIndexName = 'packageID'; + + /** + * package requirements + * @var array + */ + protected static $requirements = null; + /** * Returns true, if this package is required by other packages. * * @return boolean */ public function isRequired() { - self::loadRequiremens(); + self::loadRequirements(); - return (isset(self::$requirements[$this->packageID])); + return isset(self::$requirements[$this->packageID]); } /** @@ -177,8 +177,8 @@ class Package extends DatabaseObject { self::loadRequirementMap(); $packages = array(); - if (isset(self::$requirementMap[$this->packageID])) { - foreach (self::$requirementMap[$this->packageID] as $packageID) { + if (isset(self::$requirements[$this->packageID])) { + foreach (self::$requirements[$this->packageID] as $packageID) { $packages[$packageID] = PackageCache::getInstance()->getPackage($packageID); } } @@ -190,7 +190,7 @@ class Package extends DatabaseObject { * Loads package requirements. */ protected static function loadRequirements() { - if (self::$requirementMap === null) { + if (self::$requirements === null) { $sql = "SELECT packageID, requirement FROM wcf".WCF_N."_package_requirement"; $statement = WCF::getDB()->prepareStatement($sql); @@ -343,7 +343,6 @@ class Package extends DatabaseObject { /** * Returns a list of plugins for currently active application. * - * @todo Care about simple plugins just providing some crap. * @return wcf\data\package\PackageList */ public static function getPluginList() { -- 2.20.1