|
1 |
| -<?php namespace Config; |
| 1 | +<?php |
2 | 2 |
|
3 |
| -require_once SYSTEMPATH . 'Config/AutoloadConfig.php'; |
| 3 | +namespace Config; |
| 4 | + |
| 5 | +use CodeIgniter\Config\AutoloadConfig; |
4 | 6 |
|
5 | 7 | /**
|
6 | 8 | * -------------------------------------------------------------------
|
7 | 9 | * AUTO-LOADER
|
8 | 10 | * -------------------------------------------------------------------
|
9 | 11 | * This file defines the namespaces and class maps so the Autoloader
|
10 | 12 | * can find the files as needed.
|
| 13 | + * |
| 14 | + * NOTE: If you use an identical key in $psr4 or $classmap, then |
| 15 | + * the values in this file will overwrite the framework's values. |
11 | 16 | */
|
12 |
| -class Autoload extends \CodeIgniter\Config\AutoloadConfig |
| 17 | +class Autoload extends AutoloadConfig |
13 | 18 | {
|
14 |
| - public $psr4 = []; |
15 |
| - |
16 |
| - public $classmap = []; |
17 |
| - |
18 |
| - //-------------------------------------------------------------------- |
19 | 19 |
|
20 | 20 | /**
|
21 |
| - * Collects the application-specific autoload settings and merges |
22 |
| - * them with the framework's required settings. |
| 21 | + * ------------------------------------------------------------------- |
| 22 | + * Namespaces |
| 23 | + * ------------------------------------------------------------------- |
| 24 | + * This maps the locations of any namespaces in your application to |
| 25 | + * their location on the file system. These are used by the autoloader |
| 26 | + * to locate files the first time they have been instantiated. |
| 27 | + * |
| 28 | + * The '/app' and '/system' directories are already mapped for you. |
| 29 | + * you may change the name of the 'App' namespace if you wish, |
| 30 | + * but this should be done prior to creating any namespaced classes, |
| 31 | + * else you will need to modify all of those classes for this to work. |
23 | 32 | *
|
24 |
| - * NOTE: If you use an identical key in $psr4 or $classmap, then |
25 |
| - * the values in this file will overwrite the framework's values. |
| 33 | + * Prototype: |
| 34 | + * |
| 35 | + * $psr4 = [ |
| 36 | + * 'CodeIgniter' => SYSTEMPATH, |
| 37 | + * 'App' => APPPATH |
| 38 | + * ]; |
| 39 | + * |
| 40 | + * @var array |
26 | 41 | */
|
27 |
| - public function __construct() |
28 |
| - { |
29 |
| - parent::__construct(); |
30 |
| - |
31 |
| - /** |
32 |
| - * ------------------------------------------------------------------- |
33 |
| - * Namespaces |
34 |
| - * ------------------------------------------------------------------- |
35 |
| - * This maps the locations of any namespaces in your application |
36 |
| - * to their location on the file system. These are used by the |
37 |
| - * Autoloader to locate files the first time they have been instantiated. |
38 |
| - * |
39 |
| - * The '/app' and '/system' directories are already mapped for |
40 |
| - * you. You may change the name of the 'App' namespace if you wish, |
41 |
| - * but this should be done prior to creating any namespaced classes, |
42 |
| - * else you will need to modify all of those classes for this to work. |
43 |
| - * |
44 |
| - * DO NOT change the name of the CodeIgniter namespace or your application |
45 |
| - * WILL break. * |
46 |
| - * Prototype: |
47 |
| - * |
48 |
| - * $Config['psr4'] = [ |
49 |
| - * 'CodeIgniter' => SYSPATH |
50 |
| - * `]; |
51 |
| - */ |
52 |
| - $psr4 = [ |
53 |
| - 'App' => APPPATH, // To ensure filters, etc still found, |
54 |
| - APP_NAMESPACE => APPPATH, // For custom namespace |
55 |
| - 'Config' => APPPATH . 'Config', |
56 |
| - ]; |
57 |
| - |
58 |
| - /** |
59 |
| - * ------------------------------------------------------------------- |
60 |
| - * Class Map |
61 |
| - * ------------------------------------------------------------------- |
62 |
| - * The class map provides a map of class names and their exact |
63 |
| - * location on the drive. Classes loaded in this manner will have |
64 |
| - * slightly faster performance because they will not have to be |
65 |
| - * searched for within one or more directories as they would if they |
66 |
| - * were being autoloaded through a namespace. |
67 |
| - * |
68 |
| - * Prototype: |
69 |
| - * |
70 |
| - * $Config['classmap'] = [ |
71 |
| - * 'MyClass' => '/path/to/class/file.php' |
72 |
| - * ]; |
73 |
| - */ |
74 |
| - $classmap = []; |
75 |
| - |
76 |
| - //-------------------------------------------------------------------- |
77 |
| - // Do Not Edit Below This Line |
78 |
| - //-------------------------------------------------------------------- |
79 |
| - |
80 |
| - $this->psr4 = array_merge($this->psr4, $psr4); |
81 |
| - $this->classmap = array_merge($this->classmap, $classmap); |
82 |
| - |
83 |
| - unset($psr4, $classmap); |
84 |
| - } |
85 |
| - |
86 |
| - //-------------------------------------------------------------------- |
| 42 | + public $psr4 = [ |
| 43 | + APP_NAMESPACE => APPPATH, // For custom app namespace |
| 44 | + 'Config' => APPPATH . 'Config', |
| 45 | + ]; |
87 | 46 |
|
| 47 | + /** |
| 48 | + * ------------------------------------------------------------------- |
| 49 | + * Class Map |
| 50 | + * ------------------------------------------------------------------- |
| 51 | + * The class map provides a map of class names and their exact |
| 52 | + * location on the drive. Classes loaded in this manner will have |
| 53 | + * slightly faster performance because they will not have to be |
| 54 | + * searched for within one or more directories as they would if they |
| 55 | + * were being autoloaded through a namespace. |
| 56 | + * |
| 57 | + * Prototype: |
| 58 | + * |
| 59 | + * $classmap = [ |
| 60 | + * 'MyClass' => '/path/to/class/file.php' |
| 61 | + * ]; |
| 62 | + * |
| 63 | + * @var array |
| 64 | + */ |
| 65 | + public $classmap = []; |
88 | 66 | }
|
0 commit comments