diff options
author | Morris Jobke <hey@morrisjobke.de> | 2017-03-09 09:27:12 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-09 09:27:12 -0600 |
commit | 15fa306ae8b9dbf30a08ac50d0afbf3c8a46688f (patch) | |
tree | ae3f8d5e637ac9d6b4fe5a29cf57fad8770b07a6 | |
parent | c23c062c89b214f4504a418cc96e5f6c740713f2 (diff) | |
parent | d6ce7ac4654136010a8fc4e2fb9a4f4312503d38 (diff) | |
download | nextcloud-server-15fa306ae8b9dbf30a08ac50d0afbf3c8a46688f.tar.gz nextcloud-server-15fa306ae8b9dbf30a08ac50d0afbf3c8a46688f.zip |
Merge pull request #3785 from nextcloud/bump_autoloader
Bump autoloader
-rw-r--r-- | lib/composer/composer/ClassLoader.php | 10 | ||||
-rw-r--r-- | lib/composer/composer/LICENSE | 2 |
2 files changed, 8 insertions, 4 deletions
diff --git a/lib/composer/composer/ClassLoader.php b/lib/composer/composer/ClassLoader.php index 4626994fd4d..2c72175e772 100644 --- a/lib/composer/composer/ClassLoader.php +++ b/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; } diff --git a/lib/composer/composer/LICENSE b/lib/composer/composer/LICENSE index 1a28124886d..f27399a042d 100644 --- a/lib/composer/composer/LICENSE +++ b/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 |