https://github.com/michaelpetri/symfony-file-watcher
File watcher based on symfony/messenger and git
https://github.com/michaelpetri/symfony-file-watcher
php symfony
Last synced: about 2 months ago
JSON representation
File watcher based on symfony/messenger and git
- Host: GitHub
- URL: https://github.com/michaelpetri/symfony-file-watcher
- Owner: michaelpetri
- License: mit
- Created: 2023-03-21T14:03:36.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2025-07-16T04:48:00.000Z (8 months ago)
- Last Synced: 2025-07-28T11:27:22.828Z (8 months ago)
- Topics: php, symfony
- Language: PHP
- Homepage:
- Size: 397 KB
- Stars: 6
- Watchers: 2
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Symfony File Watcher
[](https://shepherd.dev/github/michaelpetri/symfony-file-watcher)
[](https://packagist.org/packages/michaelpetri/symfony-file-watcher)
[](https://packagist.org/packages/michaelpetri/symfony-file-watcher)
This package contains a file watcher based on [symfony/messenger](https://github.com/symfony/messenger) and [michaelpetri/php-git](https://github.com/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
```shell
composer require michaelpetri/symfony-file-watcher
```
## Usage
```yaml
# messenger.yaml
transports:
my-file-watcher:
dsn: 'watch:///absolute/path/to/files?timeout=60000' # timeout in milliseconds
```
```shell
bin/console messenger:setup
bin/console messenger:consume my-file-watcher
```
## Sponsor
[](https://lyska.cloud)
By using cutting-edge technology, process automation and taking responsibility for integration, synchronization, quality and consistency of your data.