7 $this->configPath = "";
11 function loadConfig($configpath)
13 error_log("loadConfig $configpath");
14 $this->configPath = $configpath;
15 $flt = file_get_contents($configpath);
16 $this->config = unserialize(base64_decode($flt));
21 function getConfigVar($var)
23 if(isset($this->config["$var"])) {
24 return $this->config["$var"];
28 function setConfigVar($var, $value)
30 if(is_array($this->config)) {
31 foreach($this->config as $vkey => $val) {
33 error_log("reset config of $var to $value");
34 $this->config[$var] = $value;
38 } else error_log("config isnt array");
41 error_log("set config of $var to $value");
42 $this->config[$var] = $value;
46 function delConfigVar($var)
48 if(is_array($this->config)) {
49 foreach($this->config as $vkey => $val) {
51 error_log("remove config of $var to $value");
52 unset($this->config[$var]);
56 } else error_log("config isnt array");
61 file_put_contents($this->configPath, base64_encode(serialize($this->config)));
67 echo "path: ".$this->configPath."\n";
68 print_r($this->config);