Finds the path to the file where the Module class is defined.

@param string $class The name of the Module class

@return string|false The path if found, false otherwise
358993
public function findFile($class)
    {
        if (substr($class, -7) !== '\\Module') {
            return false;
        }

        $path = Normalizer::path($class, false) . '.php';
        foreach ($this->paths as $dir) {
            $file = $dir . $path;
            if (is_readable($file)) {
                return $file;
            }
        }

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

        return $file;
    }
1172233
public function loadClass($class)
    {
        if (!$file = $this->findFile($class)) {
            return;
        }
        if (!$this->patchable($class)) {
            include $file;
            return true;
        }
        return $this->loadFile($file, $class);
    }
1365761
public function getModule(string $class) : Module
    {
        foreach ($this->modules as $module) {
            if ($module instanceof $class) {
                return $module;
            }
        }

        throw new \InvalidArgumentException("No register module modules with class '%s'", get_class($class));
    }
666798
protected function findFileInApc($class)
    {
        if (false === $file = apc_fetch($this->apc_prefix . $class)) {
            apc_store($this->apc_prefix . $class, $file = $this->findFile($class));
        }

        return $file;
    }
786661
public function locate($class, $basepath = null)
    {
        $path = false;

        if($this->_loader) {
            $path = $this->_loader->findFile($class);
        }

        return $path;
    }
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);
            }
        }
    }
634070
public function findClass($class)
    {
        if (strrpos($class, '\\') !== false) {
            $file = Loaders\Psr4::getInstance()->findClass($class);
            if (!$file) {
                $file = Loaders\Psr0::getInstance()->findClass($class);
            }
        } else {
            $file = Loaders\Pear::getInstance()->findClass($class);
        }

        return $file;
    }
116618
public function autoload($class)
    {
        if ($this->_collectClasses) {
            $this->_arrLoadedClasses[self::$_scope][] = $class;
        }

	    $classFile = str_replace(' ', DIRECTORY_SEPARATOR, ucwords(str_replace('_', ' ', $class)));

	    if ($this->_isIncludePathDefined) {
            $classFile =  COMPILER_INCLUDE_PATH . DIRECTORY_SEPARATOR . $class;
        }

        $classFile.= '.php';

        if (stream_resolve_include_path($classFile)) {
            return include $classFile;
        }

        $classFile = ltrim($this->classToFile($class) . '.php', '\\/');
	    if (stream_resolve_include_path($classFile)) {
		    return include $classFile;
	    }

        return false;
    }
1361749
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) {
            return false;
        }

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

        // Search for Hack files if we are running on HHVM
        if ($file === null && defined('HHVM_VERSION')) {
            $file = $this->findFileWithExtension($class, '.hh');
        }

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

        return $file;
    }
1267762
public function load($class)
    {
        $result = false;

        //Get the path
        $path = $this->getPath( $class, $this->_base_path);

        if ($path !== false)
        {
            if (!in_array($path, get_included_files()) && file_exists($path))
            {
                require $path;

                if($this->_debug)
                {
                    if(!$this->isDeclared($class))
                    {
                        throw new RuntimeException(sprintf(
                            'The autoloader expected class "%s" to be defined in file "%s".
                            The file was found but the class was not in it, the class name
                            or namespace probably has a typo.', $class, $path
                        ));
                    }
                }
            }
            else $result = false;
        }

        return $result;
    }
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);
    }
1032941
public static function load($class)
    {
        $file = static::normalizePath($class);

        if (file_exists($path = __DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.$file))
        {
            require $path;

            return true;
        }

        foreach (static::$directories as $directory)
        {
            if (file_exists($path = $directory.DIRECTORY_SEPARATOR.$file))
            {
                require $path;

                return true;
            }
        }

        if (static::$aliases[$class])
        {
            class_alias(static::$aliases[$class], $class);

            return true;
        }
        
        return false;
    }
1116789
private function getResourcePathFromClassName($class)
    {
        $reflection = new \ReflectionClass($class);

        if (is_dir($dir = dirname($reflection->getFileName()).'/Resources/contao')) {
            return $dir;
        }

        return null;
    }
956583
public function loadClass( $class ) {

		//make sure the class name is absolute
		if ( 0 !== strpos( $class, '\\' ) )
			$class = '\\' . $class;

		// check if the namespace matches the class
		if ( 0 !== strpos( $class, $this->base_ns ) )
			return FALSE;

		// strip the base namespace from the beginning of the class name
		if ( $this->base_ns === substr( $class, 0, strlen( $this->base_ns ) ) )
			$class = substr( $class, strlen( $this->base_ns ) );

		$class = ltrim( $class, '\\' );
		$class = str_replace( '\\', '/', $class );
		$file = $this->base_dir . '/' . $class . '.php';

		return $this->file_loader->loadFile( $file );
	}
1036519
public function findPath($class, $basepath = null)
    {
        static $base;

        //Switch the base
        $base = $basepath ? $basepath : $base;

        if (!$this->_registry->offsetExists($base.'-'.(string) $class)) {
            $result = false;

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

            if (isset(self::$_prefix_map[$parts[0]])) {
                $result = self::$_adapters[self::$_prefix_map[$parts[0]]]->findPath($class, $basepath);

                if ($result !== false) {
                    //Get the canonicalized absolute pathname
                    $result = realpath($result);
                }
                $this->_registry->offsetSet($base.'-'.(string) $class, $result);
            }
        } else {
            $result = $this->_registry->offsetGet($base.'-'.(string)$class);
        }

        return $result;
    }
1321643
private static function findFile($class)
    {
        $namespace = substr($class, 0, strpos($class, '\\'));
        $filePath = substr($class, strlen($namespace)) . EXT;
        return strtr($namespace . $filePath, '\\', DIRECTORY_SEPARATOR);
    }