dbxapp 4.1.3
CMS, Shop, Workflows und modulare Geschäftsanwendungen
Loading...
Searching...
No Matches
dbxConfigStore.class.php
Go to the documentation of this file.
1<?php
2
7
11 public function is_module_db_entry(string $key, array $entry): bool {
12 $type = strtolower(trim((string)($entry['type'] ?? '')));
13 if ($type === 'sqlite' || $type === 'sqlite3') {
14 return true;
15 }
16
17 if (preg_match('/\.(db3|sqlite|sqlite3)$/i', $key)) {
18 return true;
19 }
20
21 $dbName = (string)($entry['dbname'] ?? ($entry['name'] ?? ''));
22 return strpos($key, '|') !== false
23 && preg_match('/\.(db3|sqlite|sqlite3)$/i', $dbName) === 1;
24 }
25
29 public function strip_module_db_entries(array $config): array {
30 if (!isset($config['db']) || !is_array($config['db'])) {
31 return $config;
32 }
33
34 foreach ($config['db'] as $key => $entry) {
35 if (is_array($entry) && $this->is_module_db_entry((string)$key, $entry)) {
36 unset($config['db'][$key]);
37 }
38 }
39
40 return $config;
41 }
42
46 public function normalize_for_store(array $config): array {
47 return $this->strip_module_db_entries($config);
48 }
49}
50
Bereitet Modulkonfigurationen für die portable Speicherung vor.
normalize_for_store(array $config)
Normalisiert die Konfiguration für config.php.
strip_module_db_entries(array $config)
Entfernt dynamische Moduldatenbanken aus einer Konfiguration.
is_module_db_entry(string $key, array $entry)
Erkennt dynamische SQLite-Moduldatenbanken.
if($resolved !==$expectedBase . 'files/test/') $config
if(!defined( 'IMG_WEBP')) define( 'IMG_WEBP'