summaryrefslogtreecommitdiffstats
path: root/apps/twofactor_backupcodes/composer
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2018-01-04 16:31:16 +0100
committerRoeland Jago Douma <roeland@famdouma.nl>2018-01-04 16:31:16 +0100
commit0280cff66fdbbcc7981b4bcc96d5cacab517c534 (patch)
tree59dd594bbf2dfac7baad9d4cd52292195b7fe46d /apps/twofactor_backupcodes/composer
parente6557324580e4f76107a059f9fe84b03fbae2b71 (diff)
downloadnextcloud-server-0280cff66fdbbcc7981b4bcc96d5cacab517c534.tar.gz
nextcloud-server-0280cff66fdbbcc7981b4bcc96d5cacab517c534.zip
Composer updated
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'apps/twofactor_backupcodes/composer')
-rw-r--r--apps/twofactor_backupcodes/composer/composer/ClassLoader.php19
-rw-r--r--apps/twofactor_backupcodes/composer/composer/autoload_static.php9
2 files changed, 12 insertions, 16 deletions
diff --git a/apps/twofactor_backupcodes/composer/composer/ClassLoader.php b/apps/twofactor_backupcodes/composer/composer/ClassLoader.php
index 2c72175e772..c6f6d2322bb 100644
--- a/apps/twofactor_backupcodes/composer/composer/ClassLoader.php
+++ b/apps/twofactor_backupcodes/composer/composer/ClassLoader.php
@@ -43,7 +43,8 @@ namespace Composer\Autoload;
class ClassLoader
{
// PSR-4
- private $prefixLengthsPsr4 = array();
+ private $firstCharsPsr4 = array();
+ private $prefixLengthsPsr4 = array(); // For BC with legacy static maps
private $prefixDirsPsr4 = array();
private $fallbackDirsPsr4 = array();
@@ -170,11 +171,10 @@ class ClassLoader
}
} elseif (!isset($this->prefixDirsPsr4[$prefix])) {
// Register directories for a new namespace.
- $length = strlen($prefix);
- if ('\\' !== $prefix[$length - 1]) {
+ if ('\\' !== substr($prefix, -1)) {
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
}
- $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
+ $this->firstCharsPsr4[$prefix[0]] = true;
$this->prefixDirsPsr4[$prefix] = (array) $paths;
} elseif ($prepend) {
// Prepend directories for an already registered namespace.
@@ -221,11 +221,10 @@ class ClassLoader
if (!$prefix) {
$this->fallbackDirsPsr4 = (array) $paths;
} else {
- $length = strlen($prefix);
- if ('\\' !== $prefix[$length - 1]) {
+ if ('\\' !== substr($prefix, -1)) {
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
}
- $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
+ $this->firstCharsPsr4[$prefix[0]] = true;
$this->prefixDirsPsr4[$prefix] = (array) $paths;
}
}
@@ -373,15 +372,15 @@ class ClassLoader
$logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
$first = $class[0];
- if (isset($this->prefixLengthsPsr4[$first])) {
+ if (isset($this->firstCharsPsr4[$first]) || isset($this->prefixLengthsPsr4[$first])) {
$subPath = $class;
while (false !== $lastPos = strrpos($subPath, '\\')) {
$subPath = substr($subPath, 0, $lastPos);
$search = $subPath.'\\';
if (isset($this->prefixDirsPsr4[$search])) {
+ $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
foreach ($this->prefixDirsPsr4[$search] as $dir) {
- $length = $this->prefixLengthsPsr4[$first][$search];
- if (file_exists($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) {
+ if (file_exists($file = $dir . $pathEnd)) {
return $file;
}
}
diff --git a/apps/twofactor_backupcodes/composer/composer/autoload_static.php b/apps/twofactor_backupcodes/composer/composer/autoload_static.php
index abde37697ee..6dd04fc047c 100644
--- a/apps/twofactor_backupcodes/composer/composer/autoload_static.php
+++ b/apps/twofactor_backupcodes/composer/composer/autoload_static.php
@@ -6,11 +6,8 @@ namespace Composer\Autoload;
class ComposerStaticInitTwoFactorBackupCodes
{
- public static $prefixLengthsPsr4 = array (
- 'O' =>
- array (
- 'OCA\\TwoFactorBackupCodes\\' => 25,
- ),
+ public static $firstCharsPsr4 = array (
+ 'O' => true,
);
public static $prefixDirsPsr4 = array (
@@ -38,7 +35,7 @@ class ComposerStaticInitTwoFactorBackupCodes
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
- $loader->prefixLengthsPsr4 = ComposerStaticInitTwoFactorBackupCodes::$prefixLengthsPsr4;
+ $loader->firstCharsPsr4 = ComposerStaticInitTwoFactorBackupCodes::$firstCharsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInitTwoFactorBackupCodes::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInitTwoFactorBackupCodes::$classMap;