cvs: phpdoc /en/features commandline.xml

From: Date: Thu, 16 May 2002 20:52:42 +0000
Subject: cvs: phpdoc /en/features commandline.xml
Groups: php.doc 
Request: Send a blank email to phpdoc+get-969345622@lists.php.net to get a copy of this message
goba Thu May 16 16:52:42 2002 EDT Modified files: /phpdoc/en/features commandline.xml Log: Correcting CGI/CLI problems in script and windows examples Index: phpdoc/en/features/commandline.xml diff -u phpdoc/en/features/commandline.xml:1.4 phpdoc/en/features/commandline.xml:1.5 --- phpdoc/en/features/commandline.xml:1.4 Tue May 14 05:06:23 2002 +++ phpdoc/en/features/commandline.xml Thu May 16 16:52:38 2002 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <chapter id="features.commandline"> <title>Using PHP from the command line</title> <!-- NEW DOCUMENTATION STARTS --> @@ -822,7 +822,7 @@ <title>Script intended to be run from command line (script.php)</title> <programlisting role="php"> <![CDATA[ -#!/usr/bin/php -q +#!/usr/bin/php <?php if ($argc != 2 || in_array($argv[1], array('--help', '-help', '-h', '-?'))) { @@ -847,13 +847,13 @@ </example> <para> In the script above, we used the special first line to indicate, - that this file should be run by PHP and should not print out HTTP - headers. There are two variables you can use while writing command - line applications with PHP: <varname>$argc</varname> and - <varname>$argv</varname>. The first is the number of arguments plus - one (the name of the script running). The second is an array - containing the arguments, starting with the script name as number - zero (<varname>$argv[0]</varname>). + that this file should be run by PHP. We work with a CLI version + here, so there will be no HTTP header printouts. There are two + variables you can use while writing command line applications with + PHP: <varname>$argc</varname> and <varname>$argv</varname>. The + first is the number of arguments plus one (the name of the script + running). The second is an array containing the arguments, starting + with the script name as number zero (<varname>$argv[0]</varname>). </para> <para> In the program above we checked if there are less or more than one @@ -872,7 +872,7 @@ <example> <title>Batch file to run a command line PHP script (script.bat)</title> <programlisting role="winbat"> -@c:\php\php.exe -q script.php %1 %2 %3 %4 +@c:\php\php.exe script.php %1 %2 %3 %4 </programlisting> </example> <para>

« previous php.doc (#969345622) next »