public static function getCache($name)
    {
        $cache_file = self::getCacheName($name);
        if (file_exists($cache_file) && ($content = file_get_contents($cache_file))) {
            $data = unserialize($content);
            if (isset($data['expired']) && (intval($data['expired']) === 0 || intval($data['expired']) >= time())) {
                return $data['value'];
            }
            self::delCache($name);
        }
        return null;
    }
public static function getCache($name)
    {
        $cache_file = self::getCacheName($name);
        if (file_exists($cache_file) && ($content = file_get_contents($cache_file))) {
            $data = unserialize($content);
            if (isset($data['expired']) && (intval($data['expired']) === 0 || intval($data['expired']) >= time())) {
                return $data['value'];
            }
            self::delCache($name);
        }
        return null;
    }
public static function getCache ( $ name ) { $ cache_file = self :: getCacheName ( $ name ) ; if ( file_exists ( $ cache_file ) && ( $ content = file_get_contents ( $ cache_file ) ) ) { $ data = unserialize ( $ content ) ; if ( isset ( $ data [ 'expired' ] ) && ( intval ( $ data [ 'expired' ] ) === 0 || intval ( $ data [ 'expired' ] ) >= time ( ) ) ) { return $ data [ 'value' ] ; } self :: delCache ( $ name ) ; } return null ; }
获取缓存内容
@param string $name 缓存名称
@return null|mixed
获取缓存内容