<?php
namespace wcf\acp\form;
use wcf\data\user\group\option\category\UserGroupOptionCategoryList;
+use wcf\data\user\group\option\UserGroupOptionAction;
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;
protected static $baseClass = 'wcf\data\cronjob\log\CronjobLog';
/**
- * Deletes the cronjob logs for the package with the given id.
- *
- * @param integer $packageID
- * Deletes the cronjob log.
++ * Deletes all cronjob logs.
*/
- 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();
}
}
/**
* Updates the language files for the given category.
- *
+ *
- * @param array $categoryIDs
- * @param array $packageIDs
+ * @param array<integer> $categoryIDs
*/
- public function updateCategory(array $categoryIDs = array(), array $packageIDs = array()) {
+ public function updateCategory(array $categoryIDs = array()) {
if (empty($categoryIDs)) {
// get all categories
$sql = "SELECT languageCategoryID
/**
* Write the languages files.
- *
+ *
- * @param array $categoryIDs
- * @param array $packageIDs
+ * @param array $categoryIDs
*/
- protected function writeLanguageFiles(array $categoryIDs, array $packageIDs) {
+ protected function writeLanguageFiles(array $categoryIDs) {
// get categories
$conditions = new PreparedStatementConditionBuilder();
$conditions->add("languageCategoryID IN (?)", array($categoryIDs));
// 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()) {
/**
* Clears language cache.
- */
+ */
public function clearCache() {
- CacheHandler::getInstance()->clear(WCF_DIR.'cache/', 'cache.languages.php');
+ CacheHandler::getInstance()->clear(WCF_DIR.'cache/', 'cache.language.php');
}
/**
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'];
use wcf\system\style\StyleHandler;
use wcf\system\template\TemplateEngine;
use wcf\system\user\storage\UserStorageHandler;
- use wcf\system\exception;
-use wcf\util;
+use wcf\util\ArrayUtil;
+use wcf\util\ClassUtil;
+use wcf\util\FileUtil;
+use wcf\util\StringUtil;
// try to disable execution time limit
@set_time_limit(0);
*/
protected function initBlacklist() {
if (defined('BLACKLIST_IP_ADDRESSES') && BLACKLIST_IP_ADDRESSES != '') {
- if (!util\StringUtil::executeWordFilter(WCF::getSession()->ipAddress, BLACKLIST_IP_ADDRESSES)) {
+ if (!StringUtil::executeWordFilter(WCF::getSession()->ipAddress, BLACKLIST_IP_ADDRESSES)) {
- throw new exception\PermissionDeniedException();
+ throw new PermissionDeniedException();
}
}
if (defined('BLACKLIST_USER_AGENTS') && BLACKLIST_USER_AGENTS != '') {
- if (!util\StringUtil::executeWordFilter(WCF::getSession()->userAgent, BLACKLIST_USER_AGENTS)) {
+ if (!StringUtil::executeWordFilter(WCF::getSession()->userAgent, BLACKLIST_USER_AGENTS)) {
- throw new exception\PermissionDeniedException();
+ throw new PermissionDeniedException();
}
}
if (defined('BLACKLIST_HOSTNAMES') && BLACKLIST_HOSTNAMES != '') {
- if (!util\StringUtil::executeWordFilter(@gethostbyaddr(WCF::getSession()->ipAddress), BLACKLIST_HOSTNAMES)) {
+ if (!StringUtil::executeWordFilter(@gethostbyaddr(WCF::getSession()->ipAddress), BLACKLIST_HOSTNAMES)) {
- throw new exception\PermissionDeniedException();
+ throw new PermissionDeniedException();
}
}
}
}
if (class_exists($objectName)) {
- if (!(util\ClassUtil::isInstanceOf($objectName, 'wcf\system\SingletonFactory'))) {
+ if (!(ClassUtil::isInstanceOf($objectName, 'wcf\system\SingletonFactory'))) {
- throw new exception\SystemException("class '".$objectName."' does not implement the interface 'SingletonFactory'");
+ throw new SystemException("class '".$objectName."' does not implement the interface 'SingletonFactory'");
}
self::$coreObject[$className] = call_user_func(array($objectName, 'getInstance'));
<?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;
/**
* Handles multi-application environments.
<?php
namespace wcf\system\cache\builder;
use wcf\data\category\CategoryList;
- use wcf\system\package\PackageDependencyHandler;
/**
- * Caches the categories for a certain package.
- *
+ * Caches the categories for the active application.
+ *
* @author Matthias Schmidt
* @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @see wcf\system\cache\ICacheBuilder::getData()
*/
public function getData(array $cacheResource) {
- list(,, $environment) = explode('-', $cacheResource['cache']);
- list(, $environment) = explode('-', $cacheResource['cache']);
++ list(, $environment) = explode('-', $cacheResource['cache']);
// get templates for current package id
$templateListenerList = new TemplateListenerList();
<?php
namespace wcf\system\cache\builder;
use wcf\data\template\listener\TemplateListenerList;
- use wcf\system\package\PackageDependencyHandler;
/**
- * Caches template listener code.
+ * Caches the template listener code for a certain template in a certain environment.
*
* @author Alexander Ebert
* @copyright 2001-2012 WoltLab GmbH
* @see wcf\system\cache\ICacheBuilder::getData()
*/
public function getData(array $cacheResource) {
- list(, $environment, $templateName) = explode('-', $cacheResource['cache']);
- list($environment, $templateName) = explode('-', $cacheResource['cache']);
++ list($environment, $templateName) = explode('-', $cacheResource['cache']);
// get template codes for specified template
$templateListenerList = new TemplateListenerList();
use wcf\system\request\LinkHandler;
use wcf\system\setup\Uninstaller;
use wcf\system\WCF;
+ use wcf\util\FileUtil;
use wcf\util\HeaderUtil;
+use wcf\util\FileUtil;
/**
- * PackageUninstallationDispatcher handles the whole uninstallation process.
+ * Handles the whole uninstallation process.
*
* @author Alexander Ebert
* @copyright 2001-2012 WoltLab GmbH
/**
* @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');
}
}
/**
* @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');
}
}
/**
* @see wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::cleanup()
- */
+ */
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');
}
}
<?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;
/**
/**
* Returns the absolute filename of a compiled template.
*
- * @param string $templateName
+ * @param string $templateName
+ * @return string
*/
public function getCompiledFilename($templateName) {
- return $this->compileDir.PACKAGE_ID.'_'.$this->templateGroupID.'_'.$this->languageID.'_'.$templateName.'.php';
+ return $this->compileDir.$this->templateGroupID.'_'.$this->languageID.'_'.$templateName.'.php';
}
/**
* Returns the absolute filename for template's meta data.
*
* @param string $templateName
+ * @return string
*/
public function getMetaDataFilename($templateName) {
- return $this->compileDir.PACKAGE_ID.'_'.$this->templateGroupID.'_'.$templateName.'.meta.php';
+ return $this->compileDir.$this->templateGroupID.'_'.$templateName.'.meta.php';
}
/**