• File: DropboxV2Filesystem.php
  • Full Path: /var/www/crm_set/modules/backup/vendor/backup-manager/backup-manager/src/Filesystems/DropboxV2Filesystem.php
  • Date Modified: 09/21/2026 4:20 AM
  • File size: 706 bytes
  • MIME-type: text/x-php
  • Charset: utf-8
<?php namespace BackupManager\Filesystems;

use League\Flysystem\Filesystem as Flysystem;
use Srmklive\Dropbox\Client\DropboxClient;
use Srmklive\Dropbox\Adapter\DropboxAdapter;

/**
 * @package BackupManager\Filesystems
 */
class DropboxV2Filesystem implements Filesystem {

    /**
     * Test fitness of visitor.
     * @param $type
     * @return bool
     */
    public function handles($type) {
        return strtolower($type) == 'dropboxv2';
    }

    /**
     * @param array $config
     * @return Flysystem
     */
    public function get(array $config) {
        $client = new DropboxClient($config['token']);
        return new Flysystem(new DropboxAdapter($client, $config['root']));
    }
}