cvs: phpdoc-zh /features commandline.xml file-upload.xml http-auth.xml safe-mode.xml
| From: | Gregory Song | Date: | Tue, 21 Jan 2003 05:42:08 +0000 |
| Subject: | cvs: phpdoc-zh /features commandline.xml file-upload.xml http-auth.xml safe-mode.xml | ||
| Groups: | php.doc.zh | ||
| Request: | Send a blank email to doc-zh+get-983@lists.php.net to get a copy of this message | ||
gregory Tue Jan 21 00:42:08 2003 EDT
Modified files:
/phpdoc-zh/features commandline.xml file-upload.xml http-auth.xml
safe-mode.xml
Log:
Up to date with En Version...
Index: phpdoc-zh/features/commandline.xml
diff -u phpdoc-zh/features/commandline.xml:1.6 phpdoc-zh/features/commandline.xml:1.7
--- phpdoc-zh/features/commandline.xml:1.6 Tue Dec 31 00:04:16 2002
+++ phpdoc-zh/features/commandline.xml Tue Jan 21 00:42:07 2003
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.6 $ -->
+<!-- $Revision: 1.7 $ -->
<!-- $Author: gregory $ -->
-<!-- EN-Revision: 1.16 Maintainer: Gregory Status: ready -->
+<!-- EN-Revision: 1.18 Maintainer: Gregory Status: ready -->
<!-- CREDITS: thomaslio -->
<chapter id="features.commandline">
<title>PHP µÄÃüÁîÐÐģʽ</title>
@@ -144,7 +144,7 @@
<row>
<entry><constant>STDERR</constant></entry>
<entry>
- Ò»¸öÒÑ´ò¿ªµÄÖ¸Ïò <literal>stdout</literal>
µÄÁ÷¡£Äú¿ÉÒÔÓÃÈçÏ·½Ê½À´µ÷Óãº
+ Ò»¸öÒÑ´ò¿ªµÄÖ¸Ïò <literal>stderr</literal>
µÄÁ÷¡£Äú¿ÉÒÔÓÃÈçÏ·½Ê½À´µ÷Óãº
<programlisting role="php">
$stderr = fopen('php://stderr', 'w');
</programlisting>
@@ -601,7 +601,12 @@
<!-- :-) -->
</para>
</note>
- </entry>
+ <note>
+ <para>
+ <literal>-r</literal> ÔÚ <emphasis>CLI</emphasis> SAPI
ÖÐÓÐЧ£¬ÔÚ <emphasis>CGI</emphasis> SAPI ÖÐÎÞЧ¡£
+ </para>
+ </note>
+ </entry>
</row>
<row>
<entry>-h</entry>
Index: phpdoc-zh/features/file-upload.xml
diff -u phpdoc-zh/features/file-upload.xml:1.4 phpdoc-zh/features/file-upload.xml:1.5
--- phpdoc-zh/features/file-upload.xml:1.4 Wed Jan 8 04:11:19 2003
+++ phpdoc-zh/features/file-upload.xml Tue Jan 21 00:42:08 2003
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.4 $ -->
+<!-- $Revision: 1.5 $ -->
<!-- $Author: gregory $ -->
-<!-- EN-Revision: 1.54 Maintainer: Gregory Status: ready -->
+<!-- EN-Revision: 1.55 Maintainer: Gregory Status: ready -->
<chapter id="features.file-upload">
<title>ÎļþÉÏ´«´¦Àí</title>
@@ -28,7 +28,7 @@
<programlisting role="html">
<![CDATA[
<form enctype="multipart/form-data" action="_URL_"
method="post">
-<input type="hidden" name="MAX_FILE_SIZE" value="1000">
+<input type="hidden" name="MAX_FILE_SIZE" value="30000">
Send this file: <input name="userfile" type="file">
<input type="submit" value="Send File">
</form>
@@ -106,19 +106,25 @@
<example>
<title>ʹÎļþÉÏ´«ÉúЧ</title>
<para>
- ÒÔÏÂÀý³ÌÊÊÓÃÓÚ PHP 4.0.2 ÒÔÉϰ汾¡£Çë²ÎÔĺ¯Êý
<function>is_uploaded_file</function> ºÍ
<function>move_uploaded_file</function>¡£
+ Çë²éÔĺ¯Êý <function>is_uploaded_file</function> ºÍ
<function>move_uploaded_file</function>
ÒÔ»ñÈ¡½øÒ»²½µÄÐÅÏ¢¡£ÒÔÏ·¶Àý´¦ÀíÓÉ±íµ¥ÌṩµÄÎļþÉÏ´«¡£
</para>
<programlisting role="php">
<![CDATA[
-<?php
-// In PHP earlier then 4.1.0, $HTTP_POST_FILES should be used instead of $_FILES.
-if (is_uploaded_file($_FILES['userfile']['tmp_name'])) {
- copy($_FILES['userfile']['tmp_name'],
"/place/to/put/uploaded/file");
+<?php
+// ÔÚ 4.1.0 ÒÔǰµÄ PHP ÖУ¬ÐèÒªÓà $HTTP_POST_FILES ´úÌæ $_FILES¡£
+// ÔÚ 4.0.3 ÒÔǰµÄ PHP ÖУ¬ÐèÒªÓà copy() ºÍ is_uploaded_file() À´´úÌæ
move_uploaded_file()¡£
+
+$uploaddir = '/var/www/uploads/';
+
+print "<pre>";
+if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploaddir .
$_FILES['userfile']['name'])) {
+ print "File is valid, and was successfully uploaded. Here's some more debugging
info:\n";
+ print_r($_FILES);
} else {
- echo "Possible file upload attack. Filename: " .
$_FILES['userfile']['name'];
+ print "Possible file upload attack! Here's some debugging info:\n";
+ print_r($_FILES);
}
-/* ...or... */
-move_uploaded_file($_FILES['userfile']['tmp_name'],
"/place/to/put/uploaded/file");
+
?>
]]>
</programlisting>
Index: phpdoc-zh/features/http-auth.xml
diff -u phpdoc-zh/features/http-auth.xml:1.5 phpdoc-zh/features/http-auth.xml:1.6
--- phpdoc-zh/features/http-auth.xml:1.5 Thu Dec 26 07:23:45 2002
+++ phpdoc-zh/features/http-auth.xml Tue Jan 21 00:42:08 2003
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="gb2312"?>
-<!-- $Revision: 1.5 $ -->
+<!-- $Revision: 1.6 $ -->
<!-- $Author: gregory $ -->
-<!-- EN-Revision: 1.30 Maintainer: Gregory Status: ready -->
+<!-- EN-Revision: 1.31 Maintainer: Gregory Status: ready -->
<chapter id="features.http-auth">
<title>ÓÃ PHP ½øÐÐ HTTP ÈÏÖ¤</title>
@@ -86,7 +86,8 @@
exit;
}
- if (!isset($_SERVER['PHP_AUTH_USER']) || ($_POST['SeenBefore'] == 1
&& $_POST['OldAuth'] == $_SERVER['PHP_AUTH_USER'])) {
+ if (!isset($_SERVER['PHP_AUTH_USER']) ||
+ ($_POST['SeenBefore'] == 1 && $_POST['OldAuth'] ==
$_SERVER['PHP_AUTH_USER'])) {
authenticate();
}
else {
Index: phpdoc-zh/features/safe-mode.xml
diff -u phpdoc-zh/features/safe-mode.xml:1.8 phpdoc-zh/features/safe-mode.xml:1.9
--- phpdoc-zh/features/safe-mode.xml:1.8 Sat Dec 28 03:26:43 2002
+++ phpdoc-zh/features/safe-mode.xml Tue Jan 21 00:42:08 2003
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="gb2312"?>
<!-- $Revision: 1.4 $ -->
<!-- $Author: gregory $ -->
-<!-- EN-Revision: 1.28 Maintainer: thomaslio Status: ready -->
+<!-- EN-Revision: 1.30 Maintainer: thomaslio Status: ready -->
<!-- CREDITS: Gregory -->
<!-- CREDITS: dallas -->
<chapter id="features.safe-mode">
@@ -115,6 +115,9 @@
linkend="ini.include-path">include_path</link>
Ö¸ÁîÀàËÆµÄ·ç¸ñÓ÷ֺŸô¿ªµÄ·¾¶£¬¶ø²»Ö»ÊÇÒ»¸öĿ¼¡£
</simpara>
+ <simpara>
+
Ö¸¶¨µÄÏÞÖÆÊµ¼ÊÉÏÊÇÒ»¸öǰ׺£¬¶ø·ÇÒ»¸öĿ¼Ãû¡£ÕâÒ²¾ÍÊÇ˵¡°safe_mode_include_dir
=
/dir/incl¡±½«ÔÊÐí·ÃÎÊ¡°/dir/include¡±ºÍ¡°/dir/incls¡±£¬Èç¹ûËüÃÇ´æÔÚ¡£Èç¹ûÄúÏ£Íû½«·ÃÎÊ¿ØÖÆÔÚÒ»¸öÖ¸¶¨µÄĿ¼£¬ÄÇôÇëÔÚ½áβ¼ÓÉÏÒ»¸öбÏߣ¬ÀýÈ磺¡°safe_mode_include_dir
= /dir/incl/¡±¡£
+ </simpara>
</listitem>
</varlistentry>
<varlistentry id="ini.safe-mode-exec-dir">
@@ -166,7 +169,7 @@
</term>
<listitem>
<para>
- ½« PHP
ËùÄÜ´ò¿ªµÄÎļþÏÞÖÆÔÚÖ¸¶¨µÄĿ¼Ê÷¡£±¾Ö¸Áî<emphasis>²»ÊÜ</emphasis>°²È«Ä£Ê½´ò¿ª»òÕ߹رյÄÓ°Ïì¡£
+ ½« PHP
ËùÄÜ´ò¿ªµÄÎļþÏÞÖÆÔÚÖ¸¶¨µÄĿ¼Ê÷£¬°üÀ¨Îļþ±¾Éí¡£±¾Ö¸Áî<emphasis>²»ÊÜ</emphasis>°²È«Ä£Ê½´ò¿ª»òÕ߹رյÄÓ°Ïì¡£
</para>
<para>
µ±Ò»¸ö½Å±¾ÊÔͼÓÃÀýÈç fopen »òÕß gzopen
´ò¿ªÒ»¸öÎļþʱ£¬¸ÃÎļþµÄλÖý«±»¼ì²é¡£µ±ÎļþÔÚÖ¸¶¨µÄĿ¼Ê÷Ö®Íâʱ