[PHP-DEV] CVS update: php3/doc/chapters From: rasmus (php-dev <email protected>)
Date: 01/29/99

Date: Friday January 29, 1999 @ 1:26
Author: rasmus

Update of /repository/php3/doc/chapters
In directory asf:/u/temp/cvs-serv2492/doc/chapters

Modified Files:
        config.sgml features.sgml
Log Message:
Phew.. That's a whole lot of docs

Index: php3/doc/chapters/config.sgml
diff -c php3/doc/chapters/config.sgml:1.44 php3/doc/chapters/config.sgml:1.45
*** php3/doc/chapters/config.sgml:1.44 Sat Dec 26 06:13:48 1998
--- php3/doc/chapters/config.sgml Fri Jan 29 01:26:43 1999
***************
*** 225,230 ****
--- 225,244 ----
          </para>
         </listitem>
        </varlistentry>
+
+ <varlistentry id="ini.ignore-user-abort">
+ <term>
+ <parameter>ignore_user_abort</parameter>
+ <type>string</type>
+ </term>
+ <listitem>
+ <para>
+ On by default. If changed to Off scripts will run to completion even
+ if the remote client disconnects in the middle. See also
+ <function>ignore_user_abort</function>.
+ </para>
+ </listitem>
+ </varlistentry>
        
        <varlistentry id="ini.include-path">
         <term>
Index: php3/doc/chapters/features.sgml
diff -c php3/doc/chapters/features.sgml:1.21 php3/doc/chapters/features.sgml:1.22
*** php3/doc/chapters/features.sgml:1.21 Sat Dec 26 07:59:41 1998
--- php3/doc/chapters/features.sgml Fri Jan 29 01:26:43 1999
***************
*** 352,357 ****
--- 352,414 ----
  
    </sect1>
  
+ <sect1 id="feature-connection-handling">
+ <title>Connection Handling</title>
+ <simpara>
+ The following applies to PHP version 3.0.7 and later.
+ </simpara>
+ <para>
+ Internally in PHP a connection status is maintained. There are 3 possible states:
+ <itemizedlist>
+ <listiterm><simpara>0 - NORMAL
+ <listiterm><simpara>1 - ABORTED
+ <listiterm><simpara>2 - TIMEOUT
+ </itemizedlist>
+ </para>
+ <simpara>
+ When a PHP script is running normally the NORMAL state, is active. If the
+ remote client disconnects the ABORTED state flag is turned on. A remote client
+ disconnect is usually caused by the user hitting his STOP button. If the PHP-imposed
+ time limit (see <function>set_time_limit</function>) is hit, the TIMEOUT state flag
+ is turned on.
+ </simpara>
+ <simpara>
+ You can decide whether or not you want a client disconnect to cause your script to be
+ aborted. 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 php3.ini directive as well as through the corresponding php3_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
+ diconnect you can use the <function>connection_aborted</function> function. This function will return
+ true if the connection was aborted.
+ </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 php3.ini directive or the corresponding
+ php3_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>
+ <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>
+ </sect1>
+
    <sect1 id="feature-source-viewer">
     <title>PHP source viewer</title>
     <simpara></simpara>

--
PHP Development Mailing List   http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe <email protected>
For help: php-dev-help <email protected>