svn: /phpdoc/en/trunk/features/ commandline.xml

From: Date: Fri, 01 Jul 2011 14:09:12 +0000
Subject: svn: /phpdoc/en/trunk/features/ commandline.xml
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-8384@lists.php.net to get a copy of this message
philip Fri, 01 Jul 2011 14:09:12 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=312768 Log: Added basic cli web server documentation. Changed paths: U phpdoc/en/trunk/features/commandline.xml Modified: phpdoc/en/trunk/features/commandline.xml =================================================================== --- phpdoc/en/trunk/features/commandline.xml 2011-07-01 13:59:18 UTC (rev 312767) +++ phpdoc/en/trunk/features/commandline.xml 2011-07-01 14:09:12 UTC (rev 312768) @@ -1579,7 +1579,78 @@ </note> </section> <!--}}}--> - + + <!--Built-in CLI Web Server: {{{--> + <section xml:id="features.commandline.webserver"> + <title>Built-in web server</title> + + <para> + As of PHP 5.4.0, the &cli.sapi; provides a built-in web server. + </para> + + <para> + This web server is designed for developmental purposes only, and should not + be used in production. + </para> + + <example> + <title>Loading a file</title> + <programlisting role="shell"> +<![CDATA[ +$ php -S localhost:8000 test.php +]]> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ +PHP Development Server is listening on localhost:8000 in . ... Press Ctrl-C to quit. +]]> + </screen> + </example> + + <example> + <title>Loading a directory</title> + <programlisting role="shell"> +<![CDATA[ +$ php -S localhost:8000 -t foo/ +]]> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ +PHP Development Server is listening on localhost:8000 in foo/ ... Press Ctrl-C to quit. +]]> + </screen> + </example> + + <example> + <title>Example output while making HTTP requests</title> + <programlisting role="php"> +<![CDATA[ +<?php +// hello.php +echo htmlspecialchars($_GET['hello'], ENT_QUOTES, 'UTF-8'); +?> +]]> + </programlisting> + <programlisting role="shell"> +<![CDATA[ +$ php -S localhost:8000 hello.php +]]> + </programlisting> + &example.outputs.similar; + <screen> +<![CDATA[ +[Fri Jul 1 06:29:04 2011] ::1:63530: / +[Fri Jul 1 06:29:10 2011] ::1:63532: /?hello=world +[Fri Jul 1 06:29:11 2011] ::1:63533: /?hello=you +]]> + </screen> + </example> + + </section> + <!--}}}--> + </chapter> <!-- Keep this comment at the end of the file

« previous php.doc.cvs (#8384) next »