Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder mlse's Avatar
    Join Date
    Mar 2005
    Posts
    624
    Thanks
    20
    Thanked 19 Times in 18 Posts

    Best way to proceed with FTP operations?

    Hi all,

    I am currently deciding which way to implement a class that handles FTP transfers.

    From reading the PHP manual, I see that I have three options as follows:

    1) Use the SSH extension in PECL.
    2) Use the ftp built-ins.
    3) Use fopen("ftp(s)://username:password@ftp.myserver.com:port", mode);.

    Currently I have implemented method 3 because it is far more straight forward than either of the other two.

    What, therefore, are the advantages (if any) of the other two methods?

    All I am doing is opening an FTP connection, writing a bunch of files and closing the connection - which seems problem-free and very simple using method 3!

    TIA
    Mike.

  • #2
    Senior Coder
    Join Date
    Jan 2007
    Posts
    1,648
    Thanks
    1
    Thanked 58 Times in 54 Posts
    The popular saying:

    "If it ain't broke, don't fix it"

  • #3
    Regular Coder mlse's Avatar
    Join Date
    Mar 2005
    Posts
    624
    Thanks
    20
    Thanked 19 Times in 18 Posts
    Lol! Quite ...

  • #4
    Senior Coder
    Join Date
    Sep 2005
    Posts
    1,791
    Thanks
    5
    Thanked 36 Times in 35 Posts
    From the point of view of the 'user' of your finished class(es), they shouldn't care how the transport happens in the background, so switching in the future (or providing alternatives) shouldn't really be that difficult.

    YAGNI (You ain't gonna need it) is another phrase to bear in mind when designing things, don't try and anticipate too much.
    My thoughts on some things: http://codemeetsmusic.com
    And my scrapbook of cool things: http://gjones.tumblr.com


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •