use wcf\data\application\ApplicationAction;
use wcf\data\application\ApplicationList;
use wcf\data\package\Package;
-use wcf\data\package\PackageList;
use wcf\system\cache\builder\ApplicationCacheBuilder;
use wcf\system\request\RequestHandler;
use wcf\system\request\RouteHandler;
use wcf\system\SingletonFactory;
+use wcf\system\WCF;
use wcf\util\ArrayUtil;
use wcf\util\FileUtil;
use wcf\util\StringUtil;
}
if ($skipCache) {
- $packageList = new PackageList();
- $packageList->getConditionBuilder()->add('package.isApplication = ?', [1]);
- $packageList->readObjects();
+ $sql = "SELECT package
+ FROM wcf" . WCF_N . "_package
+ WHERE isApplication = ?";
+ $statement = WCF::getDB()->prepareUnmanaged($sql);
+ $statement->execute([1]);
+ $packages = $statement->fetchAll(\PDO::FETCH_COLUMN);
$abbreviations = \implode(
'|',
- \array_map(static function (Package $package): string {
- return \preg_quote(Package::getAbbreviation($package->package), '~');
- }, $packageList->getObjects())
+ \array_map(static function (string $package): string {
+ return \preg_quote(Package::getAbbreviation($package), '~');
+ }, $packages)
);
$regex = "~(\\b(?:{$abbreviations}))1_~";
$string = \preg_replace(
$regex,
- '${1}1_',
+ '${1}' . WCF_N . '_',
$string
);
} else {
$string = \preg_replace(
$regex,
- '${1}1_',
+ '${1}' . WCF_N . '_',
$string
);
}
namespace wcf\system\cache\builder;
-use wcf\data\application\ApplicationList;
+use wcf\data\application\Application;
use wcf\data\package\Package;
-use wcf\data\package\PackageList;
+use wcf\system\WCF;
/**
* Caches applications.
];
// fetch applications
- $applicationList = new ApplicationList();
- $applicationList->readObjects();
+ $sql = "SELECT *
+ FROM wcf" . WCF_N . "_application";
+ $statement = WCF::getDB()->prepareUnmanaged($sql);
+ $statement->execute();
+ $applications = $statement->fetchObjects(Application::class);
- foreach ($applicationList as $application) {
+ foreach ($applications as $application) {
$data['application'][$application->packageID] = $application;
}
// fetch abbreviations
- $packageList = new PackageList();
- $packageList->getConditionBuilder()->add('package.isApplication = ?', [1]);
- $packageList->readObjects();
- foreach ($packageList as $package) {
- $data['abbreviation'][Package::getAbbreviation($package->package)] = $package->packageID;
+ $sql = "SELECT packageID, package
+ FROM wcf" . WCF_N . "_package
+ WHERE isApplication = ?";
+ $statement = WCF::getDB()->prepareUnmanaged($sql);
+ $statement->execute([1]);
+ $packages = $statement->fetchMap('packageID', 'package');
+ foreach ($packages as $packageID => $package) {
+ $data['abbreviation'][Package::getAbbreviation($package)] = $packageID;
}
return $data;