Skip to content

pdfsystems/backup-sdk

Repository files navigation

PDF Systems Backup SDK

Tests

Installation

You can install the package via composer, but first you need to add PDF's composer repository to your composer.json file:

{
    "repositories": [
        {
            "type": "composer",
            "url": "https://composer.pdfsystems.com"
        }
    ]
}

You can install the package via composer:

composer require pdfsystems/backup-sdk

Usage

Creating a Client

$client = new \Pdfsystems\BackupSdk\BackupClient('{Auth Token}');

Applications

List Applications

$client = new \Pdfsystems\BackupSdk\BackupClient('{Auth Token}');
$client->applications()->list();

Load Application

$client = new \Pdfsystems\BackupSdk\BackupClient('{Auth Token}');
$client->applications()->find(1);

Create Application

$client = new \Pdfsystems\BackupSdk\BackupClient('{Auth Token}');
$client->applications()->create(
    new \Pdfsystems\BackupSdk\Dtos\Application([
        'name' => 'My Application',
    ])
);

Update Application

$client = new \Pdfsystems\BackupSdk\BackupClient('{Auth Token}');
$application = $client->applications()->find(1);
$application->name = 'My Updated Application';
$client->applications()->update($application);

Backups

List Backups

$client = new \Pdfsystems\BackupSdk\BackupClient('{Auth Token}');
$client->backups()->list(); // All backups
$client->backups()->list(1); // Backups for a specific application
$client->backups()->list(1, 'database'); // Backups for a specific application + type

Load Backup

$client = new \Pdfsystems\BackupSdk\BackupClient('{Auth Token}');
$client->backups()->find(1);

Create Backup

$client = new \Pdfsystems\BackupSdk\BackupClient('{Auth Token}');
$file = new SplFileInfo('/path/to/file.ext');
$client->backups()->create(
    1,
    $file,
    [
        'field1' =>  'value1',
        'field2' =>  'value2',
    ],
    'database'
);

Update Backup

$client = new \Pdfsystems\BackupSdk\BackupClient('{Auth Token}');
$backup = $client->backups()->find(1);
$backup->name = 'My Updated Backup';
$client->backups()->update($backup);

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

About

SDK for interfacing with pdfsystems/backup

Resources

License

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published

Languages