This website requires JavaScript.
Explore
Help
Sign In
diogo
/
symfony
Archived
Watch
1
Star
0
Fork
0
You've already forked symfony
Code
Issues
Pull Requests
Packages
Projects
Releases
Wiki
Activity
This repository has been archived on
2023-08-20
. You can view files and clone it, but cannot push or open issues or pull requests.
500cc3c4d7
symfony
/
tests
/
Symfony
/
Tests
/
Component
/
ClassLoader
/
Fixtures
/
Pearlike
/
Bar.php
7 lines
64 B
PHP
Raw
Normal View
History
Unescape
Escape
Fix UniversalClassLoader issues with leading slashes. This fixes a bug in UniversalClassLoader when attempting to autoload class names with leading slashes: $namespacedClass = "\\Foo\\Bar"; $pearlikeClass = "\\Foo_Bar"; $namespaced = new $namespacedClass(); $pearlike = new $pearlikeClass(); `UniversalClassLoader::loadClass()` was unable to load PEAR-like classes with leading slashes because it found the slash and assumed that the requested class was namespaced. It was unable to load namespaced classes with leading slashes because it would look them up in the autoloader's registered namespaces, and was unable to match '\Foo' to 'Foo'. One (ugly) workaround for the namespaced classes was to register all namespaces twice: $loader->registerNamespaces(array( 'Foo' => __DIR__ . '/lib', '\Foo' => __DIR__ . '/lib', )); But that's not very pretty, nor does it solve the bug with PEAR-like classes. Stripping the leading slash before trying to autoload allows UniversalClassLoader to load both namespaced and PEAR-like classes.
2010-10-19 20:45:04 +01:00
<
?
php
[HttpFoundation] added a directory fallback for when the class is not found in registered namespaces and class prefixes
2011-01-20 09:20:14 +00:00
class
Pearlike_Bar
{
CS fixes
2010-12-13 10:09:41 +00:00
public
static
$loaded
=
true
;
[HttpFoundation] added a directory fallback for when the class is not found in registered namespaces and class prefixes
2011-01-20 09:20:14 +00:00
}
Reference in New Issue
Copy Permalink