Documentation

Restore
in package

Database restore and truncation operations.

Tags
since
3.0.0

Table of Contents

Methods

restoreFile()  : string
Restore the database from a file.
truncateUserDatabase()  : void
Truncate the database, remove all data belonging by the current user.
dropAllLwtTables()  : void
Drop all LWT tables to prepare for a clean restore.

Methods

restoreFile()

Restore the database from a file.

public static restoreFile(resource $handle, string $title[, bool $validateSql = true ]) : string
Parameters
$handle : resource

Backup file handle

$title : string

File title

$validateSql : bool = true

Whether to validate SQL statements (default true)

Tags
since
2.0.3-fork

Function was broken

since
2.5.3-fork

Function repaired

since
2.7.0-fork

$handle should be an uncompressed file.

since
2.9.1-fork

It can read SQL with more or less than one instruction a line

since
3.0.0

Added SQL validation for security hardening

Return values
string

Human-readable status message

truncateUserDatabase()

Truncate the database, remove all data belonging by the current user.

public static truncateUserDatabase() : void

Keep settings.

dropAllLwtTables()

Drop all LWT tables to prepare for a clean restore.

private static dropAllLwtTables() : void

This is needed to ensure migrations run on a clean slate and don't fail due to partial state from previous attempts.


        
On this page

Search results