PHP code example of laudeon / fileon

1. Go to this page and download the library: Download laudeon/fileon library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

laudeon / fileon example snippets


use Fileon\Resource;
use Fileon\Watcher;

$resource = new Resource(_DIR_);
$watcher = new Watcher($resource);

$watcher->onNew(function(\SplFileInfo $file){
    //...
});
$watcher->onModified(function(\SplFileInfo $file){
    //...
});

$watcher->watch(function() use ($watcher) {
  if(...) {
      $watcher->stop();
  }
});