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()
18     {
19         print_R($_SERVER['argv']);exit;
20         $file  = $_SERVER['argv'][2];
21         $ar = json_decode(file_get_contents($file));
22         $this->walk($o);
23         die("DONE");
24     }
25     
26     function walk($o) 
27     {
28         
29         $this->parse($o);
30         
31         
32         
33         
34         foreach($o as $k=>$v) {
35             if (is_array($v)) {
36                 foreach($v as $oo) {
37                     $this->walk($o);
38                 }
39                 
40                 continue;
41             }
42             if (is_object($v)) {
43                 $this->walk($v);
44                 continue;
45             }
46         }
47         
48     }
49     function parse($o) 
50     {
51         
52         if (empty($o->xtype)) {
53             return;
54         }
55         echo $o->xtype ."\n";
56         
57     }
58     
59 }