dougu5950 2012-11-26 20:05
浏览 51
已采纳

使用PHP从MediaWiki数据库中提取压缩文本

A client of ours would like to have all the contents from a wiki site they ran for a while. They provided us the complete database of the 'mediawiki' software. We are trying to extract the articles from the 'text' table with php, without using the MediaWiki engine.

MediaWiki seems to zip the contents before putting it as a BLOB in the database. We can't find a way to extract it without the engine. I looked at the source code, but can't recreate how they extract the BLOB's.

Any suggestions how solve this?

  • 写回答

2条回答 默认 最新

  • douxuan3095 2012-11-26 20:15
    关注

    From Text table:

    old_flags 

    Comma-separated list of flags. Contains the following possible values:

    ┌──────────┬──────────────────────────────────────────────────────────────────┐
    │ gzip     │ Text is compressed with PHP's gzdeflate() function.              │
    │          │ Note: If the $wgCompressRevisions option is on, new rows         │
    │          │ (=current revisions) will be gzipped transparently at save time. │
    │          │ Previous revisions can also be compressed by using the script    │
    │          │ compressOld.php                                                  │
    ├──────────┼──────────────────────────────────────────────────────────────────┤
    │ utf-8    │ Text was stored as UTF-8.                                        │
    │          │ Note: If the $wgLegacyEncoding option is on, rows *without* this │
    │          │ flag will be converted to UTF-8 transparently at load time.      │
    ├──────────┼──────────────────────────────────────────────────────────────────┤
    │ object   │ Text field contained a serialized PHP object.                    │
    │          │ Note: The object either contains multiple versions compressed    │
    │          │ together to achieve a better compression ratio, or it refers to  │
    │          │ another row where the text can be found.                         │
    ├──────────┼──────────────────────────────────────────────────────────────────┤
    │ external │ Text was stored in an external location specified by old_text    │
    └──────────┴──────────────────────────────────────────────────────────────────┘
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 求京东批量付款能替代天诚
  • ¥15 slaris 系统断电后,重新开机后一直自动重启
  • ¥15 51寻迹小车定点寻迹
  • ¥15 谁能帮我看看这拒稿理由啥意思啊阿啊
  • ¥15 关于vue2中methods使用call修改this指向的问题
  • ¥15 idea自动补全键位冲突
  • ¥15 请教一下写代码,代码好难
  • ¥15 iis10中如何阻止别人网站重定向到我的网站
  • ¥15 滑块验证码移动速度不一致问题
  • ¥15 Utunbu中vscode下cern root工作台中写的程序root的头文件无法包含