src/ClassLoader.php
public static function getLibFileWithPath($className, $packageName = "")
    {
        if (!$className) {
            return;
        }

        if (isset(self::$classMap[$packageName . $className])) {
            return self::$classMap[$packageName . $className];
        }

        // search it in cache first
        $cacheKey = $className . "_path";
        if (extension_loaded('apc') ) {
            $filePath = apc_fetch($cacheKey);
            if ( $filePath !== null ) {
                return $filePath;
            }
        }
        
        $filePath = self::findClassFileOnCache($className);
        if ( $filePath !== null ) {
            return $filePath;
        }
        

        if (strpos($className, ".") > 0) {
            $className = str_replace(".", "/", $className);
        }

        $filePath = null;
        $classFile = $className . ".php";
        $classFile_0 = $className . ".php";
        // convert package name to path, add it to classfile
        $classFileIsFound = false;
        if ($packageName) {
            $path = str_replace(".", "/", $packageName);
            // check the leading char '@'
            $checkExtModule = true;
            if (strpos($path, '@') === 0) {
                $path = substr($path, 1);
                $checkExtModule = false;
            }

            // search in apphome/modules directory first, search in apphome/bin directory then
            $classFiles[0] = Openbizx::$app->getModulePath() . "/" . $path . "/" . $classFile;
            $classFiles[1] = OPENBIZ_APP_PATH . "/bin/" . $path . "/" . $classFile;
            if ($checkExtModule && defined('MODULE_EX_PATH')) {
                array_unshift($classFiles, MODULE_EX_PATH . "/" . $path . "/" . $classFile);
            }
            foreach ($classFiles as $classFile) {
                if (file_exists($classFile)) {
                    $filePath = $classFile;
                    $classFileIsFound = true;
                    break;
                }
            }
        }

        if (!$classFileIsFound) {
            $filePath = self::getCoreLibFilePath($className);
        }
        // cache it to save file search
        if ($filePath && extension_loaded('apc')) {
            apc_store($cacheKey, $filePath);
        }
        /* if (!file_exists($filePath)) {
          trigger_error("Cannot find the library file of $className", E_USER_ERROR);
          } */
        return $filePath;
    }
public static function getLibFileWithPath($className, $packageName = "")
    {
        if (!$className) {
            return;
        }

        if (isset(self::$classMap[$packageName . $className])) {
            return self::$classMap[$packageName . $className];
        }

        // search it in cache first
        $cacheKey = $className . "_path";
        if (extension_loaded('apc') ) {
            $filePath = apc_fetch($cacheKey);
            if ( $filePath !== null ) {
                return $filePath;
            }
        }
        
        $filePath = self::findClassFileOnCache($className);
        if ( $filePath !== null ) {
            return $filePath;
        }
        

        if (strpos($className, ".") > 0) {
            $className = str_replace(".", "/", $className);
        }

        $filePath = null;
        $classFile = $className . ".php";
        $classFile_0 = $className . ".php";
        // convert package name to path, add it to classfile
        $classFileIsFound = false;
        if ($packageName) {
            $path = str_replace(".", "/", $packageName);
            // check the leading char '@'
            $checkExtModule = true;
            if (strpos($path, '@') === 0) {
                $path = substr($path, 1);
                $checkExtModule = false;
            }

            // search in apphome/modules directory first, search in apphome/bin directory then
            $classFiles[0] = Openbizx::$app->getModulePath() . "/" . $path . "/" . $classFile;
            $classFiles[1] = OPENBIZ_APP_PATH . "/bin/" . $path . "/" . $classFile;
            if ($checkExtModule && defined('MODULE_EX_PATH')) {
                array_unshift($classFiles, MODULE_EX_PATH . "/" . $path . "/" . $classFile);
            }
            foreach ($classFiles as $classFile) {
                if (file_exists($classFile)) {
                    $filePath = $classFile;
                    $classFileIsFound = true;
                    break;
                }
            }
        }

        if (!$classFileIsFound) {
            $filePath = self::getCoreLibFilePath($className);
        }
        // cache it to save file search
        if ($filePath && extension_loaded('apc')) {
            apc_store($cacheKey, $filePath);
        }
        /* if (!file_exists($filePath)) {
          trigger_error("Cannot find the library file of $className", E_USER_ERROR);
          } */
        return $filePath;
    }
Get openbiz library php file path by searching modules/package, /bin/package and /bin

@param string $className
@return string php library file path