2017 © Pedro PelĂĄez
 

library watch-files

Watch files and directories for changes

image

crodas/watch-files

Watch files and directories for changes

  • Thursday, August 18, 2016
  • by crodas
  • Repository
  • 1 Watchers
  • 8 Stars
  • 5,623 Installations
  • PHP
  • 8 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 12 Versions
  • 1 % Grown

The README.md

WatchFiles

Stateless way of watching files and directory for changes., (*1)

It is useful when you compile files, and you would like a simple and efficient way of watching files and directories for changes to avoid re-compilation., (*2)

How to install

You can install it using composer., (*3)

composer require crodas/watch-files *

How to use it

require "vendor/autoload.php";

use WatchFiles\Watch;

// we'd like to watch some files
// and to save its state in foobar.php
$foobar = new Watch("foobar.php");
if ($foobar->isWatching()) {
  if (!$foobar->hasChanged()) {
    // somebody else before us started watching files/dirs
    // on foobar.php and *nothing* changed since last 
    // time
    return;
  }
  // do heavy stuff here (Recompile it?)
  // we need to tell the watch that we're aware of lastest
  // changes and we'd like to update the file modification time
  $foobar->rebuild();
  return;
}

// we'd love to see when a new file has been added or deleted
$foobar->watchDir("foodir");
$foobar->watchDirs(array("foodir", 'foobar'));

// or monitor changes inside file or files
$foobar->watchFile("foodir.php");
$foobar->watchFiles(array("foodir.php", 'foobar.php'));

// start watching!
$foobar->watch();

The Versions

18/08 2016

dev-develop

dev-develop

Watch files and directories for changes

  Sources   Download

BSD-4-Clause

The Requires

 

The Development Requires

by CĂ©sar D. Rodas

18/08 2016

dev-master

9999999-dev

Watch files and directories for changes

  Sources   Download

BSD-4-Clause

The Requires

 

The Development Requires

by CĂ©sar D. Rodas

18/08 2016

v0.1.9

0.1.9.0

Watch files and directories for changes

  Sources   Download

BSD-4-Clause

The Requires

 

The Development Requires

by CĂ©sar D. Rodas

05/01 2016

v0.1.8

0.1.8.0

Watch files and directories for changes

  Sources   Download

BSD-4-Clause

The Requires

 

The Development Requires

by CĂ©sar D. Rodas

03/01 2016

v0.1.7

0.1.7.0

Watch files and directories for changes

  Sources   Download

BSD-4-Clause

The Requires

 

The Development Requires

by CĂ©sar D. Rodas

04/01 2015

v0.1.6

0.1.6.0

Watch files and directories for changes

  Sources   Download

BSD-4-Clause

The Requires

 

by CĂ©sar D. Rodas

12/05 2014

v0.1.5

0.1.5.0

Watch files and directories for changes

  Sources   Download

BSD-4-Clause

The Requires

 

by CĂ©sar D. Rodas

02/11 2013

v0.1.4

0.1.4.0

Watch files and directories for changes

  Sources   Download

BSD-4-Clause

The Requires

 

by CĂ©sar D. Rodas

01/11 2013

v0.1.3

0.1.3.0

Watch files and directories for changes

  Sources   Download

BSD-4-Clause

The Requires

 

by CĂ©sar D. Rodas

20/10 2013

v0.1.2

0.1.2.0

Watch files and directories for changes

  Sources   Download

BSD-4-Clause

The Requires

 

by CĂ©sar D. Rodas

30/08 2013

v0.1.1

0.1.1.0

Watch files and directories for changes

  Sources   Download

BSD-4-Clause

The Requires

 

by CĂ©sar D. Rodas

07/08 2013

v0.1.0

0.1.0.0

Watch files and directories for changes

  Sources   Download

BSD-4-Clause

The Requires

 

by CĂ©sar D. Rodas