forked from thelia/thelia
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbootstrap.php
36 lines (33 loc) · 1.87 KB
/
bootstrap.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
<?php
/*************************************************************************************/
/* This file is part of the Thelia package. */
/* */
/* Copyright (c) OpenStudio */
/* email : [email protected] */
/* web : http://www.thelia.net */
/* */
/* For the full copyright and license information, please view the LICENSE.txt */
/* file that was distributed with this source code. */
/*************************************************************************************/
/**
* Thelia essential definitions
*/
define('DS' , DIRECTORY_SEPARATOR);
define('THELIA_ROOT' , rtrim(realpath(dirname(__DIR__)), DS) . DS);
define('THELIA_LOCAL_DIR' , THELIA_ROOT . 'local' . DS);
define('THELIA_CONF_DIR' , THELIA_LOCAL_DIR . 'config' . DS);
define('THELIA_MODULE_DIR' , THELIA_LOCAL_DIR . 'modules' . DS);
define('THELIA_WEB_DIR' , THELIA_ROOT . 'web' . DS);
define('THELIA_CACHE_DIR' , THELIA_ROOT . 'cache' . DS);
define('THELIA_LOG_DIR' , THELIA_ROOT . 'log' . DS);
define('THELIA_TEMPLATE_DIR' , THELIA_ROOT . 'templates' . DS);
$loader = require __DIR__ . "/vendor/autoload.php";
if (!file_exists(THELIA_CONF_DIR . 'database.yml') && !defined('THELIA_INSTALL_MODE')) {
$sapi = php_sapi_name();
if (substr($sapi, 0, 3) == 'cli') {
define('THELIA_INSTALL_MODE', true);
} else {
$request = \Thelia\Core\HttpFoundation\Request::createFromGlobals();
header('Location: '.$request->getUriForPath('/install'));
}
}