didou Sun Mar 21 12:00:21 2004 EDT
Modified files: /phpdoc/en/features commandline.xml Log: adding php tags, CDATAs, CS and corrected a role http://cvs.php.net/diff.php/phpdoc/en/features/commandline.xml?r1=1.30&r2=1.31&ty=u Index: phpdoc/en/features/commandline.xml diff -u phpdoc/en/features/commandline.xml:1.30 phpdoc/en/features/commandline.xml:1.31 --- phpdoc/en/features/commandline.xml:1.30 Fri Feb 6 12:17:52 2004 +++ phpdoc/en/features/commandline.xml Sun Mar 21 12:00:21 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.30 $ --> +<!-- $Revision: 1.31 $ --> <chapter id="features.commandline"> <title>Using PHP from the command line</title> <!-- NEW DOCUMENTATION STARTS --> @@ -226,7 +226,11 @@ opening it with <programlisting role="php"> <![CDATA[ +<?php + $stdin = fopen('php://stdin', 'r'); + +?> ]]> </programlisting> </entry> @@ -238,7 +242,11 @@ opening it with <programlisting role="php"> <![CDATA[ +<?php + $stdout = fopen('php://stdout', 'w'); + +?> ]]> </programlisting> </entry> @@ -250,7 +258,11 @@ opening it with <programlisting role="php"> <![CDATA[ +<?php + $stderr = fopen('php://stderr', 'w'); + +?> ]]> </programlisting> </entry> @@ -263,7 +275,7 @@ Given the above, you don't need to open e.g. a stream for <literal>stderr</literal> yourself but simply use the constant instead of the stream resource: - <programlisting role="php"> + <programlisting role="shell"> <![CDATA[ php -r 'fwrite(STDERR, "stderr\n");' ]]> @@ -283,8 +295,8 @@ <programlisting role="php"> <![CDATA[ <?php - /* Our simple test application named test.php*/ - echo getcwd(), "\n"; +// Our simple test application named test.php +echo getcwd(), "\n"; ?> ]]> </programlisting> @@ -476,7 +488,7 @@ <![CDATA[ #!/usr/bin/php <?php - var_dump($argv); +var_dump($argv); ?> ]]> </programlisting> @@ -1101,7 +1113,9 @@ <example> <title>Batch file to run a command line PHP script (script.bat)</title> <programlisting role="shell"> +<![CDATA[ @c:\php\cli\php.exe script.php %1 %2 %3 %4 +]]> </programlisting> </example> </para>