37
37
* @filesource
38
38
*/
39
39
40
- namespace CodeIgniter ;
41
-
42
- use CodeIgniter ;
43
- use Config ;
44
-
45
40
/*
46
41
* ---------------------------------------------------------------
47
42
* SETUP OUR PATH CONSTANTS
52
47
* so they are available in the config files that are loaded.
53
48
*/
54
49
55
- /**
56
- * The path to the application directory.
57
- */
50
+ // The path to the application directory.
58
51
if (! defined ('APPPATH ' ))
59
52
{
60
- // @phpstan-ignore-next-line
61
- define ('APPPATH ' , realpath ($ paths ->appDirectory ) . DIRECTORY_SEPARATOR );
53
+ /**
54
+ * @var \Config\Paths $paths
55
+ */
56
+ define ('APPPATH ' , realpath (rtrim ($ paths ->appDirectory , '\\/ ' )) . DIRECTORY_SEPARATOR );
62
57
}
63
58
64
- /**
65
- * The path to the project root directory. Just above APPPATH.
66
- */
59
+ // The path to the project root directory. Just above APPPATH.
67
60
if (! defined ('ROOTPATH ' ))
68
61
{
69
62
define ('ROOTPATH ' , realpath (APPPATH . '../ ' ) . DIRECTORY_SEPARATOR );
70
63
}
71
64
72
- /**
73
- * The path to the system directory.
74
- */
65
+ // The path to the system directory.
75
66
if (! defined ('SYSTEMPATH ' ))
76
67
{
77
- // @phpstan-ignore-next-line
78
- define ('SYSTEMPATH ' , realpath ($ paths ->systemDirectory ) . DIRECTORY_SEPARATOR );
68
+ /**
69
+ * @var \Config\Paths $paths
70
+ */
71
+ define ('SYSTEMPATH ' , realpath (rtrim ($ paths ->systemDirectory , '\\/ ' )) . DIRECTORY_SEPARATOR );
79
72
}
80
73
81
- /**
82
- * The path to the writable directory.
83
- */
74
+ // The path to the writable directory.
84
75
if (! defined ('WRITEPATH ' ))
85
76
{
86
- // @phpstan-ignore-next-line
87
- define ('WRITEPATH ' , realpath ($ paths ->writableDirectory ) . DIRECTORY_SEPARATOR );
77
+ /**
78
+ * @var \Config\Paths $paths
79
+ */
80
+ define ('WRITEPATH ' , realpath (rtrim ($ paths ->writableDirectory , '\\/ ' )) . DIRECTORY_SEPARATOR );
88
81
}
89
82
90
- /**
91
- * The path to the tests directory
92
- */
83
+ // The path to the tests directory
93
84
if (! defined ('TESTPATH ' ))
94
85
{
95
- // @phpstan-ignore-next-line
96
- define ('TESTPATH ' , realpath ($ paths ->testsDirectory ) . DIRECTORY_SEPARATOR );
86
+ /**
87
+ * @var \Config\Paths $paths
88
+ */
89
+ define ('TESTPATH ' , realpath (rtrim ($ paths ->testsDirectory , '\\/ ' )) . DIRECTORY_SEPARATOR );
97
90
}
98
91
99
92
/*
125
118
* that the config files can use the path constants.
126
119
*/
127
120
128
- if (! class_exists (Config \Autoload::class , false ))
121
+ if (! class_exists (' Config\Autoload ' , false ))
129
122
{
130
123
require_once SYSTEMPATH . 'Config/AutoloadConfig.php ' ;
131
124
require_once APPPATH . 'Config/Autoload.php ' ;
@@ -146,12 +139,12 @@ class_alias('Config\Services', 'CodeIgniter\Services');
146
139
147
140
$ loader = CodeIgniter \Services::autoloader ();
148
141
$ loader ->initialize (new Config \Autoload (), new Config \Modules ());
149
- $ loader ->register (); // Register the loader with the SPL autoloader stack.
142
+ $ loader ->register (); // Register the loader with the SPL autoloader stack.
150
143
151
144
// Now load Composer's if it's available
152
145
if (is_file (COMPOSER_PATH ))
153
146
{
154
- /**
147
+ /*
155
148
* The path to the vendor directory.
156
149
*
157
150
* We do not want to enforce this, so set the constant if Composer was used.
@@ -185,7 +178,7 @@ class_alias('Config\Services', 'CodeIgniter\Services');
185
178
* the pieces all working together.
186
179
*/
187
180
188
- $ appConfig = config (Config \App::class );
181
+ $ appConfig = config (' Config\App ' );
189
182
$ app = new CodeIgniter \CodeIgniter ($ appConfig );
190
183
$ app ->initialize ();
191
184
0 commit comments