Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.4.0

Bug #7132 Missing value for $_SERVER['SCRIPT_NAME']
Submitted: 2006-03-16 16:12 UTC
From: robmadole at gmail dot com Assigned: scottmattocks
Status: Closed Package: Console_Getargs (version 1.3.0)
PHP Version: 5.1.2 OS: FreeBSD 6.0
Roadmaps: (Not assigned)    
Subscription  


 [2006-03-16 16:12 UTC] robmadole at gmail dot com (Rob Madole)
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'; }

Comments

 [2006-04-10 20:18 UTC] scottmattocks (Scott Mattocks)
Thank you for your bug report. This issue has been fixed in the latest released version of the package, which you can download at http://pear.php.net/get/Console_Getargs