Explorar o código

Add config set functions

Andy Baugh %!s(int64=6) %!d(string=hai) anos
pai
achega
6c7d979307
Modificáronse 1 ficheiros con 8 adicións e 0 borrados
  1. 8 0
      lib/tCMS/Config.inc

+ 8 - 0
lib/tCMS/Config.inc

@@ -67,5 +67,13 @@
         public function get_config_model($type='main') {
             return $this->conf_model[$type];
         }
+
+        public function set( $type='main', $new_value=array() ) {
+            return $this->conf[$type] = $new_value;
+        }
+
+        public function save( $type='main' ) {
+            return file_put_contents($this->get_conf_dir()."/$type.json", $this->get($type));
+        }
     }
 ?>