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条)

报告相同问题?

悬赏问题

  • ¥60 fail to initialize keyboard hotkeys through kernel.0000000000
  • ¥30 ppOCRLabel导出识别结果失败
  • ¥15 Centos7 / PETGEM
  • ¥15 csmar数据进行spss描述性统计分析
  • ¥15 各位请问平行检验趋势图这样要怎么调整?说标准差差异太大了
  • ¥15 delphi webbrowser组件网页下拉菜单自动选择问题
  • ¥15 wpf界面一直接收PLC给过来的信号,导致UI界面操作起来会卡顿
  • ¥15 init i2c:2 freq:100000[MAIXPY]: find ov2640[MAIXPY]: find ov sensor是main文件哪里有问题吗
  • ¥15 运动想象脑电信号数据集.vhdr
  • ¥15 三因素重复测量数据R语句编写,不存在交互作用