-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.php
More file actions
24 lines (19 loc) · 755 Bytes
/
config.php
File metadata and controls
24 lines (19 loc) · 755 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php
// Composer autoload
require_once __DIR__ . '/vendor/autoload.php';
// Proje ana dizini
define('ROOT_PATH', __DIR__);
// Veritabanı dosyası yolu
define('DB_PATH', ROOT_PATH . '/database/bilet_platformu.sqlite');
// Site ana URL'i
if (getenv('DOCKER_ENV') === 'true') {
// Docker ortamı için BASE_URL
define('BASE_URL', 'http://localhost');
} else {
// XAMPP veya diğer ortamlar için dinamik BASE_URL
$protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? "https://" : "http://";
$host = $_SERVER['HTTP_HOST'];
$script_name = str_replace('/public/index.php', '', $_SERVER['SCRIPT_NAME']);
define('BASE_URL', $protocol . $host . $script_name . '/public');
}
?>