1
|
|
|
<?php |
2
|
|
|
defined('BASEPATH') OR exit('No direct script access allowed'); |
3
|
|
|
|
4
|
|
|
/* |
5
|
|
|
| ------------------------------------------------------------------- |
6
|
|
|
| AUTO-LOADER |
7
|
|
|
| ------------------------------------------------------------------- |
8
|
|
|
| This file specifies which systems should be loaded by default. |
9
|
|
|
| |
10
|
|
|
| In order to keep the framework as light-weight as possible only the |
11
|
|
|
| absolute minimal resources are loaded by default. For example, |
12
|
|
|
| the database is not connected to automatically since no assumption |
13
|
|
|
| is made regarding whether you intend to use it. This file lets |
14
|
|
|
| you globally define which systems you would like loaded with every |
15
|
|
|
| request. |
16
|
|
|
| |
17
|
|
|
| ------------------------------------------------------------------- |
18
|
|
|
| Instructions |
19
|
|
|
| ------------------------------------------------------------------- |
20
|
|
|
| |
21
|
|
|
| These are the things you can load automatically: |
22
|
|
|
| |
23
|
|
|
| 1. Packages |
24
|
|
|
| 2. Libraries |
25
|
|
|
| 3. Drivers |
26
|
|
|
| 4. Helper files |
27
|
|
|
| 5. Custom config files |
28
|
|
|
| 6. Language files |
29
|
|
|
| 7. Models |
30
|
|
|
| |
31
|
|
|
*/ |
32
|
|
|
|
33
|
|
|
/* |
|
|
|
|
34
|
|
|
| ------------------------------------------------------------------- |
35
|
|
|
| Auto-load Packages |
36
|
|
|
| ------------------------------------------------------------------- |
37
|
|
|
| Prototype: |
38
|
|
|
| |
39
|
|
|
| $autoload['packages'] = array(APPPATH.'third_party', '/usr/local/shared'); |
40
|
|
|
| |
41
|
|
|
*/ |
42
|
|
|
$autoload['packages'] = array(APPPATH.'third_party'); |
43
|
|
|
|
44
|
|
|
/* |
45
|
|
|
| ------------------------------------------------------------------- |
46
|
|
|
| Auto-load Libraries |
47
|
|
|
| ------------------------------------------------------------------- |
48
|
|
|
| These are the classes located in system/libraries/ or your |
49
|
|
|
| application/libraries/ directory, with the addition of the |
50
|
|
|
| 'database' library, which is somewhat of a special case. |
51
|
|
|
| |
52
|
|
|
| Prototype: |
53
|
|
|
| |
54
|
|
|
| $autoload['libraries'] = array('database', 'email', 'session'); |
55
|
|
|
| |
56
|
|
|
| You can also supply an alternative library name to be assigned |
57
|
|
|
| in the controller: |
58
|
|
|
| |
59
|
|
|
| $autoload['libraries'] = array('user_agent' => 'ua'); |
60
|
|
|
*/ |
61
|
|
|
$autoload['libraries'] = array(); |
62
|
|
|
|
63
|
|
|
/* |
64
|
|
|
| ------------------------------------------------------------------- |
65
|
|
|
| Auto-load Drivers |
66
|
|
|
| ------------------------------------------------------------------- |
67
|
|
|
| These classes are located in system/libraries/ or in your |
68
|
|
|
| application/libraries/ directory, but are also placed inside their |
69
|
|
|
| own subdirectory and they extend the CI_Driver_Library class. They |
70
|
|
|
| offer multiple interchangeable driver options. |
71
|
|
|
| |
72
|
|
|
| Prototype: |
73
|
|
|
| |
74
|
|
|
| $autoload['drivers'] = array('cache'); |
75
|
|
|
*/ |
76
|
|
|
$autoload['drivers'] = array(); |
77
|
|
|
|
78
|
|
|
/* |
|
|
|
|
79
|
|
|
| ------------------------------------------------------------------- |
80
|
|
|
| Auto-load Helper Files |
81
|
|
|
| ------------------------------------------------------------------- |
82
|
|
|
| Prototype: |
83
|
|
|
| |
84
|
|
|
| $autoload['helper'] = array('url', 'file'); |
85
|
|
|
*/ |
86
|
|
|
$autoload['helper'] = array('url', 'language'); |
87
|
|
|
|
88
|
|
|
/* |
89
|
|
|
| ------------------------------------------------------------------- |
90
|
|
|
| Auto-load Config files |
91
|
|
|
| ------------------------------------------------------------------- |
92
|
|
|
| Prototype: |
93
|
|
|
| |
94
|
|
|
| $autoload['config'] = array('config1', 'config2'); |
95
|
|
|
| |
96
|
|
|
| NOTE: This item is intended for use ONLY if you have created custom |
97
|
|
|
| config files. Otherwise, leave it blank. |
98
|
|
|
| |
99
|
|
|
*/ |
100
|
|
|
$autoload['config'] = array('application'); |
101
|
|
|
|
102
|
|
|
/* |
|
|
|
|
103
|
|
|
| ------------------------------------------------------------------- |
104
|
|
|
| Auto-load Language files |
105
|
|
|
| ------------------------------------------------------------------- |
106
|
|
|
| Prototype: |
107
|
|
|
| |
108
|
|
|
| $autoload['language'] = array('lang1', 'lang2'); |
109
|
|
|
| |
110
|
|
|
| NOTE: Do not include the "_lang" part of your file. For example |
111
|
|
|
| "codeigniter_lang.php" would be referenced as array('codeigniter'); |
112
|
|
|
| |
113
|
|
|
*/ |
114
|
|
|
$autoload['language'] = array('application'); |
115
|
|
|
|
116
|
|
|
/* |
117
|
|
|
| ------------------------------------------------------------------- |
118
|
|
|
| Auto-load Models |
119
|
|
|
| ------------------------------------------------------------------- |
120
|
|
|
| Prototype: |
121
|
|
|
| |
122
|
|
|
| $autoload['model'] = array('first_model', 'second_model'); |
123
|
|
|
| |
124
|
|
|
| You can also supply an alternative model name to be assigned |
125
|
|
|
| in the controller: |
126
|
|
|
| |
127
|
|
|
| $autoload['model'] = array('first_model' => 'first'); |
128
|
|
|
*/ |
129
|
|
|
$autoload['model'] = array(); |
130
|
|
|
|
131
|
|
|
/** |
132
|
|
|
* Load PHPError |
133
|
|
|
* todo Look into enabling save file feature because that would be bad ass |
134
|
|
|
*/ |
135
|
|
|
if (ENVIRONMENT == 'development' && ! is_cli() && config_item('use_php_error') ) { |
136
|
|
|
require(__DIR__ . '/../php_error.php'); |
137
|
|
|
\php_error\reportErrors(array( |
138
|
|
|
'application_folders' => 'application', |
139
|
|
|
'ignore_folders' => 'system', |
140
|
|
|
'enable_saving' => false |
141
|
|
|
)); |
142
|
|
|
} |
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.
The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.
This check looks for comments that seem to be mostly valid code and reports them.