Difference between revisions of "Extension:Backup.php"
(interface to backup.pl) |
(comments for execute() todo) |
||
| Line 35: | Line 35: | ||
global $wgOut; | global $wgOut; | ||
$title = Title::makeTitle(NS_SPECIAL,'Backups'); | $title = Title::makeTitle(NS_SPECIAL,'Backups'); | ||
| − | + | ||
| − | + | # create a sortable table for all wiki's found and accessible in mysql | |
| − | + | # - each row has: name,domains,dir,db,prefix,active,backup-hrs,delete,backup,version | |
| − | + | ||
| − | + | # create a sortable table of all backup files | |
| − | + | # - each row has same cols as above +backup-filename -backup -delete | |
| − | + | ||
| + | # add list of backup.pl job queue (and link to MW log of completed items) | ||
| + | |||
} | } | ||
Revision as of 09:25, 9 June 2007
<?php
- Extension:Backups
- - Licenced under LGPL (http://www.gnu.org/copyleft/lesser.html)
- - Author: User:NadCategory:Extensions created with Template:SpecialPage
- - Started: 2007-06-09
- - This is a SpecialPage which acts as an in-wiki interface to backup.pl which reduces the backup/compress/distribute queue
if (!defined('MEDIAWIKI')) die('Not an entry point.');
define('BACKUPS_VERSION','0.0.0, 2007-06-09');
$wgExtensionFunctions[] = 'wfSetupBackups';
$wgExtensionCredits['specialpage'][] = array( 'name' => 'Special:Backups', 'author' => 'User:Nad', 'description' => 'A special page for backing up and restoring multiple wikis on a server', 'url' => 'http://www.organicdesign.co.nz/Extension:Backup_&_Restore', 'version' => BACKUPS_VERSION );
require_once "$IP/includes/SpecialPage.php";
- Define a new class based on the SpecialPage class
class SpecialBackups extends SpecialPage {
# Constructor function SpecialSearchLog() { SpecialPage::SpecialPage('Backups','sysop'); }
# Override SpecialPage::execute() # - $param is from the URL, eg Special:Backups/param function execute($param) { global $wgOut; $title = Title::makeTitle(NS_SPECIAL,'Backups');
# create a sortable table for all wiki's found and accessible in mysql # - each row has: name,domains,dir,db,prefix,active,backup-hrs,delete,backup,version
# create a sortable table of all backup files # - each row has same cols as above +backup-filename -backup -delete
# add list of backup.pl job queue (and link to MW log of completed items)
}
}
- Called from $wgExtensionFunctions array when initialising extensions
function wfSetupBackups() { global $wgLanguageCode,$wgMessageCache;
# Add the messages used by the specialpage if ($wgLanguageCode == 'en') { $wgMessageCache->addMessages(array( 'backups' => 'Backup & restore wikis', 'exampleMessage' => "Example message: $1", )); }
# Add the specialpage to the environment SpecialPage::addPage(new SpecialBackups()); } ?>



