fixed the autoloader to take into account namespaced classes

This commit is contained in:
Fabien Potencier
2019-03-13 16:07:45 +01:00
parent dae3b1cead
commit 0c1d18b90a
2 changed files with 3 additions and 1 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
* 1.38.3 (2019-XX-XX)
* n/a
* fixed the bundled Autoloader to also load namespaced classes
* 1.38.2 (2019-03-12)
+2
View File
@@ -45,6 +45,8 @@ class Twig_Autoloader
if (is_file($file = __DIR__.'/../'.str_replace(['_', "\0"], ['/', ''], $class).'.php')) {
require $file;
} elseif (is_file($file = __DIR__.'/../../src/'.str_replace(['Twig\\', '\\', "\0"], ['', '/', ''], $class).'.php')) {
require $file;
}
}
}