| 1 | <?php |
||
| 13 | class Instance |
||
| 14 | { |
||
| 15 | /** |
||
| 16 | * Creates an instance of CodeIgniter based on the application path. |
||
| 17 | * |
||
| 18 | * @param string $appPath |
||
| 19 | * @param array $server |
||
| 20 | * @param array $globals |
||
| 21 | * @return \CI_Controller |
||
| 22 | */ |
||
| 23 | 12 | public static function create($appPath = '', array $server = [], array $globals = []) |
|
| 32 | } |
||
| 33 |
Instead of super-globals, we recommend to explicitly inject the dependencies of your class. This makes your code less dependent on global state and it becomes generally more testable: