Split DBStructure & View to avoid DB-calls and dependencies for basic operations

- new "Definition" classes vor DB and Views
- new "Writer" classes to create SQL definitions for DB and Views
- DBStructure & View are responsible to execute DB-querys
This commit is contained in:
Philipp 2022-07-12 23:21:16 +02:00
parent a2c929d128
commit a910fd8864
No known key found for this signature in database
GPG key ID: 24A7501396EB5432
30 changed files with 898 additions and 608 deletions

View file

@ -170,7 +170,7 @@ class Install extends BaseModule
return;
}
$this->installer->installDatabase($configCache->get('system', 'basepath'));
$this->installer->installDatabase();
// install allowed themes to register theme hooks
// this is same as "Reload active theme" in /admin/themes

View file

@ -124,7 +124,7 @@ class UserExport extends BaseSettings
*/
private static function exportMultiRow(string $query)
{
$dbStructure = DBStructure::definition(DI::app()->getBasePath(), false);
$dbStructure = DI::dbaDefinition()->getAll();
preg_match("/\s+from\s+`?([a-z\d_]+)`?/i", $query, $match);
$table = $match[1];
@ -156,7 +156,7 @@ class UserExport extends BaseSettings
*/
private static function exportRow(string $query)
{
$dbStructure = DBStructure::definition(DI::app()->getBasePath(), false);
$dbStructure = DI::dbaDefinition()->getAll();
preg_match("/\s+from\s+`?([a-z\d_]+)`?/i", $query, $match);
$table = $match[1];