WebDAV Adapter
Wrapper for Flysystem WebDAV adapter with Joomla events support.
1. Usage
To use the adapter programmatically you can use:
JLoader::import('flysystem.library');
use Sabre\DAV\Client;
use Phproberto\Joomla\Flysystem\Filesystem;
use Phproberto\Joomla\Flysystem\Adapter\WebDAV;
$settings = ['baseUri' => 'http://localhost'];
$client = new Client($settings);
$adapter = new WebDAV($client, 'optional/path/prefix');
$flysystem = new Flysystem\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
onFlysystemBeforeLoadWebDAVAdapter Called before a WebDAV adapter instance has been created.
/**
* Triggered before adapter has been loaded.
*
* @param WebDAV $adapter Adapter being instatiated
* @param Client $client WebDAV client
* @param string $prefix Optional prefix
* @param bool $useStreamedCopy Use streamd copy. defaults to true.
*
* @return void
*/
public function onFlysystemBeforeLoadWebDAVAdapter(WebDAV $adapter, Client $client, &$prefix = null, &$useStreamedCopy = true)
onFlysystemAfterLoadWebDAVAdapter Called after a WebDAV adapter instance has been created.
/**
* Triggered after adapter has been loaded.
*
* @param WebDAV $adapter Adapter being instatiated
* @param Client $client WebDAV client
* @param string $prefix Optional prefix
* @param bool $useStreamedCopy Use streamd copy. defaults to true.
*
* @return void
*/
public function onFlysystemAfterLoadWebDAVAdapter(WebDAV $adapter, Client $client, $prefix = null, $useStreamedCopy = true)