Extension:Backup
From MediaWiki.org
|
Release status: beta |
|||
|---|---|---|---|
| Implementation | Hook | ||
| Description | |||
| Author(s) | Jean-Lou Dupont | ||
| Last Version | 1.0.0 | ||
| MediaWiki | 1.10, 1.11 | ||
| License | No license specified | ||
| Download | no link See SVN ($Id: Backup.doc.wikitext 786 2007-09-16 19:34:52Z jeanlou.dupont $) |
||
|
|||
|
check usage (experimental) |
|||
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] Dependencies
- StubManager extension
- (optional) patched Article.php
- (optional but strongly recommended) Extension:ImagePageEx
[edit] Installation
See the Mediawiki Extension table entry "download" above.[1]
[edit] LocalSettings.php
Extension:ExtensionManager: See footnote[2]
- Add the following to LocalSettings.php if the extension was downloaded from Jean-Lou Dupont's MediaWiki SVN directory (link in the download entry of the table above)[2]:
require_once( "$IP/extensions/Backup/Backup.php" );
[edit] PEARPEAR is a repository of en:PHP software code.
require 'MediaWiki/Backup/Backup.php';
[edit] Upgrades through PEARSometimes, it is necessary to clear PEAR's cache in order to perform upgrades.
or use the force method:
[edit] PEAR Web FrontendFor 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 feed__
.
[edit] Notes
[edit] Other Extensions From the same author
Consult User Jldupont's page.
- ↑ The most recent release is always available through the extension's PEAR and SVN repositories. This page is not necessarily up-to-date.
- ↑ 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. - ↑ Modifications to
LocalSettings.phpis only necessary if not using Extension:ExtensionManager
- If desired, an updated 'includes/Article.php' file can be installed. See Extension:Backup#Article.php patch.
- If desired but strongly recommended, Extension:ImagePageEx should be installed in order to properly
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)