namespace Symfony\Component\ClassLoader;
+@trigger_error('The '.__NAMESPACE__.'\ClassLoader class is deprecated since Symfony 3.3 and will be removed in 4.0. Use Composer instead.', E_USER_DEPRECATED);
+
/**
* ClassLoader implements an PSR-0 class loader.
*
*
* @author Fabien Potencier <fabien@symfony.com>
* @author Jordi Boggiano <j.boggiano@seld.be>
+ *
+ * @deprecated since version 3.3, to be removed in 4.0.
*/
class ClassLoader
{
return;
}
if (isset($this->prefixes[$prefix])) {
- if (is_array($paths)) {
+ if (\is_array($paths)) {
$this->prefixes[$prefix] = array_unique(array_merge(
$this->prefixes[$prefix],
$paths
));
- } elseif (!in_array($paths, $this->prefixes[$prefix])) {
+ } elseif (!\in_array($paths, $this->prefixes[$prefix])) {
$this->prefixes[$prefix][] = $paths;
}
} else {
{
if (false !== $pos = strrpos($class, '\\')) {
// namespaced class name
- $classPath = str_replace('\\', DIRECTORY_SEPARATOR, substr($class, 0, $pos)).DIRECTORY_SEPARATOR;
+ $classPath = str_replace('\\', \DIRECTORY_SEPARATOR, substr($class, 0, $pos)).\DIRECTORY_SEPARATOR;
$className = substr($class, $pos + 1);
} else {
// PEAR-like class name
$className = $class;
}
- $classPath .= str_replace('_', DIRECTORY_SEPARATOR, $className).'.php';
+ $classPath .= str_replace('_', \DIRECTORY_SEPARATOR, $className).'.php';
foreach ($this->prefixes as $prefix => $dirs) {
if ($class === strstr($class, $prefix)) {
foreach ($dirs as $dir) {
- if (file_exists($dir.DIRECTORY_SEPARATOR.$classPath)) {
- return $dir.DIRECTORY_SEPARATOR.$classPath;
+ if (file_exists($dir.\DIRECTORY_SEPARATOR.$classPath)) {
+ return $dir.\DIRECTORY_SEPARATOR.$classPath;
}
}
}
}
foreach ($this->fallbackDirs as $dir) {
- if (file_exists($dir.DIRECTORY_SEPARATOR.$classPath)) {
- return $dir.DIRECTORY_SEPARATOR.$classPath;
+ if (file_exists($dir.\DIRECTORY_SEPARATOR.$classPath)) {
+ return $dir.\DIRECTORY_SEPARATOR.$classPath;
}
}