Get the path based on a class name

@param  string		  	The class name
@return string|false		Returns the path on success FALSE on failure
325430
public function findPath($classname, $basepath = null)
    {
        $path = false;

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

        if (array_shift($parts) == 'plg') {
            //Switch the basepath
            if (!empty($basepath)) {
                $this->_basepath = $basepath;
            }

            $type = array_shift($parts);

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

            //Plugins can have their own folder
            if (is_file($this->_basepath.'/plugins/'.$type.'/'.$path.'/'.$path.'.php')) {
                $path = $this->_basepath.'/plugins/'.$type.'/'.$path.'/'.$path.'.php';
            } else {
                $path = $this->_basepath.'/plugins/'.$type.'/'.$path.'.php';
            }
        }

        return $path;
    }
1159757
private function getClassNameByPath($path)
	{
		foreach ($this->map as $key => $value) {
			if ($value === $path) {
				return $key;
			}
		}
		
		return null;
	}
913699
public function path($name, $folder = false)
    {

        // the current namespace prefix
        $prefix = $name;

        // 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($name, 0, $pos + 1);

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

            // try to load a mapped file for the prefix and relative class
            $mapped_file = $this->loadMappedFile($prefix, $relative_class, $folder);
            if ($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;
    }
337100
protected function getPath($name) {
		$path = [];
		$matches = null;
		preg_match('/^([^\[]+)/', $name, $matches);
		$path[] = $matches[0];
		preg_match_all('/\[([^\]]*)\]/', $name, $matches);
		$path = array_merge($path, $matches[1]);

		return $path;
	}
783276
protected function classFile($className)
	{
		$classFile = preg_replace('#[_\\\]#', '/', $className).'.php';

		foreach ($this->_paths as $path)
		{
			$classPath = "$path/$classFile";
			if (file_exists($classPath))
			{
				return $classPath;
			}
		}
	}
866943
public function getRelativePathForFutureClass(string $className)
    {
        $path = $this->autoloaderUtil->getPathForFutureClass($className);

        return null === $path ? null : $this->relativizePath($path);
    }
1098201
public function getPathForFutureClass(string $className)
    {
        $classLoader = $this->getClassLoader();

        // lookup is obviously modeled off of Composer's autoload logic
        foreach ($classLoader->getPrefixesPsr4() as $prefix => $paths) {
            if (0 === strpos($className, $prefix)) {
                return $paths[0].'/'.str_replace('\\', '/', substr($className, \strlen($prefix))).'.php';
            }
        }

        foreach ($classLoader->getPrefixes() as $prefix => $paths) {
            if (0 === strpos($className, $prefix)) {
                return $paths[0].'/'.str_replace('\\', '/', $className).'.php';
            }
        }

        if ($classLoader->getFallbackDirsPsr4()) {
            return $classLoader->getFallbackDirsPsr4()[0].'/'.str_replace('\\', '/', $className).'.php';
        }

        if ($classLoader->getFallbackDirs()) {
            return $classLoader->getFallbackDirs()[0].'/'.str_replace('\\', '/', $className).'.php';
        }

        return null;
    }
280711
protected static function getFilePath($name)
  {
    $path = str_replace("_", DIRECTORY_SEPARATOR, $name);
    $path = str_replace(__CLASS__, dirname(__FILE__), $path);

    return $path;
  }
4802
public function getPath($module)
    {
        // treat $module as a namespace
        $class = $module."\\SlenderModule";

        // Try to find class for path
        if (class_exists($class) ) {
            $reflector = new \ReflectionClass($class);
            $interfaces = $reflector->getInterfaceNames();
            if (is_string($interfaces)) {
                $interfaces = array($interfaces);
            }
            if (in_array('Slender\Interfaces\ModulePathProviderInterface',$interfaces)) {
                return call_user_func(array($class,'getModulePath'));
            }
        }

        // Give up
        return false;
    }
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 );
	}
1188649
public static function getPath($class)
    {
        if (strncmp('HTMLPurifier', $class, 12) !== 0) {
            return false;
        }
        // Custom implementations
        if (strncmp('HTMLPurifier_Language_', $class, 22) === 0) {
            $code = str_replace('_', '-', substr($class, 22));
            $file = 'HTMLPurifier/Language/classes/' . $code . '.php';
        } else {
            $file = str_replace('_', '/', $class) . '.php';
        }
        if (!file_exists(HTMLPURIFIER_PREFIX . '/' . $file)) {
            return false;
        }
        return $file;
    }
281885
public function findPath($classname, $basepath = null)
    {
        $path = false;

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

        // If class start with a 'An' it is a anahita framework class and we handle it
        if (array_shift($parts) == $this->_prefix) {
            $path = strtolower(implode('/', $parts));

            if (count($parts) == 1) {
                $path = $path.'/'.$path;
            }

            if (!is_file($this->_basepath.'/'.$path.'.php')) {
                $path = $path.'/'.strtolower(array_pop($parts));
            }

            $path = $this->_basepath.'/'.$path.'.php';
        }

        return $path;
    }
286123
private function getClass($value)
    {
        if (! is_object($value) && ! is_string($value)) {
            return false;
        }

        if (is_object($value)) {
            $value = get_class($value);
        }

        return ltrim($value, '\\');
    }
1117900
public function findClass($class) {
        $this->init();

        $fullQualifiedNamespace = $this->trimNamespace($class);

        foreach ($this->localCache as $phpClass) {
            if ($fullQualifiedNamespace === $phpClass->getFullQualifiedNamespace()) {
                return $phpClass;
            }
        }

        return false;
    }
536706
public function findFile($class) {
		if ('\\' === $class[0]) {
			$class = substr($class, 1);
		}

		if (isset($this->classMap[$class])) {
			return $this->classMap[$class];
		}
		elseif ($this->classMapAuthoratative) {
			return false;
		}

		$classPath = $this->getClassPath($class);

		foreach ($this->prefixes as $prefix => $dirs) {
			if (0 === strpos($class, $prefix)) {
				foreach ($dirs as $dir) {
					if (file_exists($dir.DIRECTORY_SEPARATOR.$classPath)) {
						return $dir.DIRECTORY_SEPARATOR.$classPath;
					}
				}
			}
		}

		foreach ($this->fallbackDirs as $dir) {
			if (file_exists($dir.DIRECTORY_SEPARATOR.$classPath)) {
				return $dir.DIRECTORY_SEPARATOR.$classPath;
			}
		}

		if ($this->useIncludePath && $file = self::resolveIncludePath($classPath)) {
			return $file;
		}

		return $this->classMap[$class] = false;
	}
370571
public function load($className)
    {
        $this->_classFilename = $className . '.php';
        $this->_includePaths  = explode(PATH_SEPARATOR, get_include_path());
        $classFound           = null;

        if(strpos($this->_classFilename, '\\') !== false)
        {
            $classFound = $this->searchForBackslashNamespacedClass();
        }
        elseif(strpos($this->_classFilename, '_') !== false)
        {
            $classFound = $this->searchForUnderscoreNamespacedClass();
        }
        else
        {
            $classFound = $this->searchForNonNamespacedClass();
        }

        return $classFound;
    }
1230538
public static function getLocalPath()
    {
        //====================================================================//
        // Safety Check => Verify Local Class is Valid
        if (null == self::local()) {
            return null;
        }
        //====================================================================//
        // Create A Reflection Class of Local Class
        $reflector = new \ReflectionClass(get_class(self::local()));
        //====================================================================//
        // Return Class Local Path
        return dirname((string) $reflector->getFileName());
    }