forked from blocka/ExpressionEngine-Bootstrap
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathbootstrap-ee2.php
91 lines (71 loc) · 2.67 KB
/
bootstrap-ee2.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
78
79
80
81
82
83
84
85
86
87
88
89
90
<?php
global $assign_to_config, $system_path, $debug, $CFG, $URI, $IN, $OUT, $LANG, $SEC, $loader;
if ( ! isset($system_path)) {
$system_path = "system";
}
$assign_to_config['enable_query_strings'] = TRUE;
$assign_to_config['subclass_prefix'] = 'EE_';
if (realpath($system_path) !== FALSE) {
$system_path = realpath($system_path).'/';
}
// ensure there's a trailing slash
$system_path = rtrim($system_path, '/').'/';
define('SELF', pathinfo(__FILE__, PATHINFO_BASENAME));
define('EXT', '.php');
define('BASEPATH', str_replace("\\", "/", $system_path.'codeigniter/system/'));
define('APPPATH', $system_path.'expressionengine/');
define('FCPATH', str_replace(SELF, '', __FILE__));
define('SYSDIR', trim(strrchr(trim(str_replace("\\", "/", $system_path), '/'), '/'), '/'));
define('CI_VERSION', '2.0');
define('DEBUG', isset($debug) ? $debug : 0);
require BASEPATH.'core/Common.php';
require APPPATH.'config/constants.php';
$CFG =& load_class('Config', 'core');
if (isset($assign_to_config)) {
$CFG->_assign_to_config($assign_to_config);
}
$UNI =& load_class('Utf8', 'core');
$URI =& load_class('URI', 'core');
$SEC =& load_class('Security', 'core');
$IN =& load_class('Input', 'core');
$OUT =& load_class('Output', 'core');
$LANG =& load_class('Lang', 'core');
$RTR =& load_class('Router', 'core');
$loader = load_class('Loader', 'core');
// Load the base controller class
require BASEPATH.'core/Controller.php';
function &get_instance()
{
return CI_Controller::get_instance();
}
function ee()
{
return get_instance();
}
// required by the input class
if ( ! isset($_SERVER['REMOTE_ADDR']))
{
$_SERVER['REMOTE_ADDR'] = '127.0.0.1';
}
new CI_Controller();
ee()->load->library('core');
if (method_exists(ee()->core, 'bootstrap')) {
ee()->core->bootstrap();
}
/*
* ------------------------------------------------------
* Load the autoloader and register it
* ------------------------------------------------------
*/
require(APPPATH.'../EllisLab/ExpressionEngine/Core/Autoloader.php');
Autoloader::getInstance()->register();
// if you are loading template library or addon library you'll need this
ee()->core->native_plugins = array('magpie', 'markdown', 'rss_parser', 'xml_encode');
ee()->core->native_modules = array('blacklist', 'channel', 'comment', 'commerce', 'email', 'emoticon', 'file', 'forum', 'ip_to_nation', 'jquery', 'mailinglist', 'member', 'metaweblog_api', 'moblog', 'pages', 'query', 'referrer', 'rss', 'rte', 'search', 'simple_commerce', 'stats', 'wiki');
ee()->load->library('remember');
ee()->load->library('localize');
ee()->load->library('session');
ee()->load->library('user_agent');
ee()->load->library('stats');
ee()->lang->loadfile('core');
ee()->load->helper('compat');