michaelpetri/symfony-file-watcher

Symfony Message Receiver to receive filesystem events.

0.2.5 2023-05-12 13:18 UTC

README

Type Coverage Latest Stable Version License

This package contains a file watcher based on symfony/messenger and michaelpetri/php-git.

Since it is based on git it can emmit events for files even after it has been paused for a decent time. All changes will trigger a FileCreated, FileChanged or FileDeleted event which then can be handled by an event handler.

Note: Keep in mind that git is not good at handling binary files and using this package can lead to bloated disk usage!

Installation

composer require michaelpetri/symfony-file-watcher 

Usage

# messenger.yaml
transports:
  my-file-watcher:
    dsn: 'watch:///absolute/path/to/files?timeout=60000' # timeout in milliseconds
bin/console messenger:setup
bin/console messenger:consume my-file-watcher

Sponsor

Lyska.cloud

By using cutting-edge technology, process automation and taking responsibility for integration, synchronization, quality and consistency of your data.