more quote identeiifers fixessss
[Pman.Core] / Generator.php
index 36e9fa8..7ffeb57 100644 (file)
@@ -2,6 +2,9 @@
  
  
 /**
+ *
+ *  THIS HAS NOT BEEN TESTED WITH PDO yet...
+ *
  * 
  * Generate DataObjects...
  * 
@@ -12,7 +15,7 @@
  * 
  */
  
-require_once 'DB/DataObject/Generator.php';
+require_once 'PDO/DataObject/Generator.php';
 
 
 /** basic thing now works... 
@@ -42,10 +45,16 @@ $this->def['forms'][$table][$t->name] = $form;
 
 
 
-class Pman_Core_Generator extends DB_DataObject_Generator
+class Pman_Core_Generator extends PDO_DataObject_Generator
 {
     
-
+     
+    function getAuth()
+    {
+         
+        die("do not use this directly.. - use Core/RunGenerator");  
+        
+    }
    
     // inherrited..
     // $tablekeys
@@ -108,6 +117,7 @@ class Pman_Core_Generator extends DB_DataObject_Generator
         $options['class_location'] = $this->rootDir .'/'.$proj.'/DataObjects';
         $options['require_prefix'] =    $proj . '/DataObjects/';
         $options['class_prefix'] =    $proj . '_DataObjects_';
+        $this->debug(print_r($options,true));
        //  print_r($this);exit;
        
        
@@ -155,6 +165,9 @@ class Pman_Core_Generator extends DB_DataObject_Generator
                 continue;
             }
             foreach(scandir($options['rootDir'].'/'.$m) as $f) {
+                
+                echo "SCAN {$options['rootDir']} $f\n";
+                
                 if (!strlen($f) || $f[0] == '.') {
                     continue;
                 }
@@ -347,6 +360,7 @@ touch Pman/????/DataObjects/".ucfirst($this->table).".php
         $cli = $options['cli'];
 
         foreach($this->tables as $this->table) {
+            
             $this->table        = trim($this->table);
             $tn  = strtolower($this->table);
             $mod = $this->modmap[$tn];
@@ -355,12 +369,13 @@ touch Pman/????/DataObjects/".ucfirst($this->table).".php
                 continue;
             }
             
+            $clean_table = preg_replace('/[^A-Z0-9]+/i','_',ucfirst(trim($this->table)));
             
-            $this->classname    = 'Pman_'.$mod . '_DataObjects_'. preg_replace('/[^A-Z0-9]+/i','_',ucfirst(trim($this->table)));; // replace odd chars?
+            $this->classname    = 'Pman_'.$mod . '_DataObjects_'. $clean_table; // replace odd chars?
            
            
-            $outfilename    = $rd.'/'.$mod.'/'. preg_replace('/[^A-Z0-9]+/i','_',ucfirst(trim($this->table)));'.php';
-            $orig           = $ff->page->rootDir .'/Pman/'.$mod.'/DataObjects/'. preg_replace('/[^A-Z0-9]+/i','_',ucfirst(trim($this->table)));.'.php';
+            $outfilename    = $rd.'/'.$mod.'/'. $clean_table .'.php';
+            $orig           = $ff->page->rootDir .'/Pman/'.$mod.'/DataObjects/'.  $clean_table.'.php';
             
            
                 // file_get_contents???