Sync documentation
Sync provides one-way filesystem synchronisation from a source path to a destination path.
The package can be used from PHP code or from the command line. It can copy files from one directory to another, delete destination files that are no longer present in the source, or create symbolic links.
[!NOTE] In WebEngine applications, this package is used by the build system to move client-side files into the public
www/directory. The same package can also be used on its own, without WebEngine.
A small example
use GT\Sync\DirectorySync;
$sync = new DirectorySync("asset", "www/asset");
$sync->exec();
echo "Copied: " . count($sync->getCopiedFilesList());
The destination is made to match the source. Files that already match are skipped.
To set up the package in a small script, move on to getting started.