Extension:Backup

From MediaWiki.org

Jump to: navigation, search
Manual on MediaWiki Extensions
List of MediaWiki Extensions
Backup

Release status: beta

Implementation Hook
Description
Author(s) Jean-Lou Dupont
Version 1.0.0
MediaWiki 1.10, 1.11
Download no link
See SVN ($Id: Backup.doc.wikitext 786 2007-09-16 19:34:52Z jeanlou.dupont $)
Hooks used

RecentChange_save
ArticleSaveComplete
ArticleDeleteComplete
ArticleDelete
SpecialMovepageAfterMove
ArticleProtectComplete
ImageDoDeleteBegin

Contents

[edit] Purpose

Defines a new hook 'backup' as a service to backup extensions.

[edit] Features

  • Page
    • Creation (done)
    • Update (done)
    • Delete (done)
    • Move (done)
    • Protection (done)
  • File
    • Upload (done)
    • Re-upload (done) (same as upload)
    • Delete (done)
    • Move (not allowed - hence, nothing to implement)
  • Log (done)

[edit] Usage

This extension is meant to serve other extensions. It is not meant to be used 'standalone'.

[edit] Theory Of Operation

Page change events are trapped and the corresponding 'Recent Change Identifier' (i.e. rc_id) field is attached to a 'backup_operation' object. Trapping is done through the 'RecentChange_save' hook. The 'revision' information is the critical information: every page change is associated with a unique 'revision id'.

When a complete 'backup_operation' is ready, the event 'backup' is fired (i.e. the hook 'backup' is called).

[edit] Dependancies



[edit] Installation

See the Mediawiki Extension table entry "download" above.[1]

[edit] LocalSettings.php

Extension:ExtensionManager: See footnote[2]

require_once( "$IP/extensions/Backup/Backup.php" );

[edit] PEAR

PEAR is a repository of software code.

pear channel-discover mediawiki.googlecode.com/svn
  • Install extension through PEAR:
pear install mediawiki/Backup
  • Add the following to LocalSettings.php[2][3]:
require 'MediaWiki/Backup/Backup.php';

[edit] Upgrades through PEAR

Sometimes, it is necessary to clear PEAR's cache in order to perform upgrades.

pear clear-cache

or use the force method:

pear upgrade --force mediawiki/Backup

[edit] PEAR Web Frontend

For easier remote package management, PEAR Frontend WEB can be installed. Installation notes can be found here. An example of the WEB frontend is available here.

[edit] RSS feed

To keep kept up-to-date with this channel, use the following RSS feedImage:Rss2.jpg.

[edit] Notes

[edit] Sandbox

You are invited in the author's sandbox to try-out some of his extensions.


  1. The most recent release is always available through the extension's PEAR and SVN repositories. This page is not necessarily up-to-date.
  2. 2.0 2.1 2.2 Extension:ExtensionManager does not require any modification to LocalSettings.php because ExtensionManager includes the extension.
    Note that if PHP code caching is in place (e.g. APC, eAccelerator), then to successfully complete the installation a cache flush might be needed.
  3. Modifications to LocalSettings.php is only necessary if not using Extension:ExtensionManager

process deletion in the NS_IMAGE namespace.

[edit] Article.php patch

MediaWiki by default purges the 'recent changes' table for entries related to a delete article/image. This behavior introduces some rather annoying side effects to this extension. A patched copy of Article.php can be downloaded from BizzWiki's repository.

[edit] Notes

[edit] Image

Upon deletion:

  • no 'ArticleDelete' event is fired.
  • recent changes table is cleared of any related entries
  • log entry is created

[edit] Revision Identifier

Verify that the 'revision id' information is safely trapped:

  • Page
    • Creation || ArticleSave || rev_id OK
    • Update || ArticleSave || rev_id OK
    • Delete || ArticleDeleteComplete || rev_id OK
    • Move || SpecialMovepageAfterMove || rev_id OK (set to latest ID of source title)
    • Protection || ArticleProtectComplete || rev_id OK
  • Log || RecentChange_save || rev_id *NOT NEEDED*
  • File
    • Upload || FileUpload || rev_id OK
    • Delete || ImageDoDeleteBegin || rev_id OK
    • Re-upload || FileUpload || (done) (same as upload)
    • Move (OK as it is not allowed anyway)

[edit] History

Personal tools
In other languages