This repository has been archived by the owner on Mar 20, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.php
77 lines (65 loc) · 1.93 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
76
77
<?php
/**
* Set error reporting and display errors settings. You will want to change these when in production.
*/
error_reporting(-1);
ini_set('display_errors', 1);
/**
* Website document root
*/
define('DOCROOT', __DIR__.DIRECTORY_SEPARATOR);
/**
* Path to the application directory.
*/
define('APPPATH', realpath(__DIR__.'/app/').DIRECTORY_SEPARATOR);
/**
* Path to the default packages directory.
*/
define('PKGPATH', realpath(__DIR__.'/fuel/packages/').DIRECTORY_SEPARATOR);
/**
* The path to the framework core.
*/
define('COREPATH', realpath(__DIR__.'/fuel/core/').DIRECTORY_SEPARATOR);
// Get the start time and memory for use later
defined('FUEL_START_TIME') or define('FUEL_START_TIME', microtime(true));
defined('FUEL_START_MEM') or define('FUEL_START_MEM', memory_get_usage());
// Boot the app
require APPPATH.'bootstrap.php';
$assetpath = (Fuel::$env == Fuel::DEVELOPMENT)
? 'http://localhost/anodyne/docs/'
: 'http://docs.anodyne-productions.net/';
$assetpath = 'http://localhost/anodyne/docs/';
define('ASSETBASE', $assetpath);
define('ASSETS', ASSETBASE.'fuel/modules/anodyne/');
define('A_DOWNLOAD', ASSETBASE.'xtras/downloads/');
define('A_PREVIEW', ASSETBASE.'xtras/previews/');
// Generate the request, execute it and send the output.
try
{
$response = Request::forge()->execute()->response();
}
catch (HttpNotFoundException $e)
{
$route = array_key_exists('_404_', Router::$routes) ? Router::$routes['_404_']->translation : Config::get('routes._404_');
if ($route)
{
$response = Request::forge($route)->execute()->response();
}
else
{
throw $e;
}
}
// This will add the execution time and memory usage to the output.
// Comment this out if you don't use it.
/*$bm = Profiler::app_total();
$response->body(
str_replace(
array('{exec_time}', '{mem_usage}'),
array(round($bm[0], 4), round($bm[1] / pow(1024, 2), 3)),
$response->body()
)
);*/
$response->send(true);
// Fire off the shutdown event
Event::shutdown();