diff options
author | Morris Jobke <hey@morrisjobke.de> | 2017-03-08 12:34:34 -0600 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2017-03-08 12:34:34 -0600 |
commit | 17108367647c5e1caefc5777248fee9e629f6038 (patch) | |
tree | cbdff89d8908a87a61ca8311a651388e53cbaaa5 /lib | |
parent | ba12ba7ed78220bb19e2b6ab282b81b64eb84e4c (diff) | |
download | nextcloud-server-17108367647c5e1caefc5777248fee9e629f6038.tar.gz nextcloud-server-17108367647c5e1caefc5777248fee9e629f6038.zip |
Update autoloader code
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'lib')
-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 |