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 stm32开发clion时遇到的编译问题
  • ¥15 lna设计 源简并电感型共源放大器
  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
  • ¥15 Vue3地图和异步函数使用
  • ¥15 C++ yoloV5改写遇到的问题
  • ¥20 win11修改中文用户名路径
  • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入
  • ¥15 用土力学知识进行土坡稳定性分析与挡土墙设计
  • ¥70 PlayWright在Java上连接CDP关联本地Chrome启动失败,貌似是Windows端口转发问题
  • ¥15 帮我写一个c++工程