cvs: phpdoc-zh /language/oop5 decon.xml
| From: | liuming | Date: | Fri, 19 Aug 2005 10:11:08 +0000 |
| Subject: | cvs: phpdoc-zh /language/oop5 decon.xml | ||
| Groups: | php.doc.zh | ||
| Request: | Send a blank email to doc-zh+get-2442@lists.php.net to get a copy of this message | ||
lm92 Fri Aug 19 06:11:08 2005 EDT
Modified files:
/phpdoc-zh/language/oop5 decon.xml
Log:
add new translated file
http://cvs.php.net/diff.php/phpdoc-zh/language/oop5/decon.xml?r1=1.2&r2=1.3&ty=u
Index: phpdoc-zh/language/oop5/decon.xml
diff -u /dev/null phpdoc-zh/language/oop5/decon.xml:1.3
--- /dev/null Fri Aug 19 06:11:08 2005
+++ phpdoc-zh/language/oop5/decon.xml Fri Aug 19 06:11:05 2005
@@ -0,0 +1,116 @@
+<?xml version="1.0" encoding="gb2312"?>
+<!-- $Revision: 1.3 $ -->
+<!-- $Author: lm92 $ -->
+<!-- EN-Revision: 1.9 Maintainer: lm92 Status: ready -->
+ <sect1 id="language.oop5.decon">
+ <title>¹¹ÔìÆ÷ºÍÎö¹¹Æ÷</title>
+
+ <sect2 id="language.oop5.decon.constructor">
+ <title>¹¹ÔìÆ÷</title>
+ <methodsynopsis>
+ <type>void</type><methodname>__construct</methodname>
+ <methodparam
choice="opt"><type>mixed</type><parameter>args</parameter></methodparam>
+ <methodparam
choice="opt"><parameter>...</parameter></methodparam>
+ </methodsynopsis>
+ <para>
+ PHP 5
ÔÊÐпª·¢ÕßÔÚÒ»¸öÀàÖж¨Òå¹¹ÔìÆ÷¡£¹¹ÔìÆ÷»áÔÚÿ´Î´´½¨¶ÔÏóʱÊ×Ïȱ»µ÷Óã¬ËùÒԷdz£Ö®ÊʺÏÓÃÓÚÍê³É³õʼ»¯¹¤×÷¡£
+ </para>
+ <note>
+ <simpara>
+
Èç¹û×ÓÀàÖж¨ÒåÁ˹¹ÔìÆ÷£¬ÄÇôµ±×ÓÀà±»µ÷ÓÃʱ£¬Æä¸¸ÀàµÄ¹¹ÔìÆ÷²»»áÖ´ÐС£Èç¹ûÒªÔÚ×ÓÀà±»µ÷ÓÃʱִÐи¸ÀàµÄ¹¹ÔìÆ÷£¬¿ÉÒÔÔÚ×ÓÀàµÄ¹¹ÔìÆ÷ÖÐʹÓÃ
<function>parent::__construct</function>¡£
+ </simpara>
+ </note>
+ <example>
+ <title>ʹÓù¹ÔìÆ÷</title>
+ <programlisting role="php">
+<![CDATA[
+<?php
+class BaseClass {
+ function __construct() {
+ print "In BaseClass constructor\n";
+ }
+}
+
+class SubClass extends BaseClass {
+ function __construct() {
+ parent::__construct();
+ print "In SubClass constructor\n";
+ }
+}
+
+$obj = new BaseClass();
+$obj = new SubClass();
+?>
+]]>
+ </programlisting>
+ </example>
+ <para>
+ ΪÁËʵÏÖÏòºó¼æÈÝÐÔ£¬Èç¹û PHP 5 ÔÚÀàÖÐÕÒ²»µ½
<function>__construct</function>
+
º¯Êý¡£Ëü¾Í»á³¢ÊÔѰÕÒ¾ÉʽµÄ¹¹ÔìÆ÷£¬Ò²¾ÍÊǺÍÀàÃû³ÆÏàͬµÄº¯Êý×÷Ϊ¹¹ÔìÆ÷¡£µ«ÊÇ£¬µ±ÀàÖÐÓÐÒ»¸öÃû³ÆÎª
<function>__construct</function>
µÄ·½·¨£¬µ«ËüÈ´²»Êǹ¹ÔìÆ÷µÄʱºò£¬¾Í»á²úÉú¼æÈÝÐÔÎÊÌâ¡£
+ </para>
+ </sect2>
+
+ <sect2 id="language.oop5.decon.destructor">
+ <title>Îö¹¹Æ÷</title>
+ <methodsynopsis>
+ <type>void</type><methodname>__destruct</methodname>
+ <void />
+ </methodsynopsis>
+ <para>
+ PHP 5
ÒýÈëÁËÎö¹¹Æ÷µÄ¸ÅÄ¾ÍÏñÆäËüÃæÏò¶ÔÏóµÄÓïÑÔ£¨Èç
+
C++£©Ò»Ñù¡£Îö¹¹Æ÷»áÔÚÒ»¸ö¶ÔÏó±»ÒƳý»ò±»Ïú»ÙʱִÐС£
+ </para>
+ <example>
+ <title>ʹÓÃÎö¹¹Æ÷</title>
+ <programlisting role="php">
+<![CDATA[
+<?php
+class MyDestructableClass {
+ function __construct() {
+ print "In constructor\n";
+ $this->name = "MyDestructableClass";
+ }
+
+ function __destruct() {
+ print "Destroying " . $this->name . "\n";
+ }
+}
+
+$obj = new MyDestructableClass();
+?>
+]]>
+ </programlisting>
+ </example>
+ <para>
+
ºÍ¹¹ÔìÆ÷Ò»Ñù£¬¸¸ÀàµÄÎö¹¹Æ÷²¢²»»áÔÚ×ÓÀàÖб»µ÷Óá£Èç¹ûÒªÖ´Ðи¸ÀàµÄÎö¹¹Æ÷£¬¿ÉÒÔÔÚ×ÓÀàµÄÎö¹¹Æ÷ÖÐʹÓÃ
+ <function>parent::__destruct</function>¡£
+ </para>
+ <note>
+ <para>
+
Îö¹¹Æ÷Ö»»áÔÚ´úÂëÖ´ÐÐÍê±Ïºó±»µ÷Óã¬Õâ¸öʱºòËùÓеÄÍ·²¿ÐÅÏ¢Òѱ»·¢³ö¡£
+ </para>
+ </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
+-->