Closed nuzulfikrie closed 4 years ago
I put Adapter class 'adapterClass' => '\Gaufrette\Adapter\AwsS3', in LocalListener.php and the script work. Is it the intended design?
public $_adapterClasses = [
'\Gaufrette\Adapter\Local',
'\Gaufrette\Adapter\AwsS3'
];
@nuzulfikrie this is intended, but it is not intended that you change this class. If it works you're lucky because the adapters API is compatible. But there might be things that break. A LOCAL adapter is for a reason a LOCAL adapter. It will very likely behave different than one for a cloud based storage. The listeners expect specific adapters because of that. They don't assume that a LOCAL adapter behaves the same as the cloud adapter. Again: If it works you're lucky, if you run into issues with this listener using a CLOUD adapter you know why. :)
@nuzulfikrie this is intended, but it is not intended that you change this class. If it works you're lucky because the adapters API is compatible. But there might be things that break. A LOCAL adapter is for a reason a LOCAL adapter. It will very likely behave different than one for a cloud based storage. The listeners expect specific adapters because of that. They don't assume that a LOCAL adapter behaves the same as the cloud adapter. Again: If it works you're lucky, if you run into issues with this listener using a CLOUD adapter you know why. :)
Thanks @burzum . I am still hoping ( and working ) to use this plugin. A very good one.
@nuzulfikrie well, just implement your own listener for AWS. You can test if LocalListener works fine, if not figure out the difference and create your own listener based on that one.
In theory all the adapters could or should even work. The underlying library Gaufrette should abstract that very well but no guarantee given.
So yes, you can extend the Listener in your app and just override the $_adapterClasses property in it and add the adapter if it works for you.
Hi All,
I followed the documentations that is listed here from https://cakephp-file-storage.readthedocs.io/en/latest/Tutorials/Quick-Start/.
When I followed this, and run from console. The script throws The listener
Burzum\FileStorage\Storage\Listener\LocalListener
doesn't allow the\Gaufrette\Adapter\AwsS3
adapter class! Probably because it can't work with it.