diff --git a/.env b/.env deleted file mode 100644 index d0b2d8d..0000000 --- a/.env +++ /dev/null @@ -1,15 +0,0 @@ -# MariaDB Verbinding -DB_HOST="192.168.2.33" -DB_PORT="3306" -DB_NAME="focizdev" -DB_USER="focizdev_user" -DB_PASS="F0c1z_Dev_Secure_2026!" - -# Omgeving: 'development' (knippert rood) of 'live' (knippert groen) -APP_ENV="development" - -# Applicatie URL (voor uitnodigingslinks) -APP_URL="https://dev.fociz.nl" - -# Applicatie Geheime Sleutel (willekeurige tekenreeks) -APP_SECRET="fociz-maria-db-super-secret-key-998877" diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..519aebf --- /dev/null +++ b/.gitattributes @@ -0,0 +1,3 @@ +# Zorg dat omgevingsspecifieke bestanden nooit worden overschreven bij merges tussen dev en main +config/config.php merge=ours +includes/env_badge.php merge=ours diff --git a/.htaccess b/.htaccess deleted file mode 100644 index e736250..0000000 --- a/.htaccess +++ /dev/null @@ -1,16 +0,0 @@ -# Fociz Apache Configuratie -DirectoryIndex index.php index.html - -# UTF-8 standaard -AddDefaultCharset UTF-8 - -# Blokkeer directe toegang tot SQL schema en configuratiebestanden - - Order allow,deny - Deny from all - - -# PHP foutmeldingen in productie (kan uitgeschakeld worden indien gewenst) -php_flag display_errors Off -php_value error_reporting E_ALL - diff --git a/README.md b/README.md index 6aec5b0..c2b8d66 100644 --- a/README.md +++ b/README.md @@ -85,9 +85,9 @@ APP_URL="https://uw-domein.nl" ``` ### 3. Automatische Tabellen Aanmaak -U hoeft **niet** handmatig SQL-commando's uit te voeren: zodra u de website voor het eerst opent in uw browser, detecteert Fociz automatisch MariaDB en worden alle tabellen en relaties uit `schema.sql` vanzelf aangemaakt! +U hoeft **niet** handmatig SQL-commando's uit te voeren: zodra u de website voor het eerst opent in uw browser, detecteert Fociz automatisch MariaDB en worden alle tabellen en relaties uit `config/schema.sql` vanzelf aangemaakt! -*(Optioneel kunt u `schema.sql` ook zelf importeren via phpMyAdmin of de MariaDB CLI).* +*(Optioneel kunt u `config/schema.sql` ook zelf importeren via phpMyAdmin of de MariaDB CLI).* ### 4. Eerste Beheerder Instellen 1. Open uw browser en ga naar `https://uw-domein.nl`. diff --git a/config/database.php b/config/database.php index 2c1ebc0..e4caf0a 100644 --- a/config/database.php +++ b/config/database.php @@ -123,7 +123,7 @@ function ensure_tables_exist(PDO $pdo): void { } // Tabellen ontbreken nog: voer schema.sql uit statement voor statement - $schemaFile = __DIR__ . '/../schema.sql'; + $schemaFile = file_exists(__DIR__ . '/schema.sql') ? (__DIR__ . '/schema.sql') : (__DIR__ . '/../schema.sql'); if (file_exists($schemaFile)) { $sql = file_get_contents($schemaFile); $statements = array_filter(array_map('trim', explode(';', $sql))); diff --git a/schema.sql b/config/schema.sql similarity index 100% rename from schema.sql rename to config/schema.sql