Releases: phpgt/Sync
CLI application
The bin/sync file is exposed through Composer to allow access to the CLI interface for keeping two directories in sync. CLI i/o is powered by php.gt/cli
Selective sync
This release introduces a new feature, selective sync, which allows setting a filename pattern (glob) to only sync matching files. The glob being used is provided by @WebMozart's Glob package, allowing advanced/recursive file matching.
Code complete
The Sync repository has a simple responsibility: keep two directories in sync. This v1 release marks the 100% code coverage, where real directories are filled with random files, etited, deleted and re-synced to test the functionality behaves as expected.
The main reason this repository exists is to allow PHP.Gt/Build to sync files and folders that do not need compiling, but there are going to be many other use cases of such a simple script out there.
Have fun staying in sync!
Functionality tested
The PHPUnit tests in this repository act as integration tests too as there is no benefit from mocking everything due to the simple nature of the responsibilities of this area of PHP.Gt.
Still to test:
- Throwing of configuration errors.
- Throwing filesystem errors.
- Getting file list statistics.
DirectorySync implementation
This super-simple repository has been implemented through exploratory code and will be fleshed out in subsequent commits by unit tests and the implementations required to fulfil them.
Abstract Sync class
Introducing an abstract class to perform the sync allows future versions to sync across multiple media, such as SSH, network drive, git, whatever.