FTP/SFTP in CodeIgniter |
[eluser]dailygrind[/eluser]
Hi, I'm developing an application that will need to transfer files. I don't know at the moment if will be an FTP or a SFTP protocol. How do you think I should design it using CodeIgniter? Is there an SFTP class in CI?
[eluser]Mauricio de Abreu Antunes[/eluser]
No, CI has no SFTP implementation. https://github.com/ipolar/CodeIgniter-sFTP-Library Look his lib and create your own. ![]() I can help you if you need, i would be glad to help.
[eluser]dailygrind[/eluser]
Hi thanks! My idea was to develop a wrapper class so that I can use it in this sort of way but having of course both FTP and SFTP implementation behind it. Code: $transfer = new Transfer(); My idea was to name methods like this Code: private function _ftp_connect() and call them based on a config file using __call.... Is this a good approach?
[eluser]Mauricio de Abreu Antunes[/eluser]
My idea: 1 - Watch for the difference between STFP and FTP. 2 - Try to construct a lib with a parent class, reusing common methods (SFTP and FTP). Good luck and have fun!
[eluser]PhilTem[/eluser]
You might also wanna have a look at CI-Drivers. That's probably better fitting your needs. And in terms of the idea of drivers and libraries, a driver fits much better ![]()
[eluser]InsiteFX[/eluser]
This would be just right for creating a CI Driver class. CodeIgniter User Guide - Using CodeIgniter Drivers CodeIgniter User Guide - Creating Drivers
|
Welcome Guest, Not a member yet? Register Sign In |