Skip to content

Instantly share code, notes, and snippets.

@jfinstrom
Created September 10, 2018 21:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jfinstrom/80b8cfe72df1d692288fb67be06d725d to your computer and use it in GitHub Desktop.
Save jfinstrom/80b8cfe72df1d692288fb67be06d725d to your computer and use it in GitHub Desktop.
example flysystem plugin for reference
<?php
namespace League\Flysystem\Plugin;
use League\Flysystem\FilesystemInterface;
class MyExample extends AbstractPlugin{
protected $filesystem;
public function setFilesystem(FilesystemInterface $filesystem){
$this->filesystem = $filesystem;
}
public function getMethod(){
return 'myExample';
}
/** does the samething as "update" and is just here for reference **/
public function handle($path, $contents){
return $this->filesystem->update($path, $contents);
}
}
@jfinstrom
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment