Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
lewislarsen committed Aug 13, 2024
1 parent 85daaad commit ce7df70
Show file tree
Hide file tree
Showing 33 changed files with 5,780 additions and 372 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/code-style.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Code Style

on: [push, pull_request]

jobs:
pint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
- name: Install dependencies
run: composer install --prefer-dist --no-progress
- name: Check code style
run: composer pint:test
32 changes: 32 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Tests

on: [push, pull_request]

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ['8.0', '8.1', '8.2', '8.3']
name: PHP ${{ matrix.php-versions }} Test
steps:
- uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, dom, fileinfo, mysql
coverage: xdebug
- name: Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache composer dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install Composer dependencies
run: composer install --no-progress --prefer-dist --optimize-autoloader
- name: Run Tests
run: vendor/bin/pest
83 changes: 83 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# Composer dependencies
/vendor/

# Composer auth file
auth.json

# PHPUnit
.phpunit.result.cache
.phpunit.cache

# PHP-CS-Fixer
.php_cs
.php_cs.cache
.php-cs-fixer.cache

# PHPStan
phpstan.neon

# IDE and editor files
.idea/
.vscode/
*.sublime-project
*.sublime-workspace

# OS generated files
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db

# Logs and databases
*.log
*.sql
*.sqlite

# Build files
build/

# Environment files
.env
.env.*
!.env.example

# Temporary files
*.tmp
*.swp
*.swo

# Backup files
*.bak
*.gho
*.ori
*.orig

# Cache files
*.cache

# Compiled source
*.com
*.class
*.dll
*.exe
*.o
*.so

# Packages
*.7z
*.dmg
*.gz
*.iso
*.jar
*.rar
*.tar
*.zip

# Laravel Pint
.pint.cache

# Pest
.pest
31 changes: 27 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

## Overview

The Vanguard PHP SDK offers a fluent interface for interacting with Vanguard's API, enabling efficient management of your backup operations.
The Vanguard PHP SDK provides a fluent interface for interacting with Vanguard's API, enabling efficient management of your backup operations.

## API Documentation

While this SDK provides a convenient way to interact with Vanguard's API, you may sometimes need more detailed information about the specific parameters and responses for each endpoint. For comprehensive API documentation, including request/response schemas and example payloads, please refer to our official API documentation:
For comprehensive API documentation, including request/response schemas and example payloads, please refer to our official API documentation:

[Vanguard API Documentation](https://docs.vanguardbackup.com/api/introduction)

This resource will be invaluable when constructing requests or handling responses, especially for more complex operations not fully abstracted by the SDK.
This resource is invaluable when constructing requests or handling responses, especially for complex operations not fully abstracted by the SDK.

## Getting Started

Expand Down Expand Up @@ -48,7 +48,7 @@ $user = $vanguard->user();

### Backup Task Management

Backup tasks are central to Vanguard's operations. Here's how to interact with them:
Manage your backup tasks:

```php
// List all backup tasks
Expand Down Expand Up @@ -93,6 +93,29 @@ $task->getLatestLog();
$task->run();
```

### Backup Task Log Management

Manage logs for your backup tasks:

```php
// List all backup task logs
$logs = $vanguard->backupTaskLogs();

// Get a specific backup task log
$log = $vanguard->backupTaskLog($logId);

// Delete a backup task log
$vanguard->deleteBackupTaskLog($logId);
```

Individual `BackupTaskLog` instances also provide methods for common operations:

```php
$log->delete();
$log->isSuccessful();
$log->isFailed();
```

### Remote Server Management

Manage the servers from which you're backing up data:
Expand Down
19 changes: 11 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
},
"require-dev": {
"roave/security-advisories": "dev-latest",
"illuminate/support": "^7.0|^8.0|^9.0|^10.0|^11.0",
"mockery/mockery": "^1.3.1",
"phpstan/phpstan": "^1.10",
"phpunit/phpunit": "^8.5|^9.0|^10.0"
"pestphp/pest": "^2.34",
"laravel/pint": "^1.0"
},
"autoload": {
"psr-4": {
Expand All @@ -38,15 +38,18 @@
"extra": {
"branch-alias": {
"dev-main": "0.x-dev"
},
"laravel": {
"providers": [
"VanguardBackup\\Vanguard\\VanguardServiceProvider"
]
}
},
"config": {
"sort-packages": true
"sort-packages": true,
"allow-plugins": {
"pestphp/pest-plugin": true
}
},
"scripts": {
"test": "pest",
"pint": "pint",
"pint:test": "pint --test"
},
"minimum-stability": "dev",
"prefer-stable": true
Expand Down
Loading

0 comments on commit ce7df70

Please sign in to comment.