mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-14 19:36:43 +00:00
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:
@@ -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)
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user