The ClusterSync component aims to provide an easy to use interface for synchronising file and directory write/delete actions across multiple servers.
Jadu_ClusterSync class provides several static methods to write and delete files and directories from the servers specified during configuration.
Usage is extremely simple, just call the static method with the path of the file/directory to be synced.
For example, if we wanted to write the file
/path/to/images/test.jpg to all clustered servers we would call:
Or delete the file:
The exact same approach is used for writing and deleting directories:
Note: ClusterSync requires a passive FTP port to be enabled on IIS.