Finds the path to the file, that contains the specified class.

@param string $class The fully-qualified class name

@return string|false The path if found, false otherwise
549148
public function findFile($class)
    {
        $class = Normalizer::ns($class, false);
        if (isset($this->classMap[$class])) {
            return $this->classMap[$class];
        }
        $index = substr($class, 0, 4);
        if (isset($this->indexes[$index])) {
            $namespace = $class;
            while (false !== $pos = strrpos($namespace, '\\')) {
                $namespace = substr($class, 0, $pos + 1);
                if (! isset($this->paths[$namespace])) {
                    $namespace = rtrim($namespace, '\\');
                    continue;
                }
                $subclass = substr($class, $pos + 1);
                $subpath  = Normalizer::path($subclass, false) . '.php';
                foreach ($this->paths[$namespace] as $dir) {
                    $path = $dir . $subpath;
                    if (is_readable($path)) {
                        if ($this->classRegistration) {
                            $this->classMap[$class] = $path;
                        }

                        return $path;
                    }
                }
                $namespace = rtrim($namespace, '\\');
            }
        }

        if ($this->classRegistration) {
            $this->classMap[$class] = false;
        }

        return false;
    }
898882
public function resolve($class)
    {
        $result = false;
        $prefix = $class;

        while (false !== ($pos = strrpos($prefix, '\\'))) {
            $prefix = substr($class, 0, $pos + 1);

            if (isset($this->prefixes[$prefix])) {
                $result = $this->resolveFilename($prefix, str_replace('\\', '/', substr($class, $pos + 1)));

                if ($result !== false) {
                    break;
                }
            }

            $prefix = rtrim($prefix, '\\');
        }

        return $result;
    }
288640
public static function load($class)
	{
		if (substr($class, 0, strlen(self::PACKAGE)) != self::PACKAGE)
			return false;

		$path = sprintf(
			'%s/%s.php',
			self::$_path,
			str_replace('_', '/', $class)
		);

		if (file_exists($path)) require_once($path);
	}
719023
public function loadClass(string $class)
    {
        if (strpos($class, 'Proxy\__Transactional__\\') !== 0) {
            return null;
        }

        if ($file = $this->findProxyFile($class)) {
            require_once $file;

            return true;
        }

        return null;
    }
888133
protected function findProxyFile(string $class): ?string
    {
        $class = substr($class, 24);

        $filePath = $this->directory . '/Proxy/' . str_replace('\\', '/', $class) . '.php';

        if (file_exists($filePath) && is_file($filePath)) {
            return $filePath;
        }

        return null;
    }
287867
private function findClassFile($class)
    {
        list($classpath, $classname) = $this->findClasspathAndClass($class);
        $classpath .= str_replace('_', DIRECTORY_SEPARATOR, $classname) . '.php';

        foreach ($this->autoloader->getPrefixes() as $prefix => $dirs) {
            if (0 === strpos($class, $prefix)) {
                return current($dirs) . DIRECTORY_SEPARATOR . $classpath;
            }
        }

        if ($dirs = $this->autoloader->getFallbackDirs()) {
            return current($dirs) . DIRECTORY_SEPARATOR . $classpath;
        }

        throw new ContextNotFoundException(sprintf(
            'Could not find where to put "%s" class. Have you configured autoloader properly?',
            $class
        ), $class);
    }
444756
public static function loadClass($class)
    {
        if (isset(self::$_classMap[$class]))
            return (bool)require sprintf('%s/%s', self::ROOT_DIR, self::$_classMap[$class]);
        return null;
    }
1288187
public function loadClass($class)
    {
        if (!$file = $this->findFile($class)) {
            return;
        }

        if (!$this->_patchers || !$this->patchable($class)) {
            includeFile($file);
            return true;
        }
        return $this->loadFile($file);
    }
277059
public static function autoload($class)
    {
        /**
         * Classes from unified namespace canot be loaded by this auto loader.
         * Do not try to load them in order to avoid strange errors in edge cases.
         */
        if (false !== strpos($class, 'OxidEsales\Eshop\\')) {
            return false;
        }
        $instance = static::getInstance();

        $class = strtolower(basename($class));

        if ($classPath = $instance->getFilePath($class)) {
            include $classPath;
        } else {
            $class = preg_replace('/_parent$/i', '', $class);

            if (!in_array($class, $instance->triedClasses)) {
                $instance->triedClasses[] = $class;
                $instance->createExtensionClassChain($class);
            }
        }
    }
124476
public function findFile($class)
    {
        // Remove first backslash
        if ('\\' == $class[0]) {
            $class = substr($class, 1);
        }

        if (false !== $pos = strrpos($class, '\\')) {
            // Namespaced class name
            $namespace = substr($class, 0, $pos);

            // Iterate in normal namespaces
            foreach ($this->namespaces as $ns => $dirs) {
                //Don't interfere with other autoloaders
                if (0 !== strpos($namespace, $ns)) {
                    continue;
                }

                foreach ($dirs as $dir) {
                    $className = substr($class, $pos + 1);

                    $file = $dir . DIRECTORY_SEPARATOR .
                        str_replace('\\', DIRECTORY_SEPARATOR, $namespace) .
                        DIRECTORY_SEPARATOR .
                        $className . '.php';

                    if (file_exists($file)) {
                        return $file;
                    }
                }
            }

            // Iterate in Thrift namespaces

            // Remove first part of namespace
            $m = explode('\\', $class);

            // Ignore wrong call
            if (count($m) <= 1) {
                return;
            }

            $class = array_pop($m);
            $namespace = implode('\\', $m);

            foreach ($this->definitions as $ns => $dirs) {
                //Don't interfere with other autoloaders
                if (0 !== strpos($namespace, $ns)) {
                    continue;
                }

                foreach ($dirs as $dir) {
                    /**
                     * Available in service: Interface, Client, Processor, Rest
                     * And every service methods (_.+)
                     */
                    if (0 === preg_match('#(.+)(if|client|processor|rest)$#i', $class, $n) and
                        0 === preg_match('#(.+)_[a-z0-9]+_(args|result)$#i', $class, $n)
                    ) {
                        $className = 'Types';
                    } else {
                        $className = $n[1];
                    }

                    $file = $dir . DIRECTORY_SEPARATOR .
                        str_replace('\\', DIRECTORY_SEPARATOR, $namespace) .
                        DIRECTORY_SEPARATOR .
                        $className . '.php';

                    if (file_exists($file)) {
                        return $file;
                    }
                }
            }
        }
    }
582523
public function locate($class)
    {
        $result = false;

        //Find the class
        foreach($this->getNamespaces() as $namespace => $basepaths)
        {
            if(empty($namespace) && strpos($class, '\\')) {
                continue;
            }

            if(strpos('\\'.$class, '\\'.$namespace) !== 0) {
                continue;
            }

            //Remove the namespace from the class name
            $classname = ltrim(substr($class, strlen($namespace)), '\\');

            /*
             * Exception rule for Exception classes
             *
             * Transform class to lower case to always load the exception class from the /exception/ folder.
             */
            if($pos = strpos($classname, 'Exception'))
            {
                $filename  = substr($classname, $pos + strlen('Exception'));
                $classname = str_replace($filename, ucfirst(strtolower($filename)), $classname);
            }

            $parts = explode(' ', strtolower(preg_replace('/(?<=\\w)([A-Z])/', ' \\1', $classname)));

            $file  = array_pop($parts);

            if(count($parts)){
                $path = implode('/', $parts) . '/' . $file;
            } else {
                $path = $file . '/' . $file;
            }

            $paths = array(
                $path . '.php',
                $path . '/' . $file . '.php'
            );

            foreach($basepaths as $basepath)
            {
                foreach($paths as $path)
                {
                    $result = $basepath . '/' .$path;
                    if (is_file($result)) {
                        break (2);
                    }
                }
            }

            return $result;
        }

        return false;
    }
50904
public function getLocator($class)
    {
        $result = false;

        if(!false == $pos = strrpos($class, '\\'))
        {
            $namespace = substr($class, 0, $pos);

            if(isset($this->_namespaces[$namespace])) {
                $result = $this->_namespaces[$namespace];
            }
        }

        return $result;
    }
371307
public static function load($class)
    {
        if (substr($class, 0, 10) !== "Highlight\\") {
            return false;
        }

        $c = str_replace("\\", "/", substr($class, 10)) . ".php";
        $res = include __DIR__ . "/$c";

        return $res == 1 ? true : false;
    }
823992
private function findClassInPath($path, $class, $prefix)
    {
        if (!$path = realpath($path.'/'.strtr($prefix, '\\_', '//')) ?: realpath($path.'/'.dirname(strtr($prefix, '\\_', '//'))) ?: realpath($path)) {
            return array();
        }

        $classes = array();
        $filename = $class.'.php';
        foreach (new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($path, \RecursiveDirectoryIterator::SKIP_DOTS), \RecursiveIteratorIterator::LEAVES_ONLY) as $file) {
            if ($filename == $file->getFileName() && $class = $this->convertFileToClass($path, $file->getPathName(), $prefix)) {
                $classes[] = $class;
            }
        }

        return $classes;
    }
1278067
protected function getFilePath($class)
    {
        $filePath = '';

        $moduleFiles = Registry::getUtilsObject()->getModuleVar('aModuleFiles');
        if (is_array($moduleFiles)) {
            $basePath = getShopBasePath();
            foreach ($moduleFiles as $moduleId => $classPaths) {
                if (array_key_exists($class, $classPaths)) {
                    $moduleFilePath = $basePath . 'modules/' . $classPaths[$class];
                    if (file_exists($moduleFilePath)) {
                        $filePath = $moduleFilePath;
                    }
                }
            }
        }

        return $filePath;
    }
1226965
public function getPath($class)
    {
        if(!$this->__registry->has($class))
        {
            if(!$locator = $this->__registry->getLocator($class))
            {
                $locators = $this->getLocators();

                foreach($locators as $locator)
                {
                    if(false !== $path = $locator->locate($class))
                    {
                        $this->__registry->setLocator($class, $locator->getName());
                        break;
                    };
                }
            }
            else $path = $this->getLocator($locator)->locate($class);

            $this->__registry->set($class, $path);

        }
        else $path = $this->__registry->get($class);

        return $path;
    }
1152803
public function findClassFile($class,$baseDir = null)
    {
        $baseDir = is_null($baseDir) ? getcwd():$baseDir;

        $file = $this->mainLoader->findFile($class);
        if (is_file($file)) {
            $spl = PathUtil::createSplFileInfo($baseDir,$file);

            return $spl;
        }

        return false;
    }