aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_external/3rdparty/composer/ClassLoader.php
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2018-01-19 20:23:51 +0100
committerGitHub <noreply@github.com>2018-01-19 20:23:51 +0100
commite869828562f3c0b212484c8232db34a1f13b2234 (patch)
tree322820914272992cc66dd2a8d774e9c4e6efd9ff /apps/files_external/3rdparty/composer/ClassLoader.php
parent8b8c796a3166e6bb56c3ccb1239242ec423e84e6 (diff)
parent4803bd1f3f2790a5e982579c154b1dc7c5d26c5a (diff)
downloadnextcloud-server-e869828562f3c0b212484c8232db34a1f13b2234.tar.gz
nextcloud-server-e869828562f3c0b212484c8232db34a1f13b2234.zip
Merge pull request #7962 from nextcloud/smb-2.0.4-12
[12] update icewind/smb to 2.0.4
Diffstat (limited to 'apps/files_external/3rdparty/composer/ClassLoader.php')
-rw-r--r--apps/files_external/3rdparty/composer/ClassLoader.php15
1 files changed, 8 insertions, 7 deletions
diff --git a/apps/files_external/3rdparty/composer/ClassLoader.php b/apps/files_external/3rdparty/composer/ClassLoader.php
index c6f6d2322bb..dc02dfb114f 100644
--- a/apps/files_external/3rdparty/composer/ClassLoader.php
+++ b/apps/files_external/3rdparty/composer/ClassLoader.php
@@ -43,8 +43,7 @@ namespace Composer\Autoload;
class ClassLoader
{
// PSR-4
- private $firstCharsPsr4 = array();
- private $prefixLengthsPsr4 = array(); // For BC with legacy static maps
+ private $prefixLengthsPsr4 = array();
private $prefixDirsPsr4 = array();
private $fallbackDirsPsr4 = array();
@@ -171,10 +170,11 @@ class ClassLoader
}
} elseif (!isset($this->prefixDirsPsr4[$prefix])) {
// Register directories for a new namespace.
- if ('\\' !== substr($prefix, -1)) {
+ $length = strlen($prefix);
+ if ('\\' !== $prefix[$length - 1]) {
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
}
- $this->firstCharsPsr4[$prefix[0]] = true;
+ $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
$this->prefixDirsPsr4[$prefix] = (array) $paths;
} elseif ($prepend) {
// Prepend directories for an already registered namespace.
@@ -221,10 +221,11 @@ class ClassLoader
if (!$prefix) {
$this->fallbackDirsPsr4 = (array) $paths;
} else {
- if ('\\' !== substr($prefix, -1)) {
+ $length = strlen($prefix);
+ if ('\\' !== $prefix[$length - 1]) {
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
}
- $this->firstCharsPsr4[$prefix[0]] = true;
+ $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
$this->prefixDirsPsr4[$prefix] = (array) $paths;
}
}
@@ -372,7 +373,7 @@ class ClassLoader
$logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
$first = $class[0];
- if (isset($this->firstCharsPsr4[$first]) || isset($this->prefixLengthsPsr4[$first])) {
+ if (isset($this->prefixLengthsPsr4[$first])) {
$subPath = $class;
while (false !== $lastPos = strrpos($subPath, '\\')) {
$subPath = substr($subPath, 0, $lastPos);