#18657 [Opn]: CLI version: scriptname is only available through argv
| From: | rasmus@php.net | Date: | Tue, 30 Jul 2002 20:01:49 +0000 |
| Subject: | #18657 [Opn]: CLI version: scriptname is only available through argv | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-15621@lists.php.net to get a copy of this message | ||
ID: 18657
Updated by: rasmus@php.net
Reported By: cmv@php.net
Status: Open
Bug Type: Feature/Change Request
Operating System: Linux 2.4
PHP Version: 4.2.2
New Comment:
Would be a bit odd to have any $_SERVER variables in the cli version as
there is no server.
Previous Comments:
------------------------------------------------------------------------
[2002-07-30 15:59:22] cmv@php.net
With the CLI version, the only way to access the script name is
through:
$_SERVER['argv'][0]
In 4.2.2, $_SERVER['PHP_SELF'] is set, but empty. In 4.3.0-dev, it's
not even set.
I don't know which of $_SERVER['SCRIPT_NAME'] or $_SERVER['PHP_SELF']
would be more appropriate, but I think setting either of those to the
script name would be more intuitive, and might make porting web-based
scripts to CLI-based scripts easier.
- Colin
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=18657&edit=1