1
sudhaker
zipftp - Life saver and pretty fast too :-)
  • 2005/4/1 16:00

  • sudhaker

  • Not too shy to talk

  • Posts: 117

  • Since: 2003/2/6 2


ZipFTP - Super fast (and secure) alternative to transfer files to your cPanel hosting server. Why to use slower FTP?

I tried uploaded xoops-2.0.9.2 on my Verizon DSL (1.5M/128k) using FileZilla FTP with 2 simultaneous connections. Guess what? It took me 12 minutes. But uploading xoops-2.0.10-b2 with ZipFTP was 1:12 minute only. All 1217 uploaded to server, changed folder permissions, with just one command. I am about to finish the documentation and manual part and will be releasing final version pretty soon. In the mean-time feel free to experiemnt with it, Sending any bug-report would be real great

Current version features:

* Upload files
* Extract uploaded archive
* Make directory
* Delete file / folder tree
* Change mode file/folder
* Empty trash
* Optional transfer over SSL

Features in future version

* All required database related activities.

Sample script file.

<?php
#
# Visit http://xoops.biz/x7/modules/mytricks/index.php?id=2 for more info.
#

#
# define credentials here
#

$host 'domain.com';
$user 'domain';
$pass 'password';

// to install in webroot i.e. $HOME/public_html
// $xdir = '';

// to install in any sub-folder
$xdir 'x2'// xoops2, x2 or x7 is my favorite 

// this archive should have mainfile.php in it top folder
//   files inside xoops-dist/html/ will go here
$xfile 'xoops2.tar.gz';

require_once(
'zipftp/FileManager.class.php');

$fm = new FileManager();
$fm->connect($host$user$pass);

#
# add your code here
#
#   following code will upload the XOOPS files in webroot/$xdir
#

echo 'Started at ' date("D M j G:i:s T Y") . "n";

// it may be dangerous to delete webroot by script, do manually if required
if($xdir != '') {
        
$fm->deleteFileFolder($xdir);
        
$fm->createFolder($xdir);
}
$fm->extractArchive($xfile$xdir);
$fm->changeMode($xdir .'/mainfile.php'0644);
$fm->changeMode($xdir .'/cache'0777);
$fm->changeMode($xdir .'/templates_c'0777);
$fm->changeMode($xdir .'/uploads'0777);
$fm->emptyTrash();

echo 
'Finished at ' date("D M j G:i:s T Y") . "n";

$fm->close();

?>


I remember someone asking for a script which can reset all file/folder permissions. Doing that should be pretty easy and handy using zipftp, Isn't it?

Updated (30 March, 2005): A basic version is added into downloads.http://xoops.biz/x7/modules/mydownloads/viewcat.php?cid=2

Cheers,

2
fatman
Re: zipftp - Life saver and pretty fast too :-)
  • 2005/4/1 16:14

  • fatman

  • Friend of XOOPS

  • Posts: 176

  • Since: 2003/12/13


This looks very interesting. You say that it can be used to upload to you 'cpanel' hosting. Does that mean CPanel is required on the server for this to work?

A little more detail on setup/install would be good. Do you have a php server running this script locally and it uploads to your remote server. Or is this script on the remote server and if so how does it know where to grab $xfile = 'xoops2.tar.gz'; from?

Also could this be used to add better more FTP like upload capabilities to a module? If perhaps combined with an upload field and a simple directory browser?

Thanks for sharing.

3
sudhaker
Re: zipftp - Life saver and pretty fast too :-)
  • 2005/4/1 16:40

  • sudhaker

  • Not too shy to talk

  • Posts: 117

  • Since: 2003/2/6 2


Yes, server must have cPanel. This code is using cPanel's reverse-engineered API for performing all operations. Check the file zipftp/FileManager.class.php for all available methods. I implemented all useful methods from cPanel's file manager module.

And you are very correct, running it at your end requires a php runtime (I have tested it on php5 only, my favorite is
XAMPP Lite). It usages CURL extension and calls HTTP methods on cPanel servers

My server was getting zero-byte or incomplete uploaded files. This was becoming a nightmare for me specially when using FTP over HTTPS proxy. I troubleshooted some other people's XOOPS site too and after wasting lots of time; we finally found zero-byte or incomplete uploaded files problem

So I wrote this utility and now it makes my XOOPS administration task very easy. I manage many XOOPS sites and it has become a real life-saver for me I am very excited by sharing this with XOOPS community and eagerly waiting for feedback and comments.

Cheers,

4
fatman
Re: zipftp - Life saver and pretty fast too :-)
  • 2005/4/1 16:55

  • fatman

  • Friend of XOOPS

  • Posts: 176

  • Since: 2003/12/13


It's a very creative idea. This could be a nice addition to my development server. :) Thanks again.

5
sudhaker
Re: zipftp - Life saver and pretty fast too :-)
  • 2005/4/1 17:08

  • sudhaker

  • Not too shy to talk

  • Posts: 117

  • Since: 2003/2/6 2


Thanks for compliments

My next plan is to make a script which can backup my XOOPS sites from a nightly running cron job. Also I should be able to recover my XOOPS site from any previously taken snap-shot.

The whole idea is to make webmaster's life easy

Cheers,

Login

Who's Online

206 user(s) are online (114 user(s) are browsing Support Forums)


Members: 0


Guests: 206


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Mar 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits