fix up cli
authorAlan Knowles <alan@akbkhome.com>
Sat, 27 Oct 2012 13:07:24 +0000 (21:07 +0800)
committerAlan Knowles <alan@akbkhome.com>
Sat, 27 Oct 2012 13:07:24 +0000 (21:07 +0800)
Cli.php
JsCompile.php
Notify.php
Pman.js
RunGenerator.php

diff --git a/Cli.php b/Cli.php
index 461ab1b..13230cb 100644 (file)
--- a/Cli.php
+++ b/Cli.php
@@ -1,65 +1,27 @@
 <?php
 /*
 
-Help file for cli in this directory.
-
 
 */
 
 
-class Pman_Core_Cli
+class Pman_Core_Cli extends Pman
 {
+    static $cli_desc = "Base class for CLI only commands";
     
     function getAuth()
     {
-        return false;
+        $ff = HTML_FlexyFramework::get();
+        if (!$ff->cli) {
+            die("CLI ONLY");
+        }
     }
     
     
-    function help($cli)
+    function get()
     {
-        echo "
-
-    $cli Core/RunGenerator
-
-    Creates ALL database tables
-    - does not change files, just shows you want would happen
-        
-        
-    $cli Core/RunGenerator/COMPONENT
-
-    Runs the generator for a COMPONENT (NOTE - will update that COMPONENT sql)
-    - does not change files, just shows you want would happen
-
-    
-    $cli Core/RunGenerator/COMPONENT pman.ini,COMPONENT.readers.js,...
-    $cli Core/RunGenerator/COMPONENT _all_
-    Runs the generator for a project (NOTE - runs all the SQL updates)
-    - Changes the files.
-
-================================    
-
-    $cli Core/JsCompile   build PROJECT
-     
-    Runs the javascript compiler - merging all the JS files so the load faster.
-    Note: cfg option Pman_Builder['jspacker'] must be set to location of jstoolkit code 
-
-================================    
-
-    $cli Core/Notify
-    
-    Runs the notification tool - should be run every minute ideally.
-    Sends out emails to anyone in the notification list.
-    
-    /etc/cron.d/pman-core-notify
-     * *  * * *     www-data     /usr/bin/php /home/gitlive/web.mtrack/admin.php  Core/Notify > /dev/null
-    
-        
-";
-
-
+        die("this is only used as a base class for Cli based commands - extend to use.");
     }
     
-    
 }
\ No newline at end of file
index 6c88bcf..ab815c2 100644 (file)
@@ -17,7 +17,10 @@ require_once 'Pman.php';
 class Pman_Core_JsCompile  extends Pman
 {
     
-    static $cli_desc = "Wrapper around Javascript compression tools";
+    static $cli_desc = "Wrapper around Javascript compression tools
+                        Runs the javascript compiler - merging all the JS files so the load faster.
+                        Note: cfg option Pman_Builder['jspacker'] must be set to location of jstoolkit code 
+";
     
     var $cli = false;
     function getAuth()
index a462098..bacad59 100644 (file)
@@ -16,7 +16,13 @@ require_once 'Pman.php';
 class Pman_Core_Notify extends Pman
 {
     
-    static $cli_desc = "Send out notification emails (usually from cron)";
+    static $cli_desc = "Runs the notification queue (usually from cron)
+                        Normally used to sends out emails to anyone in the notification list.
+    
+                        /etc/cron.d/pman-core-notify
+                        * *  * * *     www-data     /usr/bin/php /home/gitlive/web.mtrack/admin.php  Core/Notify > /dev/null
+    
+";
     
     static $cli_opts = array(
         'debug' => array(
diff --git a/Pman.js b/Pman.js
index dd99f1c..1fcd843 100644 (file)
--- a/Pman.js
+++ b/Pman.js
@@ -619,13 +619,13 @@ Pman = new Roo.Document(
     },
     /**
      * Depreciated - USE new Pman.Request
-    * 
+    *  We need to replace all the uses with this, however the api is slightly different,
+    *  the success argument is res.data, not res..
      * 
      */
     request : function(c) {
-        return new Pman.Request(c);
-        /*
-        
+        //return new Pman.Request(c);
+         
         var r= new Roo.data.Connection({
             timeout : typeof(c.timeout) == 'undefined' ?  30000 : c.timeout
         });
@@ -668,7 +668,7 @@ Pman = new Roo.Document(
             scope: this
             
         });
-        */
+         
     },
     
     
index cb67aea..1283107 100644 (file)
 require_once 'Pman.php';
 class Pman_Core_RunGenerator extends Pman
 {     
-    static $cli_desc = "Generate DataObjects (runs updatedatabase first)";
-   
+    static $cli_desc = "Generate DataObjects (runs updatedatabase first)  
+                     does not change files, just shows you want would happen";
+        
+        
     static $cli_opts = array(
         'module' => array(
             'desc' => 'Module (if new tables are found, they will be put in the modules database directory',