namespace wcf\system\acp\dashboard\box;
use wcf\data\devtools\missing\language\item\DevtoolsMissingLanguageItemList;
+use wcf\system\acp\dashboard\box\event\PHPExtensionCollecting;
use wcf\system\acp\dashboard\box\event\StatusMessageCollecting;
use wcf\system\application\ApplicationHandler;
use wcf\system\cache\builder\PackageUpdateCacheBuilder;
{
if (!isset($this->messages)) {
$this->messages = \array_merge(
+ $this->getPHPExtensionMessage(),
$this->getEvaluationMessages(),
$this->getBasicMessages(),
$this->getCustomMessages()
return $event->getMessages();
}
+
+ /**
+ * @return StatusMessage[]
+ */
+ private function getPHPExtensionMessage(): array
+ {
+ $event = new PHPExtensionCollecting();
+ EventHandler::getInstance()->fire($event);
+ $missingExtensions = [];
+
+ foreach ($event->getExtensions() as $extension) {
+ if (!\extension_loaded($extension)) {
+ $missingExtensions[] = $extension;
+ }
+ }
+
+ if (!empty($missingExtensions)) {
+ return [
+ new StatusMessage(
+ StatusMessageType::Error,
+ WCF::getLanguage()->getDynamicVariable('wcf.acp.dashboard.box.missing.extensions', [
+ 'missingExtensions' => $missingExtensions,
+ ])
+ )
+ ];
+ }
+
+ return [];
+ }
}
--- /dev/null
+<?php
+
+namespace wcf\system\acp\dashboard\box\event;
+
+use wcf\system\event\IEvent;
+
+/**
+ * @author Olaf Braun
+ * @copyright 2001-2024 WoltLab GmbH
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @since 6.1
+ */
+final class PHPExtensionCollecting implements IEvent
+{
+ /**
+ * @var string[]
+ */
+ private array $extensions = [
+ 'ctype',
+ 'dom',
+ 'exif',
+ 'intl',
+ 'libxml',
+ 'mbstring',
+ 'pdo',
+ 'pdo_mysql',
+ 'zlib',
+ ];
+
+ /**
+ * Registers a php extension.
+ */
+ public function register(string $extension): void
+ {
+ if (\in_array($extension, $this->extensions)) {
+ return;
+ }
+ $this->extensions[] = $extension;
+ }
+
+ /**
+ * @return string[]
+ */
+ public function getExtensions(): array
+ {
+ return $this->extensions;
+ }
+}
<item name="wcf.acp.dashboard.box.credits.contributor.more"><![CDATA[Weitere]]></item>
<item name="wcf.acp.dashboard.box.usersAwaitingApproval"><![CDATA[{#$usersAwaitingApproval} Benutzer {if $usersAwaitingApproval == 1}wartet{else}warten{/if} auf Aktivierung]]></item>
<item name="wcf.acp.dashboard.box.statusMessage"><![CDATA[Status]]></item>
+ <item name="wcf.acp.dashboard.box.missing.extensions"><![CDATA[Die {plural value=$missingExtensions|count one='PHP-Erweiterung' other='PHP-Erweiterungen'} {implode from=$missingExtensions item=extension}<strong>{$extension}</strong>{/implode} {plural value=$missingExtensions|count one='fehlt' other='fehlen'} und {plural value=$missingExtensions|count one='wird' other='werden'} benötigt.]]></item>
<item name="wcf.acp.dashboard.configure"><![CDATA[Dashboard konfigurieren]]></item>
</category>
<category name="wcf.acp.index">
<item name="wcf.acp.dashboard.box.credits.contributor.more"><![CDATA[More]]></item>
<item name="wcf.acp.dashboard.box.usersAwaitingApproval"><![CDATA[{plural value=$usersAwaitingApproval one='# User' other='# Users'} Awaiting Approval]]></item>
<item name="wcf.acp.dashboard.box.statusMessage"><![CDATA[Status]]></item>
+ <item name="wcf.acp.dashboard.box.missing.extensions"><![CDATA[The PHP {plural value=$missingExtensions|count one='extension' other='extensions'} {implode from=$missingExtensions item=extension}<strong>{$extension}</strong>{/implode} {plural value=$missingExtensions|count one='is' other='are'} missing and required.]]></item>
<item name="wcf.acp.dashboard.configure"><![CDATA[Configure Dashboard]]></item>
</category>
<category name="wcf.acp.index">