#18657 [Opn]: CLI version: scriptname is only available through argv

From: Date: Sat, 03 Aug 2002 13:21: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-15914@lists.php.net to get a copy of this message
ID: 18657 Updated by: helly@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: But it would make sense AND the incase of CLI why not treat SHELL as SERVER? Previous Comments: ------------------------------------------------------------------------ [2002-07-30 16:01:49] rasmus@php.net Would be a bit odd to have any $_SERVER variables in the cli version as there is no server. ------------------------------------------------------------------------ [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

« previous php.bugs (#15914) next »