aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/composer/ClassLoader.php
diff options
context:
space:
mode:
authorgit-marijus <mario@mariovavti.com>2018-03-01 12:08:31 +0100
committerGitHub <noreply@github.com>2018-03-01 12:08:31 +0100
commit8cd539e12585d90e0f9bf9b693d64ff9d3e17dd3 (patch)
tree6c01308e4a3c0d994d8e671156b341b0d0be46df /vendor/composer/ClassLoader.php
parent3b8a0d47733ebd9a3ed91b25b75a34e49c272438 (diff)
parentb60098ec68e76cad9ebebdc83bb9c23766be9c52 (diff)
downloadvolse-hubzilla-8cd539e12585d90e0f9bf9b693d64ff9d3e17dd3.tar.gz
volse-hubzilla-8cd539e12585d90e0f9bf9b693d64ff9d3e17dd3.tar.bz2
volse-hubzilla-8cd539e12585d90e0f9bf9b693d64ff9d3e17dd3.zip
Merge pull request #984 from dawnbreak/dev
Update composer autoload cache.
Diffstat (limited to 'vendor/composer/ClassLoader.php')
-rw-r--r--vendor/composer/ClassLoader.php15
1 files changed, 8 insertions, 7 deletions
diff --git a/vendor/composer/ClassLoader.php b/vendor/composer/ClassLoader.php
index c6f6d2322..dc02dfb11 100644
--- a/vendor/composer/ClassLoader.php
+++ b/vendor/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);