Home » Console » Console_Getargs » Bug #7132
Missing value for $_SERVER['SCRIPT_NAME']
Details
| Submitted | 2006-03-16 16:12 UTC |
|---|---|
| From | robmadole at gmail dot com |
| Assigned | scottmattocks |
| Status | Closed |
| Package | Console_Getargs |
| PHP Version | 5.1.2 |
| OS | FreeBSD 6.0 |
| Roadmaps | (Not assigned) |
Comments
[2006-03-16 16:12 UTC] robmadole at gmail dot com
Description:
------------
In Console/Getargs.php on line 288 there is a reference to $_SERVER. On my use of this package, the value for $_SERVER['SCRIPT_NAME'] is not set. The getHelp() function returns a help menu with missing information, namely the script name.
From what I understand, $_SERVER can be fairly unreliable from one operating system to another. Would it be a better solution to use argv[0] instead. I would think this information would be much more stable from one OS to another. And since this is a package devoted to the CLI, I would think the use of it would be ok.
Test script:
---------------
if (!isset($_SERVER['SCRIPT_NAME']))
{
echo 'The script name is not set in $_SERVER';
}
else
{
echo 'The script name is set';
}