Dropbox Adapter
Wrapper for Spatie Dropbox v2 adapter with Joomla events support.
1. Usage
To use the adapter programmatically you can use:
JLoader::import('flysystem.library');
use Spatie\Dropbox\Client;
use Phproberto\Joomla\Flysystem\Filesystem;
use Phproberto\Joomla\Flysystem\Adapter\Dropbox;
$client = new Client($authorizationToken);
$adapter = new Dropbox($client);
$filesystem = new Filesystem($adapter);
2. Events
Global events.
These events allow to perform common actions for all the adapters with a single entry point.
onFlysystemBeforeLoadAdapter Called before an AdapterInterface instance is created.
/**
* Triggered before adapter has been loaded.
*
* @param AdapterInterface $adapter Adapter being instatiated
*
* @return void
*/
public function onFlysystemBeforeLoadAdapter(AdapterInterface $adapter)
onFlysystemAfterLoadAdapter Called after an AdapterInterface instance has been created.
/**
* Triggered after adapter has been loaded.
*
* @param AdapterInterface $adapter Adapter being instatiated
*
* @return void
*/
public function onFlysystemAfterLoadAdapter(AdapterInterface $adapter)
Custom events
onFlysystemBeforeLoadDropboxAdapter Called before a Dropbox adapter instance has been created.
/**
* Triggered before adapter has been loaded.
*
* @param Dropbox $adapter Adapter being instatiated
* @param Client $client Client to connect to Dropbox
* @param string $prefix Optional prefix.
*
* @return void
*/
public function onFlysystemBeforeLoadDropboxAdapter(Dropbox $adapter, Client $client, string &$prefix)
onFlysystemAfterLoadDropboxAdapter Called after a Dropbox adapter instance has been created.
/**
* Triggered after adapter has been loaded.
*
* @param Dropbox $adapter Adapter being instatiated
* @param Client $client Client to connect to Dropbox
* @param string $prefix Optional prefix.
*
* @return void
*/
public function onFlysystemAfterLoadDropboxAdapter(Dropbox $adapter, Client $client, string $prefix)