cvs: phpdoc-zh /language/types resource.xml

From: Date: Thu, 25 Dec 2008 01:25:33 +0000
Subject: cvs: phpdoc-zh /language/types resource.xml
Groups: php.doc.zh 
Request: Send a blank email to doc-zh+get-3142@lists.php.net to get a copy of this message
eniac2008 Thu Dec 25 01:25:33 2008 UTC Added files: /phpdoc-zh/language/types resource.xml Log: Sync with EN-Revision 1.4 http://cvs.php.net/viewvc.cgi/phpdoc-zh/language/types/resource.xml?view=markup&rev=1.1 Index: phpdoc-zh/language/types/resource.xml +++ phpdoc-zh/language/types/resource.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <!-- $Author: eniac2008 --> <!-- EN-Revision: 1.4 Maintainer: Altair Status: ready --> <!-- CREDITS: Geogory dallas --> <sect1 xml:id="language.types.resource"> <title>资源类型</title> <para> 资源是一种特殊变量,保存了到外部资源的一个引用。资源是通过专门的函数来建立和使用的。所有这些函数及其相应资源类型见<link linkend="resource">附录</link>。 </para> <note> <simpara> 资源类型是 PHP 4 引进的。 </simpara> </note> <para> 参见 <function>get_resource_type</function>。 </para> <sect2 xml:id="language.types.resource.casting"> <title>转换为资源</title> <para> 由于资源类型变量保存有为打开文件、数据库连接、图形画布区域等的特殊句柄,因此将其它类型的值转换为资源没有意义。 </para> </sect2> <sect2 xml:id="language.types.resource.self-destruct"> <title>释放资源</title> <para> 由于 PHP4 Zend 引擎引进了引用计数系统,可以自动检测到一个资源不再被引用了(和 Java 一样)。这种情况下此资源使用的所有外部资源都会被垃圾回收系统释放。因此,很少需要手工释放内存。 Thanks to the reference-counting system introduced with PHP 4's Zend Engine, a <type>resource</type> with no more references to it is detected automatically, and it is freed by the garbage collector. For this reason, it is rarely necessary to free the memory manually. </para> <note> <simpara> 持久数据库连接比较特殊,它们<emphasis>不会</emphasis>被垃圾回收系统销毁。参见<link linkend="features.persistent-connections">数据库永久连接</link>一章。 </simpara> </note> </sect2> </sect1> <!-- 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:"../../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 -->

« previous php.doc.zh (#3142) next »