SofaDoc

SofaDoc Map Usage

inc/backup.php

Provides functions to backup code and data.
The functions are used by Special:Backup and Special:Snapshot
There is no restore function yet. You would have to combine the extractions manually actually.

Functions

swBackup($sitebackup,$logbackup,$revisionbackup,$filebackup,$listing=false)

Saves files from the site folder to the bak folder.
It saves only the original files and not the index files, because the latter can be reconstructed.
As there are many files, zip files are created in batches.
@param $sitebackup Saves configuration.php and function and skins folder as site.zip and siteYYYYMMDD.zip.
@param $logbackup Saves monthly log files as logs-YY-MM.zip.
@param $revisionbackup Saves thousand revisions as revisions-N000.zip.
@param $filebackup Saves hundred files from site/files as files-N00.zip.
@param $listing Shows listing of files.

swSnapShot($username)

Saves the current source code in the inc folder and the index.php and the api.php file as zip file and creates a image page.
There is a snapshot.zip, a versioned snapshotVERSION.zip and a timed snapshotYYYYmmdd.zip.
The snapshots are saved to the site/files folder and image pages are created for them.
One snapshot is also saved to the bak folder.
Snapshots use the zip.php code. Something prevents MacOS to open them directly in the finder.
However, you can decompress it using the unzip command in the Terminal.
@param $username The username is used to create the Image pages for the snapshots.

swExport($revisions)

Saves a list of revisions to a zip file.
The Zip file is saved to the bak folder. The result returns a link to the file.
@param $revisions Array of revision numbers

Used elements

Classes

ZipArchive, swRecord, swWiki

Functions

swGetLastRevision, swSemaphoreRelease, swSemaphoreSignal

Globals

$swRoot, $swVersion

Variables

$absolutedir, $currentmonth, $currentthousand, $emptydirectories, $file, $file2, $filebackup, $filename, $filename2, $filename3, $files, $formats, $includeddirectories, $list, $listing, $logbackup, $month, $record, $result, $revisionbackup, $revisions, $sitebackup, $thousand, $today, $username, $wiki, $wikiname, $zipfile, $ziptest

Short variables: $dir, $f, $fd, $fn, $fn2, $out, $r, $url, $zf, $zip

Features

array, file, str, string, time