-
Notifications
You must be signed in to change notification settings - Fork 20
/
index.php
75 lines (65 loc) · 2.03 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
68
69
70
71
72
73
74
75
<?php
/**
* Axis
*
* This file is part of Axis.
*
* Axis is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Axis is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Axis. If not, see <http://www.gnu.org/licenses/>.
* Index file
*
* @category Axis
* @package Axis_Core
* @copyright Copyright 2008-2011 Axis
* @license GNU Public License V3.0
*/
define('AXIS_ROOT', realpath(dirname(__FILE__)));
if (!file_exists('./app/etc/config.php')) {
if (!headers_sent()) {
$host = $_SERVER['HTTP_HOST'];
$uri = rtrim(dirname($_SERVER['PHP_SELF']), '/\\');
$extra = 'install';
header("Location: http://$host$uri/$extra/");
}
exit();
}
set_include_path(
realpath('library') . PATH_SEPARATOR
. realpath('app/code') . PATH_SEPARATOR
. get_include_path()
);
@include_once 'Axis/Application.php';
if (!class_exists('Zend_Application')) {
echo 'Please, copy Zend Framework to the "library" folder: '
. realpath('library');
exit();
}
defined('APPLICATION_ENV')
|| define('APPLICATION_ENV',
(getenv('APPLICATION_ENV') ?
getenv('APPLICATION_ENV') : 'production'
)
);
$displayErrors = (int)(APPLICATION_ENV === 'development');
$bootstrapConfig = array(
'bootstrap' => array(
'path' =>'Axis/Bootstrap.php',
'class' => 'Axis_Bootstrap'
),
'phpSettings' => array(
'display_startup_errors' => $displayErrors,
'display_errors' => $displayErrors
)
);
$application = new Axis_Application(APPLICATION_ENV, $bootstrapConfig);
$application->bootstrap()->run();