Major overhaul: Removed package dependencies
authorAlexander Ebert <ebert@woltlab.com>
Tue, 4 Dec 2012 17:09:25 +0000 (18:09 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Tue, 4 Dec 2012 17:09:25 +0000 (18:09 +0100)
Other packages aren't modified yet and I cannot guarantee that the installation will work at all. I will check this after applying these changes to all existing packages.

91 files changed:
wcfsetup/install/files/lib/acp/action/CacheClearAction.class.php
wcfsetup/install/files/lib/acp/form/PageMenuItemAddForm.class.php
wcfsetup/install/files/lib/acp/form/UserGroupOptionForm.class.php
wcfsetup/install/files/lib/acp/page/CacheListPage.class.php
wcfsetup/install/files/lib/acp/page/CronjobListPage.class.php
wcfsetup/install/files/lib/acp/page/CronjobLogListPage.class.php
wcfsetup/install/files/lib/acp/page/PageMenuItemListPage.class.php
wcfsetup/install/files/lib/acp/page/UserListPage.class.php
wcfsetup/install/files/lib/data/acp/session/ACPSessionEditor.class.php
wcfsetup/install/files/lib/data/application/ApplicationAction.class.php
wcfsetup/install/files/lib/data/application/group/ApplicationGroup.class.php [deleted file]
wcfsetup/install/files/lib/data/application/group/ApplicationGroupAction.class.php [deleted file]
wcfsetup/install/files/lib/data/application/group/ApplicationGroupEditor.class.php [deleted file]
wcfsetup/install/files/lib/data/application/group/ApplicationGroupList.class.php [deleted file]
wcfsetup/install/files/lib/data/application/group/ViewableApplicationGroup.class.php [deleted file]
wcfsetup/install/files/lib/data/category/CategoryEditor.class.php
wcfsetup/install/files/lib/data/cronjob/Cronjob.class.php
wcfsetup/install/files/lib/data/cronjob/CronjobEditor.class.php
wcfsetup/install/files/lib/data/cronjob/log/CronjobLogEditor.class.php
wcfsetup/install/files/lib/data/language/LanguageEditor.class.php
wcfsetup/install/files/lib/data/object/type/ObjectTypeCache.class.php
wcfsetup/install/files/lib/data/option/Option.class.php
wcfsetup/install/files/lib/data/option/OptionEditor.class.php
wcfsetup/install/files/lib/data/package/Package.class.php
wcfsetup/install/files/lib/data/package/PackageCache.class.php
wcfsetup/install/files/lib/data/page/menu/item/PageMenuItemEditor.class.php
wcfsetup/install/files/lib/data/style/ActiveStyle.class.php
wcfsetup/install/files/lib/data/style/StyleEditor.class.php
wcfsetup/install/files/lib/data/template/Template.class.php
wcfsetup/install/files/lib/data/user/User.class.php
wcfsetup/install/files/lib/data/user/group/UserGroup.class.php
wcfsetup/install/files/lib/data/user/group/UserGroupEditor.class.php
wcfsetup/install/files/lib/system/WCF.class.php
wcfsetup/install/files/lib/system/WCFACP.class.php
wcfsetup/install/files/lib/system/WCFSetup.class.php
wcfsetup/install/files/lib/system/application/ApplicationHandler.class.php
wcfsetup/install/files/lib/system/cache/builder/ACPMenuCacheBuilder.class.php
wcfsetup/install/files/lib/system/cache/builder/ACPSearchProviderCacheBuilder.class.php
wcfsetup/install/files/lib/system/cache/builder/CategoryCacheBuilder.class.php
wcfsetup/install/files/lib/system/cache/builder/CleanupAdapterCacheBuilder.class.php
wcfsetup/install/files/lib/system/cache/builder/ClipboardActionCacheBuilder.class.php
wcfsetup/install/files/lib/system/cache/builder/ClipboardPageCacheBuilder.class.php
wcfsetup/install/files/lib/system/cache/builder/CoreObjectCacheBuilder.class.php
wcfsetup/install/files/lib/system/cache/builder/CronjobCacheBuilder.class.php
wcfsetup/install/files/lib/system/cache/builder/EventListenerCacheBuilder.class.php
wcfsetup/install/files/lib/system/cache/builder/IconCacheBuilder.class.php
wcfsetup/install/files/lib/system/cache/builder/ObjectTypeCacheBuilder.class.php
wcfsetup/install/files/lib/system/cache/builder/OptionCacheBuilder.class.php
wcfsetup/install/files/lib/system/cache/builder/PackageCacheBuilder.class.php
wcfsetup/install/files/lib/system/cache/builder/PackageDependencyCacheBuilder.class.php [deleted file]
wcfsetup/install/files/lib/system/cache/builder/PageMenuCacheBuilder.class.php
wcfsetup/install/files/lib/system/cache/builder/SitemapCacheBuilder.class.php
wcfsetup/install/files/lib/system/cache/builder/TemplateCacheBuilder.class.php
wcfsetup/install/files/lib/system/cache/builder/TemplateListenerCacheBuilder.class.php
wcfsetup/install/files/lib/system/cache/builder/TemplateListenerCodeCacheBuilder.class.php
wcfsetup/install/files/lib/system/cache/builder/UserGroupPermissionCacheBuilder.class.php
wcfsetup/install/files/lib/system/cache/source/DiskCacheSource.class.php
wcfsetup/install/files/lib/system/category/CategoryHandler.class.php
wcfsetup/install/files/lib/system/cleanup/CleanupHandler.class.php
wcfsetup/install/files/lib/system/clipboard/ClipboardHandler.class.php
wcfsetup/install/files/lib/system/cronjob/CronjobScheduler.class.php
wcfsetup/install/files/lib/system/cronjob/RefreshSearchRobotsCronjob.class.php
wcfsetup/install/files/lib/system/event/EventHandler.class.php
wcfsetup/install/files/lib/system/language/I18nHandler.class.php
wcfsetup/install/files/lib/system/language/LanguageFactory.class.php
wcfsetup/install/files/lib/system/menu/acp/ACPMenu.class.php
wcfsetup/install/files/lib/system/menu/page/PageMenu.class.php
wcfsetup/install/files/lib/system/option/OptionHandler.class.php
wcfsetup/install/files/lib/system/package/PackageArchive.class.php
wcfsetup/install/files/lib/system/package/PackageDependencyHandler.class.php [deleted file]
wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php
wcfsetup/install/files/lib/system/package/PackageInstallationSQLParser.class.php
wcfsetup/install/files/lib/system/package/PackageUninstallationDispatcher.class.php
wcfsetup/install/files/lib/system/package/plugin/ACPSearchProviderPackageInstallationPlugin.class.php
wcfsetup/install/files/lib/system/package/plugin/CoreObjectPackageInstallationPlugin.class.php
wcfsetup/install/files/lib/system/package/plugin/EventListenerPackageInstallationPlugin.class.php
wcfsetup/install/files/lib/system/package/plugin/ObjectTypePackageInstallationPlugin.class.php
wcfsetup/install/files/lib/system/package/plugin/SitemapPackageInstallationPlugin.class.php
wcfsetup/install/files/lib/system/package/plugin/TemplateListenerPackageInstallationPlugin.class.php
wcfsetup/install/files/lib/system/search/acp/ACPSearchHandler.class.php
wcfsetup/install/files/lib/system/search/acp/MenuItemACPSearchResultProvider.class.php
wcfsetup/install/files/lib/system/search/acp/OptionACPSearchResultProvider.class.php
wcfsetup/install/files/lib/system/search/acp/PackageACPSearchResultProvider.class.php
wcfsetup/install/files/lib/system/search/acp/UserGroupOptionACPSearchResultProvider.class.php
wcfsetup/install/files/lib/system/session/SessionHandler.class.php
wcfsetup/install/files/lib/system/sitemap/SitemapHandler.class.php
wcfsetup/install/files/lib/system/style/StyleCompiler.class.php
wcfsetup/install/files/lib/system/style/StyleHandler.class.php
wcfsetup/install/files/lib/system/template/TemplateEngine.class.php
wcfsetup/install/files/lib/system/user/storage/UserStorageHandler.class.php
wcfsetup/setup/db/install.sql

index 70461964c1eca0bee50ea273bd541186faa5c8ec..8eb8a336bb072c59ca014e9b9630b3ee695aa7e0 100644 (file)
@@ -3,9 +3,7 @@ namespace wcf\acp\action;
 use wcf\action\AbstractAction;
 use wcf\system\cache\CacheHandler;
 use wcf\system\exception\SystemException;
-use wcf\system\database\util\PreparedStatementConditionBuilder;
 use wcf\system\language\LanguageFactory;
-use wcf\system\package\PackageDependencyHandler;
 use wcf\system\request\LinkHandler;
 use wcf\system\WCF;
 use wcf\util\FileUtil;
@@ -36,16 +34,12 @@ class CacheClearAction extends AbstractAction {
                // delete language cache and compiled templates as well
                LanguageFactory::getInstance()->deleteLanguageCache();
                
-               $conditions = new PreparedStatementConditionBuilder();
-               $conditions->add("packageID IN (?)", array(PackageDependencyHandler::getInstance()->getDependencies()));
-               $conditions->add("isApplication = ?", array(1));
-               
                // get package dirs
                $sql = "SELECT  packageDir
                        FROM    wcf".WCF_N."_package
-                       ".$conditions;
+                       WHERE   isApplication = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute($conditions->getParameters());
+               $statement->execute(array(1));
                while ($row = $statement->fetchArray()) {
                        $packageDir = FileUtil::getRealPath(WCF_DIR . $row['packageDir']);
                        try {
index 920840800ad6695306d733744181ce75189f20c2..f09be1b422b9d8b5c52e2345d2cd65e1e543ddad 100644 (file)
@@ -5,7 +5,6 @@ use wcf\data\page\menu\item\PageMenuItemEditor;
 use wcf\data\page\menu\item\PageMenuItemList;
 use wcf\system\exception\UserInputException;
 use wcf\system\language\I18nHandler;
-use wcf\system\package\PackageDependencyHandler;
 use wcf\system\WCF;
 use wcf\util\StringUtil;
 
@@ -101,7 +100,6 @@ class PageMenuItemAddForm extends ACPForm {
         */
        protected function initAvailableParentMenuItems() {
                $this->availableParentMenuItems = new PageMenuItemList();
-               $this->availableParentMenuItems->getConditionBuilder()->add("page_menu_item.packageID IN (?)", array(PackageDependencyHandler::getInstance()->getDependencies()));
                $this->availableParentMenuItems->getConditionBuilder()->add("page_menu_item.parentMenuItem = ''");
                $this->availableParentMenuItems->sqlOrderBy = "page_menu_item.showOrder ASC";
        }
index 02aab118587355da92fd08b444130a64a66cc639..1796f8dd0c625e130a81977612f9c157b3efbe8d 100644 (file)
@@ -1,9 +1,8 @@
 <?php
 namespace wcf\acp\form;
-use wcf\data\user\group\option\UserGroupOptionAction;
-
 use wcf\data\user\group\option\category\UserGroupOptionCategoryList;
 use wcf\data\user\group\option\UserGroupOption;
+use wcf\data\user\group\option\UserGroupOptionAction;
 use wcf\data\user\group\UserGroup;
 use wcf\data\DatabaseObject;
 use wcf\system\database\util\PreparedStatementConditionBuilder;
@@ -11,7 +10,6 @@ use wcf\system\exception\IllegalLinkException;
 use wcf\system\exception\PermissionDeniedException;
 use wcf\system\exception\SystemException;
 use wcf\system\exception\UserInputException;
-use wcf\system\package\PackageDependencyHandler;
 use wcf\system\WCF;
 
 /**
@@ -108,6 +106,7 @@ class UserGroupOptionForm extends ACPForm {
                }
                
                // verify options and permissions for current option
+               throw new SystemException("UserGroupOptionForm::readParameters()");
                $dependencies = PackageDependencyHandler::getInstance()->getDependencies();
                if ($this->verifyPermissions($this->userGroupOption) && in_array($this->userGroupOption->packageID, $dependencies)) {
                        // read all categories
index 98ceb8689badd06514c1d049e219260b584d3e62..f711dc50283e0c47d9773705f31725a17b48aa3d 100755 (executable)
@@ -2,11 +2,9 @@
 namespace wcf\acp\page;
 use wcf\system\menu\acp\ACPMenu;
 use wcf\page\AbstractPage;
-use wcf\system\database\util\PreparedStatementConditionBuilder;
 use wcf\system\cache\source\MemcacheAdapter;
 use wcf\system\cache\CacheHandler;
 use wcf\system\exception\SystemException;
-use wcf\system\package\PackageDependencyHandler;
 use wcf\system\Regex;
 use wcf\system\WCF;
 use wcf\util\FileUtil;
@@ -74,16 +72,12 @@ class CacheListPage extends AbstractPage {
                                // set version
                                $this->cacheData['version'] = WCF_VERSION;
                                
-                               $conditions = new PreparedStatementConditionBuilder();
-                               $conditions->add("packageID IN (?)", array(PackageDependencyHandler::getInstance()->getDependencies()));
-                               $conditions->add("isApplication = ?", array(1));
-                               
                                // get package dirs
                                $sql = "SELECT  packageDir
                                        FROM    wcf".WCF_N."_package
-                                       ".$conditions;
+                                       WHERE   isApplication = ?";
                                $statement = WCF::getDB()->prepareStatement($sql);
-                               $statement->execute($conditions->getParameters());
+                               $statement->execute(array(1));
                                while ($row = $statement->fetchArray()) {
                                        $packageDir = FileUtil::getRealPath(WCF_DIR.$row['packageDir']);
                                        $this->readCacheFiles('data', $packageDir.'cache');
@@ -94,16 +88,12 @@ class CacheListPage extends AbstractPage {
                                // set version
                                $this->cacheData['version'] = WCF_VERSION;
                                
-                               $conditions = new PreparedStatementConditionBuilder();
-                               $conditions->add("packageID IN (?)", array(PackageDependencyHandler::getInstance()->getDependencies()));
-                               $conditions->add("isApplication = ?", array(1));
-                               
                                // get package dirs
                                $sql = "SELECT  packageDir
                                        FROM    wcf".WCF_N."_package
-                                       ".$conditions;
+                                       WHERE   isApplication = ?";
                                $statement = WCF::getDB()->prepareStatement($sql);
-                               $statement->execute($conditions->getParameters());
+                               $statement->execute(array(1));
                                while ($row = $statement->fetchArray()) {
                                        $packageDir = FileUtil::getRealPath(WCF_DIR.$row['packageDir']);
                                        $this->readCacheFiles('data', $packageDir.'cache');
@@ -114,16 +104,12 @@ class CacheListPage extends AbstractPage {
                                // set version
                                $this->cacheData['version'] = phpversion('apc');
                                
-                               $conditions = new PreparedStatementConditionBuilder();
-                               $conditions->add("packageID IN (?)", array(PackageDependencyHandler::getInstance()->getDependencies()));
-                               $conditions->add("isApplication = ?", array(1));
-                               
                                // get package dirs
                                $sql = "SELECT  packageDir, packageName, instanceNo
                                        FROM    wcf".WCF_N."_package
-                                       ".$conditions;
+                                       WHERE   isApplication = ?";
                                $statement = WCF::getDB()->prepareStatement($sql);
-                               $statement->execute($conditions->getParameters());
+                               $statement->execute(array(1));
                                
                                $packageNames = array();
                                while ($row = $statement->fetchArray()) {
index 058d99ac2ac18558cb6179c9e06b277b2c161aba..5e3ddaa0cc37593efe7e20a1e9b76d3a6532a5b2 100755 (executable)
@@ -2,7 +2,6 @@
 namespace wcf\acp\page;
 use wcf\page\SortablePage;
 use wcf\system\menu\acp\ACPMenu;
-use wcf\system\package\PackageDependencyHandler;
 
 /**
  * Shows information about configured cron jobs.
@@ -41,7 +40,6 @@ class CronjobListPage extends SortablePage {
        public function initObjectList() {
                parent::initObjectList();
                
-               $this->objectList->getConditionBuilder()->add("cronjob.packageID IN (?)", array(PackageDependencyHandler::getInstance()->getDependencies()));
                $this->sqlOrderBy = "cronjob.".$this->sortField." ".$this->sortOrder;
        }
        
index 7ef4195ad0c4cf57e2bcf69abdb94581a3c5f247..fab57cc15c7c6a3e53dac321cef85af78cdb37a6 100755 (executable)
@@ -2,7 +2,6 @@
 namespace wcf\acp\page;
 use wcf\page\SortablePage;
 use wcf\system\menu\acp\ACPMenu;
-use wcf\system\package\PackageDependencyHandler;
 
 /**
  * Shows cronjob log information.
@@ -53,7 +52,6 @@ class CronjobLogListPage extends SortablePage {
                
                $this->objectList->sqlSelects = "cronjob.*";
                $this->objectList->sqlJoins = "LEFT JOIN wcf".WCF_N."_cronjob cronjob ON (cronjob.cronjobID = cronjob_log.cronjobID)";
-               $this->objectList->getConditionBuilder()->add("cronjob_log.cronjobID IN (SELECT cronjobID FROM wcf".WCF_N."_cronjob WHERE packageID IN (?))", array(PackageDependencyHandler::getInstance()->getDependencies()));
        }
        
        /**
index 57a160bff33002225d70fb69732ca9f754fde500..5e1c9dd1cf07ee833105b908408e70c28f832dbe 100644 (file)
@@ -4,7 +4,6 @@ use wcf\data\page\menu\item\PageMenuItemList;
 use wcf\data\page\menu\item\ViewablePageMenuItem;
 use wcf\page\AbstractPage;
 use wcf\system\menu\acp\ACPMenu;
-use wcf\system\package\PackageDependencyHandler;
 use wcf\system\WCF;
 
 /**
@@ -42,7 +41,6 @@ class PageMenuItemListPage extends AbstractPage {
                parent::readData();
                
                $menuItemList = new PageMenuItemList();
-               $menuItemList->getConditionBuilder()->add("page_menu_item.packageID IN (?)", array(PackageDependencyHandler::getInstance()->getDependencies()));
                $menuItemList->sqlOrderBy = "page_menu_item.parentMenuItem ASC, page_menu_item.showOrder ASC";
                $menuItemList->readObjects();
                
index 7d8f45c9d75aeaec3d101299f09fbb6456b01760..99ecbbdae1a3b4e6479da406b6b31fa1fac81876 100755 (executable)
@@ -314,13 +314,12 @@ class UserListPage extends SortablePage {
         * Gets the user options from cache.
         */
        protected function readUserOptions() {
-               $cacheName = 'user-option-'.PACKAGE_ID;
                CacheHandler::getInstance()->addResource(
-                       $cacheName,
-                       WCF_DIR.'cache/cache.'.$cacheName.'.php',
+                       'userOption',
+                       WCF_DIR.'cache/cache.userOption.php',
                        'wcf\system\cache\builder\OptionCacheBuilder'
                );
-               $this->options = CacheHandler::getInstance()->get($cacheName, 'options');
+               $this->options = CacheHandler::getInstance()->get('userOption', 'options');
                
                foreach ($this->options as &$option) {
                        $option = new ViewableUserOption($option);
index 60614836814961c533e27cce10fb33ef2a8fbd98..e783e0400a7bff48620844e3a5591a43c51b2138 100644 (file)
@@ -27,9 +27,6 @@ class ACPSessionEditor extends DatabaseObjectEditor {
                if (isset($parameters['userID']) && !$parameters['userID']) {
                        $parameters['userID'] = null;
                }
-               if (isset($parameters['packageID']) && !$parameters['packageID']) {
-                       $parameters['packageID'] = null;
-               }
                
                return parent::create($parameters);
        }
@@ -41,9 +38,6 @@ class ACPSessionEditor extends DatabaseObjectEditor {
                if (isset($parameters['userID']) && !$parameters['userID']) {
                        $parameters['userID'] = null;
                }
-               if (isset($parameters['packageID']) && !$parameters['packageID']) {
-                       $parameters['packageID'] = null;
-               }
                
                return parent::update($parameters);
        }
index 8e4f888188f914e29056c482257b7eb03aec2697..81dbf456ab2798dd2ecdd37c16ac5b1c92079dcd 100644 (file)
@@ -26,14 +26,13 @@ class ApplicationAction extends AbstractDatabaseObjectAction {
        /**
         * Assigns a list of applications to a group and computes cookie domain and path.
         */
-       public function group() {
+       public function rebuild() {
                if (empty($this->objects)) {
                        $this->readObjects();
                }
                
                $sql = "UPDATE  wcf".WCF_N."_application
-                       SET     groupID = ?,
-                               cookieDomain = ?,
+                       SET     cookieDomain = ?,
                                cookiePath = ?,
                                isPrimary = ?
                        WHERE   packageID = ?";
@@ -79,7 +78,6 @@ class ApplicationAction extends AbstractDatabaseObjectAction {
                                $isPrimary = ($this->parameters['primaryApplication'] == $packageID) ? 1 : 0;
                                
                                $statement->execute(array(
-                                       $this->parameters['groupID'],
                                        $domainName,
                                        $path,
                                        $isPrimary,
@@ -91,48 +89,4 @@ class ApplicationAction extends AbstractDatabaseObjectAction {
                
                $this->rebuild();
        }
-       
-       /**
-        * Removes a list of applications from their group and resets the cookie domain and path.
-        */
-       public function ungroup() {
-               if (empty($this->objects)) {
-                       $this->readObjects();
-               }
-               
-               $sql = "UPDATE  wcf".WCF_N."_application
-                       SET     groupID = ?,
-                               cookieDomain = domainName,
-                               cookiePath = domainPath,
-                               isPrimary = 0
-                       WHERE   packageID = ?";
-               $statement = WCF::getDB()->prepareStatement($sql);
-               
-               WCF::getDB()->beginTransaction();
-               foreach ($this->objects as $application) {
-                       $statement->execute(array(
-                               null,
-                               $application->packageID
-                       ));
-               }
-               WCF::getDB()->commitTransaction();
-               
-               $this->rebuild();
-       }
-       
-       /**
-        * Rebuilds application cache and dependencies.
-        */
-       protected function rebuild() {
-               foreach ($this->objects as $application) {
-                       // reset cache
-                       $directory = PackageCache::getInstance()->getPackage($application->packageID)->packageDir;
-                       $directory = FileUtil::getRealPath(WCF_DIR.$directory);
-                       
-                       CacheHandler::getInstance()->clear($directory.'cache', '*.php');
-                       
-                       // rebuild dependencies
-                       Package::rebuildPackageDependencies($application->packageID);
-               }
-       }
 }
diff --git a/wcfsetup/install/files/lib/data/application/group/ApplicationGroup.class.php b/wcfsetup/install/files/lib/data/application/group/ApplicationGroup.class.php
deleted file mode 100644 (file)
index 8631c87..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-<?php
-namespace wcf\data\application\group;
-use wcf\data\DatabaseObject;
-
-/**
- * Represents an application group.
- * 
- * @author     Alexander Ebert
- * @copyright  2001-2012 WoltLab GmbH
- * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @package    com.woltlab.wcf
- * @subpackage data.application.group
- * @category   Community Framework
- */
-class ApplicationGroup extends DatabaseObject {
-       /**
-        * @see wcf\data\DatabaseObject::$databaseTableName
-        */
-       protected static $databaseTableName = 'application_group';
-       
-       /**
-        * @see wcf\data\DatabaseObject::$databaseTableIndexName
-        */
-       protected static $databaseTableIndexName = 'groupID';
-}
diff --git a/wcfsetup/install/files/lib/data/application/group/ApplicationGroupAction.class.php b/wcfsetup/install/files/lib/data/application/group/ApplicationGroupAction.class.php
deleted file mode 100644 (file)
index e724384..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
-<?php
-namespace wcf\data\application\group;
-use wcf\data\application\ApplicationAction;
-use wcf\data\application\ApplicationList;
-use wcf\data\AbstractDatabaseObjectAction;
-use wcf\system\cache\CacheHandler;
-use wcf\system\language\LanguageFactory;
-
-/**
- * Executes application group-related actions.
- * 
- * @author     Alexander Ebert
- * @copyright  2001-2012 WoltLab GmbH
- * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @package    com.woltlab.wcf
- * @subpackage data.application.group
- * @category   Community Framework
- */
-class ApplicationGroupAction extends AbstractDatabaseObjectAction {
-       /**
-        * @see wcf\data\AbstractDatabaseObjectAction::$className
-        */
-       protected $className = 'wcf\data\application\group\ApplicationGroupEditor';
-       
-       /**
-        * @see wcf\data\AbstractDatabaseObjectAction::$permissionsDelete
-        */
-       protected $permissionsDelete = array('admin.system.canManageApplication');
-       
-       /**
-        * @see wcf\data\AbstractDatabaseObjectAction::create()
-        */
-       public function create() {
-               $applicationGroup = parent::create();
-               
-               $applicationAction = new ApplicationAction($this->parameters['applications'], 'group', array(
-                       'groupID' => $applicationGroup->groupID,
-                       'primaryApplication' => $this->parameters['primaryApplication']
-               ));
-               $applicationAction->executeAction();
-               
-               return $applicationGroup;
-       }
-       
-       /**
-        * @see wcf\data\AbstractDatabaseObjectAction::update()
-        */
-       public function update() {
-               parent::update();
-               
-               // read list of currently associated applications
-               $applicationGroup = current(reset($this->objects));
-               $applicationList = new ApplicationList();
-               $applicationList->getConditionBuilder()->add("application.groupID = ?", array($applicationGroup->groupID));
-               $applicationList->sqlLimit = 0;
-               $applicationList->readObjects();
-               
-               $updateApplications = $removeApplications = array();
-               foreach ($applicationList as $application) {
-                       $index = array_search($application->packageID, $this->parameters['applications']);
-                       if ($index === false) {
-                               $removeApplications[] = $application;
-                       }
-                       else {
-                               // already existing
-                               $updateApplications[] = $application;
-                               unset($this->parameters['applications'][$index]);
-                       }
-               }
-               
-               if (!empty($this->parameters['applications'])) {
-                       $applicationList = new ApplicationList();
-                       $applicationList->getConditionBuilder()->add("application.packageID IN (?)", $this->parameters['applications']);
-                       $applicationList->sqlLimit = 0;
-                       $applicationList->readObjects();
-                       $updateApplications = array_merge($updateApplications, $applicationList->getObjects());
-               }
-               
-               // rebuild current group
-               $applicationAction = new ApplicationAction($updateApplications, 'group', array(
-                       'groupID' => $applicationGroup->groupID,
-                       'primaryApplication' => $this->parameters['primaryApplication']
-               ));
-               $applicationAction->executeAction();
-               
-               // remove applications from group
-               if (!empty($removeApplications)) {
-                       $applicationAction = new ApplicationAction($removeApplications, 'ungroup');
-                       $applicationAction->executeAction();
-               }
-               
-               $this->clearCache();
-       }
-       
-       /**
-        * @see wcf\data\AbstractDatabaseObjectAction::delete()
-        */
-       public function delete() {
-               // read all associated applications
-               $applicationGroup = current($this->objects);
-               $applicationList = new ApplicationList();
-               $applicationList->getConditionBuilder()->add("application.groupID = ?", array($applicationGroup->groupID));
-               $applicationList->sqlLimit = 0;
-               $applicationList->readObjects();
-               
-               $applicationAction = new ApplicationAction($applicationList->getObjects(), 'ungroup');
-               $applicationAction->executeAction();
-               
-               $this->clearCache();
-               
-               return parent::delete();
-       }
-       
-       /**
-        * Clears WCF cache.
-        */
-       protected function clearCache() {
-               // delete language cache and compiled templates
-               LanguageFactory::getInstance()->deleteLanguageCache();
-               
-               // delete WCF cache
-               CacheHandler::getInstance()->clear(WCF_DIR.'cache', '*.php');
-               CacheHandler::getInstance()->clear(WCF_DIR.'cache/templateListener', '*.php');
-       }
-}
diff --git a/wcfsetup/install/files/lib/data/application/group/ApplicationGroupEditor.class.php b/wcfsetup/install/files/lib/data/application/group/ApplicationGroupEditor.class.php
deleted file mode 100644 (file)
index 3991026..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-<?php
-namespace wcf\data\application\group;
-use wcf\data\DatabaseObjectEditor;
-
-/**
- * Provides functions to edit application groups.
- * 
- * @author     Alexander Ebert
- * @copyright  2001-2012 WoltLab GmbH
- * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @package    com.woltlab.wcf
- * @subpackage data.application.group
- * @category   Community Framework
- */
-class ApplicationGroupEditor extends DatabaseObjectEditor {
-       /**
-        * @see wcf\data\DatabaseObjectDecorator::$baseClass
-        */
-       protected static $baseClass = 'wcf\data\application\group\ApplicationGroup';
-}
diff --git a/wcfsetup/install/files/lib/data/application/group/ApplicationGroupList.class.php b/wcfsetup/install/files/lib/data/application/group/ApplicationGroupList.class.php
deleted file mode 100644 (file)
index d730161..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-<?php
-namespace wcf\data\application\group;
-use wcf\data\DatabaseObjectList;
-
-/**
- * Represents a list of application groups.
- * 
- * @author     Alexander Ebert
- * @copyright  2001-2012 WoltLab GmbH
- * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @package    com.woltlab.wcf
- * @subpackage data.application.group
- * @category   Community Framework
- */
-class ApplicationGroupList extends DatabaseObjectList {
-       /**
-        * @see wcf\data\DatabaseObjectList::$className
-        */
-       public $className = 'wcf\data\application\group\ApplicationGroup';
-}
diff --git a/wcfsetup/install/files/lib/data/application/group/ViewableApplicationGroup.class.php b/wcfsetup/install/files/lib/data/application/group/ViewableApplicationGroup.class.php
deleted file mode 100644 (file)
index 06633f0..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-<?php
-namespace wcf\data\application\group;
-use wcf\data\application\ViewableApplication;
-use wcf\data\DatabaseObjectDecorator;
-
-/**
- * Provides a viewable application group.
- * 
- * @author     Alexander Ebert
- * @copyright  2001-2012 WoltLab GmbH
- * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @package    com.woltlab.wcf
- * @subpackage data.application.group
- * @category   Community Framework
- */
-class ViewableApplicationGroup extends DatabaseObjectDecorator implements \Countable, \Iterator {
-       /**
-        * @see wcf\data\DatabaseObjectDecorator::$baseClass
-        */
-       protected static $baseClass = 'wcf\data\application\group\ApplicationGroup';
-       
-       /**
-        * list of viewable applications
-        * @var array<wcf\data\application\ViewableApplication>
-        */
-       protected $applications = array();
-       
-       /**
-        * current iterator index
-        * @var integer
-        */
-       protected $index = 0;
-       
-       /**
-        * Assigns an application to this group.
-        * 
-        * @param       wcf\data\application\ViewableApplication        $application
-        */
-       public function addApplication(ViewableApplication $application) {
-               if ($this->groupID == $application->groupID) {
-                       $this->applications[] = $application;
-               }
-       }
-       
-       /**
-        * @see \Countable::count()
-        */
-       public function count() {
-               return count($this->applications);
-       }
-       
-       /**
-        * @see \Iterator::current()
-        */
-       public function current() {
-               return $this->applications[$this->index];
-       }
-       
-       /**
-        * @see \Iterator::key()
-        */
-       public function key() {
-               return $this->applications[$this->index];
-       }
-       
-       /**
-        * @see \Iterator::next()
-        */
-       public function next() {
-               ++$this->index;
-       }
-       
-       /**
-        * @see \Iterator::rewind()
-        */
-       public function rewind() {
-               $this->index = 0;
-       }
-       
-       /**
-        * @see \Iterator::valid()
-        */
-       public function valid() {
-               return isset($this->applications[$this->index]);
-       }
-}
index 43c205365d1016d69cb0d189362ae9a82bd46fbd..51cb8780abea3b96158c43c9310f199a12ccaeaf 100644 (file)
@@ -213,6 +213,6 @@ class CategoryEditor extends DatabaseObjectEditor implements IEditableCachedObje
         * @see wcf\data\IEditableCachedObject::resetCache()
         */
        public static function resetCache() {
-               CacheHandler::getInstance()->clear(WCF_DIR.'cache/', 'cache.category-'.PACKAGE_ID.'.php');
+               CacheHandler::getInstance()->clear(WCF_DIR.'cache/', 'cache.category.php');
        }
 }
index 07d456e53e427fbc81800f9554b9bbfccf0ae4f3..854539d9624f3763c5cb1de9856c44cd5d87b4fd 100644 (file)
@@ -40,6 +40,11 @@ class Cronjob extends DatabaseObject {
         */
        const EXECUTING = 2;
        
+       /**
+        * maximum number of allowed fails
+        */
+       const MAX_FAIL_COUNT = 3;
+       
        /**
         * Returns timestamp of next execution.
         * 
index 56f5ca41940d5443cd359b1ead73211664c970a5..2d94b265231c1e9e6f21eb91e35ab234fa89cdfd 100644 (file)
@@ -111,6 +111,6 @@ class CronjobEditor extends DatabaseObjectEditor implements IEditableCachedObjec
         * @see wcf\data\IEditableCachedObject::resetCache()
         */
        public static function resetCache() {
-               CacheHandler::getInstance()->clear(WCF_DIR.'cache', 'cache.cronjobs-*');
+               CacheHandler::getInstance()->clear(WCF_DIR.'cache', 'cache.cronjob.php');
        }
 }
index 5ffab15e6d6525fbe0662258ac17443bcd949a99..07956d87b2d403b1634bb2a928b5c41779fd4320 100644 (file)
@@ -22,17 +22,10 @@ class CronjobLogEditor extends DatabaseObjectEditor {
        /**
         * Deletes the cronjob log.
         */
-       public static function clearLogs($packageID = PACKAGE_ID) {
+       public static function clearLogs() {
                // delete logs
-               $sql = "DELETE FROM     wcf".WCF_N."_cronjob_log
-                       WHERE           cronjobID IN (
-                                               SELECT  cronjobID
-                                               FROM    wcf".WCF_N."_cronjob cronjob,
-                                                       wcf".WCF_N."_package_dependency package_dependency
-                                               WHERE   cronjob.packageID = package_dependency.dependency
-                                                       AND package_dependency.packageID = ?
-                                       )";
+               $sql = "DELETE FROM     wcf".WCF_N."_cronjob_log";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($packageID));
+               $statement->execute();
        }
 }
index fe250c460fbad22cfb79782ebe4a5a1675b14646..c2316430c1a7a1f7c4d26d06101587570fe314cb 100644 (file)
@@ -11,7 +11,6 @@ use wcf\system\database\util\PreparedStatementConditionBuilder;
 use wcf\system\exception\SystemException;
 use wcf\system\io\File;
 use wcf\system\language\LanguageFactory;
-use wcf\system\package\PackageDependencyHandler;
 use wcf\system\Regex;
 use wcf\system\WCF;
 use wcf\util\DirectoryUtil;
@@ -91,25 +90,10 @@ class LanguageEditor extends DatabaseObjectEditor implements IEditableCachedObje
                                $conditions->add("languageCategoryID = ?", array($categoryID));
                                
                                // get language items
-                               if ($packageID === 0) {
-                                       // update after wcf installation
-                                       $conditions->add("packageID IS NULL");
-                                       
-                                       $sql = "SELECT  languageItem, languageItemValue, languageCustomItemValue, languageUseCustomValue
-                                               FROM    wcf".WCF_N."_language_item
-                                               ".$conditions;
-                               }
-                               else {
-                                       // update after regular package installation or update or manual import
-                                       $conditions->add("package_dependency.packageID = ?", array($packageID));
-                                       
-                                       $sql = "SELECT          languageItem, languageItemValue, languageCustomItemValue, languageUseCustomValue
-                                               FROM            wcf".WCF_N."_language_item language_item
-                                               LEFT JOIN       wcf".WCF_N."_package_dependency package_dependency
-                                               ON              (package_dependency.dependency = language_item.packageID)
-                                               ".$conditions."
-                                               ORDER BY        package_dependency.priority ASC";
-                               }
+                               $conditions->add("packageID IS NULL");
+                               $sql = "SELECT  languageItem, languageItemValue, languageCustomItemValue, languageUseCustomValue
+                                       FROM    wcf".WCF_N."_language_item
+                                       ".$conditions;
                                
                                $statement2 = WCF::getDB()->prepareStatement($sql);
                                $statement2->execute($conditions->getParameters());
@@ -150,6 +134,7 @@ class LanguageEditor extends DatabaseObjectEditor implements IEditableCachedObje
         */
        public function export($packageIDArray = array(), $exportCustomValues = false) {
                $conditions = new PreparedStatementConditionBuilder();
+               $conditions->add("language_item.languageID = ?", array($this->languageID));
                
                // bom
                echo "\xEF\xBB\xBF";
@@ -160,30 +145,14 @@ class LanguageEditor extends DatabaseObjectEditor implements IEditableCachedObje
                // get items
                $items = array();
                if (!empty($packageIDArray)) {
-                       // sql conditions
                        $conditions->add("language_item.packageID IN (?)", array($packageIDArray));
-                       $conditions->add("language_item.languageID = ?", array($this->languageID));
-                       
-                       $sql = "SELECT          languageItem, " . ($exportCustomValues ? "CASE WHEN languageUseCustomValue > 0 THEN languageCustomItemValue ELSE languageItemValue END AS languageItemValue" : "languageItemValue") . ", languageCategory
-                               FROM            wcf".WCF_N."_language_item language_item
-                               LEFT JOIN       wcf".WCF_N."_language_category language_category
-                               ON              (language_category.languageCategoryID = language_item.languageCategoryID)
-                               ".$conditions;
-               }
-               else {
-                       // sql conditions
-                       $conditions->add("language_item.packageID = package_dependency.dependency");
-                       $conditions->add("package_dependency.packageID = ?", array(PACKAGE_ID));
-                       $conditions->add("language_item.languageID = ?", array($this->languageID));
-                               
-                       $sql = "SELECT          languageItem, " . ($exportCustomValues ? "CASE WHEN languageUseCustomValue > 0 THEN languageCustomItemValue ELSE languageItemValue END AS languageItemValue" : "languageItemValue") . ", languageCategory
-                               FROM            wcf".WCF_N."_package_dependency package_dependency,
-                                               wcf".WCF_N."_language_item language_item
-                               LEFT JOIN       wcf".WCF_N."_language_category language_category
-                               ON              (language_category.languageCategoryID = language_item.languageCategoryID)
-                               ".$conditions."
-                               ORDER BY        package_dependency.priority ASC";
                }
+                       
+               $sql = "SELECT          languageItem, " . ($exportCustomValues ? "CASE WHEN languageUseCustomValue > 0 THEN languageCustomItemValue ELSE languageItemValue END AS languageItemValue" : "languageItemValue") . ", languageCategory
+                       FROM            wcf".WCF_N."_language_item language_item
+                       LEFT JOIN       wcf".WCF_N."_language_category language_category
+                       ON              (language_category.languageCategoryID = language_item.languageCategoryID)
+                       ".$conditions;
                $statement = WCF::getDB()->prepareStatement($sql);
                $statement->execute($conditions->getParameters());
                while ($row = $statement->fetchArray()) {
@@ -502,11 +471,8 @@ class LanguageEditor extends DatabaseObjectEditor implements IEditableCachedObje
                
                // find existing language items
                $languageItemList = new LanguageItemList();
-               $languageItemList->sqlJoins = "LEFT JOIN wcf".WCF_N."_package_dependency package_dependency ON (package_dependency.dependency = language_item.packageID)";
-               $languageItemList->getConditionBuilder()->add("package_dependency.packageID = ?", array($packageID));
                $languageItemList->getConditionBuilder()->add("language_item.languageItem IN (?)", array(array_keys($items)));
                $languageItemList->getConditionBuilder()->add("languageID = ?", array($this->languageID));
-               $languageItemList->sqlOrderBy = "package_dependency.priority ASC";
                $languageItemList->sqlLimit = 0;
                $languageItemList->readObjects();
                
@@ -572,7 +538,7 @@ class LanguageEditor extends DatabaseObjectEditor implements IEditableCachedObje
         * Clears language cache.
         */     
        public function clearCache() {
-               CacheHandler::getInstance()->clear(WCF_DIR.'cache/', 'cache.languages.php');
+               CacheHandler::getInstance()->clear(WCF_DIR.'cache/', 'cache.language.php');
        }
        
        /**
@@ -622,7 +588,6 @@ class LanguageEditor extends DatabaseObjectEditor implements IEditableCachedObje
                }
                
                $conditionBuilder->add($searchCondition, $statementParameters);
-               $conditionBuilder->add("packageID IN (?)", array(PackageDependencyHandler::getInstance()->getDependencies()));
                if ($languageID !== null) $conditionBuilder->add("languageID = ?", array($languageID));
                
                // search
index 81cb75e5ac64ed158392c3b6c803f7feef902570..057a2a3a84fa8d8815ad5ac2477e3eb7621b639d 100644 (file)
@@ -49,15 +49,19 @@ class ObjectTypeCache extends SingletonFactory {
         */
        protected function init() {
                // get definition cache
-               CacheHandler::getInstance()->addResource('objectType-'.PACKAGE_ID, WCF_DIR.'cache/cache.objectType-'.PACKAGE_ID.'.php', 'wcf\system\cache\builder\ObjectTypeCacheBuilder');
-               $this->definitionsByCategory = CacheHandler::getInstance()->get('objectType-'.PACKAGE_ID, 'categories');
-               $this->definitions = CacheHandler::getInstance()->get('objectType-'.PACKAGE_ID, 'definitions');
+               CacheHandler::getInstance()->addResource(
+                       'objectType',
+                       WCF_DIR.'cache/cache.objectType.php',
+                       'wcf\system\cache\builder\ObjectTypeCacheBuilder'
+               );
+               $this->definitionsByCategory = CacheHandler::getInstance()->get('objectType', 'categories');
+               $this->definitions = CacheHandler::getInstance()->get('objectType', 'definitions');
                foreach ($this->definitions as $definition) {
                        $this->definitionsByName[$definition->definitionName] = $definition;
                }
                
                // get object type cache
-               $this->objectTypes = CacheHandler::getInstance()->get('objectType-'.PACKAGE_ID, 'objectTypes');
+               $this->objectTypes = CacheHandler::getInstance()->get('objectType', 'objectTypes');
                foreach ($this->objectTypes as $objectType) {
                        $definition = $this->getDefinition($objectType->definitionID);
                        if (!isset($this->groupedObjectTypes[$definition->definitionName])) {
@@ -162,7 +166,7 @@ class ObjectTypeCache extends SingletonFactory {
         * Resets and reloads the object type cache.
         */
        public function resetCache() {
-               CacheHandler::getInstance()->clearResource('objectType-'.PACKAGE_ID);
+               CacheHandler::getInstance()->clearResource('objectType');
                $this->init();
        }
 }
index 6b0eae1ac69c97e808614a7b5996bf27a9e1a5a2..a54662763506666a19dd7c2b7f9aaa46e8e092ae 100644 (file)
@@ -51,24 +51,20 @@ class Option extends DatabaseObject {
        /**
         * Returns a list of options.
         * 
-        * @param       integer         $packageID
         * @return      array<wcf\data\option\Option>
         */
-       public static function getOptions($packageID = PACKAGE_ID) {
+       public static function getOptions() {
                $sql = "SELECT          option_table.*,
                                        package.package, package.isApplication,
                                        parent_package.package AS parentPackage,
                                        parent_package.isApplication AS parentPackageIsApplication
-                       FROM            wcf".WCF_N."_package_dependency package_dependency,
-                                       wcf".WCF_N."_option option_table
+                       FROM            wcf".WCF_N."_option option_table
                        LEFT JOIN       wcf".WCF_N."_package package
                        ON              (package.packageID = option_table.packageID)
                        LEFT JOIN       wcf".WCF_N."_package parent_package
-                       ON              (parent_package.packageID = package.parentPackageID)
-                       WHERE           package_dependency.dependency = option_table.packageID
-                                       AND package_dependency.packageID = ?";
+                       ON              (parent_package.packageID = package.parentPackageID)";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($packageID));
+               $statement->execute();
                while ($row = $statement->fetchArray()) {
                        $option = new Option(null, $row);
                        $options[$option->getConstantName()] = $option;
index 53334cb41d8e32cb257d37d580eda7d79e3ff5fe..bc193d90bcc9c42e89ac48b39c07f454be461b28 100644 (file)
@@ -37,13 +37,9 @@ class OptionEditor extends DatabaseObjectEditor implements IEditableCachedObject
        public static function import(array $options) {
                // get option ids
                $sql = "SELECT          optionName, optionID
-                       FROM            wcf".WCF_N."_option option_table
-                       LEFT JOIN       wcf".WCF_N."_package_dependency package_dependency
-                       ON              (package_dependency.dependency = option_table.packageID)
-                       WHERE           package_dependency.packageID = ?
-                       ORDER BY        package_dependency.priority ASC";
+                       FROM            wcf".WCF_N."_option";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(PACKAGE_ID));
+               $statement->execute();
                $optionIDs = array();
                while ($row = $statement->fetchArray()) {
                        $optionIDs[$row['optionName']] = $row['optionID'];
@@ -86,7 +82,7 @@ class OptionEditor extends DatabaseObjectEditor implements IEditableCachedObject
         */
        public static function resetCache() {
                // reset cache
-               CacheHandler::getInstance()->clear(WCF_DIR.'cache', 'cache.option-*.php');
+               CacheHandler::getInstance()->clear(WCF_DIR.'cache', 'cache.option.php');
                
                // reset options.inc.php files
                $sql = "SELECT  package, packageID, packageDir
index 85021f9330b68d729e7c7b8c2c68ac7993c3be5e..2f55314519e9f53c44d0d2cb98f4e1a423a64525 100644 (file)
@@ -5,7 +5,7 @@ use wcf\system\database\statement\PreparedStatement;
 use wcf\system\database\util\PreparedStatementConditionBuilder;
 use wcf\system\exception\SystemException;
 use wcf\system\io\File;
-use wcf\system\package\PackageDependencyHandler;
+use wcf\system\package\PackageInstallationDispatcher;
 use wcf\system\WCF;
 use wcf\util\FileUtil;
 use wcf\util\StringUtil;
@@ -123,18 +123,7 @@ class Package extends DatabaseObject {
         */
        public function getDependencies() {
                if ($this->dependencies === null) {
-                       $this->dependencies = array();
-                       
-                       $sql = "SELECT          package.*, CASE WHEN instanceName <> '' THEN instanceName ELSE packageName END AS packageName
-                               FROM            wcf".WCF_N."_package_dependency package_dependency
-                               LEFT JOIN       wcf".WCF_N."_package package ON (package.packageID = package_dependency.dependency)
-                               WHERE           package_dependency.packageID = ?
-                               ORDER BY        packageName ASC";
-                       $statement = WCF::getDB()->prepareStatement($sql);
-                       $statement->execute(array($this->packageID));
-                       while ($package = $statement->fetchObject('wcf\data\package\Package')) {
-                               $this->dependencies[$package->packageID] = $package;
-                       }
+                       throw new SystemException("Package::getDependencies()");
                }
                
                return $this->dependencies;
@@ -361,206 +350,6 @@ class Package extends DatabaseObject {
                }
        }
        
-       /**
-        * Rebuilds the dependencies list for the given package id.
-        * 
-        * @param       integer         $packageID
-        */
-       public static function rebuildPackageDependencies($packageID) {
-               // delete old dependencies
-               $sql = "DELETE FROM     wcf".WCF_N."_package_dependency
-                       WHERE           packageID = ?";
-               $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($packageID));
-               
-               // get all requirements of this package
-               $allRequirements = array($packageID);
-               $sql = "SELECT  requirement
-                       FROM    wcf".WCF_N."_package_requirement_map
-                       WHERE   packageID = ?";
-               $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($packageID));
-               while ($row = $statement->fetchArray()) {
-                       $allRequirements[] = $row['requirement'];
-               }
-               
-               // find their plugins
-               $requirements = $allRequirements;
-               do {
-                       $conditions = new PreparedStatementConditionBuilder();
-                       $conditions->add("packageID IN (SELECT packageID FROM wcf".WCF_N."_package WHERE parentPackageID IN (?))", array($requirements));
-                       $conditions->add("requirement NOT IN (?)", array($allRequirements));
-                       
-                       $sql = "SELECT  DISTINCT requirement
-                               FROM    wcf".WCF_N."_package_requirement_map
-                               ".$conditions;
-                       $statement = WCF::getDB()->prepareStatement($sql);
-                       $statement->execute($conditions->getParameters());
-                       $requirements = array();
-                       while ($row = $statement->fetchArray()) {
-                               $requirements[] = $row['requirement'];
-                               $allRequirements[] = $row['requirement'];
-                       }
-               }
-               while (!empty($requirements));
-               
-               // rebuild
-               // select requirements
-               $conditions = new PreparedStatementConditionBuilder(false);
-               $conditions->add("requirement IN (?)", array($allRequirements));
-               
-               $statementParameters = $conditions->getParameters();
-               $statementParameters[] = $packageID;
-               $statementParameters[] = $packageID;
-               
-               $requirements = array();
-               $sql = "SELECT          requirement, level
-                       FROM            wcf".WCF_N."_package_requirement_map
-                       WHERE           ".$conditions."
-                                       AND requirement NOT IN (                -- exclude dependencies to other installations of same package
-                                               SELECT  packageID
-                                               FROM    wcf".WCF_N."_package
-                                               WHERE   package = (
-                                                               SELECT  package
-                                                               FROM    wcf".WCF_N."_package
-                                                               WHERE   packageID = ?
-                                                       )
-                                                       AND packageID <> ?
-                                       )
-                       ORDER BY        level ASC";
-               $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute($statementParameters);
-               while ($row = $statement->fetchArray()) {
-                       $requirements[$row['requirement']] = $row['level'];
-               }
-               
-               // insert requirements
-               $sql = "INSERT INTO     wcf".WCF_N."_package_dependency
-                                       (packageID, dependency, priority)
-                       VALUES          (?, ?, ?)";
-               $statement = WCF::getDB()->prepareStatement($sql);
-               
-               $insertedDependencies = self::insertApplicationDependencies($packageID, $statement);
-               $shiftPriority = (empty($insertedDependencies)) ? false : true;
-               foreach ($requirements as $dependency => $priority) {
-                       $statement->execute(array(
-                               $packageID,
-                               $dependency,
-                               ($shiftPriority ? ($priority + 1) : $priority)
-                       ));
-                       
-                       if (!isset($insertedDependencies[$packageID])) {
-                               $insertedDependencies[$packageID] = array();
-                       }
-                       
-                       $insertedDependencies[$packageID][] = $dependency;
-               }
-               
-               // select plugins
-               $conditions = new PreparedStatementConditionBuilder();
-               $conditions->add("parentPackageID IN (?)", array($allRequirements));
-               
-               $plugins = array();
-               $sql = "SELECT          packageID,
-                                       (
-                                               SELECT  MAX(level) AS level
-                                               FROM    wcf".WCF_N."_package_requirement_map
-                                               WHERE   packageID = package.packageID
-                                       ) AS requirementLevel
-                       FROM            wcf".WCF_N."_package package
-                       ".$conditions."
-                       ORDER BY        requirementLevel ASC";
-               $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute($conditions->getParameters());
-               while ($row = $statement->fetchArray()) {
-                       $row['requirementLevel'] = intval($row['requirementLevel']) + 1;
-                       $plugins[$row['packageID']] = $row['requirementLevel'];
-               }
-               
-               // insert plugins
-               $sql = "INSERT INTO     wcf".WCF_N."_package_dependency
-                                       (packageID, dependency, priority)
-                       VALUES          (?, ?, ?)";
-               $statement = WCF::getDB()->prepareStatement($sql);
-               foreach ($plugins as $dependency => $priority) {
-                       // ignore already inserted dependencies
-                       if (isset($insertedDependencies[$packageID]) && in_array($dependency, $insertedDependencies[$packageID])) {
-                               continue;
-                       }
-                       
-                       $statement->execute(array($packageID, $dependency, $priority));
-               }
-               
-               // in some cases (e.g. if rebuilding dependencies for WCF) it is very likely, that
-               // there is always a dependency on the package itself. This was avoided in the past
-               // by using INSERT IGNORE, thus we have to validate if a self-depdendency already
-               // exist before inserting.
-               $sql = "SELECT  COUNT(*) AS count
-                       FROM    wcf".WCF_N."_package_dependency
-                       WHERE   packageID = ?
-                               AND dependency = ?";
-               $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(
-                       $packageID,
-                       $packageID
-               ));
-               $row = $statement->fetchArray();
-               
-               // no dependencies on the package itself exists yet
-               if (!$row['count']) {
-                       // self insert
-                       $sql = "SELECT  (MAX(priority) + 1) AS priority
-                               FROM    wcf".WCF_N."_package_dependency";
-                       $statement = WCF::getDB()->prepareStatement($sql);
-                       $statement->execute();
-                       
-                       $row = $statement->fetchArray();
-                       if (!$row || !$row['priority']) {
-                               $row['priority'] = 0;
-                       }
-                       
-                       $sql = "INSERT INTO     wcf".WCF_N."_package_dependency
-                                               (packageID, dependency, priority)
-                               VALUES          (?, ?, ?)";
-                       $statement = WCF::getDB()->prepareStatement($sql);
-                       $statement->execute(array($packageID, $packageID, $row['priority']));
-               }
-       }
-       
-       /**
-        * Inserts dependencies on applications within the same application group.
-        * 
-        * @param       integer                                                 $packageID
-        * @param       wcf\system\database\statement\PreparedStatement         $insertStatement
-        * @return      array<string>
-        */
-       protected static function insertApplicationDependencies($packageID, PreparedStatement $insertStatement) {
-               $insertedDependencies = array();
-               
-               // check for application group
-               $sql = "SELECT  groupID
-                       FROM    wcf".WCF_N."_application
-                       WHERE   packageID = ?";
-               $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($packageID));
-               $row = $statement->fetchArray();
-               if ($row !== false && $row['groupID'] !== null) {
-                       // select application ids
-                       $sql = "SELECT  packageID
-                               FROM    wcf".WCF_N."_application
-                               WHERE   groupID = ?";
-                       $statement = WCF::getDB()->prepareStatement($sql);
-                       $statement->execute(array($row['groupID']));
-                       while ($row = $statement->fetchArray()) {
-                               $insertStatement->execute(array(
-                                       $packageID,
-                                       $row['packageID'],
-                                       1
-                               ));
-                       }
-               }
-       }
-       
        /**
         * Writes the config.inc.php for an application.
         * 
@@ -569,54 +358,28 @@ class Package extends DatabaseObject {
        public static function writeConfigFile($packageID) {
                $package = new Package($packageID);
                $packageDir = FileUtil::addTrailingSlash(FileUtil::getRealPath(WCF_DIR.$package->packageDir));
-               $file = new File($packageDir.\wcf\system\package\PackageInstallationDispatcher::CONFIG_FILE);
+               $file = new File($packageDir.PackageInstallationDispatcher::CONFIG_FILE);
                $file->write("<?php\n");
-               $currentPrefix = strtoupper(Package::getAbbreviation($package->package));
+               $prefix = strtoupper(Package::getAbbreviation($package->package));
                
-               // get dependencies (only applications)
-               $sql = "SELECT          package.*, CASE WHEN package.packageID = ? THEN 1 ELSE 0 END AS sortOrder 
-                       FROM            wcf".WCF_N."_package_dependency package_dependency
-                       LEFT JOIN       wcf".WCF_N."_package package
-                       ON              (package.packageID = package_dependency.dependency)
-                       WHERE           package_dependency.packageID = ?
-                                       AND package.isApplication = 1
-                                       AND package.packageDir <> ''
-                       ORDER BY        sortOrder DESC,
-                                       package_dependency.priority DESC";
-               $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(
-                       $packageID,
-                       $packageID
-               ));
-               while ($row = $statement->fetchArray()) {
-                       $dependency = new Package(null, $row);
-                       $dependencyDir = FileUtil::addTrailingSlash(FileUtil::getRealPath(WCF_DIR.$dependency->packageDir));
-                       $prefix = strtoupper(Package::getAbbreviation($dependency->package));
-                       
-                       $file->write("// ".$dependency->package." (packageID ".$dependency->packageID.")\n");
-                       $file->write("if (!defined('".$prefix."_DIR')) define('".$prefix."_DIR', ".($dependency->packageID == $package->packageID ? "dirname(__FILE__).'/'" : "'".$dependencyDir."'").");\n");
-                       $file->write("if (!defined('RELATIVE_".$prefix."_DIR')) define('RELATIVE_".$prefix."_DIR', ".($dependency->packageID == $package->packageID ? "''" : "RELATIVE_".$currentPrefix."_DIR.'".FileUtil::getRelativePath($packageDir, $dependencyDir)."'").");\n");
-                       $file->write("if (!defined('".$prefix."_N')) define('".$prefix."_N', '".WCF_N."_".$dependency->instanceNo."');\n");
-                       $file->write("\n");
-               }
+               $file->write("// ".$package->package." (packageID ".$package->packageID.")\n");
+               $file->write("if (!defined('".$prefix."_DIR')) define('".$prefix."_DIR', dirname(__FILE__).'/');\n");
+               $file->write("if (!defined('RELATIVE_".$prefix."_DIR')) define('RELATIVE_".$prefix."_DIR', '');\n");
+               $file->write("if (!defined('".$prefix."_N')) define('".$prefix."_N', '".WCF_N."_".$package->instanceNo."');\n");
+               $file->write("\n");
                
                // get primary application
-               $sql = "SELECT          applications.packageID
-                       FROM            wcf".WCF_N."_application application,
-                                       wcf".WCF_N."_application applications
-                       WHERE           application.packageID = ?
-                                       AND applications.groupID = application.groupID
-                                       AND applications.groupID IS NOT NULL
-                                       AND applications.isPrimary = ?";
+               $sql = "SELECT          packageID
+                       FROM            wcf".WCF_N."_application
+                       WHERE           applications.isPrimary = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($packageID, 1));
+               $statement->execute(array(1));
                $row = $statement->fetchArray();
-               $packageID = ($row === false) ? $packageID : $row['packageID'];
                
                // write general information
                $file->write("// general info\n");
-               $file->write("if (!defined('RELATIVE_WCF_DIR')) define('RELATIVE_WCF_DIR', RELATIVE_".$currentPrefix."_DIR.'".FileUtil::getRelativePath($packageDir, WCF_DIR)."');\n");
-               $file->write("if (!defined('PACKAGE_ID')) define('PACKAGE_ID', ".$packageID.");\n");
+               $file->write("if (!defined('RELATIVE_WCF_DIR')) define('RELATIVE_WCF_DIR', RELATIVE_".$prefix."_DIR.'".FileUtil::getRelativePath($packageDir, WCF_DIR)."');\n");
+               $file->write("if (!defined('PACKAGE_ID')) define('PACKAGE_ID', ".$row['packageID'].");\n");
                $file->write("if (!defined('PACKAGE_NAME')) define('PACKAGE_NAME', '".str_replace("'", "\'", $package->getName())."');\n");
                $file->write("if (!defined('PACKAGE_VERSION')) define('PACKAGE_VERSION', '".$package->packageVersion."');\n");
                
@@ -624,47 +387,14 @@ class Package extends DatabaseObject {
                $file->close();
        }
        
-       /**
-        * Searches all dependent packages for the given package id
-        * and rebuild their package dependencies list.
-        * 
-        * @param       integer         $packageID
-        */
-       public static function rebuildParentPackageDependencies($packageID) {
-               $sql = "SELECT          packageID, MAX(priority) AS maxPriority
-                       FROM            wcf".WCF_N."_package_dependency
-                       WHERE           packageID IN (
-                                               SELECT  packageID
-                                               FROM    wcf".WCF_N."_package_dependency
-                                               WHERE   dependency = ?
-                                                       AND packageID <> ?
-                                               UNION
-                                               SELECT  parentPackageID
-                                               FROM    wcf".WCF_N."_package
-                                               WHERE   packageID = ?
-                                       )
-                       GROUP BY        packageID
-                       ORDER BY        maxPriority ASC, packageID DESC";
-               $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(
-                       $packageID,
-                       $packageID,
-                       $packageID
-               ));
-               while ($row = $statement->fetchArray()) {
-                       self::rebuildPackageDependencies($row['packageID']);
-               }
-       }
-       
        /**
         * Returns a list of plugins for currently active application.
         * 
-        * @todo        Care about plugins within dependencies, but are simple plugins just providing some crap.
+        * @todo        Care about simple plugins just providing some crap.
         * @return      wcf\data\package\PackageList
         */
        public static function getPluginList() {
                $pluginList = new PackageList();
-               $pluginList->getConditionBuilder()->add("package.packageID IN (?)", array(PackageDependencyHandler::getInstance()->getDependencies()));
                $pluginList->getConditionBuilder()->add("package.isApplication = ?", array(0));
                
                return $pluginList;
index bd39a50bf9105981724f55dada9aa29e4e1177db..f0cd28abf996cd43ce0d69c2d045b29f8f8d0868 100644 (file)
@@ -16,7 +16,7 @@ use wcf\system\SingletonFactory;
 class PackageCache extends SingletonFactory {
        /**
         * list of cached packages
-        * @var array<wcf\data\package\Package>
+        * @var array<array>
         */
        protected $packages = array();
        
@@ -39,7 +39,23 @@ class PackageCache extends SingletonFactory {
         * @return      wcf\data\package\Package
         */
        public function getPackage($packageID) {
-               if (isset($this->packages[$packageID])) return $this->packages[$packageID];
+               if (isset($this->packages['packages'][$packageID])) {
+                       return $this->packages['packages'][$packageID];
+               }
+               
+               return null;
+       }
+       
+       /**
+        * Returns the id of a specific package or 'null' if not found.
+        *
+        * @param       string          $package
+        * @return      string
+        */
+       public function getPackageID($package) {
+               if (isset($this->packages['packageIDs'][$package])) {
+                       return $this->packages['packageIDs'][$package];
+               }
                
                return null;
        }
index 35bdcd909d590073c739d6ca9ef3d7507a49f335..dd76b18a49decd486666dcd6adde39314a8faaaa 100644 (file)
@@ -3,8 +3,6 @@ namespace wcf\data\page\menu\item;
 use wcf\data\DatabaseObjectEditor;
 use wcf\data\IEditableCachedObject;
 use wcf\system\cache\CacheHandler;
-use wcf\system\database\util\PreparedStatementConditionBuilder;
-use wcf\system\package\PackageDependencyHandler;
 use wcf\system\WCF;
 
 /**
@@ -52,21 +50,32 @@ class PageMenuItemEditor extends DatabaseObjectEditor implements IEditableCached
         * @see wcf\data\IEditableObject::delete()
         */
        public function delete() {
-               $conditions = new PreparedStatementConditionBuilder();
-               $conditions->add("packageID IN (?)", array(PackageDependencyHandler::getInstance()->getDependencies()));
-               $conditions->add("showOrder >= ?", array($this->showOrder));
-               $conditions->add("menuPosition = ?", array($this->menuPosition));
-               
                // update show order
                $sql = "UPDATE  wcf".WCF_N."_page_menu_item
                        SET     showOrder = showOrder - 1
-                       ".$conditions;
+                       WHERE   showOrder >= ?
+                               AND menuPosition = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute($conditions->getParameters());
+               $statement->execute(array(
+                       $this->showOrder,
+                       $this->menuPosition
+               ));
                
                parent::delete();
        }
        
+       /**
+        * Sets current page menu item as landing page.
+        */
+       public function setAsLandingPage() {
+               $sql = "UPDATE  wcf".WCF_N."_page_menu_item
+                       SET     isLandingPage = 0";
+               $statement = WCF::getDB()->prepareStatement($sql);
+               $statement->execute();
+               
+               $this->update(array('isLandingPage' => 1));
+       }
+       
        /**
         * Updates the positions of a page menu item directly.
         * 
@@ -75,38 +84,17 @@ class PageMenuItemEditor extends DatabaseObjectEditor implements IEditableCached
         * @param       integer         $showOrder
         */
        public static function setShowOrder($menuItemID, $menuPosition = 'header', $showOrder = 1) {
-               $conditions = new PreparedStatementConditionBuilder();
-               $conditions->add("packageID IN (?)", array(PackageDependencyHandler::getInstance()->getDependencies()));
-               $conditions->add("menuItemID = ?", array($menuItemID));
-               
-               // update show order
+               // Update
                $sql = "UPDATE  wcf".WCF_N."_page_menu_item
                        SET     showOrder = ?,
                                menuPosition = ?
-                       ".$conditions;
+                       WHERE   menuItemID = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               
-               $parameters = array_merge(array(
+               $statement->execute(array(
                        $showOrder,
-                       $menuPosition
-               ), $conditions->getParameters());
-               $statement->execute($parameters);
-       }
-       
-       /**
-        * Sets current page menu item as landing page.
-        */
-       public function setAsLandingPage() {
-               $conditions = new PreparedStatementConditionBuilder();
-               $conditions->add("packageID IN (?)", array(PackageDependencyHandler::getInstance()->getDependencies()));
-               
-               $sql = "UPDATE  wcf".WCF_N."_page_menu_item
-                       SET     isLandingPage = 0
-                       ".$conditions;
-               $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute($conditions->getParameters());
-               
-               $this->update(array('isLandingPage' => 1));
+                       $menuPosition,
+                       $menuItemID
+               ));
        }
        
        /**
@@ -118,18 +106,18 @@ class PageMenuItemEditor extends DatabaseObjectEditor implements IEditableCached
        protected function updateShowOrder($showOrder, $menuPosition) {
                if ($menuPosition == $this->menuPosition) {
                        if ($this->showOrder != $showOrder) {
-                               $conditions = new PreparedStatementConditionBuilder();
-                               $conditions->add("packageID IN (?)", array(PackageDependencyHandler::getInstance()->getDependencies()));
-                               $conditions->add("showOrder <= ?", array($showOrder));
-                               $conditions->add("showOrder > ?", array($this->showOrder));
-                               $conditions->add("menuPosition = ?", array($menuPosition));
-                               
                                if ($showOrder < $this->showOrder) {
                                        $sql = "UPDATE  wcf".WCF_N."_page_menu_item
                                                SET     showOrder = showOrder + 1
-                                               ".$conditions;
+                                               WHERE   showOrder >= ?
+                                                       AND showOrder < ?
+                                                       AND menuPosition = ?";
                                        $statement = WCF::getDB()->prepareStatement($sql);
-                                       $statement->execute($conditions->getParameters());
+                                       $statement->execute(array(
+                                               $showOrder,
+                                               $this->showOrder,
+                                               $menuPosition
+                                       ));
                                }
                                else if ($showOrder > $this->showOrder) {
                                        $sql = "UPDATE  wcf".WCF_N."_page_menu_item
@@ -138,32 +126,34 @@ class PageMenuItemEditor extends DatabaseObjectEditor implements IEditableCached
                                                        AND showOrder > ?
                                                        AND menuPosition = ?";
                                        $statement = WCF::getDB()->prepareStatement($sql);
-                                       $statement->execute($conditions->getParameters());
+                                       $statement->execute(array(
+                                               $showOrder,
+                                               $this->showOrder,
+                                               $menuPosition
+                                       ));
                                }
                        }
                }
                else {
-                       $conditions = new PreparedStatementConditionBuilder();
-                       $conditions->add("packageID IN (?)", array(PackageDependencyHandler::getInstance()->getDependencies()));
-                       $conditions->add("showOrder >= ?", array($this->showOrder));
-                       $conditions->add("menuPosition = ?", array($this->menuPosition));
-                       
                        $sql = "UPDATE  wcf".WCF_N."_page_menu_item
                                SET     showOrder = showOrder - 1
-                               ".$conditions;
+                               WHERE   showOrder >= ?
+                                       AND menuPosition = ?";
                        $statement = WCF::getDB()->prepareStatement($sql);
-                       $statement->execute($conditions->getParameters());
-                       
-                       $conditions = new PreparedStatementConditionBuilder();
-                       $conditions->add("packageID IN (?)", array(PackageDependencyHandler::getInstance()->getDependencies()));
-                       $conditions->add("showOrder >= ?", array($showOrder));
-                       $conditions->add("menuPosition = ?", array($menuPosition));
-                       
+                       $statement->execute(array(
+                               $this->showOrder,
+                               $this->menuPosition
+                       ));
+                               
                        $sql = "UPDATE  wcf".WCF_N."_page_menu_item
                                SET     showOrder = showOrder + 1
-                               ".$conditions;
+                               WHERE   showOrder >= ?
+                                       AND menuPosition = ?";
                        $statement = WCF::getDB()->prepareStatement($sql);
-                       $statement->execute($conditions->getParameters());
+                       $statement->execute(array(
+                               $showOrder,
+                               $menuPosition
+                       ));
                }
        }
        
@@ -176,31 +166,26 @@ class PageMenuItemEditor extends DatabaseObjectEditor implements IEditableCached
         */
        protected static function getShowOrder($showOrder, $menuPosition) {
                if ($showOrder == 0) {
-                       $conditions = new PreparedStatementConditionBuilder();
-                       $conditions->add("packageID IN (?)", array(PackageDependencyHandler::getInstance()->getDependencies()));
-                       $conditions->add("menuPosition = ?", array($menuPosition));
-                       
                        // get next number in row
                        $sql = "SELECT  MAX(showOrder) AS showOrder
                                FROM    wcf".WCF_N."_page_menu_item
-                               ".$conditions;
+                               WHERE   menuPosition = ?";
                        $statement = WCF::getDB()->prepareStatement($sql);
-                       $statement->execute($conditions->getParameters());
+                       $statement->execute(array($menuPosition));
                        $row = $statement->fetchArray();
                        if (!empty($row)) $showOrder = intval($row['showOrder']) + 1;
                        else $showOrder = 1;
                }
                else {
-                       $conditions = new PreparedStatementConditionBuilder();
-                       $conditions->add("packageID IN (?)", array(PackageDependencyHandler::getInstance()->getDependencies()));
-                       $conditions->add("showOrder >= ?", array($showOrder));
-                       $conditions->add("menuPosition = ?", array($menuPosition));
-                       
                        $sql = "UPDATE  wcf".WCF_N."_page_menu_item
                                SET     showOrder = showOrder + 1
-                               ".$conditions;
+                               WHERE   showOrder >= ?
+                                       AND menuPosition = ?";
                        $statement = WCF::getDB()->prepareStatement($sql);
-                       $statement->execute($conditions->getParameters());
+                       $statement->execute(array(
+                               $showOrder,
+                               $menuPosition
+                       ));
                }
                
                return $showOrder;
@@ -210,6 +195,6 @@ class PageMenuItemEditor extends DatabaseObjectEditor implements IEditableCached
         * @see wcf\data\IEditableCachedObject::resetCache()
         */
        public static function resetCache() {
-               CacheHandler::getInstance()->clear(WCF_DIR.'cache', 'cache.pageMenu-*.php');
+               CacheHandler::getInstance()->clear(WCF_DIR.'cache', 'cache.pageMenu.php');
        }
 }
index bc4a98f9d8d182c582c167b66a5595cd1959a229..e92a1b807c82562e02e3621742b3fd3e515ae056 100644 (file)
@@ -34,7 +34,7 @@ class ActiveStyle extends DatabaseObjectDecorator {
                parent::__construct($object);
                
                // load icon cache
-               $cacheName = 'icon-'.PACKAGE_ID.'-'.$this->styleID;
+               $cacheName = 'icon-'.$this->styleID;
                CacheHandler::getInstance()->addResource(
                        $cacheName,
                        WCF_DIR.'cache/cache.'.$cacheName.'.php',
index 27dd4e1458a1a81f6d63d0028788e905689465ab..f41a3a429a19de5fa730dfd55037406f4918e53d 100644 (file)
@@ -864,7 +864,7 @@ class StyleEditor extends DatabaseObjectEditor implements IEditableCachedObject
         * @see wcf\data\IEditableCachedObject::resetCache()
         */
        public static function resetCache() {
-               CacheHandler::getInstance()->clear(WCF_DIR.'cache', 'cache.styles.php');
+               CacheHandler::getInstance()->clear(WCF_DIR.'cache', 'cache.style.php');
        }
        
        /**
index ef486ac44e528369ad309b9b1070434f57c2645e..3491ef5015c434c52af90e97717c32f5d2c05546 100644 (file)
@@ -88,15 +88,11 @@ class Template extends DatabaseObject {
                // get available template ids
                $results = array();
                $availableTemplateIDs = array();
-               $sql = "SELECT          template.templateName, template.templateID, template.templateGroupID, template.packageID
-                       FROM            wcf".WCF_N."_template template
-                       LEFT JOIN       wcf".WCF_N."_package_dependency package_dependency
-                       ON              (package_dependency.dependency = template.packageID)
-                       WHERE           package_dependency.packageID = ?
-                                       ".($replace !== null ? "AND template.templateGroupID <> 0" : "")."
-                       ORDER BY        package_dependency.priority ASC";
+               $sql = "SELECT          templateName, templateID, templateGroupID, packageID
+                       FROM            wcf".WCF_N."_template
+                                       ".($replace !== null ? "WHERE templateGroupID <> 0" : "");
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(PACKAGE_ID));
+               $statement->execute();
                while ($row = $statement->fetchArray()) {
                        if (!isset($availableTemplateIDs[$row['templateName'].'-'.$row['templateGroupID']]) || PACKAGE_ID == $row['packageID']) {
                                $availableTemplateIDs[$row['templateName'].'-'.$row['templateGroupID']] = $row['templateID'];
index 0a51b307a4a5e122fc0b7452e2ef2a4d56ef7094..d7a28908a5b4a4f2e767fbe54b5bebc34ea95d59 100644 (file)
@@ -206,13 +206,12 @@ final class User extends DatabaseObject implements IRouteController {
         * Gets all user options from cache.
         */
        protected static function getUserOptionCache() {
-               $cacheName = 'user-option-'.PACKAGE_ID;
                CacheHandler::getInstance()->addResource(
-                       $cacheName,
-                       WCF_DIR.'cache/cache.'.$cacheName.'.php',
+                       'userOption',
+                       WCF_DIR.'cache/cache.userOption.php',
                        'wcf\system\cache\builder\OptionCacheBuilder'
                );
-               self::$userOptions = CacheHandler::getInstance()->get($cacheName, 'options');
+               self::$userOptions = CacheHandler::getInstance()->get('userOption', 'options');
        }
        
        /**
index 65276dceceb9c852f65dbc0dcba3cbbad3962b60..75a13a8b7df7488ce7e502b975950dc9bcde07a4 100644 (file)
@@ -230,11 +230,11 @@ class UserGroup extends DatabaseObject {
        protected static function getCache() {
                if (self::$cache === null) {
                        CacheHandler::getInstance()->addResource(
-                               'usergroups',
-                               WCF_DIR.'cache/cache.userGroups.php',
+                               'userGroup',
+                               WCF_DIR.'cache/cache.userGroup.php',
                                'wcf\system\cache\builder\UserGroupCacheBuilder'
                        );
-                       self::$cache = CacheHandler::getInstance()->get('usergroups');
+                       self::$cache = CacheHandler::getInstance()->get('userGroup');
                }
        }
        
@@ -309,14 +309,10 @@ class UserGroup extends DatabaseObject {
                if ($this->groupOptions === null) {
                        // get all options and filter options with low priority
                        $this->groupOptions = $groupOptionIDs = array();
-                       $sql = "SELECT          optionName, optionID 
-                               FROM            wcf".WCF_N."_user_group_option option_table
-                               LEFT JOIN       wcf".WCF_N."_package_dependency package_dependency
-                               ON              (package_dependency.dependency = option_table.packageID)
-                               WHERE           package_dependency.packageID = ?
-                               ORDER BY        package_dependency.priority ASC";
+                       $sql = "SELECT          optionName, optionID
+                               FROM            wcf".WCF_N."_user_group_option";
                        $statement = WCF::getDB()->prepareStatement($sql);
-                       $statement->execute(array(PACKAGE_ID));
+                       $statement->execute();
                        
                        while ($row = $statement->fetchArray()) {
                                $groupOptionIDs[$row['optionName']] = $row['optionID'];
index 7ec120eac11a16777da9b33993a22ce75240d1f7..2de92c406cbf6792b50e7a8bbd81a6d4e6fbbde8 100644 (file)
@@ -180,7 +180,7 @@ class UserGroupEditor extends DatabaseObjectEditor implements IEditableCachedObj
         */
        public static function resetCache() {
                // clear cache
-               CacheHandler::getInstance()->clear(WCF_DIR.'cache/', 'cache.userGroups*.php');
+               CacheHandler::getInstance()->clear(WCF_DIR.'cache/', 'cache.userGroup.php');
                
                // clear sessions
                SessionHandler::resetSessions();
index d926e22a1be417aa0dce5f71cbfa750faa113cd2..bdd19f15e27095bcc1562d3394e5511550f035be 100644 (file)
@@ -65,12 +65,6 @@ class WCF {
         */
        protected static $coreObjectCache = array();
        
-       /**
-        * list of ids of dependent packages
-        * @var array<integer>
-        */     
-       protected static $packageDependencies = array();
-       
        /**
         * database object
         * @var wcf\system\database\Database
@@ -294,20 +288,20 @@ class WCF {
         */
        protected function loadDefaultCacheResources() {
                CacheHandler::getInstance()->addResource(
-                       'languages',
-                       WCF_DIR.'cache/cache.languages.php',
+                       'language',
+                       WCF_DIR.'cache/cache.language.php',
                        'wcf\system\cache\builder\LanguageCacheBuilder'
                );
                CacheHandler::getInstance()->addResource(
-                       'spiders',
-                       WCF_DIR.'cache/cache.spiders.php',
+                       'spider',
+                       WCF_DIR.'cache/cache.spider.php',
                        'wcf\system\cache\builder\SpiderCacheBuilder'
                );
                
                if (defined('PACKAGE_ID')) {
                        CacheHandler::getInstance()->addResource(
-                               'coreObjects-'.PACKAGE_ID,
-                               WCF_DIR.'cache/cache.coreObjects-'.PACKAGE_ID.'.php',
+                               'coreObject',
+                               WCF_DIR.'cache/cache.coreObject.php',
                                'wcf\system\cache\builder\CoreObjectCacheBuilder'
                        );
                }
@@ -506,8 +500,7 @@ class WCF {
                        return;
                }
                
-               self::$coreObjectCache = CacheHandler::getInstance()->get('coreObjects-'.PACKAGE_ID);
-               self::$packageDependencies = \wcf\system\package\PackageDependencyHandler::getInstance()->getDependencies();
+               self::$coreObjectCache = CacheHandler::getInstance()->get('coreObject');
        }
        
        /**
@@ -609,10 +602,8 @@ class WCF {
         * @return      string
         */
        protected static final function getCoreObject($className) {
-               foreach (self::$packageDependencies as $packageID) {
-                       if (isset(self::$coreObjectCache[$packageID][$className])) {
-                               return self::$coreObjectCache[$packageID][$className];
-                       }
+               if (isset(self::$coreObjectCache[$className])) {
+                       return self::$coreObjectCache[$className];
                }
                
                return null;
index 90c68effd31a6776dab784c1698af43ba2e5ff42..e4161588eb86566fd4a4ac5fdcc70bb9a3e63fc0 100644 (file)
@@ -128,8 +128,8 @@ class WCFACP extends WCF {
                parent::loadDefaultCacheResources();
                
                CacheHandler::getInstance()->addResource(
-                       'packages',
-                       WCF_DIR.'cache/cache.packages.php',
+                       'package',
+                       WCF_DIR.'cache/cache.package.php',
                        'wcf\system\cache\builder\PackageCacheBuilder'
                );
        }
@@ -143,19 +143,6 @@ class WCFACP extends WCF {
                        $packageID = self::getWcfPackageID();
                        define('PACKAGE_ID', $packageID);
                }
-               
-               /* todo
-               $packageID = 0;
-               $packages = CacheHandler::getInstance()->get('packages');
-               if (isset($_REQUEST['packageID'])) $packageID = intval($_REQUEST['packageID']);
-               
-               if (!isset($packages[$packageID]) || !$packages[$packageID]['isApplication']) {
-                       // package id is invalid
-                       $packageID = self::getWcfPackageID();
-               }
-               
-               // define active package id
-               if (!defined('PACKAGE_ID')) define('PACKAGE_ID', $packageID);*/ 
        }
        
        /**
@@ -183,7 +170,7 @@ class WCFACP extends WCF {
         */
        protected function getQuickAccessPackages() {
                $quickAccessPackages = array();
-               $packages = CacheHandler::getInstance()->get('packages');
+               $packages = CacheHandler::getInstance()->get('package');
                foreach ($packages as $packageID => $package) {
                        if (!$package->isApplication) break;
                        if ($package->package != 'com.woltlab.wcf') {
index 951a704d2ade37ffb5a03fd78c512395ce558e98..0b0a58fa4bb286ec5cabec23b931896267a25cdc 100644 (file)
@@ -844,7 +844,7 @@ class WCFSetup extends WCF {
                }
                
                // rebuild language cache
-               CacheHandler::getInstance()->clearResource('languages');
+               CacheHandler::getInstance()->clearResource('language');
                
                // go to next step
                $this->gotoNextStep('createUser');
index 71524984a6c3a3533b77f52bd625e565449e4c2e..8b8c4ade26a3c1bb4ef7a4308474f0216f44a00c 100644 (file)
@@ -1,5 +1,7 @@
 <?php
 namespace wcf\system\application;
+use wcf\data\application\ApplicationAction;
+use wcf\data\application\ApplicationList;
 use wcf\system\cache\CacheHandler;
 use wcf\system\SingletonFactory;
 use wcf\util\StringUtil;
@@ -31,13 +33,12 @@ class ApplicationHandler extends SingletonFactory {
         * Initializes cache.
         */
        protected function init() {
-               $cacheName = 'application-'.PACKAGE_ID;
                CacheHandler::getInstance()->addResource(
-                       $cacheName,
-                       WCF_DIR.'cache/cache.'.$cacheName.'.php',
+                       'application',
+                       WCF_DIR.'cache/cache.application.php',
                        'wcf\system\cache\builder\ApplicationCacheBuilder'
                );
-               $this->cache = CacheHandler::getInstance()->get($cacheName);
+               $this->cache = CacheHandler::getInstance()->get('application');
        }
        
        /**
@@ -166,4 +167,16 @@ class ApplicationHandler extends SingletonFactory {
                
                return false;
        }
+       
+       /**
+        * Rebuilds cookie domain/path for all applications.
+        */
+       public static function rebuild() {
+               $applicationList = new ApplicationList();
+               $applicationList->sqlLimit = 0;
+               $applicationList->readObjects();
+               
+               $applicationAction = new ApplicationAction($applicationList->getObjects(), 'rebuild');
+               $applicationAction->executeAction();
+       }
 }
index 57e30c9c9f542a6e9cc8bbe47b6a59e5b71171a4..4ddbfb309bdabe9dd54f10461217bf937cac361d 100644 (file)
@@ -20,19 +20,14 @@ class ACPMenuCacheBuilder implements ICacheBuilder {
        /**
         * @see wcf\system\cache\ICacheBuilder::getData()
         */
-       public function getData(array $cacheResource) {
-               list($cache, $packageID) = explode('-', $cacheResource['cache']); 
+       public function getData(array $cacheResource) { 
                $data = array();
                
                // get all menu items and filter menu items with low priority
                $sql = "SELECT          menuItem, menuItemID
-                       FROM            wcf".WCF_N."_acp_menu_item menu_item
-                       LEFT JOIN       wcf".WCF_N."_package_dependency package_dependency
-                       ON              (menu_item.packageID = package_dependency.dependency)
-                       WHERE           package_dependency.packageID = ?
-                       ORDER BY        package_dependency.priority ASC";
+                       FROM            wcf".WCF_N."_acp_menu_item menu_item";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($packageID));
+               $statement->execute();
                $itemIDs = array();
                while ($row = $statement->fetchArray()) {
                        $itemIDs[$row['menuItem']] = $row['menuItemID'];
@@ -62,7 +57,7 @@ class ACPMenuCacheBuilder implements ICacheBuilder {
                }
                
                // get top option categories
-               $optionCategories = $this->getTopOptionCategories($packageID);
+               $optionCategories = $this->getTopOptionCategories();
                if (!empty($optionCategories)) {
                        if (!isset($data['wcf.acp.menu.link.option.category'])) {
                                $data['wcf.acp.menu.link.option.category'] = array();
@@ -94,16 +89,12 @@ class ACPMenuCacheBuilder implements ICacheBuilder {
                return $data;
        }
        
-       protected function getTopOptionCategories($packageID) {
-               // get all option categories and filter categories with low priority
+       protected function getTopOptionCategories() {
+               // get all option categories
                $sql = "SELECT          categoryName, categoryID 
-                       FROM            wcf".WCF_N."_option_category option_category
-                       LEFT JOIN       wcf".WCF_N."_package_dependency package_dependency
-                       ON              (package_dependency.dependency = option_category.packageID)
-                       WHERE           package_dependency.packageID = ?
-                       ORDER BY        package_dependency.priority ASC";
+                       FROM            wcf".WCF_N."_option_category";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($packageID));
+               $statement->execute();
                $optionCategories = array();
                while ($row = $statement->fetchArray()) {
                        $optionCategories[$row['categoryName']] = $row['categoryID'];
@@ -111,19 +102,14 @@ class ACPMenuCacheBuilder implements ICacheBuilder {
                
                $conditions = new PreparedStatementConditionBuilder();
                $conditions->add("categoryID IN (?)", array($optionCategories));
-               $statementParameters = $conditions->getParameters();
-               array_unshift($statementParameters, $packageID);
-               
                $sql = "SELECT          categoryID, parentCategoryName, categoryName,
                                        (
-                                               SELECT COUNT(*) FROM wcf".WCF_N."_option WHERE categoryName = category.categoryName AND packageID IN (
-                                                       SELECT dependency FROM wcf".WCF_N."_package_dependency WHERE packageID = ?
-                                               )
+                                               SELECT COUNT(*) FROM wcf".WCF_N."_option WHERE categoryName = category.categoryName
                                        ) AS count
                        FROM            wcf".WCF_N."_option_category category
                        ".$conditions;
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute($statementParameters);
+               $statement->execute($conditions->getParameters());
                while ($row = $statement->fetchArray()) {
                        if (!isset($this->optionCategoryStructure[$row['parentCategoryName']])) $this->optionCategoryStructure[$row['parentCategoryName']] = array();
                        $this->optionCategoryStructure[$row['parentCategoryName']][] = $row;
index e3b62225f58d1823e4722a8e507e0b77a1378b06..3ad498985ee70487d4b47597bf7fd1d34bfb72ce 100644 (file)
@@ -1,7 +1,6 @@
 <?php
 namespace wcf\system\cache\builder;
 use wcf\data\acp\search\provider\ACPSearchProviderList;
-use wcf\system\package\PackageDependencyHandler;
 
 /**
  * Caches the ACP search providers.
@@ -19,7 +18,6 @@ class ACPSearchProviderCacheBuilder implements ICacheBuilder {
         */
        public function getData(array $cacheResource) {
                $providerList = new ACPSearchProviderList();
-               $providerList->getConditionBuilder()->add("acp_search_provider.packageID IN (?)", array(PackageDependencyHandler::getInstance()->getDependencies()));
                $providerList->sqlLimit = 0;
                $providerList->sqlOrderBy = "acp_search_provider.showOrder ASC";
                $providerList->readObjects();
index 362efc9fe67d41d68bff0c93341aa3f4ea07b3fa..c761474d4511b0a1c12c30b850b0b1ff6905d1e0 100644 (file)
@@ -1,7 +1,6 @@
 <?php
 namespace wcf\system\cache\builder;
 use wcf\data\category\CategoryList;
-use wcf\system\package\PackageDependencyHandler;
 
 /**
  * Caches the categories for a certain package.
@@ -21,9 +20,7 @@ class CategoryCacheBuilder implements ICacheBuilder {
                $list = new CategoryList();
                $list->sqlLimit = 0;
                $list->sqlSelects = "object_type.objectType";
-               $list->sqlJoins = "     LEFT JOIN       wcf".WCF_N."_object_type object_type
-                                       ON              (object_type.objectTypeID = category.objectTypeID)";
-               $list->getConditionBuilder()->add("object_type.packageID IN (?)", array(PackageDependencyHandler::getInstance()->getDependencies()));
+               $list->sqlJoins = "LEFT JOIN wcf".WCF_N."_object_type object_type ON (object_type.objectTypeID = category.objectTypeID)";
                $list->sqlOrderBy = "category.showOrder ASC";
                $list->readObjects();
                
index 91592262179d85377df56c9aeb11cfadaeb49210..c8ae3cedd98bde07f9601a876340a0764a6f9e6b 100644 (file)
@@ -17,7 +17,6 @@ class CleanupAdapterCacheBuilder implements ICacheBuilder {
         * @see wcf\system\cache\ICacheBuilder::getData()
         */
        public function getData(array $cacheResource) {
-               list($cache, $packageID) = explode('-', $cacheResource['cache']);
                $data = array(
                        'adapters' => array(),
                        'objectTypes' => array(),
@@ -26,14 +25,10 @@ class CleanupAdapterCacheBuilder implements ICacheBuilder {
                
                $sql = "SELECT          listener.*, package.packageDir
                        FROM            wcf".WCF_N."_cleanup_listener listener
-                       LEFT JOIN       wcf".WCF_N."_package_dependency package_dependency
-                       ON              (package_dependency.dependency = listener.packageID)
                        LEFT JOIN       wcf".WCF_N."_package package
-                       ON              (package.packageID = listener.packageID)
-                       WHERE           package_dependency.packageID = ?
-                       ORDER BY        package_dependency.priority ASC";
+                       ON              (package.packageID = listener.packageID)";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($packageID));
+               $statement->execute();
                while ($row = $statement->fetchArray()) {
                        if (!is_array($data['adapters'][$row['objectType']])) $data['adapters'][$row['objectType']] = array();
                        $data['adapters'][$row['objectType']][] = $row;
index 7d08de5214ae7be79d6a39da6d69cbe384af2991..c1070610ba9f7588958b414c7309e75626b26cfe 100644 (file)
@@ -1,7 +1,6 @@
 <?php
 namespace wcf\system\cache\builder;
 use wcf\data\clipboard\action\ClipboardActionList;
-use wcf\system\package\PackageDependencyHandler;
 
 /**
  * Caches clipboard actions.
@@ -19,7 +18,6 @@ class ClipboardActionCacheBuilder implements ICacheBuilder {
         */
        public function getData(array $cacheResource) {
                $actionList = new ClipboardActionList();
-               $actionList->getConditionBuilder()->add("packageID IN (?)", array(PackageDependencyHandler::getInstance()->getDependencies()));
                $actionList->sqlLimit = 0;
                $actionList->readObjects();
                
index e5a4ad4dba425a1d943b34507730a44c02b11f0f..eeede22ee11f54beec0328b9c265a0f78c81a0e4 100644 (file)
@@ -1,7 +1,5 @@
 <?php
 namespace wcf\system\cache\builder;
-use wcf\system\database\util\PreparedStatementConditionBuilder;
-use wcf\system\package\PackageDependencyHandler;
 use wcf\system\WCF;
 
 /**
@@ -19,14 +17,10 @@ class ClipboardPageCacheBuilder implements ICacheBuilder {
         * @see wcf\system\cache\ICacheBuilder::getData()
         */
        public function getData(array $cacheResource) {
-               $conditions = new PreparedStatementConditionBuilder();
-               $conditions->add("packageID IN (?)", array(PackageDependencyHandler::getInstance()->getDependencies()));
-               
                $sql = "SELECT  pageClassName, actionID
-                       FROM    wcf".WCF_N."_clipboard_page
-                       ".$conditions;
+                       FROM    wcf".WCF_N."_clipboard_page";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute($conditions->getParameters());
+               $statement->execute();
                
                $data = array();
                while ($row = $statement->fetchArray()) {
index b2565a7abb46caee543baf820a6e3076b6a26abc..7b4eeae579fb037952a0332e951d58236f2082f8 100644 (file)
@@ -1,7 +1,6 @@
 <?php
 namespace wcf\system\cache\builder;
 use wcf\data\core\object\CoreObjectList;
-use wcf\system\package\PackageDependencyHandler;
 
 /**
  * Caches the core objects.
@@ -18,23 +17,17 @@ class CoreObjectCacheBuilder implements ICacheBuilder {
         * @see wcf\system\cache\ICacheBuilder::getData()
         */
        public function getData(array $cacheResource) {
-               list($cache, $packageID) = explode('-', $cacheResource['cache']);
                $data = array();
                
                $coreObjectList = new CoreObjectList();
-               $coreObjectList->getConditionBuilder()->add("core_object.packageID IN (?)", array(PackageDependencyHandler::getInstance()->getDependencies()));
                $coreObjectList->sqlLimit = 0;
                $coreObjectList->readObjects();
                $coreObjects = $coreObjectList->getObjects();
                
                foreach ($coreObjects as $coreObject) {
-                       if (!isset($data[$coreObject->packageID])) {
-                               $data[$coreObject->packageID] = array();
-                       }
-                       
                        $tmp = explode('\\', $coreObject->objectName);
                        $className = array_pop($tmp);
-                       $data[$coreObject->packageID][$className] = $coreObject->objectName;
+                       $data[$className] = $coreObject->objectName;
                }
                
                return $data;
index 8c1ac21d3fab9a326e5eab1f979a10017116ab07..f4dd35be827a104e9edb229c278cd5bb46e6a7c4 100644 (file)
@@ -1,7 +1,5 @@
 <?php
 namespace wcf\system\cache\builder;
-use wcf\system\database\util\PreparedStatementConditionBuilder;
-use wcf\system\package\PackageDependencyHandler;
 use wcf\system\WCF;
 
 /**
@@ -19,16 +17,11 @@ class CronjobCacheBuilder implements ICacheBuilder {
         * @see wcf\system\cache\ICacheBuilder::getData()
         */
        public function getData(array $cacheResource) {
-               // get next execution time
-               $conditionBuilder = new PreparedStatementConditionBuilder();
-               $conditionBuilder->add("packageID IN (?)", array(PackageDependencyHandler::getInstance()->getDependencies()));
-               
                $sql = "SELECT          MIN(nextExec) AS nextExec,
                                        MIN(afterNextExec) AS afterNextExec
-                       FROM            wcf".WCF_N."_cronjob
-                       ".$conditionBuilder->__toString();
+                       FROM            wcf".WCF_N."_cronjob";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute($conditionBuilder->getParameters());
+               $statement->execute();
                $row = $statement->fetchArray();
                
                return array(
index 6a2207a53c6d2c7d0e00fe04da938ecb8a266f65..35db2cd237c2db3e46a16bce4ca63fd7f4553da5 100644 (file)
@@ -18,21 +18,16 @@ class EventListenerCacheBuilder implements ICacheBuilder {
         * @see wcf\system\cache\ICacheBuilder::getData()
         */
        public function getData(array $cacheResource) {
-               list($cache, $packageID) = explode('-', $cacheResource['cache']); 
                $data = array(
                        'actions' => array('user' => array(), 'admin' => array()),
                        'inheritedActions' => array('user' => array(), 'admin' => array())
                );
                
                // get all listeners and filter options with low priority
-               $sql = "SELECT          event_listener.*
-                       FROM            wcf".WCF_N."_event_listener event_listener
-                       LEFT JOIN       wcf".WCF_N."_package_dependency package_dependency
-                       ON              (package_dependency.dependency = event_listener.packageID)
-                       WHERE           package_dependency.packageID = ?
-                       ORDER BY        package_dependency.priority ASC";
+               $sql = "SELECT  event_listener.*
+                       FROM    wcf".WCF_N."_event_listener event_listener";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($packageID));
+               $statement->execute();
                while ($row = $statement->fetchArray()) {
                        // distinguish between inherited actions and non-inherited actions
                        if (!$row['inherit']) {
index 9882b85302f0ec1b1ca98281b9b3a971311d4810..7c55bb197d0b8ff20549a150dc80ef07bf050ab0 100644 (file)
@@ -1,8 +1,6 @@
 <?php
 namespace wcf\system\cache\builder;
 use wcf\data\package\Package;
-use wcf\system\database\util\PreparedStatementConditionBuilder;
-use wcf\system\package\PackageDependencyHandler;
 use wcf\system\WCF;
 use wcf\util\FileUtil;
 
@@ -30,16 +28,11 @@ class IconCacheBuilder implements ICacheBuilder {
                
                // get package dirs
                $packageDirs = array();
-               $conditionBuilder = new PreparedStatementConditionBuilder();
-               $conditionBuilder->add("dependency.packageID IN (?) AND package.packageDir <> ''", array(PackageDependencyHandler::getInstance()->getDependencies()));
-               $sql = "SELECT          DISTINCT package.packageDir, dependency.priority
-                       FROM            wcf".WCF_N."_package_dependency dependency
-                       LEFT JOIN       wcf".WCF_N."_package package
-                       ON              (package.packageID = dependency.dependency)
-                       ".$conditionBuilder->__toString()."
-                       ORDER BY        dependency.priority DESC";
+               $sql = "SELECT  packageDir
+                       FROM    wcf".WCF_N."_package package
+                       WHERE   isApplication = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute($conditionBuilder->getParameters());
+               $statement->execute(array(1));
                while ($row = $statement->fetchArray()) {
                        $packageDirs[] = FileUtil::getRealPath(WCF_DIR.$row['packageDir']);
                }
index 51c4267f939ba2acf85cd1ab3fa7c51d87d1d633..f99c9075a92bbcd16e85249f9369a1f488edeb40 100644 (file)
@@ -27,14 +27,10 @@ class ObjectTypeCacheBuilder implements ICacheBuilder {
                );
                
                // get definitions
-               $sql = "SELECT          object_type_definition.*
-                       FROM            wcf".WCF_N."_package_dependency package_dependency,
-                                       wcf".WCF_N."_object_type_definition object_type_definition
-                       WHERE           object_type_definition.packageID = package_dependency.dependency
-                                       AND package_dependency.packageID = ?
-                       ORDER BY        package_dependency.priority";
+               $sql = "SELECT  *
+                       FROM    wcf".WCF_N."_object_type_definition";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($packageID));
+               $statement->execute();
                while ($row = $statement->fetchArray()) {
                        $data['definitions'][$row['definitionID']] = new ObjectTypeDefinition(null, $row);
                        
@@ -48,12 +44,8 @@ class ObjectTypeCacheBuilder implements ICacheBuilder {
                }
                
                // get object types
-               $sql = "SELECT          object_type.*
-                       FROM            wcf".WCF_N."_package_dependency package_dependency,
-                                       wcf".WCF_N."_object_type object_type
-                       WHERE           object_type.packageID = package_dependency.dependency
-                                       AND package_dependency.packageID = ?
-                       ORDER BY        package_dependency.priority";
+               $sql = "SELECT  *
+                       FROM    wcf".WCF_N."_object_type object_type";
                $statement = WCF::getDB()->prepareStatement($sql);
                $statement->execute(array($packageID));
                while ($row = $statement->fetchArray()) {
index b11cd1b637e122281c4c3e1850c827aff30a6d42..e2d85f3fbb03a883d06e50263f931ac6926e3999 100644 (file)
@@ -24,7 +24,6 @@ class OptionCacheBuilder implements ICacheBuilder {
                
                if (count($information) == 3) {
                        $type = $information[0];
-                       $packageID = $information[2];
                        
                        preg_match_all('~((?:^|[A-Z])[a-z]+)~', $information[0], $matches);
                        if (isset($matches[1])) {
@@ -35,7 +34,6 @@ class OptionCacheBuilder implements ICacheBuilder {
                }
                else {
                        $type = '';
-                       $packageID = $information[1];
                }
                 
                $data = array(
@@ -47,14 +45,10 @@ class OptionCacheBuilder implements ICacheBuilder {
                
                // option categories
                // get all option categories and sort categories by priority
-               $sql = "SELECT          categoryName, categoryID 
-                       FROM            wcf".WCF_N."_".$tableName."option_category option_category
-                       LEFT JOIN       wcf".WCF_N."_package_dependency package_dependency
-                       ON              (package_dependency.dependency = option_category.packageID)
-                       WHERE           package_dependency.packageID = ?
-                       ORDER BY        package_dependency.priority ASC";
+               $sql = "SELECT  categoryName, categoryID 
+                       FROM    wcf".WCF_N."_".$tableName."option_category";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($packageID));
+               $statement->execute();
                $optionCategories = array();
                while ($row = $statement->fetchArray()) {
                        $optionCategories[$row['categoryName']] = $row['categoryID'];
@@ -87,13 +81,9 @@ class OptionCacheBuilder implements ICacheBuilder {
                // get all options and sort options by priority
                $optionIDs = array();
                $sql = "SELECT          optionName, optionID 
-                       FROM            wcf".WCF_N."_".$tableName."option option_table
-                       LEFT JOIN       wcf".WCF_N."_package_dependency package_dependency
-                       ON              (package_dependency.dependency = option_table.packageID)
-                       WHERE           package_dependency.packageID = ?
-                       ORDER BY        package_dependency.priority ASC";
+                       FROM            wcf".WCF_N."_".$tableName."option";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($packageID));
+               $statement->execute();
                while ($row = $statement->fetchArray()) {
                        $optionIDs[$row['optionName']] = $row['optionID'];
                }
index 0c7107cecceb55c4418571e10181480b2bd19825..e187a9aa35a6054122a95598c270187c5756165e 100644 (file)
@@ -17,10 +17,20 @@ class PackageCacheBuilder implements ICacheBuilder {
         * @see wcf\system\cache\ICacheBuilder::getData()
         */
        public function getData(array $cacheResource) {
+               $data = array(
+                       'packages' => array(),
+                       'packageIDs' => array()
+               );
+               
                $packageList = new PackageList();
                $packageList->sqlLimit = 0;
                $packageList->readObjects();
                
-               return $packageList->getObjects();
+               foreach ($packageList as $package) {
+                       $data['packages'][$package->packageID] = $package;
+                       $data['packageIDs'][$package->package] = $package->packageID;
+               }
+               
+               return $data;
        }
 }
diff --git a/wcfsetup/install/files/lib/system/cache/builder/PackageDependencyCacheBuilder.class.php b/wcfsetup/install/files/lib/system/cache/builder/PackageDependencyCacheBuilder.class.php
deleted file mode 100644 (file)
index e22b1eb..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-<?php
-namespace wcf\system\cache\builder;
-use wcf\system\WCF;
-
-/**
- * Caches the dependencies of a package.
- * 
- * @author     Marcel Werk
- * @copyright  2001-2012 WoltLab GmbH
- * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @package    com.woltlab.wcf
- * @subpackage system.cache.builder
- * @category   Community Framework
- */
-class PackageDependencyCacheBuilder implements ICacheBuilder {
-       /**
-        * @see wcf\system\cache\ICacheBuilder::getData()
-        */
-       public function getData(array $cacheResource) {
-               list($cache, $packageID) = explode('-', $cacheResource['cache']);
-               $data = array(
-                       'dependency' => array(),
-                       'resolve' => array()
-               );
-               
-               if ($packageID != 0) {
-                       // general dependencies for current package id
-                       $sql = "SELECT  dependency
-                               FROM    wcf".WCF_N."_package_dependency
-                               WHERE   packageID = ?";
-                       $statement = WCF::getDB()->prepareStatement($sql);
-                       $statement->execute(array($packageID));
-                       while ($row = $statement->fetchArray()) {
-                               $data['dependency'][] = $row['dependency'];
-                       }
-                       
-                       // resolve package id by package name
-                       $sql = "SELECT          package.packageID, package.package
-                               FROM            wcf".WCF_N."_package_dependency package_dependency
-                               LEFT JOIN       wcf".WCF_N."_package package
-                               ON              (package.packageID = package_dependency.dependency)
-                               WHERE           package_dependency.packageID = ?
-                               ORDER BY        package_dependency.priority ASC";
-                       $statement = WCF::getDB()->prepareStatement($sql);
-                       $statement->execute(array($packageID));
-                       while ($row = $statement->fetchArray()) {
-                               if (!isset($data['resolve'][$row['package']])) $data['resolve'][$row['package']] = array();
-                               $data['resolve'][$row['package']][] = $row['packageID'];
-                       }
-                       
-                       foreach ($data['resolve'] as $package => $packageIDArray) {
-                               if (count($packageIDArray) == 1) {
-                                       $data[$package] = array_shift($packageIDArray);
-                               }
-                       }
-               }
-               
-               return $data;
-       }
-}
index ae1936c3a15c1a359545397c5d8789ee3e436102..b25f0b58a7690944fb9150ba8fbac02154c687d5 100644 (file)
@@ -18,19 +18,14 @@ class PageMenuCacheBuilder implements ICacheBuilder {
        /**
         * @see wcf\system\cache\ICacheBuilder::getData()
         */
-       public function getData(array $cacheResource) {
-               list($cache, $packageID) = explode('-', $cacheResource['cache']); 
+       public function getData(array $cacheResource) { 
                $data = array();
-
+               
                // get all menu items and filter menu items with low priority
-               $sql = "SELECT          menuItem, menuItemID 
-                       FROM            wcf".WCF_N."_page_menu_item menu_item
-                       LEFT JOIN       wcf".WCF_N."_package_dependency package_dependency
-                       ON              (package_dependency.dependency = menu_item.packageID)
-                       WHERE           package_dependency.packageID = ?
-                       ORDER BY        package_dependency.priority ASC";
+               $sql = "SELECT  menuItem, menuItemID 
+                       FROM    wcf".WCF_N."_page_menu_item";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($packageID));
+               $statement->execute();
                $itemIDs = array();
                while ($row = $statement->fetchArray()) {
                        $itemIDs[$row['menuItem']] = $row['menuItemID'];
index 334ef4633d5aa2a13544d5488d2d23c5b87b58bb..ddfb3f73692c25a19e3d5d8358888fbebb1ab6ba 100644 (file)
@@ -1,7 +1,6 @@
 <?php
 namespace wcf\system\cache\builder;
 use wcf\data\sitemap\SitemapList;
-use wcf\system\package\PackageDependencyHandler;
 
 /**
  * Caches sitemap structure.
@@ -19,7 +18,6 @@ class SitemapCacheBuilder implements ICacheBuilder {
         */
        public function getData(array $cacheResource) {
                $sitemapList = new SitemapList();
-               $sitemapList->getConditionBuilder()->add("sitemap.packageID IN (?)", array(PackageDependencyHandler::getInstance()->getDependencies()));
                $sitemapList->sqlLimit = 0;
                $sitemapList->sqlOrderBy = "sitemap.showOrder ASC";
                $sitemapList->readObjects();
index 8e3c980219026415ce61f3c733e94a0d804e63b8..4b4e4624ec82f686e17f0dcae852ae14e3d4a08f 100644 (file)
@@ -20,26 +20,20 @@ class TemplateCacheBuilder implements ICacheBuilder {
                $information = explode('-', $cacheResource['cache']);
                if (count($information) == 3) {
                        $prefix = $information[0].'_';
-                       $packageID = $information[2];
                }
                else {
                        $prefix = '';
-                       $packageID = $information[1];
                }
                
                $data = array();
                
                // get all templates and filter options with low priority
                $sql = "SELECT          templateName, template.packageID 
-                       FROM            wcf".WCF_N."_".$prefix."template template
-                       LEFT JOIN       wcf".WCF_N."_package_dependency package_dependency
-                       ON              (package_dependency.dependency = template.packageID)
-                       WHERE           package_dependency.packageID = ?
-                       ORDER BY        package_dependency.priority DESC";
+                       FROM            wcf".WCF_N."_".$prefix."template";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($packageID));
+               $statement->execute();
                while ($row = $statement->fetchArray()) {
-                       if (!isset($data[$row['templateName']]) || $packageID == $row['packageID']) {
+                       if (!isset($data[$row['templateName']])) {
                                $data[$row['templateName']] = $row['packageID'];
                        }
                }
index c4502a35e8b2a1e6c8de028d40ac3f7c4d01ca9d..b979624161bd7b08205a5d51064e63f84eefe8d8 100644 (file)
@@ -1,7 +1,6 @@
 <?php
 namespace wcf\system\cache\builder;
 use wcf\data\template\listener\TemplateListenerList;
-use wcf\system\package\PackageDependencyHandler;
 
 /**
  * Caches template listener information.
@@ -23,8 +22,6 @@ class TemplateListenerCacheBuilder implements ICacheBuilder {
                // get templates for current package id
                $templateListenerList = new TemplateListenerList();
                $templateListenerList->getConditionBuilder()->add("template_listener.environment = ?", array($environment));
-               // work-around during setup
-               if (PACKAGE_ID) $templateListenerList->getConditionBuilder()->add("template_listener.packageID IN (?)", array(PackageDependencyHandler::getInstance()->getDependencies()));
                $templateListenerList->sqlLimit = 0;
                $templateListenerList->readObjects();
                
index 773bc0009fb0c1a1d23c0e525862a91dd4c45242..6ab710f3d00dcc6343fddbe16e3cfcded3c433c0 100644 (file)
@@ -1,7 +1,6 @@
 <?php
 namespace wcf\system\cache\builder;
 use wcf\data\template\listener\TemplateListenerList;
-use wcf\system\package\PackageDependencyHandler;
 
 /**
  * Caches template listener code.
@@ -24,7 +23,6 @@ class TemplateListenerCodeCacheBuilder implements ICacheBuilder {
                $templateListenerList = new TemplateListenerList();
                $templateListenerList->getConditionBuilder()->add("template_listener.environment = ?", array($environment));
                $templateListenerList->getConditionBuilder()->add("template_listener.templateName = ?", array($templateName));
-               $templateListenerList->getConditionBuilder()->add("template_listener.packageID IN (?)", array(PackageDependencyHandler::getInstance()->getDependencies()));
                $templateListenerList->sqlLimit = 0;
                $templateListenerList->readObjects();
                
index ac6d4db0e502723c9347c88046b4bedd9299e415..d00a45ea304fb1d2b8f6f1369522ab848a84a368 100644 (file)
@@ -40,14 +40,10 @@ class UserGroupPermissionCacheBuilder implements ICacheBuilder {
                        $statement->execute();
                }
                else {
-                       $sql = "SELECT          optionName, optionID 
-                               FROM            wcf".WCF_N."_user_group_option option_table
-                               LEFT JOIN       wcf".WCF_N."_package_dependency package_dependency
-                               ON              (package_dependency.dependency = option_table.packageID)
-                               WHERE           package_dependency.packageID = ?
-                               ORDER BY        package_dependency.priority ASC";
+                       $sql = "SELECT  optionName, optionID 
+                               FROM    wcf".WCF_N."_user_group_option";
                        $statement = WCF::getDB()->prepareStatement($sql);
-                       $statement->execute(array($packageID));
+                       $statement->execute();
                }
                
                $options = array();
index 1b960f631e59dfaa6b551f33c7202411da45b317..deffc78df91d2a523225141b14d68d8f51415135 100644 (file)
@@ -192,17 +192,11 @@ class DiskCacheSource implements ICacheSource {
         * @see wcf\system\cache\source\ICacheSource::flush()
         */
        public function flush() {
-               $sql = "SELECT          package.packageDir
-                       FROM            wcf".WCF_N."_package_dependency package_dependency
-                       LEFT JOIN       wcf".WCF_N."_package package
-                       ON              (package.packageID = package_dependency.dependency)
-                       WHERE           package_dependency.packageID = ?
-                                       AND isApplication = ?";
+               $sql = "SELECT  packageDir
+                       FROM    wcf".WCF_N."_package
+                       WHERE   isApplication = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(
-                       PACKAGE_ID,
-                       1
-               ));
+               $statement->execute(array(1));
                while ($row = $statement->fetchArray()) {
                        $packageDir = FileUtil::getRealPath(WCF_DIR.$row['packageDir']);
                        $cacheDir = $packageDir.'cache';
index 133eecfe7177c3e1895b454a887589b555ca9148..2368c5607ab01d7a8d200a95339b36d8864430e1 100644 (file)
@@ -147,21 +147,20 @@ class CategoryHandler extends SingletonFactory {
                        $this->objectTypeIDs[$objectType->objectTypeID] = $objectType->objectType;
                }
                
-               $cacheName = 'category-'.PACKAGE_ID;
                CacheHandler::getInstance()->addResource(
-                       $cacheName,
-                       WCF_DIR.'cache/cache.'.$cacheName.'.php',
+                       'category',
+                       WCF_DIR.'cache/cache.category.php',
                        'wcf\system\cache\builder\CategoryCacheBuilder'
                );
-               $this->categories = CacheHandler::getInstance()->get($cacheName, 'categories');
-               $this->objectTypeCategoryIDs = CacheHandler::getInstance()->get($cacheName, 'objectTypeCategoryIDs');
+               $this->categories = CacheHandler::getInstance()->get('category', 'categories');
+               $this->objectTypeCategoryIDs = CacheHandler::getInstance()->get('category', 'objectTypeCategoryIDs');
        }
        
        /**
         * Reloads the category cache.
         */
        public function reloadCache() {
-               CacheHandler::getInstance()->clearResource('category-'.PACKAGE_ID);
+               CacheHandler::getInstance()->clearResource('category');
                
                $this->init();
        }
index 9177758a3fbe18b9897b88b7462367003c67aea0..e792f5bd669edb0a5feed943b2332492113744c8 100644 (file)
@@ -47,14 +47,12 @@ class CleanupHandler {
         * Loads cleanup adapter cache.
         */
        protected function loadCache() {
-               $cacheName = 'cleanupAdapter-'.PACKAGE_ID;
                CacheHandler::getInstance()->addResource(
-                       $cacheName,
-                       WCF_DIR.'cache/cache.'.$cacheName.'.php',
+                       'cleanupAdapter',
+                       WCF_DIR.'cache/cache.cleanupAdapter.php',
                        'wcf\system\cache\builder\CleanupAdapterCacheBuilder'
                );
-               
-               $this->cache = CacheHandler::getInstance()->get($cacheName);
+               $this->cache = CacheHandler::getInstance()->get('cleanupAdapter');
        }
        
        /**
index 500c36d526a2fd99d7fecc6ac55d493d93941ed3..ee3e2f592eeef02f45d4ecbc98c661818e82c063 100644 (file)
@@ -58,11 +58,11 @@ class ClipboardHandler extends SingletonFactory {
                }
                
                CacheHandler::getInstance()->addResource(
-                       'clipboard-page-'.PACKAGE_ID,
-                       WCF_DIR.'cache/cache.clipboard-page-'.PACKAGE_ID.'.php',
+                       'clipboardPage',
+                       WCF_DIR.'cache/cache.clipboardPage.php',
                        'wcf\system\cache\builder\ClipboardPageCacheBuilder'
                );
-               $this->pageCache = CacheHandler::getInstance()->get('clipboard-page-'.PACKAGE_ID);
+               $this->pageCache = CacheHandler::getInstance()->get('clipboardPage');
        }
        
        /**
@@ -72,11 +72,11 @@ class ClipboardHandler extends SingletonFactory {
                if ($this->actionCache !== null) return;
                
                CacheHandler::getInstance()->addResource(
-                       'clipboard-action-'.PACKAGE_ID,
-                       WCF_DIR.'cache/cache.clipboard-action-'.PACKAGE_ID.'.php',
+                       'clipboardAction',
+                       WCF_DIR.'cache/cache.clipboardAction.php',
                        'wcf\system\cache\builder\ClipboardActionCacheBuilder'
                );
-               $this->actionCache = CacheHandler::getInstance()->get('clipboard-action-'.PACKAGE_ID);
+               $this->actionCache = CacheHandler::getInstance()->get('clipboardAction');
        }
        
        /**
index b3f4d401582cb53c8618d22237258539a6cc56c1..26df20a318e2acc50d0c5ea267702b070b1540a7 100644 (file)
@@ -4,9 +4,7 @@ use wcf\data\cronjob\log\CronjobLogEditor;
 use wcf\data\cronjob\Cronjob;
 use wcf\data\cronjob\CronjobEditor;
 use wcf\system\cache\CacheHandler;
-use wcf\system\database\util\PreparedStatementConditionBuilder;
 use wcf\system\exception\SystemException;
-use wcf\system\package\PackageDependencyHandler;
 use wcf\system\SingletonFactory;
 use wcf\system\WCF;
 use wcf\util\ClassUtil;
@@ -104,18 +102,20 @@ class CronjobScheduler extends SingletonFactory {
         * Loads outstanding cronjobs.
         */
        protected function loadCronjobs() {
-               $conditions = new PreparedStatementConditionBuilder();
-               $conditions->add("cronjob.packageID IN (?)", array(PackageDependencyHandler::getInstance()->getDependencies()));
-               $conditions->add("(cronjob.nextExec <= ? OR cronjob.afterNextExec <= ?)", array(TIME_NOW, TIME_NOW));
-               $conditions->add("cronjob.active = ?", array(1));
-               $conditions->add("cronjob.failCount < ?", array(3));
-               $conditions->add("cronjob.state = ?", array(Cronjob::READY));
-               
-               $sql = "SELECT          cronjob.*
-                       FROM            wcf".WCF_N."_cronjob cronjob
-                       ".$conditions;
+               $sql = "SELECT  *
+                       FROM    wcf".WCF_N."_cronjob
+                       WHERE   (cronjob.nextExec <= ? OR cronjob.afterNextExec <= ?)
+                               AND cronjob.active = ?
+                               AND cronjob.failCount < ?
+                               AND cronjob.state = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute($conditions->getParameters());
+               $statement->execute(array(
+                       TIME_NOW,
+                       TIME_NOW,
+                       1,
+                       Cronjob::MAX_FAIL_COUNT,
+                       Cronjob::READY
+               ));
                while ($row = $statement->fetchArray()) {
                        $cronjob = new Cronjob(null, $row);
                        $cronjobEditor = new CronjobEditor($cronjob);
@@ -206,19 +206,18 @@ class CronjobScheduler extends SingletonFactory {
         * Loads the cached data for cronjob execution.
         */
        protected function loadCache() {
-               $cacheName = 'cronjobs-'.PACKAGE_ID;
                CacheHandler::getInstance()->addResource(
-                       $cacheName,
-                       WCF_DIR.'cache/cache.'.$cacheName.'.php',
+                       'cronjob',
+                       WCF_DIR.'cache/cache.cronjob.php',
                        'wcf\system\cache\builder\CronjobCacheBuilder'
                );
-               $this->cache = CacheHandler::getInstance()->get($cacheName);
+               $this->cache = CacheHandler::getInstance()->get('cronjob');
        }
        
        /**
         * Clears the cronjob data cache.
         */
        public static function clearCache() {
-               CacheHandler::getInstance()->clear(WCF_DIR.'cache/', 'cache.cronjobs-'.PACKAGE_ID.'.php');
+               CacheHandler::getInstance()->clear(WCF_DIR.'cache/', 'cache.cronjob.php');
        }
 }
index 351176b77b7cfc3ced9fe969f21a0666c84d99df..0cf62140b72eb6cad332a76916ed8dc0ac31b063 100644 (file)
@@ -66,7 +66,7 @@ class RefreshSearchRobotsCronjob implements ICronjob {
                        }
                        
                        // clear spider cache
-                       CacheHandler::getInstance()->clear(WCF_DIR.'cache', 'cache.spiders.php');
+                       CacheHandler::getInstance()->clear(WCF_DIR.'cache', 'cache.spider.php');
                }
                
                // delete tmp file
index f699ea3c136613961df816d3be2b9ea81b1319ca..81f3383d182647b05d4fd19439569207afadca60 100644 (file)
@@ -51,13 +51,12 @@ class EventHandler extends SingletonFactory {
         */
        protected function loadActions() {
                $environment = (class_exists('wcf\system\WCFACP', false) ? 'admin' : 'user');
-               $cacheName = 'eventListener-'.PACKAGE_ID;
                CacheHandler::getInstance()->addResource(
-                       $cacheName,
-                       WCF_DIR.'cache/cache.'.$cacheName.'.php',
+                       'eventListener',
+                       WCF_DIR.'cache/cache.eventListener.php',
                        'wcf\system\cache\builder\EventListenerCacheBuilder'
                );
-               $cache = CacheHandler::getInstance()->get($cacheName);
+               $cache = CacheHandler::getInstance()->get('eventListener');
                
                if (isset($cache['actions'][$environment])) {
                        $this->actions = $cache['actions'][$environment];
index 598ad03e9fdaef791209f024277800f9ec308462..bafdd7c01270b6b168c2f1dfe46b3beb7971d95c 100644 (file)
@@ -3,7 +3,6 @@ namespace wcf\system\language;
 use wcf\system\database\util\PreparedStatementConditionBuilder;
 use wcf\system\exception\SystemException;
 use wcf\system\language\LanguageFactory;
-use wcf\system\package\PackageDependencyHandler;
 use wcf\system\Regex;
 use wcf\system\SingletonFactory;
 use wcf\system\WCF;
@@ -277,13 +276,6 @@ class I18nHandler extends SingletonFactory {
                $conditions->add("languageID IN (?)", array($languageIDs));
                $conditions->add("languageItem = ?", array($languageVariable));
                
-               if (isset($this->elementOptions[$elementID]) && !Regex::compile('^'.$this->elementOptions[$elementID]['pattern'].'$')->match($languageVariable) && $this->isLanguageVariable($languageVariable)) {
-                       $conditions->add("packageID IN (?)", array(PackageDependencyHandler::getInstance()->getDependencies()));
-               }
-               else {
-                       $conditions->add("packageID = ?", array($packageID));
-               }
-               
                $sql = "SELECT  languageItemID, languageID
                        FROM    wcf".WCF_N."_language_item
                        ".$conditions;
@@ -346,17 +338,12 @@ class I18nHandler extends SingletonFactory {
         * Removes previously created i18n language variables.
         * 
         * @param       string          $languageVariable
-        * @param       integer         $packageID
         */
-       public function remove($languageVariable, $packageID = PACKAGE_ID) {
+       public function remove($languageVariable) {
                $sql = "DELETE FROM     wcf".WCF_N."_language_item
-                       WHERE           languageItem = ?
-                                       AND packageID = ?";
+                       WHERE           languageItem = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(
-                       $languageVariable,
-                       $packageID
-               ));
+               $statement->execute(array($languageVariable));
                
                // reset language cache
                LanguageFactory::getInstance()->deleteLanguageCache();
@@ -421,12 +408,10 @@ class I18nHandler extends SingletonFactory {
                                                // use i18n values from language items
                                                $sql = "SELECT  languageID, languageItemValue
                                                        FROM    wcf".WCF_N."_language_item
-                                                       WHERE   languageItem = ?
-                                                               AND packageID = ?";
+                                                       WHERE   languageItem = ?";
                                                $statement = WCF::getDB()->prepareStatement($sql);
                                                $statement->execute(array(
-                                                       $this->elementOptions[$elementID]['value'],
-                                                       $this->elementOptions[$elementID]['packageID']
+                                                       $this->elementOptions[$elementID]['value']
                                                ));
                                                while ($row = $statement->fetchArray()) {
                                                        $i18nValues[$row['languageID']] = StringUtil::encodeJS(StringUtil::unifyNewlines($row['languageItemValue']));
index 2980add9858e303afcca5a65c8b246b051b383a9..a79adf986c187166629145dc2b7b054760151944 100644 (file)
@@ -203,12 +203,12 @@ class LanguageFactory extends SingletonFactory {
        protected function loadCache() {
                if (defined('WCF_N')) {
                        CacheHandler::getInstance()->addResource(
-                               'languages',
-                               WCF_DIR.'cache/cache.languages.php',
+                               'language',
+                               WCF_DIR.'cache/cache.language.php',
                                'wcf\system\cache\builder\LanguageCacheBuilder'
                        );
                        
-                       $this->cache = CacheHandler::getInstance()->get('languages');
+                       $this->cache = CacheHandler::getInstance()->get('language');
                }
        }
        
@@ -216,7 +216,7 @@ class LanguageFactory extends SingletonFactory {
         * Clears languages cache.
         */
        public function clearCache() {
-               CacheHandler::getInstance()->clear(WCF_DIR.'cache/', 'cache.languages.php');
+               CacheHandler::getInstance()->clear(WCF_DIR.'cache/', 'cache.language.php');
        }
        
        /**
index 02985525571ecbd31b92f3ffc807819a1bd489f1..a3451fd2f16ea8a33701eee77fd6f0381dc7bb9d 100644 (file)
@@ -24,12 +24,11 @@ class ACPMenu extends TreeMenu {
                        return;
                }
                
-               $cacheName = 'acpMenu-'.PACKAGE_ID;
                CacheHandler::getInstance()->addResource(
-                       $cacheName,
-                       WCF_DIR.'cache/cache.'.$cacheName.'.php',
+                       'acpMenu',
+                       WCF_DIR.'cache/cache.acpMenu.php',
                        'wcf\system\cache\builder\ACPMenuCacheBuilder'
                );
-               $this->menuItems = CacheHandler::getInstance()->get($cacheName);
+               $this->menuItems = CacheHandler::getInstance()->get('acpMenu');
        }
 }
index 54fd2b230f9e3b29c7ed9f37516a2798c2cbece4..bf1469ac3c331f17e27cb7dbf8e597f268dabc62 100644 (file)
@@ -42,13 +42,12 @@ class PageMenu extends TreeMenu {
                parent::loadCache();
                
                // get cache
-               $cacheName = 'pageMenu-'.PACKAGE_ID;
                CacheHandler::getInstance()->addResource(
-                       $cacheName,
-                       WCF_DIR.'cache/cache.'.$cacheName.'.php',
+                       'pageMenu',
+                       WCF_DIR.'cache/cache.pageMenu.php',
                        'wcf\system\cache\builder\PageMenuCacheBuilder'
                );
-               $this->menuItems = CacheHandler::getInstance()->get($cacheName);
+               $this->menuItems = CacheHandler::getInstance()->get('pageMenu');
        }
        
        /**
index 7a38619424bb0a33c3a2869e0fcc8548a8d11e61..98912517805e56ed1971f372ecdd13220df6c2e2 100644 (file)
@@ -369,14 +369,17 @@ class OptionHandler implements IOptionHandler {
         * @param       boolean         $loadActiveOptions
         */
        protected function readCache($loadActiveOptions) {
-               $cacheName = $this->cacheName . '-' . PACKAGE_ID;
-               CacheHandler::getInstance()->addResource($cacheName, WCF_DIR.'cache/cache.'.$cacheName.'.php', $this->cacheClass);
+               CacheHandler::getInstance()->addResource(
+                       $this->cacheName,
+                       WCF_DIR.'cache/cache.'.$this->cacheName.'.php',
+                       $this->cacheClass
+               );
                
                // get cache contents
-               $this->cachedCategories = CacheHandler::getInstance()->get($cacheName, 'categories');
-               $this->cachedOptions = CacheHandler::getInstance()->get($cacheName, 'options');
-               $this->cachedCategoryStructure = CacheHandler::getInstance()->get($cacheName, 'categoryStructure');
-               $this->cachedOptionToCategories = CacheHandler::getInstance()->get($cacheName, 'optionToCategories');
+               $this->cachedCategories = CacheHandler::getInstance()->get($this->cacheName, 'categories');
+               $this->cachedOptions = CacheHandler::getInstance()->get($this->cacheName, 'options');
+               $this->cachedCategoryStructure = CacheHandler::getInstance()->get($this->cacheName, 'categoryStructure');
+               $this->cachedOptionToCategories = CacheHandler::getInstance()->get($this->cacheName, 'optionToCategories');
                
                if ($loadActiveOptions) {
                        // get active options
index a0111a54b2d82d064e8e9cfd9d2f1a5d0d3146e3..89df10ae19d3676ef1097e20aaf544e7ed1acef4 100644 (file)
@@ -441,56 +441,14 @@ class PackageArchive {
         * @return      boolean
         */
        public function isAlreadyInstalled() {
-               $duplicates = $this->getDuplicates();
-               
-               // package is not installed
-               if (empty($duplicates)) {
-                       return false;
-               }
-               
-               $parentPackageIDs = array();
-               foreach ($duplicates as $package) {
-                       // applications are always allowed
-                       if ($package['isApplication']) {
-                               return false;
-                       }
-                       
-                       // wcf packages must be unique
-                       if (!$package['parentPackageID']) {
-                               return true;
-                       }
-                       
-                       $parentPackageIDs[] = $package['parentPackageID'];
-               }
-               
-               // determine if plugin is unique within current application
-               $packageIDs = PackageDependencyHandler::getInstance()->getDependencies();
-               foreach ($parentPackageIDs as $packageID) {
-                       if (in_array($packageID, $packageIDs)) {
-                               return true;
-                       }
-               }
-               
-               return false;
-       }
-       
-       /**
-        * Returns a list of all installed instances of this package.
-        * 
-        * @return      array           packages
-        */
-       public function getDuplicates() {
-               $packages = array();
-               $sql = "SELECT  *
-                       FROM    wcf".WCF_N."_package 
-                       WHERE   package = ?";
+               $sql = "SELECT  COUNT(*) AS count
+                       FROM    wcf".WCF_N."_package
+                       WHERE   package = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
                $statement->execute(array($this->packageInfo['name']));
-               while ($row = $statement->fetchArray()) {
-                       $packages[$row['packageID']] = $row;
-               }
+               $row = $statement->fetchArray();
                
-               return $packages;
+               return ($row['count'] > 0) ? true : false;
        }
        
        /**
diff --git a/wcfsetup/install/files/lib/system/package/PackageDependencyHandler.class.php b/wcfsetup/install/files/lib/system/package/PackageDependencyHandler.class.php
deleted file mode 100644 (file)
index c6a72cb..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-<?php
-namespace wcf\system\package;
-use wcf\system\cache\CacheHandler;
-use wcf\system\SingletonFactory;
-
-/**
- * PackageDependencyHandler stores package dependencies and providing a consistent interface for accessing.
- * 
- * @author     Alexander Ebert
- * @copyright  2001-2012 WoltLab GmbH
- * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @package    com.woltlab.wcf
- * @subpackage system.package
- * @category   Community Framework
- */
-class PackageDependencyHandler extends SingletonFactory {
-       /**
-        * cache of package dependencies
-        * @var array
-        */     
-       protected $packageDependencyCache = null;
-       
-       /**
-        * @see wcf\system\SingletonFactory::init()
-        */
-       protected function init() {
-               $cacheName = 'packageDependencies-'.PACKAGE_ID;
-               CacheHandler::getInstance()->addResource(
-                       $cacheName,
-                       WCF_DIR.'cache/cache.'.$cacheName.'.php',
-                       'wcf\system\cache\builder\PackageDependencyCacheBuilder'
-               );
-               
-               $this->packageDependencyCache = CacheHandler::getInstance()->get($cacheName);
-       }
-       
-       /**
-        * Returns the id of a specific package in the active dependencies.
-        * 
-        * @param       string          $package        package identifier
-        * @return      mixed
-        */
-       public function getPackageID($package) {
-               if (!defined('PACKAGE_ID')) {
-                       return null;
-               }
-               
-               if (isset($this->packageDependencyCache['resolve'][$package])) {
-                       $packageID = $this->packageDependencyCache['resolve'][$package];
-                       
-                       if (is_array($packageID)) {
-                               $packageID = array_shift($packageID);
-                       }
-                       
-                       return $packageID;
-               }
-               
-               return null;
-       }
-       
-       /**
-        * Returns the package ids of all dependent packages.
-        * 
-        * @return      array
-        */
-       public function getDependencies() {
-               if (!defined('PACKAGE_ID')) {
-                       return null;
-               }
-               
-               return $this->packageDependencyCache['dependency'];
-       }
-}
index b0c9e18a258802e0fc8b160a4fd297679918da14..a159ed1b158e70ac619333216fd02a54a09126c3 100644 (file)
@@ -10,6 +10,7 @@ use wcf\data\package\installation\queue\PackageInstallationQueue;
 use wcf\data\package\installation\queue\PackageInstallationQueueEditor;
 use wcf\data\package\Package;
 use wcf\data\package\PackageEditor;
+use wcf\system\application\ApplicationHandler;
 use wcf\system\cache\CacheHandler;
 use wcf\system\database\statement\PreparedStatement;
 use wcf\system\database\util\PreparedStatementConditionBuilder;
@@ -141,6 +142,9 @@ class PackageInstallationDispatcher {
                                if (!PACKAGE_ID) {
                                        CacheHandler::getInstance()->clear(WCF_DIR.'cache/', 'cache.*.php');
                                }
+                               
+                               // rebuild application paths
+                               ApplicationHandler::rebuild();
                        }
                }
                
index 47039fb72d0e1a49b5d7f67a4a5bfd4959427d76..10bde8291bf6984e3a6326616aa96865d453a872 100644 (file)
@@ -46,11 +46,6 @@ class PackageInstallationSQLParser extends SQLParser {
         */
        protected $knownTables = array();
        
-       /**
-        * list of package ids
-        * @var array
-        */
-       protected $dependentPackageIDs = array();
        
        /**
         * list of conflicted database tables
@@ -102,9 +97,6 @@ class PackageInstallationSQLParser extends SQLParser {
                
                // get logged tables
                $this->getKnownTables();
-                               
-               // get package ids of dependencies
-               $this->getDependentPackageIDs();
                
                // enable testing mode
                $this->test = true;
@@ -214,20 +206,6 @@ class PackageInstallationSQLParser extends SQLParser {
                }
        }
        
-       /**
-        * Gets a list of dependent packages.
-        */
-       protected function getDependentPackageIDs() {
-               $sql = "SELECT          dependency
-                       FROM            wcf".WCF_N."_package_dependency
-                       WHERE           packageID = ?";
-               $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($this->package->packageID));
-               while ($row = $statement->fetchArray()) {
-                       $this->dependentPackageIDs[] = $row['dependency'];
-               }
-       }
-       
        /**
         * Returns the owner of a specific database table column.
         * 
@@ -306,8 +284,8 @@ class PackageInstallationSQLParser extends SQLParser {
        protected function executeAddColumnStatement($tableName, $columnName, $columnData) {
                if ($this->test) {
                        if (isset($this->knownTables[$tableName])) {
-                               if ($this->knownTables[$tableName] != $this->package->packageID && !in_array($this->knownTables[$tableName], $this->dependentPackageIDs)) {
-                                       throw new SystemException("Can not add column '".$columnName."' to table '.$tableName.'. An installion can only 'ADD' things to tables from the same package environment.");
+                               if ($this->knownTables[$tableName] != $this->package->packageID) {
+                                       throw new SystemException("Can not add column '".$columnName."' to table '.$tableName.'.");
                                }
                        }
                }
@@ -349,8 +327,8 @@ class PackageInstallationSQLParser extends SQLParser {
        protected function executeAddIndexStatement($tableName, $indexName, $indexData) {
                if ($this->test) {
                        if (isset($this->knownTables[$tableName])) {
-                               if ($this->knownTables[$tableName] != $this->package->packageID && !in_array($this->knownTables[$tableName], $this->dependentPackageIDs)) {
-                                       throw new SystemException("Can not add index '".$indexName."' to table '.$tableName.'. An installion can only 'ADD' things to tables from the same package environment.");
+                               if ($this->knownTables[$tableName] != $this->package->packageID) {
+                                       throw new SystemException("Can not add index '".$indexName."' to table '.$tableName.'.");
                                }
                        }
                }
@@ -369,8 +347,8 @@ class PackageInstallationSQLParser extends SQLParser {
        protected function executeAddForeignKeyStatement($tableName, $indexName, $indexData) {
                if ($this->test) {
                        if (isset($this->knownTables[$tableName])) {
-                               if ($this->knownTables[$tableName] != $this->package->packageID && !in_array($this->knownTables[$tableName], $this->dependentPackageIDs)) {
-                                       throw new SystemException("Can not add foreign key '".$indexName."' to table '.$tableName.'. An installion can only 'ADD' things to tables from the same package environment.");
+                               if ($this->knownTables[$tableName] != $this->package->packageID) {
+                                       throw new SystemException("Can not add foreign key '".$indexName."' to table '.$tableName.'.");
                                }
                        }
                }
index 2f22523a9d3941729e98854222ac41b4e29e8683..683710ae8be49150487e55d72e59649a9af974e3 100644 (file)
@@ -1,18 +1,18 @@
 <?php
 namespace wcf\system\package;
-use wcf\util\FileUtil;
-
 use wcf\data\option\OptionEditor;
 use wcf\data\package\installation\queue\PackageInstallationQueue;
 use wcf\data\package\Package;
 use wcf\data\package\PackageEditor;
 use wcf\data\package\PackageList;
+use wcf\system\application\ApplicationHandler;
 use wcf\system\cache\CacheHandler;
 use wcf\system\exception\IllegalLinkException;
 use wcf\system\exception\SystemException;
 use wcf\system\request\LinkHandler;
 use wcf\system\setup\Uninstaller;
 use wcf\system\WCF;
+use wcf\util\FileUtil;
 use wcf\util\HeaderUtil;
 
 /**
@@ -84,6 +84,9 @@ class PackageUninstallationDispatcher extends PackageInstallationDispatcher {
                                        CacheHandler::getInstance()->clear($dir.'cache/', 'cache.*.php');
                                }
                        }
+                       
+                       // rebuild application paths
+                       ApplicationHandler::rebuild();
                }
                
                // return next node
@@ -117,7 +120,7 @@ class PackageUninstallationDispatcher extends PackageInstallationDispatcher {
                ));
                
                // reset package cache
-               CacheHandler::getInstance()->clearResource('packages');
+               CacheHandler::getInstance()->clearResource('package');
                
                // rebuild package dependencies
                Package::rebuildParentPackageDependencies($this->queue->packageID);
index 4de033ed828daf376954b02562ab6f1d27a00293..25975d7087c28633fda99896b0a0eff96df4d1ff 100644 (file)
@@ -76,6 +76,6 @@ class ACPSearchProviderPackageInstallationPlugin extends AbstractXMLPackageInsta
         * @see wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::cleanup()
         */
        protected function cleanup() {
-               CacheHandler::getInstance()->clear(WCF_DIR.'cache', 'cache.acpSearchProvider-*.php');
+               CacheHandler::getInstance()->clear(WCF_DIR.'cache', 'cache.acpSearchProvider.php');
        }
 }
index fe71c1633d39a957b5dc43b41e86e4a19feb89c4..a8d17660a2c68d33e5213dba97447521d002e5e1 100644 (file)
@@ -67,6 +67,6 @@ class CoreObjectPackageInstallationPlugin extends AbstractXMLPackageInstallation
         * @see wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::cleanup()
         */     
        protected function cleanup() {
-               CacheHandler::getInstance()->clear(WCF_DIR.'cache', 'cache.coreObjects.php');
+               CacheHandler::getInstance()->clear(WCF_DIR.'cache', 'cache.coreObject.php');
        }
 }
index 7826184fbfb7f9357f5b4974d8af00086a3cbdf3..e92f9b1475f084c32bcf7b1d1cbbb0990a062bf1 100644 (file)
@@ -98,6 +98,6 @@ class EventListenerPackageInstallationPlugin extends AbstractXMLPackageInstallat
                parent::uninstall();
                
                // clear cache immediately
-               CacheHandler::getInstance()->clear(WCF_DIR.'cache', 'cache.eventListener-*.php');
+               CacheHandler::getInstance()->clear(WCF_DIR.'cache', 'cache.eventListener.php');
        }
 }
index 045d14e863adb51802e1405361ad2e9810d489fe..7c08856f08208ae47a85628cf945c8ded65df75c 100644 (file)
@@ -38,15 +38,11 @@ class ObjectTypePackageInstallationPlugin extends AbstractXMLPackageInstallation
         */
        protected function getDefinitionID($definitionName) {
                // get object type id
-               $sql = "SELECT          object_type_definition.definitionID
-                       FROM            wcf".WCF_N."_package_dependency package_dependency,
-                                       wcf".WCF_N."_object_type_definition object_type_definition
-                       WHERE           object_type_definition.packageID = package_dependency.dependency
-                                       AND package_dependency.packageID = ?
-                                       AND object_type_definition.definitionName = ?
-                       ORDER BY        package_dependency.priority DESC";
+               $sql = "SELECT  definitionID
+                       FROM    wcf".WCF_N."_object_type_definition
+                       WHERE   definitionName = ?";
                $statement = WCF::getDB()->prepareStatement($sql, 1);
-               $statement->execute(array($this->installation->getPackageID(), $definitionName));
+               $statement->execute(array($definitionName));
                $row = $statement->fetchArray();
                if (empty($row['definitionID'])) throw new SystemException("unknown object type definition '".$definitionName."' given");
                return $row['definitionID'];
index 2a2752d21290b37a5892d010ba322e9af4f3e503..4490dc70ba5cd25e4a0d387c83fed78aaba8dec7 100644 (file)
@@ -72,6 +72,6 @@ class SitemapPackageInstallationPlugin extends AbstractXMLPackageInstallationPlu
         * @see wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::cleanup()
         */     
        protected function cleanup() {
-               CacheHandler::getInstance()->clear(WCF_DIR.'cache', 'cache.sitemap-*.php');
+               CacheHandler::getInstance()->clear(WCF_DIR.'cache', 'cache.sitemap.php');
        }
 }
index 01cead1ec97a2ead5a396e3facc774d26a221b2c..e7e4ffd26c854d0776b4f7946d7d9ee0bc73d11b 100644 (file)
@@ -84,7 +84,7 @@ class TemplateListenerPackageInstallationPlugin extends AbstractXMLPackageInstal
         */     
        protected function cleanup() {
                // clear cache immediately
-               CacheHandler::getInstance()->clear(WCF_DIR.'cache', 'cache.templateListener-*.php');
+               CacheHandler::getInstance()->clear(WCF_DIR.'cache', 'cache.templateListener.php');
                CacheHandler::getInstance()->clear(WCF_DIR.'cache/templateListener', '*.php');
        }
 }
index dea4438f2d31d3149952ff543ee8f91d553eb837..11ea16f6fa2289f6c766f1ce2f3f85e1df0585fc 100644 (file)
@@ -1,6 +1,5 @@
 <?php
 namespace wcf\system\search\acp;
-use wcf\system\application\ApplicationHandler;
 use wcf\system\cache\CacheHandler;
 use wcf\system\exception\SystemException;
 use wcf\system\SingletonFactory;
@@ -33,16 +32,13 @@ class ACPSearchHandler extends SingletonFactory {
         * @see wcf\system\SingletonFactory::init()
         */
        protected function init() {
-               $application = ApplicationHandler::getInstance()->getPrimaryApplication();
-               $cacheName = 'acpSearchProvider-'.$application->packageID;
-               
                CacheHandler::getInstance()->addResource(
-                       $cacheName,
-                       WCF_DIR.'cache/cache.'.$cacheName.'.php',
+                       'acpSearchProvider',
+                       WCF_DIR.'cache/cache.acpSearchProvider.php',
                        'wcf\system\cache\builder\ACPSearchProviderCacheBuilder'
                );
                
-               $this->cache = CacheHandler::getInstance()->get($cacheName);
+               $this->cache = CacheHandler::getInstance()->get('acpSearchProvider');
        }
        
        /**
index 0f31ad2c17543633b7af73b8e4fcd9e755beca2b..a588b0f6b0def531edf71c6f19f5e09bb8e6bd2b 100644 (file)
@@ -1,7 +1,6 @@
 <?php
 namespace wcf\system\search\acp;
 use wcf\system\database\util\PreparedStatementConditionBuilder;
-use wcf\system\package\PackageDependencyHandler;
 use wcf\system\request\LinkHandler;
 use wcf\system\WCF;
 
@@ -26,7 +25,6 @@ class MenuItemACPSearchResultProvider extends AbstractACPSearchResultProvider im
                $conditions = new PreparedStatementConditionBuilder();
                $conditions->add("languageID = ?", array(WCF::getLanguage()->languageID));
                $conditions->add("languageItemValue LIKE ?", array($query.'%'));
-               $conditions->add("packageID IN (?)", array(PackageDependencyHandler::getInstance()->getDependencies()));
                
                // filter by language item
                $languageItemsConditions = '';
index 80ead1b678fa95cc4e58bbf4fd4c5b090421f5f7..ceac9f08f95101d3eccee9204cd342c31d982a04 100644 (file)
@@ -1,7 +1,6 @@
 <?php
 namespace wcf\system\search\acp;
 use wcf\system\database\util\PreparedStatementConditionBuilder;
-use wcf\system\package\PackageDependencyHandler;
 use wcf\system\request\LinkHandler;
 use wcf\system\WCF;
 
@@ -31,7 +30,6 @@ class OptionACPSearchResultProvider extends AbstractCategorizedACPSearchResultPr
                $conditions = new PreparedStatementConditionBuilder();
                $conditions->add("languageID = ?", array(WCF::getLanguage()->languageID));
                $conditions->add("languageItemValue LIKE ?", array($query.'%'));
-               $conditions->add("packageID IN (?)", array(PackageDependencyHandler::getInstance()->getDependencies()));
                
                // filter by language item
                $languageItemsConditions = '';
index 79b0b5cbbca7615b53a6bdbfb51a1ef00fe0727f..de5db44be9d2e0416341fbe6cf583c183141ec2d 100644 (file)
@@ -1,7 +1,6 @@
 <?php
 namespace wcf\system\search\acp;
 use wcf\system\database\util\PreparedStatementConditionBuilder;
-use wcf\system\package\PackageDependencyHandler;
 use wcf\system\request\LinkHandler;
 use wcf\system\WCF;
 
@@ -31,7 +30,6 @@ class PackageACPSearchResultProvider implements IACPSearchResultProvider {
                $conditions->add("languageID = ?", array(WCF::getLanguage()->languageID));
                $conditions->add("languageItem LIKE ?", array('wcf.acp.package.packageName.package%'));
                $conditions->add("languageItemValue LIKE ?", array($query.'%'));
-               $conditions->add("packageID IN (?)", array(PackageDependencyHandler::getInstance()->getDependencies()));
                
                $sql = "SELECT          languageItem
                        FROM            wcf".WCF_N."_language_item
index f1b267077cf8f0896789615bccf32108b95ec4f6..a8c4fde3ec63cd4c1f8d265ad9808a03695fdd4d 100644 (file)
@@ -1,7 +1,6 @@
 <?php
 namespace wcf\system\search\acp;
 use wcf\system\database\util\PreparedStatementConditionBuilder;
-use wcf\system\package\PackageDependencyHandler;
 use wcf\system\request\LinkHandler;
 use wcf\system\WCF;
 
@@ -31,7 +30,6 @@ class UserGroupOptionACPSearchResultProvider extends AbstractCategorizedACPSearc
                $conditions = new PreparedStatementConditionBuilder();
                $conditions->add("languageID = ?", array(WCF::getLanguage()->languageID));
                $conditions->add("languageItemValue LIKE ?", array($query.'%'));
-               $conditions->add("packageID IN (?)", array(PackageDependencyHandler::getInstance()->getDependencies()));
                
                // filter by language item
                $languageItemsConditions = '';
index e74bc5c16ebc02bee176a17b5346fd0ccd350284..360785d560fc6e678efbf2a082570384db58c9bc 100644 (file)
@@ -409,10 +409,10 @@ class SessionHandler extends SingletonFactory {
                $groupsFileName = StringUtil::getHash($groups);
                
                // register cache resource
-               $cacheName = 'groups-'.PACKAGE_ID.'-'.$groups;
+               $cacheName = 'userGroup-'.$groups;
                CacheHandler::getInstance()->addResource(
                        $cacheName,
-                       WCF_DIR.'cache/cache.userGroups-'.PACKAGE_ID.'-'.$groupsFileName.'.php',
+                       WCF_DIR.'cache/cache.userGroup-'.$groupsFileName.'.php',
                        'wcf\system\cache\builder\UserGroupPermissionCacheBuilder'
                );
                
index ae67f2e9072b7c2d7eed6a9831b65dad60d21b28..95ec1ea55154e2b4886ae169335c53e6f8e40bbb 100644 (file)
@@ -1,6 +1,5 @@
 <?php
 namespace wcf\system\sitemap;
-use wcf\system\application\ApplicationHandler;
 use wcf\system\cache\CacheHandler;
 use wcf\system\exception\SystemException;
 use wcf\system\SingletonFactory;
@@ -26,15 +25,12 @@ class SitemapHandler extends SingletonFactory {
         * @see wcf\system\SingletonFactory::init()
         */
        protected function init() {
-               $application = ApplicationHandler::getInstance()->getPrimaryApplication();
-               $cacheName = 'sitemap-'.$application->packageID;
-               
                CacheHandler::getInstance()->addResource(
-                       $cacheName,
-                       WCF_DIR.'cache/cache.'.$cacheName.'.php',
+                       'sitemap',
+                       WCF_DIR.'cache/cache.sitemap.php',
                        'wcf\system\cache\builder\SitemapCacheBuilder'
                );
-               $this->cache = CacheHandler::getInstance()->get($cacheName);
+               $this->cache = CacheHandler::getInstance()->get('sitemap');
        }
        
        /**
index b15c7ea85bb2514d2872f1d32c65f665bb472c12..c623fe261f1e4c02dec7f0e9c12404a0b39a4554 100644 (file)
@@ -45,16 +45,12 @@ class StyleCompiler extends SingletonFactory {
                // read stylesheets by dependency order
                $conditions = new PreparedStatementConditionBuilder();
                $conditions->add("file_log.filename REGEXP ?", array('style/([a-zA-Z0-9\_\-\.]+)\.less'));
-               $conditions->add("package_dependency.packageID = ?", array(ApplicationHandler::getInstance()->getPrimaryApplication()->packageID));
                
                $sql = "SELECT          file_log.filename, package.packageDir
                        FROM            wcf".WCF_N."_package_installation_file_log file_log
-                       LEFT JOIN       wcf".WCF_N."_package_dependency package_dependency
-                       ON              (file_log.packageID = package_dependency.dependency)
                        LEFT JOIN       wcf".WCF_N."_package package
                        ON              (file_log.packageID = package.packageID)
-                       ".$conditions."
-                       ORDER BY        package_dependency.priority ASC";
+                       ".$conditions;
                $statement = WCF::getDB()->prepareStatement($sql);
                $statement->execute($conditions->getParameters());
                $files = array();
@@ -71,7 +67,7 @@ class StyleCompiler extends SingletonFactory {
                }
                
                $this->compileStylesheet(
-                       WCF_DIR.'style/style-'.ApplicationHandler::getInstance()->getPrimaryApplication()->packageID.'-'.$style->styleID,
+                       WCF_DIR.'style/style-'.$style->styleID,
                        $files,
                        $variables,
                        $individualLess,
index e3fc9ee9212a161bb8b90d393e59d5d0889fc383..4af7ce02591b77b75641e127bf2d2978e184141c 100644 (file)
@@ -2,7 +2,6 @@
 namespace wcf\system\style;
 use wcf\data\style\ActiveStyle;
 use wcf\data\style\Style;
-use wcf\system\application\ApplicationHandler;
 use wcf\system\cache\CacheHandler;
 use wcf\system\exception\SystemException;
 use wcf\system\request\RequestHandler;
@@ -38,11 +37,11 @@ class StyleHandler extends SingletonFactory {
        protected function init() {
                // load cache
                CacheHandler::getInstance()->addResource(
-                       'styles',
-                       WCF_DIR.'cache/cache.styles.php',
+                       'style',
+                       WCF_DIR.'cache/cache.style.php',
                        'wcf\system\cache\builder\StyleCacheBuilder'
                );
-               $this->cache = CacheHandler::getInstance()->get('styles');
+               $this->cache = CacheHandler::getInstance()->get('style');
        }
        
        /**
@@ -133,7 +132,7 @@ class StyleHandler extends SingletonFactory {
                }
                else {
                        // frontend
-                       $filename = 'style/style-'.ApplicationHandler::getInstance()->getPrimaryApplication()->packageID.'-'.$this->getStyle()->styleID.'.css';
+                       $filename = 'style/style-'.$this->getStyle()->styleID.'.css';
                        if (!file_exists(WCF_DIR.$filename)) {
                                StyleCompiler::getInstance()->compile($this->getStyle()->getDecoratedObject());
                        }
@@ -148,7 +147,7 @@ class StyleHandler extends SingletonFactory {
         * @param       wcf\data\style\Style    $style
         */
        public function resetStylesheet(Style $style) {
-               $stylesheets = glob(WCF_DIR.'style/style-*-'.$style->styleID.'*.css');
+               $stylesheets = glob(WCF_DIR.'style/style-'.$style->styleID.'*.css');
                foreach ($stylesheets as $stylesheet) {
                        @unlink($stylesheet);
                }
index 6418ba022b5c85b4c99aae60bea7e893ae1cef62..07e6c1d5a7fcfe915e11a9f343b694f18021ce4d 100755 (executable)
@@ -411,7 +411,7 @@ class TemplateEngine extends SingletonFactory {
         * @param       string          $templateName
         */
        public function getCompiledFilename($templateName) {
-               return $this->compileDir.PACKAGE_ID.'_'.$this->templateGroupID.'_'.$this->languageID.'_'.$templateName.'.php';
+               return $this->compileDir.$this->templateGroupID.'_'.$this->languageID.'_'.$templateName.'.php';
        }
        
        /**
@@ -420,7 +420,7 @@ class TemplateEngine extends SingletonFactory {
         * @param       string          $templateName
         */
        public function getMetaDataFilename($templateName) {
-               return $this->compileDir.PACKAGE_ID.'_'.$this->templateGroupID.'_'.$templateName.'.meta.php';
+               return $this->compileDir.$this->templateGroupID.'_'.$templateName.'.meta.php';
        }
        
        /**
@@ -462,7 +462,7 @@ class TemplateEngine extends SingletonFactory {
                                if ($this->hasTemplateListeners($templateName)) {
                                        $this->loadTemplateListenerCode($templateName);
                                        
-                                       $templateListenerCache = WCF_DIR.'cache/templateListener/'.PACKAGE_ID.'-'.$this->environment.'-'.$templateName.'.php';
+                                       $templateListenerCache = WCF_DIR.'cache/templateListener/'.$this->environment.'-'.$templateName.'.php';
                                        $templateListenerCacheMTime = @filemtime($templateListenerCache);
                                        
                                        return !($sourceMTime >= $templateListenerCacheMTime);
@@ -669,11 +669,11 @@ class TemplateEngine extends SingletonFactory {
         */
        protected function loadTemplateGroupCache() {
                CacheHandler::getInstance()->addResource(
-                       'templateGroups',
-                       WCF_DIR.'cache/cache.templateGroups.php',
+                       'templateGroup',
+                       WCF_DIR.'cache/cache.templateGroup.php',
                        'wcf\system\cache\builder\TemplateGroupCacheBuilder'
                );
-               $this->templateGroupCache = CacheHandler::getInstance()->get('templateGroups');
+               $this->templateGroupCache = CacheHandler::getInstance()->get('templateGroup');
        }
        
        /**
@@ -746,7 +746,7 @@ class TemplateEngine extends SingletonFactory {
         * Loads all available template listeners.
         */
        protected function loadTemplateListeners() {
-               $cacheName = 'templateListener-'.PACKAGE_ID.'-'.$this->environment;
+               $cacheName = 'templateListener-'.$this->environment;
                CacheHandler::getInstance()->addResource(
                        $cacheName,
                        WCF_DIR.'cache/cache.'.$cacheName.'.php',
@@ -780,13 +780,12 @@ class TemplateEngine extends SingletonFactory {
                // cache was already loaded
                if (!isset($this->templateListeners[$templateName]) || !empty($this->templateListeners[$templateName])) return;
                
-               $cacheName = PACKAGE_ID.'-'.$this->environment.'-'.$templateName;
+               $cacheName = $this->environment.'-'.$templateName;
                CacheHandler::getInstance()->addResource(
                        $cacheName,
                        WCF_DIR.'cache/templateListener/'.$cacheName.'.php',
                        'wcf\system\cache\builder\TemplateListenerCodeCacheBuilder'
                );
-               
                $this->templateListeners[$templateName] = CacheHandler::getInstance()->get($cacheName);
        }
        
index 10c300530ff930e1a47a152ea9513cc91172acd9..1b9ec3adb671eb177357a32c9007b8e606f2506f 100644 (file)
@@ -1,7 +1,6 @@
 <?php
 namespace wcf\system\user\storage;
 use wcf\system\database\util\PreparedStatementConditionBuilder;
-use wcf\system\package\PackageDependencyHandler;
 use wcf\system\SingletonFactory;
 use wcf\system\WCF;
 
@@ -38,9 +37,8 @@ class UserStorageHandler extends SingletonFactory {
         * Loads storage for a given set of users.
         * 
         * @param       array<integer>  $userIDs
-        * @param       integer         $packageID
         */
-       public function loadStorage(array $userIDs, $packageID = PACKAGE_ID) {
+       public function loadStorage(array $userIDs) {
                $tmp = array();
                foreach ($userIDs as $userID) {
                        if (!isset($this->cache[$userID])) $tmp[] = $userID;
@@ -51,7 +49,6 @@ class UserStorageHandler extends SingletonFactory {
                
                $conditions = new PreparedStatementConditionBuilder();
                $conditions->add("userID IN (?)", array($tmp));
-               $conditions->add("packageID IN (?)", array(PackageDependencyHandler::getInstance()->getDependencies($packageID)));
                
                $sql = "SELECT  *
                        FROM    wcf".WCF_N."_user_storage
@@ -95,10 +92,9 @@ class UserStorageHandler extends SingletonFactory {
         * @param       integer         $userID
         * @param       string          $field
         * @param       string          $fieldValue
-        * @param       integer         $packageID
         */
-       public function update($userID, $field, $fieldValue, $packageID = PACKAGE_ID) {
-               $this->updateFields[$userID][$packageID][$field] = $fieldValue;
+       public function update($userID, $field, $fieldValue) {
+               $this->updateFields[$userID][$field] = $fieldValue;
                
                // update data cache for given user
                if (!isset($this->cache[$userID])) {
@@ -108,7 +104,7 @@ class UserStorageHandler extends SingletonFactory {
                $this->cache[$userID][$field] = $fieldValue;
                
                // flag key as outdated
-               self::reset(array($userID), $field, $packageID);
+               self::reset(array($userID), $field);
        }
        
        /**
@@ -116,11 +112,10 @@ class UserStorageHandler extends SingletonFactory {
         * 
         * @param       array<integer>  $userIDs
         * @param       string          $field
-        * @param       integer         $packageID
         */
-       public function reset(array $userIDs, $field, $packageID = PACKAGE_ID) {
+       public function reset(array $userIDs, $field) {
                foreach ($userIDs as $userID) {
-                       $this->resetFields[$userID][$packageID][] = $field;
+                       $this->resetFields[$userID][] = $field;
                        
                        if (isset($this->cache[$userID][$field])) {
                                unset($this->cache[$userID][$field]);
@@ -132,17 +127,12 @@ class UserStorageHandler extends SingletonFactory {
         * Removes a specific data record for all users.
         * 
         * @param       string          $field
-        * @param       integer         $packageID
         */
-       public function resetAll($field, $packageID = PACKAGE_ID) {
+       public function resetAll($field) {
                $sql = "DELETE FROM     wcf".WCF_N."_user_storage
-                       WHERE           field = ?
-                                       AND packageID = ?";
+                       WHERE           field = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(
-                       $field,
-                       $packageID
-               ));
+               $statement->execute(array($field));
                
                foreach ($this->cache as $userID => $fields) {
                        if (isset($fields[$field])) {
@@ -160,17 +150,15 @@ class UserStorageHandler extends SingletonFactory {
                if (!empty($this->resetFields)) {
                        $sql = "DELETE FROM     wcf".WCF_N."_user_storage
                                WHERE           userID = ?
-                                               AND field = ?
-                                               AND packageID = ?";
+                                               AND field = ?";
                        $statement = WCF::getDB()->prepareStatement($sql);
                        
                        foreach ($this->resetFields as $userID => $data) {
-                               foreach ($data as $packageID => $fields) {
+                               foreach ($data as $fields) {
                                        foreach ($fields as $field) {
                                                $statement->execute(array(
                                                        $userID,
-                                                       $field,
-                                                       $packageID
+                                                       $field
                                                ));
                                        }
                                }
@@ -180,18 +168,17 @@ class UserStorageHandler extends SingletonFactory {
                // insert data
                if (!empty($this->updateFields)) {
                        $sql = "INSERT INTO     wcf".WCF_N."_user_storage
-                                               (userID, field, fieldValue, packageID)
-                               VALUES          (?, ?, ?, ?)";
+                                               (userID, field, fieldValue)
+                               VALUES          (?, ?, ?)";
                        $statement = WCF::getDB()->prepareStatement($sql);
                        
                        foreach ($this->updateFields as $userID => $data) {
-                               foreach ($data as $packageID => $fieldValues) {
+                               foreach ($data as $fieldValues) {
                                        foreach ($fieldValues as $field => $fieldValue) {
                                                $statement->execute(array(
                                                        $userID,
                                                        $field,
-                                                       $fieldValue,
-                                                       $packageID
+                                                       $fieldValue
                                                ));
                                        }
                                }
index 92136c07e89d8819cb74fdfa8dc729da4e0a91ea..b0d6b1018a748f0386809905302eb9ebe54b3964 100644 (file)
@@ -25,7 +25,6 @@ CREATE TABLE wcf1_acp_search_provider (
 DROP TABLE IF EXISTS wcf1_acp_session;
 CREATE TABLE wcf1_acp_session (
        sessionID CHAR(40) NOT NULL PRIMARY KEY,
-       packageID INT(10),
        userID INT(10),
        ipAddress VARCHAR(39) NOT NULL DEFAULT '',
        userAgent VARCHAR(255) NOT NULL DEFAULT '',
@@ -45,7 +44,6 @@ DROP TABLE IF EXISTS wcf1_acp_session_access_log;
 CREATE TABLE wcf1_acp_session_access_log (
        sessionAccessLogID INT(10) NOT NULL AUTO_INCREMENT PRIMARY KEY,
        sessionLogID INT(10) NOT NULL,
-       packageID INT(10),
        ipAddress VARCHAR(39) NOT NULL DEFAULT '',
        time INT(10) NOT NULL DEFAULT 0,
        requestURI VARCHAR(255) NOT NULL DEFAULT '',
@@ -82,16 +80,9 @@ CREATE TABLE wcf1_application (
        domainPath VARCHAR(255) NOT NULL DEFAULT '/',
        cookieDomain VARCHAR(255) NOT NULL,
        cookiePath VARCHAR(255) NOT NULL DEFAULT '/',
-       groupID INT(10),
        isPrimary TINYINT(1) NOT NULL DEFAULT 0
 );
 
-DROP TABLE IF EXISTS wcf1_application_group;
-CREATE TABLE wcf1_application_group (
-       groupID INT(10) NOT NULL AUTO_INCREMENT PRIMARY KEY,
-       groupName VARCHAR(255) NOT NULL
-);
-
 DROP TABLE IF EXISTS wcf1_cache_resource;
 CREATE TABLE wcf1_cache_resource (
        cacheResource VARCHAR(255) NOT NULL PRIMARY KEY
@@ -234,7 +225,7 @@ CREATE TABLE wcf1_language_item (
        languageItemOriginIsSystem TINYINT(1) NOT NULL DEFAULT 1,
        languageCategoryID INT(10) NOT NULL,
        packageID INT(10),
-       UNIQUE KEY languageItem (languageItem, packageID, languageID),
+       UNIQUE KEY languageItem (languageItem, languageID),
        KEY languageItemOriginIsSystem (languageItemOriginIsSystem)
 );
 
@@ -245,13 +236,6 @@ CREATE TABLE wcf1_language_server (
        disabled TINYINT(1) NOT NULL DEFAULT 0
 );
 
-DROP TABLE IF EXISTS wcf1_language_to_package;
-CREATE TABLE wcf1_language_to_package (
-       languageID INT(10) NOT NULL,
-       packageID INT(10),
-       UNIQUE KEY languageID (languageID, packageID)
-);
-
 DROP TABLE IF EXISTS wcf1_modification_log;
 CREATE TABLE wcf1_modification_log (
        logID INT(10) NOT NULL AUTO_INCREMENT PRIMARY KEY,
@@ -341,14 +325,6 @@ CREATE TABLE wcf1_package (
        KEY package (package)
 );
 
-DROP TABLE IF EXISTS wcf1_package_dependency;
-CREATE TABLE wcf1_package_dependency (
-       packageID INT(10) NOT NULL,
-       dependency INT(10) NOT NULL,
-       priority INT(10) NOT NULL DEFAULT 0,
-       UNIQUE KEY packageID (packageID, dependency)
-);
-
 DROP TABLE IF EXISTS wcf1_package_exclusion;
 CREATE TABLE wcf1_package_exclusion (
        packageID INT(10) NOT NULL,
@@ -525,7 +501,6 @@ CREATE TABLE wcf1_search (
 DROP TABLE IF EXISTS wcf1_session;
 CREATE TABLE wcf1_session (
        sessionID CHAR(40) NOT NULL PRIMARY KEY,
-       packageID INT(10) NOT NULL,
        userID INT(10),
        ipAddress VARCHAR(39) NOT NULL DEFAULT '',
        userAgent VARCHAR(255) NOT NULL DEFAULT '',
@@ -581,15 +556,6 @@ CREATE TABLE wcf1_style (
        imagePath VARCHAR(255) NOT NULL DEFAULT ''
 );
 
-DROP TABLE IF EXISTS wcf1_style_to_package;
-CREATE TABLE wcf1_style_to_package (
-       styleID INT(10) NOT NULL,
-       packageID INT(10) NOT NULL,
-       isDefault TINYINT(1) NOT NULL DEFAULT 0,
-       disabled TINYINT(1) NOT NULL DEFAULT 0,
-       UNIQUE KEY (styleID, packageID)
-);
-
 DROP TABLE IF EXISTS wcf1_style_variable;
 CREATE TABLE wcf1_style_variable (
        variableID INT(10) NOT NULL AUTO_INCREMENT PRIMARY KEY,
@@ -755,7 +721,6 @@ CREATE TABLE wcf1_user_storage (
        userID INT(10) NOT NULL,
        field VARCHAR(80) NOT NULL DEFAULT '',
        fieldValue TEXT,
-       packageID INT(10),
        UNIQUE KEY userStorageData (userID, field, packageID)
 );
 
@@ -779,17 +744,14 @@ ALTER TABLE wcf1_acp_menu_item ADD FOREIGN KEY (packageID) REFERENCES wcf1_packa
 ALTER TABLE wcf1_acp_search_provider ADD FOREIGN KEY (packageID) REFERENCES wcf1_package (packageID) ON DELETE CASCADE;
 
 ALTER TABLE wcf1_acp_session ADD FOREIGN KEY (userID) REFERENCES wcf1_user (userID) ON DELETE CASCADE;
-ALTER TABLE wcf1_acp_session ADD FOREIGN KEY (packageID) REFERENCES wcf1_package (packageID) ON DELETE CASCADE;
 
 ALTER TABLE wcf1_acp_session_access_log ADD FOREIGN KEY (sessionLogID) REFERENCES wcf1_acp_session_log (sessionLogID) ON DELETE CASCADE;
-ALTER TABLE wcf1_acp_session_access_log ADD FOREIGN KEY (packageID) REFERENCES wcf1_package (packageID) ON DELETE SET NULL;
 
 ALTER TABLE wcf1_acp_session_log ADD FOREIGN KEY (userID) REFERENCES wcf1_user (userID) ON DELETE SET NULL;
 
 ALTER TABLE wcf1_acp_template ADD FOREIGN KEY (packageID) REFERENCES wcf1_package (packageID) ON DELETE CASCADE;
 
 ALTER TABLE wcf1_application ADD FOREIGN KEY (packageID) REFERENCES wcf1_package (packageID) ON DELETE CASCADE;
-ALTER TABLE wcf1_application ADD FOREIGN KEY (groupID) REFERENCES wcf1_application_group (groupID) ON DELETE SET NULL;
 
 ALTER TABLE wcf1_category ADD FOREIGN KEY (objectTypeID) REFERENCES wcf1_object_type (objectTypeID) ON DELETE CASCADE;
 
@@ -816,9 +778,6 @@ ALTER TABLE wcf1_language_item ADD FOREIGN KEY (languageID) REFERENCES wcf1_lang
 ALTER TABLE wcf1_language_item ADD FOREIGN KEY (languageCategoryID) REFERENCES wcf1_language_category (languageCategoryID) ON DELETE CASCADE;
 ALTER TABLE wcf1_language_item ADD FOREIGN KEY (packageID) REFERENCES wcf1_package (packageID) ON DELETE CASCADE;
 
-ALTER TABLE wcf1_language_to_package ADD FOREIGN KEY (languageID) REFERENCES wcf1_language (languageID) ON DELETE CASCADE;
-ALTER TABLE wcf1_language_to_package ADD FOREIGN KEY (packageID) REFERENCES wcf1_package (packageID) ON DELETE CASCADE;
-
 ALTER TABLE wcf1_modification_log ADD FOREIGN KEY (objectTypeID) REFERENCES wcf1_object_type (objectTypeID) ON DELETE CASCADE;
 ALTER TABLE wcf1_modification_log ADD FOREIGN KEY (userID) REFERENCES wcf1_user (userID) ON DELETE SET NULL;
 
@@ -831,9 +790,6 @@ ALTER TABLE wcf1_option ADD FOREIGN KEY (packageID) REFERENCES wcf1_package (pac
 
 ALTER TABLE wcf1_option_category ADD FOREIGN KEY (packageID) REFERENCES wcf1_package (packageID) ON DELETE CASCADE;
 
-ALTER TABLE wcf1_package_dependency ADD FOREIGN KEY (packageID) REFERENCES wcf1_package (packageID) ON DELETE CASCADE;
-ALTER TABLE wcf1_package_dependency ADD FOREIGN KEY (dependency) REFERENCES wcf1_package (packageID) ON DELETE CASCADE;
-
 ALTER TABLE wcf1_package_exclusion ADD FOREIGN KEY (packageID) REFERENCES wcf1_package (packageID) ON DELETE CASCADE;
 
 ALTER TABLE wcf1_package_installation_file_log ADD FOREIGN KEY (packageID) REFERENCES wcf1_package (packageID) ON DELETE CASCADE;
@@ -869,19 +825,14 @@ ALTER TABLE wcf1_page_menu_item ADD FOREIGN KEY (packageID) REFERENCES wcf1_pack
 
 ALTER TABLE wcf1_search ADD FOREIGN KEY (userID) REFERENCES wcf1_user (userID) ON DELETE CASCADE;
 
-ALTER TABLE wcf1_session ADD FOREIGN KEY (packageID) REFERENCES wcf1_package (packageID) ON DELETE CASCADE;
 ALTER TABLE wcf1_session ADD FOREIGN KEY (userID) REFERENCES wcf1_user (userID) ON DELETE CASCADE;
 
 ALTER TABLE wcf1_sitemap ADD FOREIGN KEY (packageID) REFERENCES wcf1_package (packageID) ON DELETE CASCADE;
 
 ALTER TABLE wcf1_user_storage ADD FOREIGN KEY (userID) REFERENCES wcf1_user (userID) ON DELETE CASCADE;
-ALTER TABLE wcf1_user_storage ADD FOREIGN KEY (packageID) REFERENCES wcf1_package (packageID) ON DELETE CASCADE;
 
 ALTER TABLE wcf1_style ADD FOREIGN KEY (packageID) REFERENCES wcf1_package (packageID) ON DELETE CASCADE;
 
-ALTER TABLE wcf1_style_to_package ADD FOREIGN KEY (styleID) REFERENCES wcf1_style (styleID) ON DELETE CASCADE;
-ALTER TABLE wcf1_style_to_package ADD FOREIGN KEY (packageID) REFERENCES wcf1_package (packageID) ON DELETE CASCADE;
-
 ALTER TABLE wcf1_style_variable_value ADD FOREIGN KEY (styleID) REFERENCES wcf1_style (styleID) ON DELETE CASCADE;
 ALTER TABLE wcf1_style_variable_value ADD FOREIGN KEY (variableID) REFERENCES wcf1_style_variable (variableID) ON DELETE CASCADE;