This repository has been archived by the owner on Dec 17, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
index.php
executable file
·57 lines (36 loc) · 1.67 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
<?php
/**
* Fari Framework
*
* @copyright Copyright (c) 2008, 2010 Radek Stepan
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
* @link http://radekstepan.com
* @category Fari Framework
*/
// start session
if (!isset($_SESSION)) session_start();
// Step 1a: Define absolute environment values
// set so that we can check if PHP pages have been accessed directly
if (!defined('FARI')) define('FARI', 'Fari Framework 2.3.14.1 (May 27, 2010)');
// get absolute pathname and define it as a constant (server install path)
if (!defined('BASEPATH')) define('BASEPATH', dirname(__FILE__));
// www root dir (path for links in your views)
if (!defined('WWW_DIR')) {
// now we can have the app running in the root
dirname($_SERVER['SCRIPT_NAME']) == '/' ? define('WWW_DIR', '')
: define('WWW_DIR', dirname($_SERVER['SCRIPT_NAME']));
}
// default file extension (.php)
if (!defined('EXT')) define('EXT', '.' . pathinfo(__FILE__, PATHINFO_EXTENSION));
// Step 1b: Include database and application specific settings
require BASEPATH . '/config/config' . EXT;
// Step 2a: Initialize Error & Exceptions handling and check environment
require BASEPATH . '/fari/Application/ApplicationDiagnostics' . EXT;
require BASEPATH . '/fari/Application/ApplicationEnvironment' . EXT;
Fari_ApplicationEnvironment::startupCheck();
// Step 2b: Setup contracts handling
require BASEPATH . '/fari/Application/ApplicationContracts' . EXT;
// Step 3: Define global functions, autoloading and those required for framework start
require BASEPATH . '/fari/Application/ApplicationFunctions' . EXT;
// Step 4: Start the whole shebang
Fari_ApplicationRouter::loadRoute();