Add array support in CLI (and update the documentation)
git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@1241 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
11
cli.php
11
cli.php
@@ -159,6 +159,17 @@ $cli->run(); */
|
||||
$argv[$key] = file_get_contents ("php://stdin");
|
||||
}
|
||||
|
||||
// Convert "toto=ror&ypyp=oo" arg to array("toto"=>"ror","ypyp"=>"oo")
|
||||
// (Array management in CLI)
|
||||
foreach ($argv as $key=>$arg)
|
||||
{
|
||||
$val = null;
|
||||
parse_str ($arg, $val);
|
||||
if (count ($val) === 1 && reset ($val) === "")
|
||||
$val = $arg;
|
||||
$argv[$key] = $val;
|
||||
}
|
||||
|
||||
// TODO : Manage a parameter in the constructor of the class
|
||||
try
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user