svn: /phpdoc/en/trunk/features/ commandline.xml
| From: | Daniel Egeberg | Date: | Sat, 22 May 2010 09:33:18 +0000 |
| Subject: | svn: /phpdoc/en/trunk/features/ commandline.xml | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-6706@lists.php.net to get a copy of this message | ||
degeberg Sat, 22 May 2010 09:33:18 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=299622
Log:
Cleaned up the examples a bit
Changed paths:
U phpdoc/en/trunk/features/commandline.xml
Modified: phpdoc/en/trunk/features/commandline.xml
===================================================================
--- phpdoc/en/trunk/features/commandline.xml 2010-05-22 09:32:43 UTC (rev 299621)
+++ phpdoc/en/trunk/features/commandline.xml 2010-05-22 09:33:18 UTC (rev 299622)
@@ -240,11 +240,11 @@
The &cli.sapi; does <emphasis role="strong">not</emphasis> change
the
current directory to the directory of the executed script!
</para>
- <informalexample>
- <para>
+ <example>
+ <title>
Example showing the difference to the <acronym>CGI</acronym>
<acronym>SAPI</acronym>:
- </para>
+ </title>
<programlisting role="php">
<![CDATA[
<?php
@@ -284,7 +284,7 @@
<para>
This allows greater flexibility when writing shell tools in PHP.
</para>
- </informalexample>
+ </example>
<note>
<para>
The <acronym>CGI</acronym> <acronym>SAPI</acronym> supports this
@@ -457,10 +457,7 @@
]]>
</screen>
</para>
- <para><informalexample>
- <para>
- Examples (lines are wrapped for layout reasons):
- </para>
+ <para><example>
<screen>
<![CDATA[
# Omitting the value part will set the given configuration directive to "1"
@@ -483,7 +480,7 @@
string(15) "doesntmakesense"
]]>
</screen>
- </informalexample></para>
+ </example></para>
</entry>
</row>
<row>
@@ -564,11 +561,8 @@
<entry>-m</entry>
<entry>--modules</entry>
<entry>
- <para><informalexample>
- <para>
- Using this option, PHP prints out the built in (and loaded) PHP and
- Zend modules:
- </para>
+ <para><example>
+ <title>Printing built in (and loaded) PHP and Zend modules</title>
<screen>
<![CDATA[
$ php -m
@@ -587,7 +581,7 @@
[Zend Modules]
]]>
</screen>
- </informalexample></para>
+ </example></para>
</entry>
</row>
<row>
@@ -607,10 +601,8 @@
to not collide with command line variable substitution done by the
shell.
</para>
- <informalexample>
- <para>
- Example showing a parser error
- </para>
+ <example>
+ <title>Getting a syntax error when using double quotes</title>
<screen>
<![CDATA[
$ php -r "$foo = get_defined_constants();"
@@ -619,7 +611,7 @@
Parse error: syntax error, unexpected '=' in Command line code on line 1
]]>
</screen>
- </informalexample>
+ </example>
<para>
The problem here is that the sh/bash performs variable substitution
even when using double quotes <literal>"</literal>. Since the
@@ -633,11 +625,16 @@
$ php -r " = get_defined_constants();"
]]>
</screen>
- <para>
- The correct way would be to use single quotes <literal>'</literal>.
- Variables in single-quoted strings are not expanded
- by sh/bash.
- </para>
+ </informalexample>
+
+ <para>
+ The correct way would be to use single quotes <literal>'</literal>.
+ Variables in single-quoted strings are not expanded
+ by sh/bash.
+ </para>
+ <example>
+ <title>Using single quotes to prevent the shell's variable
+ substitution</title>
<screen>
<![CDATA[
$ php -r '$foo = get_defined_constants(); var_dump($foo);'
@@ -654,7 +651,7 @@
[...]
]]>
</screen>
- </informalexample>
+ </example>
<para>
If you are using a shell different from sh/bash, you might experience
further issues. Feel free to open a bug report at
@@ -762,11 +759,9 @@
<entry>-v</entry>
<entry>--version</entry>
<entry>
- <para><informalexample>
- <para>
- Writes the PHP, PHP <acronym>SAPI</acronym>, and Zend version to
- standard output, e.g.
- </para>
+ <para><example>
+ <title>Using <option>-v</option> to get the
<acronym>SAPI</acronym>
+ name and the version of PHP and Zend</title>
<screen>
<![CDATA[
$ php -v
@@ -775,7 +770,7 @@
Zend Engine v2.3.0, Copyright (c) 1998-2009 Zend Technologies
]]>
</screen>
- </informalexample></para>
+ </example></para>
</entry>
</row>
<row>