/
index.php
48 lines (41 loc) · 1.52 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
<?php
if (!defined('APPLICATION_PATH')) {
define('APPLICATION_PATH', realpath(dirname(__FILE__)
. DIRECTORY_SEPARATOR . '..'
. DIRECTORY_SEPARATOR . 'application'));
}
if (!defined('APPLICATION_ROOT')) {
define('APPLICATION_ROOT', realpath(dirname(__FILE__)
. DIRECTORY_SEPARATOR . '..'));
}
if (!defined('APPLICATION_ENV')) {
if (getenv('APPLICATION_ENV')) {
$env = getenv('APPLICATION_ENV');
} else {
$env = 'production';
}
define('APPLICATION_ENV', $env);
}
if (!defined('LIBRARY_PATH')) {
define('LIBRARY_PATH', realpath( APPLICATION_ROOT
. DIRECTORY_SEPARATOR . '..'
. DIRECTORY_SEPARATOR . 'lib'));
}
if (!defined('ZEND_PATH')) {
define('ZEND_PATH', realpath( APPLICATION_ROOT
. DIRECTORY_SEPARATOR . '..'
. DIRECTORY_SEPARATOR . 'vendor'
. DIRECTORY_SEPARATOR . 'ZendFramework'
. DIRECTORY_SEPARATOR . 'library'));
}
set_include_path( APPLICATION_PATH . PATH_SEPARATOR
. LIBRARY_PATH . PATH_SEPARATOR
. ZEND_PATH . PATH_SEPARATOR
. get_include_path()
);
include('ZendX/Application53/Application.php');
$application = new \ZendX\Application53\Application(
APPLICATION_ENV,
APPLICATION_PATH . DIRECTORY_SEPARATOR . 'config.ini'
);
$application->bootstrap()->run();