PHP Classes

File: ftp_sync_example.php

Recommend this page to a friend!
  Classes of John Saman   PHP FTP Sync   ftp_sync_example.php   Download  
File: ftp_sync_example.php
Role: Example script
Content type: text/plain
Description: FTP Synchronizer Example
Class: PHP FTP Sync
Synchronize files and folders over FTP
Author: By
Last change:
Date: 11 years ago
Size: 1,447 bytes


Class file image Download
    Ver. : 1.0.0
    Desc.: The class is made to work as an alternative to rsync when FTP is only available.
        The class use FTP to do synchronization to the target FTP host.
        It copies only the new and modified files after last run of the script.
        You can specify exclude list to the class and any directories or files in this list will be ignored from synchronization.

    Developed By John Saman (
    Used and owned by
    Licensed Under Non-Profit Open Software License 3.0 (Non-Profit OSL 3.0)

include_once 'ftp_sync.php';


//max simulatnous connections. the more of this number the faster synchronization will be but if set to high number it'll be aborted by FTP server probably so try to keep it in between.
//Note: if it's getting connection refused error try to set this number to low number usually 5 should be fine.

//a comma separated list of folder names or file names - full name is required

$sync=new FTPSync($ftpServer,$ftpUsername,$ftpPassword,$maxConnections,$exclude_list);

//This to display detailed information about the directories and files being uploaded - use for testing

//start synchronization process