-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
67 lines (58 loc) · 1.73 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?php
if (!defined("ROOT_DIR")) {
define('ROOT_DIR', realpath(__DIR__ . '/..'));
}
if (!defined("PUBLIC_DIR")) {
define('PUBLIC_DIR', ROOT_DIR . '/public');
}
if (!defined("VENDOR_DIR")) {
define('VENDOR_DIR', ROOT_DIR . '/vendor');
}
if (!defined("DATA_DIR")) {
define('DATA_DIR', ROOT_DIR . '/data');
}
if (!is_dir(__DIR__ . "/../vendor")) {
die("Access Denied: index script not inside root public dir");
}
$loader = require ROOT_DIR . "/vendor/autoload.php";
$app = new \Akademiano\Core\Application();
$app->setLoader($loader);
$app->getDiContainer()->extend('baseConfigLoader', function (\Akademiano\Config\ConfigLoader $configLoader, \Pimple\Container $pimple) {
$configLoader->addConfigDir(ROOT_DIR . "/src/config");
return $configLoader;
});
/*$app->getDiContainer()["baseConfig"] = new \Akademiano\Config\Config(
[
'view' => [
'adapter' => 'twig',
'options' => [
'cache' => false,
"debug" => true,
],
"init" => [
"setLocale" => function ($c) {
setlocale(LC_ALL, 'ru_RU.UTF-8');
setlocale(LC_NUMERIC, "en_US.UTF-8");
locale_set_default('ru');
}
],
"Acl" => [
"adapter" => "Akademiano\\Acl\\Model\\Adapter\\RegisteredAdapter",
],
"modules" => [
"Akademiano\\Core",
],
],
]
);
*/
/*$app->getDiContainer()["routes"] = [
"root" => [
"patterns" => [
"type" => \Akademiano\Router\RoutePattern::TYPE_FIRST_PREFIX,
"value" => "/",
],
"action" => ["index", "index"],
],
];*/
$app->run();