From: Matthias Schmidt Date: Sun, 30 Dec 2012 15:49:39 +0000 (+0100) Subject: Fixes errors in Package class X-Git-Tag: 2.0.0_Beta_1~649^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=490ef79995fadfaf45930005a5fc411c8f0b19ff;p=GitHub%2FWoltLab%2FWCF.git Fixes errors in Package class --- 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() {