1
0

Add new method env for global conf

This commit is contained in:
Kryscau 2025-06-17 19:09:43 +02:00
parent e859270e65
commit 2c04555439
2 changed files with 18 additions and 6 deletions

View File

@ -1,5 +1,15 @@
# Database configuration
DB_HOST=localhost
DB_PORT=3306
DB_NAME=my_webapp
DB_USER=my_webapp
DB_PASSWORD=mypassword
DB_PASSWORD=mypassword
# Global website configuration
GLOBAL_SITE_NAME=My Web App
GLOBAL_SITE_URL=mywebapp.com
GLOBAL_SITE_IMG=img.mywebapp.com # Image if you using this
# Global author configuration
GLOBAL_AUTHOR_NAME=Username
GLOBAL_AUTHOR_BIO_URL=https://google.com/?q=Kryscau

View File

@ -1,14 +1,16 @@
<?php
include_once __DIR__ . '/env.php';
$config['site'] = [
'name' => "KVS.FYI",
'main_domain' => "kvs.fyi",
'imgs_domain' => "xbb.kvs.fyi"
'name' => $env['GLOBAL_SITE_NAME'] ?? "My Web App",
'main_domain' => $env['GLOBAL_SITE_URL'] ?? "localhost",
'imgs_domain' => $env['GLOBAL_SITE_IMG'] ?? $env['GLOBAL_SITE_URL'] ?? "localhost"
];
$config['author'] = [
'name' => "Kryscau",
'bio' => "https://e-z.bio/kryscau"
'name' => $env['GLOBAL_AUTHOR_NAME'] ?? "Username",
'bio' => $env['GLOBAL_AUTHOR_BIO_URL'] ?? "https://google.com/?q=Kryscau"
];
?>