Zend Framework

Neverending loop in ->parse()

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.7.4
  • Fix Version/s: 1.9.7
  • Component/s: Zend_Console_Getopt
  • Labels:
    None

Description

->setArguments() require an array as the only parameter, but setting it to something else i.e. a string or number will cause ->parse() to jump into a neverending loop at line 697:
Warning: array_shift(): The argument should be an array in \includes\ZendFramework-1.7.4\library\Zend\Console\Getopt.php on line 697

An error message both in ->setArguments() and ->parse() would be more apropriate

Activity

Hide
Menno Luiten added a comment -

Attached patch to throw Zend_Console_Getopt_Exception when not given an array as parameter. Another solution would be to transform the non-array value into an array and work with that. However, current documentation would suggest the Exception should be the expected behaviour.

Show
Menno Luiten added a comment - Attached patch to throw Zend_Console_Getopt_Exception when not given an array as parameter. Another solution would be to transform the non-array value into an array and work with that. However, current documentation would suggest the Exception should be the expected behaviour.
Hide
Menno Luiten added a comment -

Resolved in r19765

Show
Menno Luiten added a comment - Resolved in r19765

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: