1up-lab / OneupFlysystemBundle

A Flysystem integration for your Symfony projects.
MIT License
630 stars 119 forks source link

MountManager->getFilesystem() method not exists #268

Closed fernandosngular closed 1 year ago

fernandosngular commented 1 year ago

Bug Report

When i try use $this->mountManager->getFilesystem('prefix') method, from my service... it not is working.

Q A
BC Break yes
Version 4.4.2

How to reproduce

  1. Inject mountManager for your service in the yml (in controller it not is working)
  2. Write code: $this->mountManager->getFilesystem('prefix')
  3. It not is working, if you see in mountManager class... filesystem is private methods and not way for get this information.
bytehead commented 1 year ago

The mount manager actually comes from Flysystem: https://flysystem.thephpleague.com/docs/advanced/mount-manager/ I can't see a getFilesystem method there.

bytehead commented 1 year ago

I see, the documentation is wrong here.

But you should be able to use your suffix for the operations:

// Read from FTP
$contents = $manager->read('ftp://some/file.txt');

// And write to local
$manager->write('local://put/it/here.txt', $contents);

// Untested, but I would give a try for you prefixed one
$manager->write('prefix://put/it/here.txt', $contents);
fernandosngular commented 1 year ago

I see, but i think that it is confused with prefix for my project... so, i am going to inject my multiples filesystem configurations directly.

Thanks