Permalink
Browse files

fix defining func in modes

  • Loading branch information...
djthread committed Mar 19, 2012
1 parent 6878b42 commit 8be52b3a67981bc8050d1dd7ec7fda357a24e884
Showing with 2 additions and 3 deletions.
  1. +2 −3 MPCWorker.php
View
@@ -127,6 +127,8 @@ protected function __construct(array $params)
}
}
+ if (!$this->params['func']) $this->params['func'] = 'help';
+
if ($this->params['debug']) {
print_r($this->params);
}
@@ -155,7 +157,6 @@ public static function runFromCLIArguments($argv)
// Parameters defined in the config file
$p = isset($p) && is_array($p) ? $p : array();
- $params['func'] = null;
$params = array_merge(self::$paramDefaults, $p);
array_shift($argv); // take off the script name. useless.
@@ -288,8 +289,6 @@ public static function runFromCLIArguments($argv)
}
}
- if (!$params['func']) $params['func'] = 'help';
-
$w = new self($params);
$w->$params['func']();
}

0 comments on commit 8be52b3

Please sign in to comment.