PHP Classes

File: twzFW-example.php

Recommend this page to a friend!
  Classes of Tony   FileWatch   twzFW-example.php   Download  
File: twzFW-example.php
Role: Example script
Content type: text/plain
Description: Example
Class: FileWatch
Monitor changes in files of a directory
Author: By
Last change: updated for new version
Date: 8 years ago
Size: 1,074 bytes
 

Contents

Class file image Download
<?php
/*
    twzFileWatch :: example script
   
    http://tweezy.net.au/filewatch.html
*/


# 1. Set variables to suit your requirements..
# --------------------------------------------
$SiteName = 'SAMPLE';
$CheckFolder = './';
$RecurseLevel = 2;
$EmailTo = 'yourself@example.com';


# 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();


?>