Finds the path to the file where the class is defined.
@param string $class The name of the class
@return string|false The path if found, false otherwise
183399
public function findFile(string $class)
    {
        // work around for PHP 5.3.0 - 5.3.2 https://bugs.php.net/50731
        if ('\\' === $class[0]) {
            $class = (string)\substr($class, 1);
        }

        // class map lookup
        if (isset($this->classMap[$class])) {
            return $this->classMap[$class];
        }

        $file = $this->findFileWithExtension($class, '.php');

        if (false === $file) {
            // Remember that this class does not exist.
            $this->missingClasses[$class] = true;
        }

        return $file;
    }
214960
public function findFile($class)
    {
        if (false === $file = apc_fetch($this->prefix.$class)) {
            apc_store($this->prefix.$class, $file = $this->decorated->findFile($class));
        }

        return $file;
    }
825838
public function loadClass($class)
    {
        $prefix = $class;

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

            $mappedFile = $this->_loadMappedFile($prefix, $relativeClass);
            if ($mappedFile) {
                return $mappedFile;
            }

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

        return false;
    }
440773
public static function loadClass($class) {
    	
        //The current namespace prefix
        $prefix = $class;

        //Work backwards through the namespace names of the fully-qualified class name to find a mapped file name
        while(false !== $pos = strrpos($prefix, '\\')) {

            //Retain the trailing namespace separator in the prefix
            $prefix = substr($class, 0, $pos + 1);

            //The rest is the relative class name
            $relative_class = substr($class, $pos + 1);

            //Try to load a mapped file for the prefix and relative class
            $mapped_file = static :: loadMappedFile($prefix, $relative_class);

            if(false !== $mapped_file) {
                return $mapped_file;
            }

            //Remove the trailing namespace separator for the next iteration of strrpos()
            $prefix = rtrim($prefix, '\\');
        }

        //Never found a mapped file
        return false;
    }
687008
public static function getExterior($class = '') {
        $path = ROOT_DIR . DS . 'server' . DS . "config" . DS . $class . '.json';
        if (is_file($path)) {
            C($class, get_json($path, true, true));
            return C($class);
        } else {
            return false;
        }
    }
1225971
private function get_file_name_from_class( $class ) {
		if ( 'classmap' === static::$autoload_type ) {
			$filtered_class_name = explode( '\\', $class );
			$class_filename      = end( $filtered_class_name );
			$class_filename      = str_replace( '_', '-', $class_filename );

			return static::$filename_prefix . $class_filename . '.php';
		} else {

			return $this->psr4_get_file_name_from_class( $class );
		}
	}
615509
public function toClassPath($class)
    {
        $parts = explode(self::ROUTE_SYNTAX_DELIMITER, $class);

        $module = $parts[0];
        unset($parts[0]);

        $path = sprintf('/%s/%s/%s', $module, self::ROUTE_CONTROLLER_DIR, implode('/', $parts));

        return $path;
    }
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;
    }
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;
    }
1019568
public function findFile(string $class)
    {
        static $isAllowedFilter = null, $isProduction = false;
        if (!$isAllowedFilter) {
            $isAllowedFilter = $this->fileEnumerator->getFilter();
            $isProduction    = !$this->options['debug'];
        }

        $file = $this->original->findFile($class);

        if ($file !== false) {
            $file = PathResolver::realpath($file)?:$file;
            $cacheState = $this->cacheState[$file] ?? null;
            if ($cacheState && $isProduction) {
                $file = $cacheState['cacheUri'] ?: $file;
            } elseif ($isAllowedFilter(new \SplFileInfo($file))) {
                // can be optimized here with $cacheState even for debug mode, but no needed right now
                $file = FilterInjectorTransformer::rewrite($file);
            }
        }

        return $file;
    }
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;
    }
97889
private function locateFile($class)
    {
        if (false !== $pos = strrpos($class, '\\')) {
            $namespace = substr($class, 0, $pos);
            $className = substr($class, $pos + 1);
            $normalized = str_replace('\\', DIRECTORY_SEPARATOR, $namespace) .
                DIRECTORY_SEPARATOR .
                str_replace('_', DIRECTORY_SEPARATOR, $className) .
                '.php';

            foreach ($this->namespaces as $space => $paths) {
                if (strpos($namespace, $space) !== 0) {
                    continue;
                }

                foreach ($paths as $path) {
                    $file = $path . DIRECTORY_SEPARATOR . $normalized;

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

                    // Attempt to handle paths that end with the *vendor* name.
                    $file = $path . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . $normalized;
                    if (is_file($file)) {
                        return $file;
                    }
                }
            }

        } else {
            $normalized = str_replace('_', DIRECTORY_SEPARATOR, $class) . '.php';
            foreach ($this->pearPrefixes as $prefix => $paths) {
                if (0 !== strpos($class, $prefix)) {
                    continue;
                }

                foreach ($paths as $path) {
                    $file = $path . DIRECTORY_SEPARATOR . $normalized;
                    if (is_file($file)) {
                        return $file;
                    }
                }
            }
        }
    }
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);
    }
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;
    }
336984
protected static function find_core_class($class)
	{
		foreach (static::$core_namespaces as $ns)
		{
			if (array_key_exists(strtolower($ns_class = $ns.'\\'.$class), static::$classes))
			{
				return $ns_class;
			}
		}

		return false;
	}
610625
public function load($class)
    {
        if ($this->psr0 and $this->loadPsr0($class)) {
            return true;
        }
        $namespace = '\\';
        $classPath = str_replace('\\', '/', $class) . '.php';
        while (true) {
            if ($this->loadFrom($classPath, $namespace)) {
                return true;
            }
            $pos = strpos($classPath, '/');
            if ($pos === false) {
                if (! $this->psr0) {
                    break;
                }
                $pos = strpos($classPath, '_');
                if ($pos === false) {
                    break;
                }
            }
            $namespace = rtrim($namespace, '\\') . '\\' . substr($classPath, 0, $pos);
            $classPath = substr($classPath, $pos + 1);
        }
        return false;
    }
555657
public function load($class)
    {
        if ($class[0] == '\\') $class = substr($class, 1);
        $class = str_replace(array('\\', '_'), DIRECTORY_SEPARATOR, $class).'.php';

        foreach ($this->directories as $directory)
        {
            if (file_exists($path = $directory.DIRECTORY_SEPARATOR.$class))
            {
                require_once $path;
                return true;
            }
        }
        return false;
    }