FormToSQL.php
[Pman.Builder] / FormToSQL.php
1 <?php
2
3 // quick way to build SQL based on a form design..
4 // might have uses later...
5
6 require_once 'Pman.php';
7
8 class Pman_Builder_FormToSQL extends Pman {
9     
10     function getAuth(){
11         if (!HTML_FlexyFramework::get()->cli) {
12             die("not cli");
13         }
14         return true;
15     }
16     
17     function get($file)
18     {
19         print_R($_SERVER['argv']);exit;
20         $ar = json_decode(file_get_contents($file));
21         $this->walk($o);
22         die("DONE");
23     }
24     
25     function walk($o) 
26     {
27         
28         $this->parse($o);
29         
30         
31         
32         
33         foreach($o as $k=>$v) {
34             if (is_array($v)) {
35                 foreach($v as $oo) {
36                     $this->walk($o);
37                 }
38                 
39                 continue;
40             }
41             if (is_object($v)) {
42                 $this->walk($v);
43                 continue;
44             }
45         }
46         
47     }
48     function parse($o) 
49     {
50         
51         if (empty($o->xtype)) {
52             return;
53         }
54         echo $o->xtype ."\n";
55         
56     }
57     
58 }