Переглянути джерело

Update Admin\Install page

Add check Encoding, Collation and Character Type for PostgreSQL.
Visman 3 роки тому
батько
коміт
bb966ebd9e

+ 24 - 0
app/Models/Pages/Admin/Install.php

@@ -544,6 +544,30 @@ class Install extends Admin
             $v->addError('Bad database charset');
             $v->addError('Bad database charset');
         }
         }
 
 
+        // база PostgreSQL, кодировка базы
+        if (
+            isset($stat['server_encoding'])
+            && 'UTF8' !== $stat['server_encoding']
+        ) {
+            $v->addError('Bad database encoding');
+        }
+
+        // база PostgreSQL, порядок сопоставления/сортировки
+        if (
+            isset($stat['lc_collate'])
+            && 'C' !== $stat['lc_collate']
+        ) {
+            $v->addError('Bad database collate');
+        }
+
+        // база PostgreSQL, тип символов
+        if (
+            isset($stat['lc_ctype'])
+            && 'C' !== $stat['lc_ctype']
+        ) {
+            $v->addError('Bad database ctype');
+        }
+
         return $dbhost;
         return $dbhost;
     }
     }
 
 

+ 9 - 0
app/lang/en/admin_install.po

@@ -219,6 +219,15 @@ msgstr "<b>File uploads appear to be disallowed on this server!</b> If you want
 msgid "Bad database charset"
 msgid "Bad database charset"
 msgstr "The database must be created with the character encoding <b>utf8mb4</b> (compare <b>utf8mb4_unicode_ci</b>)."
 msgstr "The database must be created with the character encoding <b>utf8mb4</b> (compare <b>utf8mb4_unicode_ci</b>)."
 
 
+msgid "Bad database encoding"
+msgstr "The database must be created with the character encoding <b>UTF8</b>."
+
+msgid "Bad database collate"
+msgstr "The database must be created with Collation order <b>C</b> (LC_COLLATE)."
+
+msgid "Bad database ctype"
+msgstr "The database must be created with Character classification <b>C</b> (LC_CTYPE)."
+
 msgid "Cookie setup"
 msgid "Cookie setup"
 msgstr "<b>Cookie setup</b>"
 msgstr "<b>Cookie setup</b>"
 
 

+ 9 - 0
app/lang/ru/admin_install.po

@@ -219,6 +219,15 @@ msgstr "<b>Загрузка файлов, кажется, выключена н
 msgid "Bad database charset"
 msgid "Bad database charset"
 msgstr "База данных должна быть создана с указанием кодировки символов <b>utf8mb4</b> (сравнение <b>utf8mb4_unicode_ci</b>)."
 msgstr "База данных должна быть создана с указанием кодировки символов <b>utf8mb4</b> (сравнение <b>utf8mb4_unicode_ci</b>)."
 
 
+msgid "Bad database encoding"
+msgstr "База данных должна быть создана с указанием кодировки символов <b>UTF8</b>."
+
+msgid "Bad database collate"
+msgstr "База данных должна быть создана с порядком сопоставления <b>C</b> (LC_COLLATE)."
+
+msgid "Bad database ctype"
+msgstr "База данных должна быть создана с типом символов <b>C</b> (LC_CTYPE)."
+
 msgid "Cookie setup"
 msgid "Cookie setup"
 msgstr "<b>Настройки cookie</b>"
 msgstr "<b>Настройки cookie</b>"