When i try this in __construct:
var_dump($argc);
var_dump($argv);
var_dump($_SERVER["argv"]);
It returns error
Undefined variable: argc and
Undefined variable: argv
and array
(size=0) empty
When i declare $argc and $argv in global it returns all null.
Also i am parsing arguments using nncron like this:
* * * * * php \php\class.xmlcontroler.php timeout=60
0 * * * * php \php\class.xmlcontroler.php timeout=3600
What is solution?
$argv
and$argc
are only available in the global namespace. You would have to handle them as a parameter to your constructor.Will provide:
when called like this
php a.php 123
Update: Class example