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

OptionCheck.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  */
00021 class OptionCheck extends Check
00022 {
00027         var $options;
00028         var $values;
00029         var $expects;
00030         
00035         function FunctionCheck()
00036         {
00037         }
00038 
00044         function Action()
00045         {
00046                 foreach ($this->options as $option)
00047                 {
00048                         $this->values[$option] = ini_get($option);
00049                 }
00050 
00051                 // Do status check...
00052                 $this->status = STATUS_PASSED;
00053                 foreach ($this->values as $key => $val)
00054                 {
00055                         if ($this->expects[$key] != $val)
00056                         {
00057                                 if ($this->serious)
00058                                 {
00059                                         $this->status = STATUS_ERROR;
00060                                 }
00061                                 else
00062                                 {
00063                                         $this->status = STATUS_WARNING;
00064                                 }
00065                         }
00066                 }
00067         }
00068 
00076         function Result()
00077         {
00078                 $result = array();
00079                 foreach ($this->options as $option)
00080                 {
00081                         $result[$option] = $this->values[$option] == $this->expects[$option];
00082                 }
00083                 return $result;
00084         }
00085 }
00086 ?>

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