oxconfigfile.php

Go to the documentation of this file.
00001 <?php
00002 
00006 class OxConfigFile
00007 {
00008 
00017     private function _loadVars($sFileName)
00018     {
00019         include $sFileName;
00020     }
00021 
00027     public function __construct($sFileName)
00028     {
00029         $this->_loadVars($sFileName);
00030     }
00031 
00039     public function getVar($sVarName)
00040     {
00041         if (isset ($this->$sVarName)) {
00042             return $this->$sVarName;
00043         }
00044 
00045         return null;
00046     }
00047 
00054     public function setVar($sVarName, $sValue)
00055     {
00056         $this->$sVarName = $sValue;
00057     }
00058 
00066     public function isVarSet($sVarName)
00067     {
00068         return isset($this->$sVarName);
00069     }
00070 
00076     public function getVars()
00077     {
00078         $aAllVars = get_object_vars($this);
00079 
00080         return $aAllVars;
00081     }
00082 
00088     public function setFile($sFileName)
00089     {
00090         if (is_readable($sFileName)) {
00091             $this->_loadVars($sFileName);
00092         }
00093     }
00094 }