00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
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 ?>