Skip to content

Commit 26e6f64

Browse files
committed
Revert the bad merge of these two files
1 parent c2a8076 commit 26e6f64

File tree

2 files changed

+47
-27
lines changed

2 files changed

+47
-27
lines changed

com.woltlab.wcf/package.xml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
<packagedescription>Free CMS and web-framework, designed for awesome websites and communities.</packagedescription>
66
<packagedescription language="de">Freies CMS und Web-Framework, das eindrucksvolle Websites und Communities ermöglicht.</packagedescription>
77
<isapplication>1</isapplication>
8-
<version>6.1.11</version>
9-
<date>2025-06-18</date>
8+
<version>6.2.0 dev 1</version>
9+
<date>2025-03-24</date>
1010
</packageinformation>
1111

1212
<authorinformation>
@@ -50,7 +50,11 @@
5050
<instruction type="script">acp/install_com.woltlab.wcf_step2.php</instruction>
5151
</instructions>
5252

53-
<instructions type="update" fromversion="6.1.10">
54-
<instruction type="file">files_update.tar</instruction>
55-
</instructions>
53+
<!--
54+
Required order of the following steps for the update to 6.2:
55+
<instruction type="script">acp/update_com.woltlab.wcf_6.2_backgroundJob.php</instruction>
56+
<instruction type="database" run="standalone">acp/database/update_com.woltlab.wcf_62_step1.php</instruction>
57+
<instruction type="script">acp/update_com.woltlab.wcf_6.2_contactOptions.php</instruction>
58+
<instruction type="database" run="standalone">acp/database/update_com.woltlab.wcf_62_step2.php</instruction>
59+
-->
5660
</package>

wcfsetup/install/files/lib/system/WCF.class.php

Lines changed: 38 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@
1010
use wcf\data\page\Page;
1111
use wcf\system\application\ApplicationHandler;
1212
use wcf\system\application\IApplication;
13+
use wcf\system\benchmark\Benchmark;
1314
use wcf\system\box\BoxHandler;
14-
use wcf\system\cache\builder\CoreObjectCacheBuilder;
1515
use wcf\system\cache\builder\PackageUpdateCacheBuilder;
16+
use wcf\system\cache\eager\CoreObjectCache;
1617
use wcf\system\database\MySQLDatabase;
1718
use wcf\system\event\EventHandler;
1819
use wcf\system\exception\ErrorException;
1920
use wcf\system\exception\IPrintableException;
20-
use wcf\system\exception\ParentClassException;
2121
use wcf\system\exception\SystemException;
2222
use wcf\system\language\LanguageFactory;
2323
use wcf\system\package\command\RebuildBootstrapper;
@@ -31,6 +31,7 @@
3131
use wcf\system\template\EmailTemplateEngine;
3232
use wcf\system\template\TemplateEngine;
3333
use wcf\system\user\storage\UserStorageHandler;
34+
use wcf\system\user\UserProfileHandler;
3435
use wcf\util\DirectoryUtil;
3536
use wcf\util\FileUtil;
3637
use wcf\util\StringUtil;
@@ -79,7 +80,7 @@
7980
\mb_language('uni');
8081

8182
// define current woltlab suite version
82-
\define('WCF_VERSION', '6.1.11');
83+
\define('WCF_VERSION', '6.2.0 dev 1');
8384

8485
// define current unix timestamp
8586
\define('TIME_NOW', \time());
@@ -98,6 +99,9 @@
9899
* @author Marcel Werk
99100
* @copyright 2001-2019 WoltLab GmbH
100101
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
102+
*
103+
* @method static Benchmark getBenchmark()
104+
* @method static UserProfileHandler getUserProfileHandler()
101105
*/
102106
class WCF
103107
{
@@ -121,7 +125,7 @@ class WCF
121125

122126
/**
123127
* list of autoload directories
124-
* @var array
128+
* @var array<string, string>
125129
*/
126130
protected static $autoloadDirectories = [
127131
'wcf' => WCF_DIR . 'lib/',
@@ -135,9 +139,10 @@ class WCF
135139

136140
/**
137141
* list of cached core objects
138-
* @var string[]
142+
*
143+
* @var array<string, class-string<SingletonFactory>>
139144
*/
140-
protected static $coreObjectCache = [];
145+
protected static array $coreObjectCache;
141146

142147
/**
143148
* database object
@@ -175,7 +180,7 @@ class WCF
175180
*/
176181
protected static $zendOpcacheEnabled;
177182

178-
public const BOOTSTRAP_LOADER = \WCF_DIR . '/lib/bootstrap.php';
183+
public const BOOTSTRAP_LOADER = \WCF_DIR . 'lib/bootstrap.php';
179184

180185
/**
181186
* Calls all init functions of the WCF class.
@@ -229,11 +234,14 @@ final protected function runBootstrappers(): void
229234
*
230235
* You *must* not create output in here under normal circumstances, as it might get eaten
231236
* when gzip is enabled.
237+
*
238+
* @return void
232239
*/
233240
public static function destruct()
234241
{
235242
try {
236243
// database has to be initialized
244+
// @phpstan-ignore function.alreadyNarrowedType
237245
if (!\is_object(self::$dbObj)) {
238246
return;
239247
}
@@ -253,6 +261,7 @@ public static function destruct()
253261
}
254262

255263
// update session
264+
// @phpstan-ignore function.alreadyNarrowedType
256265
if (\is_object(self::getSession())) {
257266
self::getSession()->update();
258267
}
@@ -318,7 +327,7 @@ final public static function getTPL()
318327
/**
319328
* Calls the show method on the given exception.
320329
*/
321-
final public static function handleException(\Throwable $e)
330+
final public static function handleException(\Throwable $e): never
322331
{
323332
// backwards compatibility
324333
if ($e instanceof IPrintableException) {
@@ -338,6 +347,8 @@ final public static function handleException(\Throwable $e)
338347
@\header('HTTP/1.1 500 Internal Server Error');
339348
try {
340349
\wcf\functions\exception\printThrowable($e);
350+
351+
exit;
341352
} catch (\Throwable $e2) {
342353
echo "<pre>An Exception was thrown while handling an Exception:\n\n";
343354
echo \preg_replace('/Database->__construct\(.*\)/', 'Database->__construct(...)', $e2);
@@ -358,11 +369,11 @@ final public static function handleException(\Throwable $e)
358369
* @param int $line
359370
* @throws ErrorException
360371
*/
361-
final public static function handleError($severity, $message, $file, $line): void
372+
final public static function handleError($severity, $message, $file, $line): bool
362373
{
363374
// this is necessary for the shut-up operator
364375
if (!(\error_reporting() & $severity)) {
365-
return;
376+
return true;
366377
}
367378

368379
throw new ErrorException($message, 0, $severity, $file, $line);
@@ -412,6 +423,7 @@ protected function loadOptions(): void
412423
if (!\is_writable($filename)) {
413424
FileUtil::makeWritable($filename);
414425

426+
// @phpstan-ignore booleanNot.alwaysTrue
415427
if (!\is_writable($filename)) {
416428
throw new SystemException("The option file '" . $filename . "' is not writable.");
417429
}
@@ -500,6 +512,9 @@ protected function defineLegacyOptions(): void
500512

501513
// The option for the SFS action has been converted into a general option with version 6.1.
502514
\define('BLACKLIST_SFS_ACTION', 'disable');
515+
516+
// The option to show an article counter in the message sidebar was removed with version 6.2.
517+
\define('MESSAGE_SIDEBAR_ENABLE_ARTICLES', 0);
503518
}
504519

505520
/**
@@ -639,6 +654,7 @@ protected function loadApplication(Application $application, bool $isDependentAp
639654
$packageDir = FileUtil::getRealPath(WCF_DIR . $relativePath);
640655
self::$autoloadDirectories[$abbreviation] = $packageDir . 'lib/';
641656

657+
// @phpstan-ignore if.alwaysFalse
642658
if (\class_exists($className)) {
643659
// the class can now be found, update the `packageDir` value
644660
(new PackageEditor($package))->update(['packageDir' => $relativePath]);
@@ -739,7 +755,7 @@ protected function initCoreObjects(): void
739755
return;
740756
}
741757

742-
self::$coreObjectCache = CoreObjectCacheBuilder::getInstance()->getData();
758+
self::$coreObjectCache = (new CoreObjectCache())->getCache();
743759
}
744760

745761
/**
@@ -825,7 +841,7 @@ final public static function setLanguage(int $languageID): void
825841
final public static function autoload(string $className): void
826842
{
827843
$className = \strtr($className, '\\', '/');
828-
if (($slashPos = \strpos($className, '/')) !== null) {
844+
if (($slashPos = \strpos($className, '/')) !== false) {
829845
$applicationPrefix = \substr($className, 0, $slashPos);
830846
if (isset(self::$autoloadDirectories[$applicationPrefix])) {
831847
$classPath = self::$autoloadDirectories[$applicationPrefix] . \substr($className, $slashPos + 1) . '.class.php';
@@ -849,7 +865,7 @@ final public static function autoloadDebug(string $className): void
849865
// logic cannot be moved into a shared function, because it
850866
// measurably reduced autoloader performance.
851867
$className = \strtr($className, '\\', '/');
852-
if (($slashPos = \strpos($className, '/')) !== null) {
868+
if (($slashPos = \strpos($className, '/')) !== false) {
853869
$applicationPrefix = \substr($className, 0, $slashPos);
854870
if (isset(self::$autoloadDirectories[$applicationPrefix])) {
855871
$classPath = self::$autoloadDirectories[$applicationPrefix] . \substr($className, $slashPos + 1) . '.class.php';
@@ -872,7 +888,8 @@ final public static function autoloadDebug(string $className): void
872888
}
873889

874890
/**
875-
* @inheritDoc
891+
* @param mixed[] $arguments
892+
* @return ?object
876893
*/
877894
final public function __call(string $name, array $arguments)
878895
{
@@ -887,9 +904,9 @@ final public function __call(string $name, array $arguments)
887904
/**
888905
* Returns dynamically loaded core objects.
889906
*
890-
* @param array $arguments
891-
* @return object
892-
* @throws SystemException
907+
* @param mixed[] $arguments
908+
* @return ?object
909+
* @throws SystemException
893910
*/
894911
final public static function __callStatic(string $name, array $arguments)
895912
{
@@ -905,20 +922,18 @@ final public static function __callStatic(string $name, array $arguments)
905922
}
906923

907924
if (\class_exists($objectName)) {
908-
if (!\is_subclass_of($objectName, SingletonFactory::class)) {
909-
throw new ParentClassException($objectName, SingletonFactory::class);
910-
}
911-
912925
self::$coreObject[$className] = \call_user_func([$objectName, 'getInstance']);
913926

914927
return self::$coreObject[$className];
915928
}
929+
930+
return null;
916931
}
917932

918933
/**
919934
* Searches for cached core object definition.
920935
*
921-
* @return string|null
936+
* @return class-string<SingletonFactory>|null
922937
*/
923938
final protected static function getCoreObject(string $className)
924939
{
@@ -987,6 +1002,7 @@ public static function getActivePath(): string
9871002
}
9881003

9891004
/**
1005+
* @param string $fragment
9901006
* @deprecated 5.5 - Put a '#' followed by the fragment as the anchor's href. Make sure to |rawurlencode any variables that may contain special characters.
9911007
*/
9921008
public function getAnchor($fragment): string

0 commit comments

Comments
 (0)