Login   Register  
PHP Classes
elePHPant
Icontem

File: test.wwwcheckup.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Andrew Collington  >  class.wwwcheckup.php  >  test.wwwcheckup.php  >  Download  
File: test.wwwcheckup.php
Role: Unit test script
Content type: text/plain
Description: Demonstration file for the class
Class: class.wwwcheckup.php
Author: By
Last change:
Date: 2002-02-07 14:58
Size: 1,697 bytes
 

Contents

Class file image Download
<?php

//
// test.wwwcheckup.php
//
// This is a document to demonstrate possible usages for the
// class.wwwcheckup.php class.
//
// Andrew Collington, 2002
// http://www.amnuts.com/ - andy@amnuts.com
//

include "class.wwwcheckup.php";
$cu = new WebsiteCheckup("user","pass","websites","test");

if (isset(
$add))
{
    echo 
"Adding http://www.amnuts.com/ - ", ($cu->AddWebsite("http://www.amnuts.com/")?"succesful":"failed"), "<br>\n";
    echo 
"Adding http://amnuts.talker.com/ - ", ($cu->AddWebsite("http://amnuts.talker.com/")?"succesful":"failed"), "<br>\n";
    echo 
"Adding http://amnuts.talker.com/cgi-bin/AMboard/UltraBoard.pl - ", ($cu->AddWebsite("http://amnuts.talker.com/cgi-bin/AMboard/UltraBoard.pl")?"succesful":"failed"), "<br>\n";
    echo 
"Adding http://phpclasses.upperdesign.com/ - ", ($cu->AddWebsite("http://phpclasses.upperdesign.com/")?"succesful":"failed"), "<br>\n";
    echo 
"Adding http://bbe.amnuts.com/ - ", ($cu->AddWebsite("http://bbe.amnuts.com/")?"succesful":"failed"), "<br>\n";
}

if (isset(
$checkup))
{
    
$cu->SetAutoUpdate(1);
    
$cu->DisplayUpdates();
    echo 
"<br><br>\n\n";
}

if (isset(
$list))
{
    
$cu->DisplayAll();
    echo 
"<br><br>\n\n";
}

if (isset(
$noupdate))
{
    
$cu->SetAutoUpdate(0);
    
$cu->DisplayUpdates();
    echo 
"<br><br>\n\n";
}

echo 
"<hr noshade>\n";
echo 
"<p><a href=\"$PHP_SELF?add=1\">Add some demo sites</a></p>\n";
echo 
"<p><a href=\"$PHP_SELF?list=1\">List all websites (no updating)</a></p>\n";
echo 
"<p><a href=\"$PHP_SELF?checkup=1\">Check for updates (and make changes in database)</a></p>\n";
echo 
"<p><a href=\"$PHP_SELF?noupdate=1\">Check for changes (and make no changes in database)</a></p>\n";

?>