Visman 3 роки тому
батько
коміт
47ee32f4da
1 змінених файлів з 6 додано та 1 видалено
  1. 6 1
      app/Models/Pages/Admin/Install.php

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

@@ -506,12 +506,17 @@ class Install extends Admin
                 break;
             case 'sqlite':
                 $this->c->DB_DSN         = "sqlite:!PATH!{$dbname}";
-                $this->c->DB_OPTS_AS_STR = '\\PDO::ATTR_TIMEOUT => 5, /* \'initSQLCommands\' => [\'PRAGMA journal_mode=WAL\',], */';
+                $this->c->DB_OPTS_AS_STR = "\n"
+                    . '        \\PDO::ATTR_TIMEOUT => 5,' . "\n"
+                    . '        /* \'initSQLCommands\' => [\'PRAGMA journal_mode=WAL\',], */' . "\n"
+                    . '        \'initFunction\' => function ($db) {return $db->sqliteCreateFunction(\'CONCAT\', function (...$args) {return \\implode(\'\', $args);});},' . "\n"
+                    . '    ';
                 $this->c->DB_OPTIONS     = [
                     PDO::ATTR_TIMEOUT => 5,
                     'initSQLCommands' => [
                         'PRAGMA journal_mode=WAL',
                     ],
+                    'initFunction' => function ($db) {return $db->sqliteCreateFunction('CONCAT', function (...$args) {return \implode('', $args);});},
                 ];
 
                 break;