philip Thu Nov 14 06:22:58 2002 EDT
Modified files:
/phpdoc/en/features commandline.xml
Log:
$argv and $argc only exist if register_globals = on in CLI before 4.3.0
Closes bug #20411
Index: phpdoc/en/features/commandline.xml
diff -u phpdoc/en/features/commandline.xml:1.11 phpdoc/en/features/commandline.xml:1.12
--- phpdoc/en/features/commandline.xml:1.11 Fri Aug 16 12:13:18 2002
+++ phpdoc/en/features/commandline.xml Thu Nov 14 06:22:58 2002
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.11 $ -->
+<!-- $Revision: 1.12 $ -->
<chapter id="features.commandline">
<title>Using PHP from the command line</title>
<!-- NEW DOCUMENTATION STARTS -->
@@ -99,11 +99,26 @@
<entry><link
linkend="ini.register-argc-argv">register_argc_argv</link></entry>
<entry>&true;</entry>
<entry>
- The global <literal>PHP</literal> variables <literal>$argc</literal>
- (number of arguments passed to the application) and
- <literal>$argv</literal> (array of the actual arguments) are always
- registered and filled in with the appropriate values when using the
- <literal>CLI SAPI</literal>.
+ <para>
+ Because this setting is &true; you will always have access to
+ <emphasis>argc</emphasis> (number of arguments passed to the
+ application) and <emphasis>argv</emphasis> (array of the actual
+ arguments) in the <literal>CLI SAPI</literal>.
+ </para>
+ <para>
+ As of PHP 4.3.0, the <literal>PHP</literal> variables
+<literal>$argc</literal>
+ and <literal>$argv</literal> are registered and filled in with the
+appropriate
+ values when using the <literal>CLI SAPI</literal>. Before this time
+ the creation of these variables behaved as they do in
+ <literal>CGI</literal> and <literal>MODULE</literal> versions
+ which requires the PHP directive
+ <link linkend="ini.register-globals">register_globals</link> to
+ be <emphasis>on</emphasis>. Regardless of version or register_globals
+ setting you can always go through either
+ <link linkend="reserved.variables.server">$_SERVER</link> or
+ <varname>$HTTP_SERVER_VARS</varname>. Example:
+ <varname>$_SERVER['argv']</varname>
+ </para>
</entry>
</row>
</tbody>
--
PHP Documentation Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php