瀏覽代碼

Update Admin\Instal page

Visman 2 年之前
父節點
當前提交
e92cd585b7
共有 3 個文件被更改,包括 11 次插入1 次删除
  1. 5 1
      app/Models/Pages/Admin/Install.php
  2. 3 0
      app/lang/en/admin_install.po
  3. 3 0
      app/lang/ru/admin_install.po

+ 5 - 1
app/Models/Pages/Admin/Install.php

@@ -624,7 +624,7 @@ class Install extends Admin
         }
 
         // тест типа возвращаемого результата
-        $table  = '::tmp' . time();
+        $table  = '::tmp_test';
         $schema = [
             'FIELDS' => [
                 'test_field' => ['INT(10) UNSIGNED', false, 0],
@@ -635,6 +635,10 @@ class Install extends Admin
         if (! $this->c->DB->createTable($table, $schema)) {
             $v->addError('Failed to create table');
         } else {
+            if (! $this->c->DB->truncateTable($table)) {
+                $v->addError('Failed to truncate table');
+            }
+
             $this->c->DB->exec("INSERT INTO {$table} (test_field) VALUES (?i)", [123]);
 
             $value = $this->c->DB->query("SELECT test_field FROM {$table} WHERE test_field=123")->fetchColumn();

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

@@ -257,3 +257,6 @@ msgstr "The PDO driver returns the wrong data type for numeric fields, most like
 
 msgid "Failed to drop table"
 msgstr "Failed to drop a table in the selected database."
+
+msgid "Failed to truncate table"
+msgstr "Failed to truncate a table in the selected database."

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

@@ -257,3 +257,6 @@ msgstr "PDO драйвер возвращает неверный тип данн
 
 msgid "Failed to drop table"
 msgstr "Не удалось удалить таблицу в выбранной БД."
+
+msgid "Failed to truncate table"
+msgstr "Не удалось очистить таблицу в выбранной БД."