-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbootstrap.php
More file actions
38 lines (29 loc) · 1018 Bytes
/
bootstrap.php
File metadata and controls
38 lines (29 loc) · 1018 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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
$autoloadPath = __DIR__ . '/vendor/autoload.php';
if (file_exists($autoloadPath)) {
require $autoloadPath;
}
// Load BCMath polyfill if the extension is missing
include_once __DIR__ . '/include/bcmath_polyfill.php';
// Initialize locale (detect, cache, and provide formatters)
// This sets a cookie 'locale' and exposes Siagraph\Utils\Locale helpers
if (class_exists(\Siagraph\Utils\Locale::class)) {
\Siagraph\Utils\Locale::init();
}
// Composer handles autoloading; no fallback needed
// Ensure floats are encoded consistently
ini_set('serialize_precision', -1);
use Siagraph\Utils\Cache;
use Siagraph\Database\Database;
// Load configuration
include_once __DIR__ . '/include/config.php';
// MySQL database connection
Database::initialize($SETTINGS['database']);
$mysqli = Database::getConnection(); // backwards compatibility
// Redis configuration
$redisConfig = [
'scheme' => 'tcp',
'host' => $SETTINGS['redis_ip'] ?? '127.0.0.1',
'port' => 6379,
];
Cache::setConfig($redisConfig);