We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent df4a21e commit d8ba3e2Copy full SHA for d8ba3e2
1 file changed
system/Config/Config.php
@@ -122,13 +122,28 @@ private static function createClass(string $name)
122
{
123
return new $name();
124
}
125
-
+
126
$locator = Services::locator();
127
$file = $locator->locateFile($name, 'Config');
128
129
if (empty($file))
130
131
- return null;
+ // No file found - check if the class was namespaced
132
+ if (strpos($name, '\\') !== false)
133
+ {
134
+ // Class was namespaced and locateFile couldn't find it
135
+ return null;
136
+ }
137
138
+ // Check all namespaces
139
+ $files = $locator->search('Config/' . $name);
140
+ if (empty($files))
141
142
143
144
145
+ // Get the first match (prioritizes user and framework)
146
+ $file = reset($files);
147
148
149
$name = $locator->getClassname($file);
0 commit comments