DataObjects/Core_notify.php
[Pman.Core] / Generator.php
index a307b7f..7c722ac 100644 (file)
@@ -151,6 +151,11 @@ class Pman_Core_Generator extends DB_DataObject_Generator
             if (!empty($options['mods'] ) && !in_array($m,  $options['mods'] )) {
                 continue;
             }
+            // this happens when we have no database tables from a module,
+            // but module code has been defined.
+            if (!file_exists($options['rootDir'].'/'.$m)) {
+                continue;
+            }
             foreach(scandir($options['rootDir'].'/'.$m) as $f) {
                 if (!strlen($f) || $f[0] == '.') {
                     continue;
@@ -369,7 +374,8 @@ touch Pman/????/DataObjects/".ucfirst($this->table).".php
    ");
                 }
                 // use mods to determine where it should output to..
-                $this->modmap[$tn] = $mods;
+                //var_dump($mods);exit;
+                $this->modmap[$tn] = $mods[0];
                 
                 
             }
@@ -419,7 +425,8 @@ touch Pman/????/DataObjects/".ucfirst($this->table).".php
             
            
                 // file_get_contents???
-            $oldcontents = file_get_contents($orig);
+            
+            $oldcontents = file_exists($orig) ? file_get_contents($orig) : '';
             
              
             echo "GENERATE: " .   $this->classname  . ($cli ? "\n" : "<BR>");