PHP code example of lucaf87 / flysystem-pcloud

1. Go to this page and download the library: Download lucaf87/flysystem-pcloud library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

lucaf87 / flysystem-pcloud example snippets


[
    'pCloud' => [
        'driver' => 'pCloud',
        'clientId' => env('PCLOUD_CLIENT_ID'),
        'clientSecret' => env('PCLOUD_CLIENT_SECRET'),
        'accessToken' => env('PCLOUD_ACCESS_TOKEN'),
        'locationId' => env('PCLOUD_LOCATION_ID'),
    ]
]
 artisan flysystem-pcloud:token


Storage::disk('pCloud')->putFileAs('files', new File('/tmp/file.txt'), 'file-name.txt');

Storage::disk('pCloud')->exists('/files/file-name.txt'));

$full_path = Storage::disk('pCloud')->get('/files/file-name.txt');


$full_path = Storage::disk('pCloud')->get('/files/file-name.txt');

$url = Storage::disk('pCloud')->fileUrl('/files/file-name.txt'));

$contents = Storage::disk('pCloud')->readStream('/files/file-name.txt');

Storage::disk('pCloud')->delete('/files/file-name.txt');

Storage::disk('pCloud')->deleteDirectory('/files'));
Storage::disk('pCloud')->deleteDirectory('/files/test'));

$mimeType = Storage::disk('pCloud')->mimeType('/files/file-name.txt');

$bytes = Storage::disk('pCloud')->fileInfo('/files/file-name.txt');

$files = Storage::disk('pCloud')->files('/files'));

php artisan flysystem-pcloud:clean-local-storage

php artisan vendor:publish --provider="LucaF87\PCloudAdapter\Providers\CustomPCloudServiceProvider" --force