-
Notifications
You must be signed in to change notification settings - Fork 1
/
init.php
30 lines (25 loc) · 1.04 KB
/
init.php
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
<?php
// define the autoloader
require_once 'lib/adianti/core/AdiantiCoreLoader.php';
spl_autoload_register(array('Adianti\Core\AdiantiCoreLoader', 'autoload'));
Adianti\Core\AdiantiCoreLoader::loadClassMap();
$loader = require 'vendor/autoload.php';
$loader->register();
// read configurations
$ini = parse_ini_file('app/config/application.ini', true);
date_default_timezone_set($ini['general']['timezone']);
AdiantiCoreTranslator::setLanguage( $ini['general']['language'] );
ApplicationTranslator::setLanguage( $ini['general']['language'] );
AdiantiApplicationConfig::load($ini);
AdiantiApplicationConfig::apply();
// define constants
define('APPLICATION_NAME', $ini['general']['application']);
define('OS', strtoupper(substr(PHP_OS, 0, 3)));
define('PATH', dirname(__FILE__));
define('LANG', $ini['general']['language']);
// custom session name
session_name('PHPSESSID_'.$ini['general']['application']);
if (version_compare(PHP_VERSION, '7.0.0') == -1)
{
die(AdiantiCoreTranslator::translate('The minimum version required for PHP is ^1', '7.0.0'));
}