<?php
 
/*
 
    twzFileWatch :: example script
 
    
 
    http://tweezy.net.au/filewatch.html
 
*/
 
 
 
# 1. Set variables to suit your requirements..
 
# --------------------------------------------
 
$SiteName       = 'SAMPLE';
 
$CheckFolder    = './';
 
$RecurseLevel   = 2;
 
$EmailTo        = '[email protected]';
 
 
 
# 2. The class file must be attached..
 
# ------------------------------------
 
require 'twzFileWatch.class.php';
 
 
 
# 3. Instantiate the class..
 
# --------------------------
 
$fw = new twzFilewatch($SiteName, $CheckFolder, $RecurseLevel, $EmailTo);
 
 
 
# 4. Set the required options..
 
# -----------------------------
 
 
# set the location of the save-file (location must be writable)
 
$fw->saveFile('../../tmp/twzFW.txt');
 
 
# for testing in a browser, set $testing=true 
 
# so the result will be echoed and no email will be sent.
 
$testing=true;
 
if($testing)
 
    {
 
    $fw->doSendEmail(false);
 
    $fw->reportAlways(true);
 
    $fw->minInterval('5 seconds');
 
    }
 
 
 
# 5. Do it!..
 
# -------------------------
 
$fw->checkFiles();
 
 
 
?>
 
 |