Revision: 213
Author:
ping...@gmail.com
Date: Thu Apr 14 06:15:50 2011
Log: set-time-limit函数页翻译完成
http://code.google.com/p/phpdoc-zh/source/detail?r=213
Added:
/trunk/xml/reference/info
/trunk/xml/reference/info/functions
/trunk/xml/reference/info/functions/set-time-limit.xml
=======================================
--- /dev/null
+++ /trunk/xml/reference/info/functions/set-time-limit.xml Thu Apr 14
06:15:50 2011
@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- $Revision: 297028 $ -->
+<refentry xml:id="function.set-time-limit"
xmlns="
http://docbook.org/ns/docbook">
+ <refnamediv>
+ <refname>set_time_limit</refname>
+ <refpurpose>设置脚本最大执行时间</refpurpose>
+ </refnamediv>
+
+ <refsect1 role="description">
+ &reftitle.description;
+ <methodsynopsis>
+ <type>void</type><methodname>set_time_limit</methodname>
+
<methodparam><type>int</type><parameter>seconds</parameter></methodparam>
+ </methodsynopsis>
+ <para>
+ 设置允许脚本运行的时间,单位为秒。如果超过了此设置,脚本返回一个致命的错
误。默认值为30秒,或者是在&php.ini;的<literal>max_execution_time</literal>被
定义的值,如果此值存在。
+ </para>
+ <para>
+ 当此函数被调用时,<function>set_time_limit</function>会从零开始重新启动超
时计数器。换句话说,如果超时默认是30秒,同时,脚本中又设置了25秒,如
<literal>set_time_limit(20)</literal>。那么,脚本在超时之前可运行总共时间为
45秒。
+ </para>
+ </refsect1>
+
+ <refsect1 role="parameters">
+ &reftitle.parameters;
+ <para>
+ <variablelist>
+ <varlistentry>
+ <term><parameter>seconds</parameter></term>
+ <listitem>
+ <para>
+ 最大的执行时间,单位为秒。如果设置为0(零),没有时间方面的限制。
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+ </refsect1>
+
+ <refsect1 role="returnvalues">
+ &reftitle.returnvalues;
+ <para>
+ &return.void;
+ </para>
+ </refsect1>
+
+ <refsect1 role="notes">
+ &reftitle.notes;
+ <warning>
+ <para>
+ 当php运行于安全模式下时,此功能不能生效。除了关闭安全模式或改变
&php.ini;中的时间限制,没有别的办法。
+ </para>
+ </warning>
+ <note>
+ <para>
+ <function>set_time_limit</function>函数和配置指令<link
linkend="ini.max-execution-time">max_execution_time</link>只影响脚本本身执行
的时间。任何发生在诸如使用<function>system</function>的系统调用,流操作,数
据库操作等的脚本执行的最大时间不包括其中,当该脚本已运行。在测量时间是实值的
Windows中,情况就不是如此了。
+ </para>
+ </note>
+ </refsect1>
+
+ <refsect1 role="seealso">
+ &reftitle.seealso;
+ <para>
+ <simplelist>
+ <member><link
linkend="ini.max-execution-time">max_execution_time</link></member>
+ <member><link
linkend="ini.max-input-time">max_input_time</link></member>
+ </simplelist>
+ </para>
+ </refsect1>
+
+</refentry>
+
+<!-- Keep this comment at the end of the file
+Local variables:
+mode: sgml
+sgml-omittag:t
+sgml-shorttag:t
+sgml-minimize-attributes:nil
+sgml-always-quote-attributes:t
+sgml-indent-step:1
+sgml-indent-data:t
+indent-tabs-mode:nil
+sgml-parent-document:nil
+sgml-default-dtd-file:"~/.phpdoc/manual.ced"
+sgml-exposed-tags:nil
+sgml-local-catalogs:nil
+sgml-local-ecat-files:nil
+End:
+vim600: syn=xml fen fdm=syntax fdl=2 si
+vim: et tw=78 syn=sgml
+vi: ts=1 sw=1
+-->