public static function getResourcePath($path)
    {
        if (self::$importPaths === null) {
            self::$importPaths = self::explodeIncludePath();
        }

        $path = str_replace(array('\\', '/'), DIRECTORY_SEPARATOR, $path);

        foreach (self::$importPaths as $prefix) {
            $testPath = $prefix . DIRECTORY_SEPARATOR . $path;
            if (file_exists($testPath)) {
                return $testPath;
            }
        }

        // Check for the property phing.home
        $homeDir = self::getProperty(self::PHING_HOME);
        if ($homeDir) {
            $testPath = $homeDir . DIRECTORY_SEPARATOR . $path;
            if (file_exists($testPath)) {
                return $testPath;
            }
        }

        // Check for the phing home of phar archive
        if (strpos(self::$importPaths[0], 'phar://') === 0) {
            $testPath = self::$importPaths[0] . '/../' . $path;
            if (file_exists($testPath)) {
                return $testPath;
            }
        }

        // Do one additional check based on path of current file (Phing.php)
        $maybeHomeDir = realpath(__DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..');
        $testPath = $maybeHomeDir . DIRECTORY_SEPARATOR . $path;
        if (file_exists($testPath)) {
            return $testPath;
        }

        return null;
    }