Browse Source

Bump autoloader

Composer was updated so lets update the autoloader

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Roeland Jago Douma 7 years ago
parent
commit
d6ce7ac465
2 changed files with 8 additions and 4 deletions
  1. 7 3
      lib/composer/composer/ClassLoader.php
  2. 1 1
      lib/composer/composer/LICENSE

+ 7 - 3
lib/composer/composer/ClassLoader.php

@@ -374,9 +374,13 @@ class ClassLoader
 
         $first = $class[0];
         if (isset($this->prefixLengthsPsr4[$first])) {
-            foreach ($this->prefixLengthsPsr4[$first] as $prefix => $length) {
-                if (0 === strpos($class, $prefix)) {
-                    foreach ($this->prefixDirsPsr4[$prefix] as $dir) {
+            $subPath = $class;
+            while (false !== $lastPos = strrpos($subPath, '\\')) {
+                $subPath = substr($subPath, 0, $lastPos);
+                $search = $subPath.'\\';
+                if (isset($this->prefixDirsPsr4[$search])) {
+                    foreach ($this->prefixDirsPsr4[$search] as $dir) {
+                        $length = $this->prefixLengthsPsr4[$first][$search];
                         if (file_exists($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) {
                             return $file;
                         }

+ 1 - 1
lib/composer/composer/LICENSE

@@ -1,5 +1,5 @@
 
-Copyright (c) 2016 Nils Adermann, Jordi Boggiano
+Copyright (c) Nils Adermann, Jordi Boggiano
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal