DataObjects/Core_event_audit.php
[Pman.Core] / RunGenerator.php
index 0a2ac0e..120771c 100644 (file)
@@ -17,6 +17,7 @@ class Pman_Core_RunGenerator extends Pman
         'module' => array(
             'desc' => 'Module',
             'short' => 'm',
+            'default' => '',
             'min' => 1,
             'max' => 1,
             
@@ -25,8 +26,8 @@ class Pman_Core_RunGenerator extends Pman
             'desc' => 'Files to Overwrite',
             'default' => '',
             'short' => 'o',
-            'min' => 0,
-            'max' => 999,
+            'min' => 1,
+            'max' => -1,
             
         )
         
@@ -51,20 +52,28 @@ class Pman_Core_RunGenerator extends Pman
         return true;
     }
      
-    function get($args)
+    function get($args, $opts)
     {
+        //print_r($opts);exit;
+        
+        HTML_FlexyFramework::run('Core/UpdateDatabase');
+        
+         
+        
         require_once 'Pman/Core/Generator.php';
         ini_set('pcre.backtrack_limit', 2000000);
         ini_set('pcre.recursion_limit', 2000000);
         $this->init();
-         
-        $lastarg = $this->cli  ? array_pop($_SERVER['argv']) : '';
-        if (preg_match('/RunGenerator/', $lastarg)) {
-            $lastarg  = '';
-        }
+        
         $x = new Pman_Core_Generator();
        // $x->page = clone($this);
-        $x->start($this->cli, $args, $lastarg);
+       
+        
+        $modules = $opts['module'];
+        // overwrite can be multiple
+        $overwrite = is_string($opts['overwrite']) ? array($opts['overwrite']) : $opts['overwrite'];
+
+        $x->start($this->cli, $modules, $overwrite);
         
         // technically it would be good to trash the cached ini files here.. 
         // however we can not really do that, as the ownships are off..