-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.php
44 lines (31 loc) · 1.04 KB
/
index.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
// composer packages load
require "vendor/autoload.php";
// lib/*.php files load
// app/controllers/*.php files load
// system class files and controller class files
$directories = ['lib/', 'app/controllers/','app/controllers/*/', 'app/models/', 'app/helpers/'];
foreach ($directories as $directory) {
foreach(glob($directory . "*.php") as $class) {
include_once $class;
}
}
// Configuration : sets
ApplicationConfig::run();
// Database : connect and global share
$db = ApplicationConfig::database();
$GLOBALS['db'] = new ApplicationDatabase($db["host"], $db["name"], $db["user"], $db["pass"]);
// model create auto
// foreach (ApplicationSql::tablenames() as $tablename) {
// eval("class $tablename extends ApplicationModel {}");
// }
// Helper : get global functions
ApplicationHelper::extract();
// Database : seed // OPTIONAL
ApplicationDatabase::seed();
// I18n : locale get // OPTIONAL
if (!isset($_SESSION['i18n']))
$_SESSION['i18n'] = new ApplicationI18n("tr");
// Route : run configration of route
ApplicationConfig::route();
?>