1up-lab / OneupFlysystemBundle

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

FTP Adapter configuration outdated #240

Closed Tilotiti closed 3 years ago

Tilotiti commented 3 years ago

Bug Report

Q A
BC Break yes
Version 4.0.6

Summary

Hi !

I try to install a FTP adapter. Since the 4.x update, it seems that the configuration needed for this adapter changed, but the documentation is not up-to-date.

The documentation link : https://github.com/1up-lab/OneupFlysystemBundle/blob/master/doc/adapter_ftp.md

The change of configuration : https://github.com/1up-lab/OneupFlysystemBundle/pull/217/commits/aa595066126739897fdd4d7d3af9b4a20e65a8cc

How to reproduce

Install the 4.0.6 version (but it seems to be reproductible since 4.0), add an FTP adapter :

oneup_flysystem:
    adapters:
        ftp_adapter:
            ftp:
                host: '***'
                username: '***'
                password: '***'
    filesystems:
        ftp:
            adapter: ftp

I'll have now this error :

 Unrecognized options "host, username, password" under "oneup_flysystem.adapters.carvivo_adapter.ftp". Available options are "connectionOptions", "connectionProvider", "connectivityChecker", "mimeTypeDetector", "visibilityConverter".

This error is consistant with the configuration file, the problem is that the adapter configuration change and there is no documentation to show how to connect the new FTP adapter.

Thank you for your help :)

bytehead commented 3 years ago

@Tilotiti can you check if #241 fixes your issue?

bytehead commented 3 years ago

~requiring "oneup/uploader-bundle": "dev-fix/ftp-adapter" should work.~ requiring "oneup/flysystem-bundle": "dev-fix/ftp-adapter" should work.

Tilotiti commented 3 years ago

requiring "oneup/uploader-bundle": "dev-fix/ftp-adapter" should work.

Wrong repo I think, but I'll try it now with OneupFlysystemBundle :)

bytehead commented 3 years ago

well... 😂 you're right!

Tilotiti commented 3 years ago

Sorry .. Not able to update composer to this branch because of dependencies that requires your "dev-main" version :/ (Yeah ... And it's mine)

bytehead commented 3 years ago

But if I merge this to main you could test?

Tilotiti commented 3 years ago

Yes :/

bytehead commented 3 years ago

Does maybe aliasing ("dev-fix/ftp-adapter as dev-main") work?

Tilotiti commented 3 years ago

composer require oneup/flysystem-bundle:"dev-fix/ftp-adapter as dev-main"

But I've an error from composer :

Could not parse version constraint as dev-main: Invalid version string "as dev-main"

Even after adding the repository manually :

"repositories": [
      {
          "type": "vcs",
          "url": "https://github.com/1up-lab/OneupFlysystemBundle"
      }
  ]
bytehead commented 3 years ago

Hmm. Too bad. But you should anyway not rely on dev-main in your deps. Can you not require 4.* instead?

Tilotiti commented 3 years ago

This is actually the case :

The other bundle requires : "oneup/flysystem-bundle": "^4.0||^3.0",

bytehead commented 3 years ago

But then you could try to require dev-fix/ftp-adapter as 4.0.7 or the like.

Tilotiti commented 3 years ago

Ho ! Working ! So I'll edit my configuration and try the FTP adapter

Tilotiti commented 3 years ago

And it works like a charm !

I add to add the root option instead of the precedent configuration. But that's it :)

bytehead commented 3 years ago

Thanks, nice! root is required by the flysystem: https://flysystem.thephpleague.com/v2/docs/adapter/ftp/

I'll tag a new release asap and let you know!

Tilotiti commented 3 years ago

Thank you :)

bytehead commented 3 years ago

4.0.7 is released! Thank you for reporting!

Tilotiti commented 3 years ago

Congratulation :) And thank you for this quick fix !