This is a feature, but there might be a fix for it in newer releases.
Basically, the console client tries to use the first letter as the short
option. In the case of test2(), you are using 't' twice. I try to name
them so that the variable names begin with different letters.
If you'd like, put this in the issue tracker and I will try to find a
solution that works for everyone.
-ralph
Nomolos Sharpe wrote:
Hi All
I experiencing some weird behaviour when implementing a Custom Provider.
Basically if two parameters start with the same letter it generates an
error.
Is this Feature or is this a Bug?
My code is as follows:
<?php
require_once "Zend/Tool/Framework/Provider/Interface.php";
class My_Component_Foo implements Zend_Tool_Framework_Provider_Interface
{
public function test1($testvar)
{
echo 'Test1 Passed';
}
public function test2($testvar, $testvariable)
{
echo 'Test2 Passed';
}
}
Executed with the following commands
_*Test 1*_
*Command:*
./zf.sh test1 foo 1
*Output*
Test1 Passed
_*Test 2*_
*Command:*
./zf.sh test2 foo 1 2
*Output:*
* An Error Has Occurred **
** Option "-t" is being defined more than once. *
Zend Framework Command Line Console Tool v1.9.0a1
Details for action "Test2" and provider "Foo"
Foo
zf test2 foo testvar testvariable
What am I doing wrong?
Regards,
Nomolos