Generator.php
[Pman.Core] / Generator.php
index 8e29214..19c9d00 100644 (file)
@@ -128,7 +128,7 @@ class Pman_Core_Generator extends DB_DataObject_Generator
         $diff = System::which('diff');
         // now for each of the directories copy/show diffs..
         echo $cli ? '' : '<PRE>';
-        $flist = explode(',', $overwrite);
+        $flist =   $overwrite;
         foreach($this->modtables as $m=>$ar) {
             if ($options['database'] !=  $standard_database) {
                 $options['database'] =  $standard_database ;
@@ -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;
@@ -356,7 +356,7 @@ touch Pman/????/DataObjects/".ucfirst($this->table).".php
             }
             
             
-            $this->classname    = 'Pman_'.$mod . '_DataObjects_'. ucfirst($this->table); // replace odd chars?
+            $this->classname    = 'Pman_'.$mod . '_DataObjects_'. preg_replace('/[^A-Z0-9]+/i','_',ucfirst(trim($this->table)));; // replace odd chars?
            
            
             $outfilename    = $rd.'/'.$mod.'/'. ucfirst($this->table).'.php';