瀏覽代碼

Add config set functions

Andy Baugh 6 年之前
父節點
當前提交
6c7d979307
共有 1 個文件被更改,包括 8 次插入0 次删除
  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));
+        }
     }
 ?>