cvs: phpdoc-zh /features connection-handling.xml cookies.xml

From: Date: Fri, 09 Aug 2002 01:08:22 +0000
Subject: cvs: phpdoc-zh /features connection-handling.xml cookies.xml
Groups: php.doc.zh 
Request: Send a blank email to doc-zh+get-289@lists.php.net to get a copy of this message
gregory Thu Aug 8 21:08:22 2002 EDT Modified files: /phpdoc-zh/features connection-handling.xml cookies.xml Log: Verbal Problem fixed...

Index: phpdoc-zh/features/connection-handling.xml diff -u phpdoc-zh/features/connection-handling.xml:1.2 phpdoc-zh/features/connection-handling.xml:1.3 --- phpdoc-zh/features/connection-handling.xml:1.2 Tue Aug 6 04:28:57 2002 +++ phpdoc-zh/features/connection-handling.xml Thu Aug 8 21:08:22 2002 @@ -1,74 +1,39 @@ -<?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.2 $ --> -<!-- $Author: yincheng $ --> -<!-- EN-Revision: 1.19 Maintainer: thomaslio Status: ready --> +<?xml version="1.0" encoding="iso-8859-1"?> +<!-- $Revision: 1.3 $ --> +<!-- $Author: gregory $ --> +<!-- EN-Revision: 1.14 Maintainer: thomaslio Status: ready --> +<!-- CREDITS: Gregory --> <chapter id="features.connection-handling"> - <title>Á¬½Ó²Ù×÷</title> + <title>Á¬½Ó´¦Àí</title> <note> - <para>Ó¦ÓÃÔÚ3.0.7°æ±¾ÒÔÉÏ</para> + <para>ÒÔÏÂÄÚÈÝ¶Ô PHP 3.0.7 ¼°¸ü¸ß°æ±¾ÊÊÓá£</para> </note> <para> - PHPµÄÈýÖÖ¿ÉÄÜ´æÔÚµÄÁ¬½Ó״̬ÊÇ£º + ÔÚ PHP ÄÚ²¿£¬ÏµÍ³Î¬»¤×ÅÁ¬½Ó״̬£¬Æä״̬ÓÐÈýÖÖ¿ÉÄܵÄÇé¿ö£º <itemizedlist> - <listitem><simpara>0 - NORMAL</simpara></listitem> - <listitem><simpara>1 - ABORTED</simpara></listitem> - <listitem><simpara>2 - TIMEOUT</simpara></listitem> + <listitem><simpara>0 - NORMAL£¨Õý³££©</simpara></listitem> + <listitem><simpara>1 - ABORTED£¨Í˳ö£©</simpara></listitem> + <listitem><simpara>2 - TIMEOUT£¨³¬Ê±£©</simpara></listitem> </itemizedlist> </para> <simpara> - µ±PHPÔËÐÐÔÚNORMAL·½Ê½ÏÂ,Èç¹ûÔ¶³ÌµÄ¿Í»§¶ËµÄÁ¬½Ó״̬ABORTED±»´ò¿ªÊ±. - Ô¶³ÌÁ¬½Ó¾­³£ÊÇÓû§µ¥»÷ÁËSTOP°´Å¥¡£Èç¹ûPHPÇ¿ÖÆÊ±¼äÓÐÏÞÖÆµÄ»°(¼û - <function>set_time_limit</function>º¯Êý)£¬TIMEOUT״̬½«»á´ò¿ª¡£</simpara> + µ± PHP ½Å±¾Õý³£µØÔËÐÐ NORMAL ״̬ʱ£¬Á¬½ÓΪÓÐЧ¡£µ±Ô¶³Ì¿Í»§¶ËÖжÏÁ¬½Óʱ£¬ABORTED ״̬µÄ±ê¼Ç½«»á±»´ò¿ª¡£Ô¶³Ì¿Í»§¶ËÁ¬½ÓµÄÖжÏͨ³£ÊÇÓÉÓû§µã»÷ STOP °´Å¥µ¼Öµġ£µ±Á¬½Óʱ¼ä³¬¹ý PHP µÄʱÏÞ£¨Çë²ÎÔÄ <function>set_time_limit</function> º¯Êý£©Ê±£¬TIMEOUT ״̬µÄ±ê¼Ç½«±»´ò¿ª¡£ + </simpara> <simpara> - Äã¿ÉÒÔ¾ö¶¨ÊÇ·ñÓÃÄãµÄ½Å±¾µ¼Ö¿ͻ§¶ËµÄÁ¬½ÓÖÕÖ¹¡£Sometimes it is handy to always have your - scripts run to completion even if there is no remote browser receiving - the output. The default behaviour is however for your script to be - aborted when the remote client disconnects. This behaviour can be - set via the ignore_user_abort &php.ini; directive as well as through - the corresponding "php_value ignore_user_abort" Apache .conf directive or - with the <function>ignore_user_abort</function> function. If you do - not tell PHP to ignore a user abort and the user aborts, your script - will terminate. The one exception is if you have registered a shutdown - function using <function>register_shutdown_function</function>. With a - shutdown function, when the remote user hits his STOP button, the - next time your script tries to output something PHP will detect that - the connection has been aborted and the shutdown function is called. - This shutdown function will also get called at the end of your script - terminating normally, so to do something different in case of a client - disconnect you can use the <function>connection_aborted</function> - function. This function will return &true; if the connection was - aborted.</simpara> + Äú¿ÉÒÔ¾ö¶¨ÄúµÄ½Å±¾ÊÇ·ñÐèÒªÔÚ¿Í»§¶ËÖжÏÁ¬½ÓʱÍ˳ö¡£ÓÐʱºòÈÃÄúµÄ½Å±¾ÍêÕûµÄÔËÐÐ»á´øÀ´ºÜ¶à·½±ã£¬¼´Ê±Ã»ÓÐÔ¶³Ìä¯ÀÀÆ÷½ÓÊܽű¾µÄÊä³ö¡£Ä¬ÈϵÄÇé¿öÊǵ±Ô¶³Ì¿Í»§¶ËÁ¬½ÓÖжÏʱ½Å±¾½«»áÍ˳ö¡£¸Ã´¦Àí¹ý³Ì¿ÉÓÉ &php.ini; µÄ ignore_user_abort »òÓÉ Apache .conf ÉèÖÃÖжÔÓ¦µÄ¡°php_value ignore_user_abort¡±ÒÔ¼° <function>ignore_user_abort</function> º¯ÊýÀ´¿ØÖÆ¡£Èç¹ûÄúûÓиæËß PHP ºöÂÔÓû§µÄÖжϣ¬ÄúµÄ½Å±¾½«»á±»Öжϣ¬³ý·ÇÄúͨ¹ý <function>register_shutdown_function</function> ÉèÖÃÁ˹رմ¥·¢º¯Êý¡£Í¨¹ý¸Ã¹Ø±Õ³ö·¢º¯Êý£¬µ±Ô¶³ÌÓû§µã»÷ STOP °´Å¥ºó£¬ÄúµÄ½Å±¾Ôٴγ¢ÊÔÊä³öÊý¾Ýʱ£¬PHP ½«»á¼ì²âµ½Á¬½ÓÒѱ»Öжϣ¬²¢µ÷Óùرմ¥·¢º¯Êý¡£ + </simpara> <simpara> - Your script can also be terminated by the built-in script timer. - The default timeout is 30 seconds. It can be changed using - the max_execution_time &php.ini; directive or the corresponding - "php_value max_execution_time" Apache .conf directive as well as with - the <function>set_time_limit</function> function. When the timer - expires the script will be aborted and as with the above client - disconnect case, if a shutdown function has been registered it will - be called. Within this shutdown function you can check to see if - a timeout caused the shutdown function to be called by calling the - <function>connection_timeout</function> function. This function will - return &true; if a timeout caused the shutdown function to be called.</simpara> + ÄúµÄ½Å±¾Ò²ÓпÉÄܱ»ÄÚÖõĽű¾¼ÆÊ±Æ÷Öжϡ£Ä¬Èϵó¬Ê±ÏÞÖÆÎª 30 Ãë¡£Õâ¸öÖµ¿ÉÒÔͨ¹ýÉèÖà &php.ini; µÄ max_execution_time »ò Apache .conf ÉèÖÃÖжÔÓ¦µÄ¡°php_value max_execution_time¡±²ÎÊý»òÕß <function>set_time_limit</function> º¯ÊýÀ´¸ü¸Ä¡£µ±¼ÆÊýÆ÷³¬Ê±ºò£¬½Å±¾½«»áÀàËÆÓÚÒÔÉÏÁ¬½ÓÖжϵÄÇé¿öÍ˳ö£¬ÏÈǰ±»×¢²á¹ýµÄ¹Ø±Õ´¥·¢º¯ÊýÒ²½«ÔÚÕâʱ±»Ö´ÐС£Ôڸùرմ¥·¢º¯ÊýÖУ¬Äú¿ÉÒÔͨ¹ýµ÷Óà <function>connection_timeout</function> º¯ÊýÀ´¼ì²é³¬Ê±ÊÇ·ñµ¼Ö¹رմ¥·¢º¯Êý±»µ÷Óá£Èç¹û³¬Ê±µ¼ÖÂÁ˹رմ¥·¢º¯ÊýµÄµ÷Ó㬸ú¯Êý½«·µ»Ø &true;¡£ + </simpara> <simpara> - One thing to note is that both the ABORTED and the TIMEOUT states - can be active at the same time. This is possible if you tell - PHP to ignore user aborts. PHP will still note the fact that - a user may have broken the connection, but the script will keep - running. If it then hits the time limit it will be aborted and - your shutdown function, if any, will be called. At this point - you will find that <function>connection_timeout</function> - and <function>connection_aborted</function> return &true;. - You can also check both states in a single call by using the - <function>connection_status</function>. This function returns a - bitfield of the active states. So, if both states are active it - would return 3, for example.</simpara> + ÐèҪעÒâµÄÒ»µãÊÇ ABORTED ºÍ TIMEOUT ״̬¿ÉÒÔͬʱÓÐЧ¡£ÕâÔÚÄã¸æËß PHP ºöÂÔÓû§µÄÍ˳ö²Ù×÷ʱÊÇ¿ÉÄܵġ£PHP ½«ÈÔÈ»×¢ÒâÓû§ÒѾ­ÖжÏÁËÁ¬½Óµ«½Å±¾ÈÔÈ»ÔÚÔËÐеÄÇé¿ö¡£Èç¹ûµ½ÁËÔËÐеÄʱ¼äÏÞÖÆ£¬½Å±¾½«±»Í˳ö£¬ÉèÖùýµÄ¹Ø±Õ´¥·¢º¯ÊýÒ²½«±»Ö´ÐС£ÔÚÕâʱÄú»á·¢ÏÖº¯Êý <function>connection_timeout</function> ºÍ <function>connection_aborted</function> ¶¼·µ»Ø &true;¡£ÄúÒ²¿ÉÒÔͨ¹ýÖ´ÐÐ <function>connection_status</function> º¯ÊýÀ´Í¬Ê±¼ì²éÕâÁ½ÖÖ״̬¡£¸Ãº¯Êý½«·µ»Ø±»¼¤»îµÄ״̬µÄ¶þ½øÖÆÎ»Âë¡£ÀýÈ磬Èç¹ûÕâÁ½ÖÖ״̬¶¼±»¼¤»î£¬Ôòº¯Êý½«·µ»Ø 3¡£ + </simpara> </chapter> Index: phpdoc-zh/features/cookies.xml diff -u phpdoc-zh/features/cookies.xml:1.3 phpdoc-zh/features/cookies.xml:1.4 --- phpdoc-zh/features/cookies.xml:1.3 Sat Jul 20 19:44:47 2002 +++ phpdoc-zh/features/cookies.xml Thu Aug 8 21:08:22 2002 @@ -1,34 +1,26 @@ -<?xml version="1.0" encoding="gb2312"?> +<?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.10 $ --> -<!-- $AUTHOR$ --> +<!-- $Author$ --> <!-- EN-Revision: 1.13 Maintainer: thomaslio Status: ready --> +<!-- CREDITS: Gregory --> <chapter id="features.cookies"> <title>Cookies</title> <para> - PHP ÏÔȻ֧³Ö HTTP cookies¡£CookiesÊÇÒ»Ì× - ´æ´¢ÔÚÔ¶³Ìä¯ÀÀÆ÷ÉϵÄÊý¾ÝºÍÓÃÀ´×·×Ù»òÕßÈÏ֤ʹÓÃÕߵġ£Äã¿ÉÒÔÉèÖÃcookiesÓà <function>setcookie</function> º¯Êý¡£CookiesÊDz¿·ÖµÄ - HTTP header, Òò´Ë<function>setcookie</function>±ØÐëÔÚÈκÎÊý¾ÝÊä³öµ½ä¯ÀÀÆ÷֮ǰӦÓá£ÓÐÏàͬµÄÓÐÏÞÏÞÖÆ - <function>header</function>£¬Äã¿ÉÒÔʹÓÃ<link - linkend="ref.outcontrol">Êä³ö»º³åº¯Êý</link>Ñӳٽű¾µÄÊä³ö£¬ÓÉÄã¾ö¶¨ÊÇ·ñÉèÖÃcookies»òÕß·¢ËÍ - headers¡£ + PHP ÍêÈ«µØÖ§³Ö HTTP Cookies¡£Cookie ÊÇÒ»ÖÖÔÚÔ¶³Ìä¯ÀÀÆ÷¶Ë´¢´æÊý¾Ý²¢ÒÔ´ËÀ´¸ú×ÙºÍʶ±ðÓû§µÄ»úÖÆ¡£Äú¿ÉÒÔʹÓà <function>setcookie</function> º¯ÊýÀ´ÉèÖà Cookie¡£Cookie ÊÇ HTTP Í·µÄÒ»²¿·Ö£¬Òò´Ë <function>setcookie</function> º¯Êý±ØÐëÔÚÆäËüÐÅÏ¢±»Êä³öµ½ä¯ÀÀÆ÷ǰµ÷Óã¬ÕâºÍ¶Ô <function>header</function> º¯ÊýµÄÏÞÖÆÊÇÀàËÆµÄ¡£Äú¿ÉÒÔʹÓÃ<link + linkend="ref.outcontrol">Êä³ö»º³åº¯Êý</link>À´Ñӳٽű¾µÄÊä³ö£¬Ö±µ½°´ÕÕÄúµÄÐèÒªÉèÖúÃÁËËùÓÐµÄ cookies »òÕ߯äËü HTTP Í·ÐÅÏ¢¡£ </para> <para> - ´Ó¿Í»§¶Ë·¢Ë͸øÄãµÄcookies½«×Ô¶¯×ª»»³ÉPHP±äÁ¿£¬±ÈÈçÏóGETºÍPOSTµÄ·½·¨´¦ÀíÊý¾Ý¡£µ«ÒªÒÀÀµÓÚ - <literal>register_globals</literal>ºÍ<literal>variables_order</literal> - ÅäÖñäÁ¿¡£Èç¹ûÄãÏë·ÖÅä¶àÏîµÄÖµµ½µ¥Ò»µÄcookiesÖµ,¿ÉÒÔÌí¼Ó<emphasis>[]</emphasis>µ½cookieµÄÃû×Ö¡£ + Èκδӿͻ§¶Ë·¢Ë͸øÄúµÄ cookies ½«»áÏñ GET ºÍ POST Êý¾ÝÒ»Ñù±»×Ô¶¯µÄת»»Îª PHP ±äÁ¿£¬¸Ã¹ý³ÌÊÜ <literal>register_globals</literal> ºÍ <literal>variables_order</literal> Á½¸öÉèÖñäÁ¿µÄÓ°Ïì¡£Èç¹ûÄúÏ£Íû¶ÔÒ»¸ö cookie ±äÁ¿ÉèÖöà¸öÖµ£¬ÔòÐèÔÚ cookie µÄÃû³Æºó¼Ó <emphasis>[]</emphasis> ·ûºÅ¡£ </para> <para> - PHP 4.1.0°æ±¾ÒÔºó£¬<literal>$_COOKIE</literal>×Ô¶¯È«¾Ö±äÁ¿½«ÓÃcookiesʼÖÕÉèÖôӿͻ§¶Ë·¢ËÍ - <literal>$HTTP_COOKIE_VARS</literal>£¬Í¬Ñù¸üÔç°æ±¾µÄPHPÓà - <literal>track_vars</literal>ÅäÖñäÁ¿¡£ + ÔÚ PHP 4.1.0 ¼°¸ü¸ß°æ±¾£¬×Ô¶¯È«¾Ö±äÁ¿Êý×é <literal>$_COOKIE</literal> ½«×ÜÊǰüº¬ËùÓÐ×ܿͻ§¶Ë·¢À´µÄ cookies Êý¾Ý¡£ÔÚÀϰ汾µÄ PHP ÖУ¬µ± <literal>track_vars</literal> ÉèÖñäÁ¿´ò¿ªÊ±£¬ÏµÍ³Îª cookies ÉèÖõÄÊý×é±äÁ¿ÊÇ <literal>$HTTP_COOKIE_VARS</literal>¡£ </para> <para> - ÐèÒª¸ü¶àµÄÏêϸ×ÊÁÏ£¬°üÀ¨ä¯ÀÀÆ÷µÄbug£¬Çë²Î¿¼ - <function>setcookie</function>º¯Êý¡£ + ¹ØÓÚ¸ü¶àϸ½ÚÒÔ¼°ÓйØä¯ÀÀÆ÷ÎÊÌâµÄ×¢ÒâÊÂÏÇë²ÎÔÄ <function>setcookie</function> º¯Êý¡£ </para> </chapter>
« previous php.doc.zh (#289) next »