$this->$k = $v;
}
$this->_parseConfig();
-
+
// echo '<PRE>'; print_r($this);exit;
if ($this->cli) {
$args = $_SERVER['argv'];
$this->_run($this->run,false,$args);
return;
}
-
+
// handle apache mod_rewrite..
// it looks like this might not work anymore..
}
$this->classPrefix = str_replace('/', '_', $this->project) . '_';
-
- // list the available options..
+ // list the available options..
if ($this->cli && empty($_SERVER['argv'][1])) {
require_once 'HTML/FlexyFramework/Cli.php';
$fcli = new HTML_FlexyFramework_Cli($this);
}
$this->_validateDatabase();
-
+
$this->_validateTemplate();
}
// echo '<PRE>'; print_r($this);exit;
// echo "CHECK GET AUTH?";
+
if (!method_exists($classobj, 'getAuth')) {
// echo "NO GET AUTH?";
$this->fatalError("class $classname does not have a getAuth Method");
return $result;
}
}
+
/* allow redirect from start */
if (method_exists($classobj,"start")) {
if (is_string($redirect = $classobj->start($subRequest,$isRedirect,$args))) {
require_once 'Console/Getargs.php';
$ar = $_SERVER['argv'];
$call = array(array_shift($ar)); // remove index.php
- $call[] = array_shift($ar);
- //var_dump($ar);
+ $has_class = false;
+ if (isset($ar[0]) && $ar[0][0] != '-') {
+ $call[] = array_shift($ar); // remove our class...
+ $has_class = true;
+ }
$val = self::$cli_opts;
$newargs = Console_Getargs::factory($val, $ar);
exit;
}
if ($newargs->getCode() === CONSOLE_GETARGS_HELP) {
-
- return true;// hel
+ if (!$has_class) {
+ echo Console_Getargs::getHelp($val,
+ $helpHeader, NULL, 78, 4)."\n\n";
+ exit;
+ }
+ return true;// help is handled later in the flow?
}
return false;
foreach($ret as $k=>$v) {
switch($k) {
case 'pman-nodatabase':
- //echo "Turning off database";
- $this->ff->nodatabase= true;
+ echo "Turning off database\n";
+ $this->ff->nodatabase = true;
break;
$generator = new HTML_FlexyFramework2_Generator();
$generator->start();
+ $this->debug('generateDataobjectsCache', 'dataObjectsCache writing');
HTML_FlexyFramework2_Generator::writeCache($iniCacheTmp, $iniCache);
// reset the cache to the correct lcoation.
PDO_DataObject::config('schema_location', $iniCache);
* $x = new HTML_FlexyFramework_Cli($ff);
* $x->cliHelp(); // summary of all classes which can be run with cli.
* (contain static $cli_desc)
- * $x->cliParse($classname);
+ * $x->cliParse($classname); // parses once we know the class name..
+ * $x->parseDefaultOpts(); // handles pman-nodatabase
*
*
*/
*/
function cliParse($classname)
{
- die("here");
+
// cli static $classname::$cli_opts
try {
// look up the parent tree for core opts.
require_once 'Console/Getargs.php';
$ar = $_SERVER['argv'];
$call = array(array_shift($ar)); // remove index.php
- $call[] = array_shift($ar);
+ $has_class = false;
+ if (isset($ar[0]) && $ar[0][0] != '-') {
+ $call[] = array_shift($ar); // remove our class...
+ $has_class = true;
+ }
//var_dump($ar);
$val = self::$cli_opts;
exit;
}
if ($newargs->getCode() === CONSOLE_GETARGS_HELP) {
-
+ if (!$has_class) {
+ echo Console_Getargs::getHelp($val,
+ $helpHeader, NULL, 78, 4)."\n\n";
+ exit;
+ }
return true;// hel
}
$ret = $newargs->getValues();
- foreach($ret as $k=>$v) {
- switch($k) {
- case 'pman-nodatabase':
- //echo "Turning off database";
- $this->ff->nodatabase= true;
-
- break;
+ foreach($ret as $k=>$v) {
+ switch($k) {
+ case 'pman-nodatabase':
+ echo "Turning off database\n";
+ $this->ff->nodatabase= true;
- default:
- die("need to fix option $k");
- }
+ break;
+ default:
+ die("need to fix option $k");
}
+
+ }
return false;
}