Welcome Guest, Not a member yet? Register   Sign In
Ftp class - reverse mirror function?
#1

[eluser]Dan King[/eluser]
Has anyone seen a function that does the opposite of ftp->mirror()? I'm looking for something that will take a directory structure on a remote ftp server, and recreate it on the web server. Basically the reverse of what the ftp->mirror() function does. Any help would be appreciated. Thanks!
#2

[eluser]pickupman[/eluser]
If your server's are two different machines, what protocol would you use to access the webserver? A possible solution is to have both services on both machines, on the FTP server create the script the runs the mirror function. Have the function mirror to the webserver. Then create a script on the webserver, that calls via cURL or wget the url on the ftp server. This would trigger the script to run, and sync the ftp to the webserver.
If you have full access to the servers, you may also be able to use Subversion.
#3

[eluser]Dan King[/eluser]
Yes, they're two different machines. I was going to use one as a backup, that would go out and download the files via FTP from the main machine. Also noticed there's no ftp->download() function, only ftp->upload(). Maybe I'll just create a MY_Ftp.php file and extend the class with some of my own functions. Didn't want to re-invent the wheel if I didn't have to though.
#4

[eluser]caleblloyd[/eluser]
I have posted this extension at http://ellislab.com/forums/viewthread/157098/




Theme © iAndrew 2016 - Forum software by © MyBB