bug #2896 Fix the autoloader to take into account namespaced classes (fabpot)

This PR was merged into the 1.x branch.

Discussion
----------

Fix the autoloader to take into account namespaced classes

fixes #2895

Commits
-------

0c1d18b9 fixed the autoloader to take into account namespaced classes
This commit is contained in:
Fabien Potencier
2019-03-14 07:46:27 +01:00
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;
}
}
}