--- library/Zend/Console/Getopt.php (revision 9045) +++ library/Zend/Console/Getopt.php (working copy) @@ -239,9 +239,15 @@ * @param array $argv * @param array $getoptConfig * @return void + * @throws Zend_Exception */ public function __construct($rules, $argv = null, $getoptConfig = array()) { + if (!isset($_SERVER['argv'])) { + require_once 'Zend/Exception.php'; + throw new Zend_Exception('No argv available, register_argc_argv is probably set to Off'); + } + $this->_progname = $_SERVER['argv'][0]; $this->setOptions($getoptConfig); $this->addRules($rules);