2017 © Pedro Peláez
 

project watcher

Watch changes

image

jdecool/watcher

Watch changes

  • Sunday, July 1, 2018
  • by jdecool
  • Repository
  • 0 Watchers
  • 0 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Watcher

Latest Stable Version, (*1)

Work in Progress

Please note that this project is currently under active development. We encourage everyone to try it and give feedback, but we don't recommend it for production use yet., (*2)

Intro

This tool watches a resource (filesystem, API resources, ...) and notify a listener of any changes., (*3)

Installation

You can install it by running Composer:, (*4)

$ composer require jdecool/watcher

Usage

First you need configure the tool by creating a watcher.yaml file:, (*5)

watcher: Vendor\Package\MyWatcher
storage: JDecool\Watcher\Storage\JsonStorage
listeners:
    - Vendor\Package\Lister1
    - Vendor\Package\Lister2

The watch class is an instance of JDecool\Watcher\Watcher and it is an implementation of a watcher. It will watch content to detect some change., (*6)

The class need to contain a method public function getObjects(): array to returns objects., (*7)

Information about data can be stored with different strategies and you need to define how you want to store those data with the storage key., (*8)

Finally, you need to register listeners that can be triggered. A listener class is an Symfony\Component\EventDispatcher\EventSubscriberInterface implementation., (*9)

Then you can run your watcher with vendor/bin/watcher., (*10)

The Versions