forked from fuel/fuel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
oil
68 lines (56 loc) · 1.79 KB
/
oil
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
<?php
/**
* Fuel is a fast, lightweight, community driven PHP 5.4+ framework.
*
* @package Fuel
* @version 1.8.2
* @author Fuel Development Team
* @license MIT License
* @copyright 2010 - 2018 Fuel Development Team
* @link http://fuelphp.com
*/
/**
* Refuse to run oil when called from php-cgi !
*/
if (substr(php_sapi_name(), 0, 3) == 'cgi')
{
die("The use of oil is not supported when running php-cgi. Oil needs php-cli to function!\n\n");
}
/**
* 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__.'/fuel/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());
// Load in the Fuel autoloader
if ( ! file_exists(COREPATH.'classes'.DIRECTORY_SEPARATOR.'autoloader.php'))
{
die("No composer autoloader found. Please run composer to install the FuelPHP framework dependencies first!\n\n");
}
// Load in the Fuel autoloader
require COREPATH.'classes'.DIRECTORY_SEPARATOR.'autoloader.php';
class_alias('Fuel\\Core\\Autoloader', 'Autoloader');
// Boot the app
require APPPATH.'bootstrap.php';
// Load oil package
\Package::load('oil');
// Fire up the command line interfact
\Oil\Command::init($_SERVER['argv']);