I'm not sure if this is an issue with Zend_Tool or Zend_Console_Getopt, but I figured that I'd post it here since this is where I've encountered it. According to the Zend_Tool_Rpc_Endpoint_Cli Component Proposal, you can specify boolean values for action parameters like this:
zf show version --details=true
However, the actual ZendL_Tool_Rpc_System_Provider_Version::show() function takes two parameters: mode and nameincluded. If I try and pass false to nameincluded, I still get the verbose output:
~ $ zf show version --mode=mini --nameincluded=false
Zend Framework Version: 1.6.1
However, if I specify it as a numeric parameter instead, it works as expected:
~ $ zf show version --mode=major --nameincluded=0
1
I checked the value of $nameincluded being passed to the show() method and it is the string "false", not the boolean value false. However, the code simply does:
if ($nameincluded) {
$output = 'Zend Framework Version: ' . $output;
}
The reason why I'm not sure whether this is an issue with Zend_Tool or Zend_Console_Getopt is: should ZendL_Tool_Rpc_System_Provider_Version::show() expect to receive a parsed boolean parameter or is it unrealistic to expect the Zend_Console_Getopt code to parse string representations of boolean values to their corresponding boolean values? Obviously PHP itself silently handles converting "0" into the numeric value 0, but this isn't the case for "true" and "false". How do we want to help it along?