Generator.php
[Pman.Core] / Generator.php
index d639fa9..a3da329 100644 (file)
@@ -167,7 +167,7 @@ class Pman_Core_Generator extends DB_DataObject_Generator
                 
                 if (!file_exists($tg) || !filesize($tg) ) {
                   
-                    if ($cli && !filesize($tg) || in_array($f, $flist)) {
+                    if ($cli && file_exists($tg) || in_array($f, $flist) || in_array('_all_', $flist )) {
                         echo "COPY $src $tg" . ($cli ? "\n" : "<BR>");
                         copy($src, $tg);
                         continue;
@@ -355,12 +355,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_'. ucfirst($this->table); // replace odd chars?
+            $this->classname    = 'Pman_'.$mod . '_DataObjects_'. $clean_table; // replace odd chars?
            
            
-            $outfilename    = $rd.'/'.$mod.'/'. ucfirst($this->table).'.php';
-            $orig           = $ff->page->rootDir .'/Pman/'.$mod.'/DataObjects/'. ucfirst($this->table).'.php';
+            $outfilename    = $rd.'/'.$mod.'/'. $clean_table .'.php';
+            $orig           = $ff->page->rootDir .'/Pman/'.$mod.'/DataObjects/'.  $clean_table.'.php';
             
            
                 // file_get_contents???