Reader
in package
The backup reader class that reads backups from the backup directory.
Tags
Table of Contents
- $_dir : string
- Backup directory.
- __construct() : mixed
- Constructor.
- listBackups() : Iterator
- Returns the available user backups.
- restore() : array<string|int, Collection>
- Returns user data from backups.
- _buildCollections() : array<string|int, Collection>
- Builds a list of object collections from any Horde_Compress backend.
- _getBackupFiles() : array<string|int, mixed>
- Builds a backup iterator for individual users.
- _restoreFromTar() : array<string|int, Collection>
- Restores user data from a TAR file.
- _restoreFromZip() : array<string|int, Collection>
- Restores user data from a ZIP file.
Properties
$_dir
Backup directory.
protected
string
$_dir
Methods
__construct()
Constructor.
public
__construct(string $directory) : mixed
Parameters
- $directory : string
-
Backup directory.
Return values
mixed —listBackups()
Returns the available user backups.
public
listBackups() : Iterator
Return values
Iterator —A list of user backups.
restore()
Returns user data from backups.
public
restore([array<string|int, mixed> $applications = array() ][, array<string|int, mixed> $users = array() ]) : array<string|int, Collection>
Parameters
- $applications : array<string|int, mixed> = array()
-
A list of applications to restore. Defaults to all backups.
- $users : array<string|int, mixed> = array()
-
A list of users to restore. Defaults to all backups.
Return values
array<string|int, Collection> —All restored object collections.
_buildCollections()
Builds a list of object collections from any Horde_Compress backend.
protected
_buildCollections(array<string|int, mixed> $files, array<string|int, mixed> $applications, string $contents, string $user, callable $factory) : array<string|int, Collection>
Parameters
- $files : array<string|int, mixed>
-
Archive info from Horde_Compress.
- $applications : array<string|int, mixed>
-
A list of applications to restore. Defaults to all backups.
- $contents : string
-
The archive file contents.
- $user : string
-
A user name.
- $factory : callable
-
A factory for iterators that are passed to \Horde\Backup\Collection.
Return values
array<string|int, Collection> —All restored object collections.
_getBackupFiles()
Builds a backup iterator for individual users.
protected
_getBackupFiles(array<string|int, mixed> $users) : array<string|int, mixed>
Parameters
- $users : array<string|int, mixed>
-
A list of users.
Return values
array<string|int, mixed> —A list of backup files.
_restoreFromTar()
Restores user data from a TAR file.
protected
_restoreFromTar(string $file, array<string|int, mixed> $applications) : array<string|int, Collection>
Parameters
- $file : string
-
Pathname to a TAR backup file.
- $applications : array<string|int, mixed>
-
A list of applications to restore. Defaults to all backups.
Return values
array<string|int, Collection> —All restored object collections.
_restoreFromZip()
Restores user data from a ZIP file.
protected
_restoreFromZip(string $file, array<string|int, mixed> $applications) : array<string|int, Collection>
Parameters
- $file : string
-
Pathname to a ZIP backup file.
- $applications : array<string|int, mixed>
-
A list of applications to restore. Defaults to all backups.
Return values
array<string|int, Collection> —All restored object collections.