Update extension checks

This commit is contained in:
ruan 2021-12-30 11:20:12 +02:00
parent f3430a4316
commit 9de7a88f9a
3 changed files with 7 additions and 4 deletions

View File

@ -14,8 +14,11 @@
<div class="text-warning">
The following PHP extensions are required by litebans-php but were not found:
<br>
<?php if (!extension_loaded("pdo_mysql")) {
echo "- <a class=\"text-danger\">pdo_mysql</a><br>";
<?php
foreach(array("pdo_mysql", "intl") as $ext) {
if (!extension_loaded($ext)) {
echo "- <a class=\"text-danger\">$ext</a><br>";
}
}
$phpini = php_ini_loaded_file();

View File

@ -7,6 +7,6 @@ function redirect($url, $showtext = true) {
die("<script data-cfasync=\"false\" type=\"text/javascript\">document.location=\"$url\";</script>");
}
if (!extension_loaded("pdo_mysql")) {
if (!extension_loaded("pdo_mysql") || !extension_loaded("intl")) {
redirect("error/missing-extensions.php");
}

View File

@ -22,7 +22,7 @@ class Page {
$this->lang = new en_US();
}
$this->formatter = new IntlDateFormatter($settings->lang, IntlDateFormatter::LONG, IntlDateFormatter::NONE, $this->settings->timezone, IntlDateFormatter::GREGORIAN, $settings->date_format);
$this->formatter = new IntlDateFormatter($settings->lang, IntlDateFormatter::LONG, IntlDateFormatter::NONE, $settings->timezone, IntlDateFormatter::GREGORIAN, $settings->date_format);
$this->conn = $settings->conn;
$this->settings = $settings;