فهرست منبع

WIP on config getting, mostly stubbing some things

Will work on tests and actual functionality next
Andy Baugh 10 سال پیش
والد
کامیت
d5d9234ea4
3فایلهای تغییر یافته به همراه34 افزوده شده و 0 حذف شده
  1. 3 0
      Makefile
  2. 9 0
      TODO
  3. 22 0
      sys/admin/lib/configure.php

+ 3 - 0
Makefile

@@ -1,3 +1,6 @@
 test:
 	[ -d t/lib/testmore ] || git clone https://github.com/shiflett/testmore.git t/lib/testmore
 	prove --exec 'php' t/*.t
+
+install:
+	php sys/admin/lib/configure.php install

+ 9 - 0
TODO

@@ -0,0 +1,9 @@
+tCMS2 still left undone (will add to as I think of em)
+* 'make install' target that runs configure.php to do first time config and install.
+* 'configure.php' needs CLI run opts triggered on ARGV not being blank
+* config needs to be based on a model json file.
+* tests for config reading and comparison based on model
+* tests for config validation of user input (wanna make sure we *can* install
+* tests for config writing
+* Un-Stubbify first time run wizard
+* Make config page in Admin work right

+ 22 - 0
sys/admin/lib/configure.php

@@ -0,0 +1,22 @@
+<?php
+# Assume we're doing things interactively if we're passing in args
+if( !empty( $argv[1] ) ) {
+    exit(0);
+}
+class configure {
+    # INPUT:
+    #   Param 1: Config file to read. Throws on failure to read.
+    #   Param 2: undef or ARRAY of keys you wanna fetch. undef/invalid assumes we'll be wanting all of them.
+    # OUTPUT: ARRAY of the requested KEY => VALUE pairs.
+    public function get_config_values() {
+        return;
+    }
+    # INPUT:
+    #   Param 1: Config file to write. Throws if it fails to write.
+    #   Param 1: ARRAY of KEY => VALUE pairs you wanna set. Throws on invalid input.
+    # OUTPUT: BOOL regarding success/failure.
+    public function set_config_values() {
+        return;
+    }
+}
+?>