https://github.com/mathsgod/flysystem-pcloud
https://github.com/mathsgod/flysystem-pcloud
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/mathsgod/flysystem-pcloud
- Owner: mathsgod
- License: mit
- Created: 2025-06-30T08:35:27.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2025-06-30T09:38:34.000Z (12 months ago)
- Last Synced: 2025-10-17T19:03:44.599Z (8 months ago)
- Language: PHP
- Size: 13.7 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# flysystem-pcloud
A [Flysystem](https://flysystem.thephpleague.com/) adapter for [pCloud](https://www.pcloud.com/), supporting PHP 8+. Usable in Laravel, Symfony, and any PHP project.
## Features
- Upload, download, delete, copy, and move files/folders
- Stream upload for large files
- Recursive directory listing
- Auto-create missing directories
- Robust error handling
## Installation
```bash
composer require mathsgod/flysystem-pcloud
```
## Usage
```php
use League\Flysystem\Filesystem;
use League\Flysystem\pCloud\pCloudAdapter;
$adapter = new pCloudAdapter(
region: 'eu', // or 'us'
accessToken: 'your-access-token'
);
$filesystem = new Filesystem($adapter);
// Upload a file
$filesystem->write('/folder/file.txt', 'content');
// Read a file
$content = $filesystem->read('/folder/file.txt');
// List directory contents
foreach ($filesystem->listContents('/folder', true) as $item) {
echo $item->path() . PHP_EOL;
}
```
## Parameters
- `region`: `'eu'` or `'us'`, depending on your pCloud account region
- `accessToken`: Your pCloud OAuth2 access token
## Notes
- Directory operations will auto-create missing parent folders
- pCloud API only supports some file attributes; visibility is not supported
- Any API error will throw an Exception
## License
MIT