From 6c641b1834539c65edb35dd43a6afa7620e73e1c Mon Sep 17 00:00:00 2001 From: zotlabs Date: Tue, 14 Mar 2017 09:09:05 +1100 Subject: move oauth2 to vendor --- vendor/composer/ClassLoader.php | 48 +++++++++-------------------------------- 1 file changed, 10 insertions(+), 38 deletions(-) (limited to 'vendor/composer/ClassLoader.php') diff --git a/vendor/composer/ClassLoader.php b/vendor/composer/ClassLoader.php index 4626994fd..ff6ecfb82 100644 --- a/vendor/composer/ClassLoader.php +++ b/vendor/composer/ClassLoader.php @@ -53,9 +53,8 @@ class ClassLoader private $useIncludePath = false; private $classMap = array(); + private $classMapAuthoritative = false; - private $missingClasses = array(); - private $apcuPrefix; public function getPrefixes() { @@ -272,26 +271,6 @@ class ClassLoader return $this->classMapAuthoritative; } - /** - * APCu prefix to use to cache found/not-found classes, if the extension is enabled. - * - * @param string|null $apcuPrefix - */ - public function setApcuPrefix($apcuPrefix) - { - $this->apcuPrefix = function_exists('apcu_fetch') && ini_get('apc.enabled') ? $apcuPrefix : null; - } - - /** - * The APCu prefix in use, or null if APCu caching is not enabled. - * - * @return string|null - */ - public function getApcuPrefix() - { - return $this->apcuPrefix; - } - /** * Registers this instance as an autoloader. * @@ -334,34 +313,29 @@ class ClassLoader */ public function findFile($class) { + // work around for PHP 5.3.0 - 5.3.2 https://bugs.php.net/50731 + if ('\\' == $class[0]) { + $class = substr($class, 1); + } + // class map lookup if (isset($this->classMap[$class])) { return $this->classMap[$class]; } - if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) { + if ($this->classMapAuthoritative) { return false; } - if (null !== $this->apcuPrefix) { - $file = apcu_fetch($this->apcuPrefix.$class, $hit); - if ($hit) { - return $file; - } - } $file = $this->findFileWithExtension($class, '.php'); // Search for Hack files if we are running on HHVM - if (false === $file && defined('HHVM_VERSION')) { + if ($file === null && defined('HHVM_VERSION')) { $file = $this->findFileWithExtension($class, '.hh'); } - if (null !== $this->apcuPrefix) { - apcu_add($this->apcuPrefix.$class, $file); - } - - if (false === $file) { + if ($file === null) { // Remember that this class does not exist. - $this->missingClasses[$class] = true; + return $this->classMap[$class] = false; } return $file; @@ -425,8 +399,6 @@ class ClassLoader if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) { return $file; } - - return false; } } -- cgit v1.2.3