From d79f1b0b766ed571150c04e2a102c10a52a0bfba Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Sat, 27 Oct 2012 21:07:24 +0800 Subject: [PATCH] fix up cli --- Cli.php | 56 ++++++++---------------------------------------- JsCompile.php | 5 ++++- Notify.php | 8 ++++++- Pman.js | 10 ++++----- RunGenerator.php | 6 ++++-- 5 files changed, 29 insertions(+), 56 deletions(-) diff --git a/Cli.php b/Cli.php index 461ab1b2..13230cb5 100644 --- a/Cli.php +++ b/Cli.php @@ -1,65 +1,27 @@ 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 diff --git a/JsCompile.php b/JsCompile.php index 6c88bcf8..ab815c2e 100644 --- a/JsCompile.php +++ b/JsCompile.php @@ -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() diff --git a/Notify.php b/Notify.php index a4620980..bacad593 100644 --- a/Notify.php +++ b/Notify.php @@ -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 dd99f1cc..1fcd8430 100644 --- 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 }); - */ + }, diff --git a/RunGenerator.php b/RunGenerator.php index cb67aea6..1283107d 100644 --- a/RunGenerator.php +++ b/RunGenerator.php @@ -11,8 +11,10 @@ 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', -- 2.39.2