public static function getUri($keyOrFiles, $opts = array())
    {
        $opts = array_merge(array( // default options
            'farExpires' => true,
            'debug' => false,
            'charset' => 'UTF-8',
            'minAppUri' => '/min',
            'rewriteWorks' => true,
            'groupsConfigFile' => self::app()->groupsConfigPath,
        ), $opts);

        $h = new self;
        $h->minAppUri = $opts['minAppUri'];
        $h->rewriteWorks = $opts['rewriteWorks'];
        $h->groupsConfigFile = $opts['groupsConfigFile'];

        if (is_array($keyOrFiles)) {
            $h->setFiles($keyOrFiles, $opts['farExpires']);
        } else {
            $h->setGroup($keyOrFiles, $opts['farExpires']);
        }
        $uri = $h->getRawUri($opts['farExpires'], $opts['debug']);

        return htmlspecialchars($uri, ENT_QUOTES, $opts['charset']);
    }