APlayer_Plugin::getlrc PHP Method

getlrc() private static method

通过url获取歌词内容,若缓存存在就直接读取缓存
private static getlrc ( string $url ) : boolean | string
$url string
return boolean | string
    private static function getlrc($url)
    {
        $key = 'lrc_' . md5($url);
        if ($g = self::cache_get($key)) {
            if (!isset($g[0])) {
                return false;
            }
            return $g[0];
        } else {
            //缓存不存在时用url获取并存入缓存
            $lyric = self::fetch_url($url);
            //用array包裹这个变量就不会判断错误啦
            self::cache_set($key, array($lyric));
            return $lyric;
        }
    }