Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members   Related Pages  

FunctionCheck.php

Go to the documentation of this file.
00001 <?php
00002 /* $Id: FunctionCheck.php,v 1.1 2003/10/17 08:14:49 mikko Exp $ */
00003 /*
00004  * ImaComm - a web based photo album software
00005  * Copyright (C) 2003, Mikko Kokkonen
00006  *
00007  * This program is free software; you can redistribute it and/or modify
00008  * it under the terms of the GNU General Public License as published by
00009  * the Free Software Foundation; either version 2 of the License, or (at
00010  * your option) any later version.
00011  * 
00012  * This program is distributed in the hope that it will be useful, but
00013  * WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015  * General Public License for more details.
00016  * 
00017  * You should have received a copy of the GNU General Public License
00018  * along with this program; if not, write to the Free Software
00019  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00020  */
00033 class FunctionCheck extends Check
00034 {
00039         var $functions;
00040         
00045         function FunctionCheck()
00046         {
00047         }
00048 
00054         function Action()
00055         {
00056                 if (count($this->functions) > 0)
00057                 {
00058                         foreach ($this->functions as $function)
00059                         {
00060                                 if (function_exists($function))
00061                                 {
00062                                         $this->founded[] = $function;
00063                                 }
00064                         }
00065                 }
00066                 else
00067                 {
00068                         $this->founded = array();
00069                 }
00070                 $this->missing = array_diff($this->functions, $this->founded);
00071 
00072                 $found = count($this->founded);
00073                 $notfound = count($this->missing);
00074                 $expect = count($this->functions);
00075                 if ($found > $this->warn_level)
00076                 {
00077                         $this->status = STATUS_PASSED;
00078                 }
00079                 elseif ($found > $this->err_level)
00080                 {
00081                         $this->status = STATUS_WARNING;
00082                 }
00083                 elseif ($this->serious)
00084                 {
00085                         $this->status = STATUS_SERIOUS_ERROR;
00086                 }
00087                 else
00088                 {
00089                         $this->status = STATUS_ERROR;
00090                 }
00091         }
00092 
00100         function Result()
00101         {
00102                 return $this->missing;
00103         }
00104 }
00105 ?>

Generated on Sun Oct 19 11:08:00 2003 for ImaComm by doxygen1.3