Release status: beta
|License||No license specified|
See SVN ($Id: Backup.doc.wikitext 786 2007-09-16 19:34:52Z jeanlou.dupont $)
Translate the Backup extension if it is available at translatewiki.net
|Check usage and version matrix; code metrics|
Purpose[edit | edit source]
Defines a new hook 'backup' as a service to backup extensions.
Features[edit | edit source]
- Creation (done)
- Update (done)
- Delete (done)
- Move (done)
- Protection (done)
- Upload (done)
- Re-upload (done) (same as upload)
- Delete (done)
- Move (not allowed - hence, nothing to implement)
- Log (done)
Usage[edit | edit source]
This extension is meant to serve other extensions. It is not meant to be used 'standalone'.
Theory Of Operation[edit | edit source]
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).
Dependencies[edit | edit source]
- StubManager extension
- (optional) patched Article.php
- (optional but strongly recommended) Extension:ImagePageEx
See the Mediawiki Extension table entry "download" above.
Extension:ExtensionManager: See footnote
- 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):
- Since this Extensions is depending on StubManager, add the line after the StubManager include, or else your Wiki won't work.
pear channel-discover mediawiki.googlecode.com/svn
pear install mediawiki/Backup
pear upgrade pear
Upgrades through PEAR
Sometimes, it is necessary to clear PEAR's cache in order to perform upgrades.
or use the force method:
pear upgrade --force mediawiki/Backup
PEAR Web Frontend
To keep up-to-date with this channel, use the following RSS feed__.
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.
- 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.
Article.php patch[edit | edit source]
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.
Notes[edit | edit source]
Image[edit | edit source]
- no 'ArticleDelete' event is fired.
- recent changes table is cleared of any related entries
- log entry is created
Revision Identifier[edit | edit source]
Verify that the 'revision id' information is safely trapped:
- 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*
- 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)