cvs: phpdoc-kr / language-defs.ent /reference/classobj book.xml constants.xml examples.xml reference.xml setup.xml /reference/classobj/functions
get-called-class.xml get-declared-interfaces.xml interface-exists.xml property-exists.xml

From: Date: Sun, 14 Dec 2008 08:00:09 +0000
Subject: cvs: phpdoc-kr / language-defs.ent /reference/classobj book.xml constants.xml examples.xml reference.xml setup.xml /reference/classobj/functions
get-called-class.xml get-declared-interfaces.xml interface-exists.xml property-exists.xml
Groups: php.doc.kr 
Request: Send a blank email to doc-kr+get-812@lists.php.net to get a copy of this message
progcom Sun Dec 14 08:00:09 2008 UTC Added files: /phpdoc-kr/reference/classobj book.xml constants.xml examples.xml setup.xml /phpdoc-kr/reference/classobj/functions get-called-class.xml get-declared-interfaces.xml interface-exists.xml property-exists.xml Modified files: /phpdoc-kr language-defs.ent /phpdoc-kr/reference/classobj reference.xml Log: classobj complete

http://cvs.php.net/viewvc.cgi/phpdoc-kr/language-defs.ent?r1=1.32&r2=1.33&diff_format=u Index: phpdoc-kr/language-defs.ent diff -u phpdoc-kr/language-defs.ent:1.32 phpdoc-kr/language-defs.ent:1.33 --- phpdoc-kr/language-defs.ent:1.32 Sun Nov 9 18:02:50 2008 +++ phpdoc-kr/language-defs.ent Sun Dec 14 08:00:09 2008 @@ -59,7 +59,7 @@ <!ENTITY ConfigureOptions "설정 옵션"> <!ENTITY Default "기본값"> <!ENTITY Definition "정의"> -<!ENTITY Functions "함수"> +<!ENTITY Functions "함수 목록"> <!ENTITY Name "이름"> <!ENTITY Alias "별칭:"> <!ENTITY Type "자료형"> http://cvs.php.net/viewvc.cgi/phpdoc-kr/reference/classobj/reference.xml?r1=1.8&r2=1.9&diff_format=u Index: phpdoc-kr/reference/classobj/reference.xml diff -u /dev/null phpdoc-kr/reference/classobj/reference.xml:1.9 --- /dev/null Sun Dec 14 08:00:09 2008 +++ phpdoc-kr/reference/classobj/reference.xml Sun Dec 14 08:00:09 2008 @@ -0,0 +1,31 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- EN-Revision: 1.20 Maintainer: progcom Status: ready --> + +<reference xml:id="ref.classobj" xmlns="http://docbook.org/ns/docbook"> + <title>클래스/객체 &Functions;</title> + + &reference.classobj.entities.functions; + +</reference> + +<!-- 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 +--> + http://cvs.php.net/viewvc.cgi/phpdoc-kr/reference/classobj/book.xml?view=markup&rev=1.1 Index: phpdoc-kr/reference/classobj/book.xml +++ phpdoc-kr/reference/classobj/book.xml <?xml version="1.0" encoding="utf-8"?> <!-- EN-Revision: 1.4 Maintainer: progcom Status: ready --> <!-- Purpose: basic.vartype --> <!-- Membership: core --> <book xml:id="book.classobj" xmlns="http://docbook.org/ns/docbook"> <title>클래스/객체 정보</title> <titleabbrev>클래스/객체</titleabbrev> <preface xml:id="intro.classobj"> &reftitle.intro; <para> 이 함수들은 클래스와 인스턴스 객체에 대한 정보를 얻을 수 있게 합니다. 객체의 클래스명은 물론, 멤버 프로퍼티와 메쏘드도 얻을 수 있습니다. 이 함수들을 사용해서, 객체의 클래스 멤버만이 아니라, 부모(즉, 객체 클래스가 상속한 클래스)도 얻을 수 있습니다. </para> </preface> &reference.classobj.setup; &reference.classobj.constants; &reference.classobj.examples; &reference.classobj.reference; </book> <!-- 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 --> http://cvs.php.net/viewvc.cgi/phpdoc-kr/reference/classobj/constants.xml?view=markup&rev=1.1 Index: phpdoc-kr/reference/classobj/constants.xml +++ phpdoc-kr/reference/classobj/constants.xml <?xml version="1.0" encoding="utf-8"?> <!-- EN-Revision: 1.2 Maintainer: progcom Status: ready --> <appendix xml:id="classobj.constants" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> &reftitle.constants; &no.constants; </appendix> <!-- 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 --> http://cvs.php.net/viewvc.cgi/phpdoc-kr/reference/classobj/examples.xml?view=markup&rev=1.1 Index: phpdoc-kr/reference/classobj/examples.xml +++ phpdoc-kr/reference/classobj/examples.xml <?xml version="1.0" encoding="utf-8"?> <!-- EN-Revision: 1.2 Maintainer: progcom Status: ready --> <appendix xml:id="classobj.examples"> &reftitle.examples; <para> 이 예제에서, 먼저 기반 클래스를 정의하고 그 클래스를 확장합니다. 기반 클래스는 일반 야채를 묘사하고, 식용 여부와 색을 가집니다. 서브클래스 <varname>Spinach</varname>는 요리하는 메쏘드와 요리되었는지 확인하는 메쏘드를 추가합니다. </para> <para> <example> <title>classes.inc</title> <programlisting role="php"> <![CDATA[ <?php // 멤버 프로퍼티와 메쏘드를 가지는 기반 클래스 class Vegetable { var $edible; var $color; function Vegetable($edible, $color="green") { $this->edible = $edible; $this->color = $color; } function is_edible() { return $this->edible; } function what_color() { return $this->color; } } // Vegetable 클래스 끝 // 기반 클래스 확장 class Spinach extends Vegetable { var $cooked = false; function Spinach() { $this->Vegetable(true, "green"); } function cook_it() { $this->cooked = true; } function is_cooked() { return $this->cooked; } } // Spinach 클래스 끝 ?> ]]> </programlisting> </example> </para> <para> 이제 이 클래스로부터 두 객체 인스턴스를 만들고, 클래스 상속을 포함한 정보를 출력합니다. 변수를 깔끔하게 출력하기 위한 몇몇 보조 함수도 정의합니다. </para> <para> <example> <title>test_script.php</title> <programlisting role="php"> <![CDATA[ <pre> <?php include "classes.inc"; // 보조 함수 function print_vars($obj) { foreach (get_object_vars($obj) as $prop => $val) { echo "\t$prop = $val\n"; } } function print_methods($obj) { $arr = get_class_methods(get_class($obj)); foreach ($arr as $method) { echo "\tfunction $method()\n"; } } function class_parentage($obj, $class) { if (is_subclass_of($GLOBALS[$obj], $class)) { echo "Object $obj belongs to class " . get_class($$obj); echo " a subclass of $class\n"; } else { echo "Object $obj does not belong to a subclass of $class\n"; } } // 두 객체 인스턴스 생성 $veggie = new Vegetable(true, "blue"); $leafy = new Spinach(); // 객체에 대한 정보 출력 echo "veggie: CLASS " . get_class($veggie) . "\n"; echo "leafy: CLASS " . get_class($leafy); echo ", PARENT " . get_parent_class($leafy) . "\n"; // veggie 프로퍼티 출력 echo "\nveggie: Properties\n"; print_vars($veggie); // leafy 메쏘드 echo "\nleafy: Methods\n"; print_methods($leafy); echo "\nParentage:\n"; class_parentage("leafy", "Spinach"); class_parentage("leafy", "Vegetable"); ?> </pre> ]]> </programlisting> <para> 위 에제에서 중요한 점은 <varname>$leafy</varname> 객체가 <classname>Vegetable</classname>의 서브클래스인 <classname>Spinach</classname> 클래스의 인스턴스라는 점입니다. 그러므로 스크립트의 마지막 부분은 다음을 출력합니다: </para> <screen> <![CDATA[ [...] Parentage: Object leafy does not belong to a subclass of Spinach Object leafy belongs to class spinach a subclass of Vegetable ]]> </screen> </example> </para> </appendix> <!-- 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 --> http://cvs.php.net/viewvc.cgi/phpdoc-kr/reference/classobj/setup.xml?view=markup&rev=1.1 Index: phpdoc-kr/reference/classobj/setup.xml +++ phpdoc-kr/reference/classobj/setup.xml <?xml version="1.0" encoding="utf-8"?> <!-- EN-Revision: 1.2 Maintainer: progcom Status: ready --> <chapter xml:id="classobj.setup"> &reftitle.setup; <section xml:id="classobj.requirements"> &reftitle.required; &no.requirement; </section> <section xml:id="classobj.installation"> &reftitle.install; &no.install; </section> <section xml:id="classobj.configuration"> &reftitle.runtime; &no.config; </section> <section xml:id="classobj.resources"> &reftitle.resources; &no.resource; </section> </chapter> <!-- 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 --> http://cvs.php.net/viewvc.cgi/phpdoc-kr/reference/classobj/functions/get-called-class.xml?view=markup&rev=1.1 Index: phpdoc-kr/reference/classobj/functions/get-called-class.xml +++ phpdoc-kr/reference/classobj/functions/get-called-class.xml <?xml version="1.0" encoding="utf-8"?> <!-- EN-Revision: 1.1 Maintainer: progcom Status: ready --> <refentry xml:id="function.get-called-class" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>get_called_class</refname> <refpurpose>"Late Static Binding" 클래스명</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <methodsynopsis> <type>string</type><methodname>get_called_class</methodname> <void/> </methodsynopsis> <para> 정적 메쏘드가 호출된 클래스명을 얻습니다. </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> 클래스명을 반환합니다. 클래스 밖에서 호출하면 &false;를 반환합니다. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title><function>get_called_class</function> 사용하기</title> <programlisting role="php"> <![CDATA[ <?php class foo { static public function test() { var_dump(get_called_class()); } } class bar extends foo { } foo::test(); bar::test(); ?> ]]> </programlisting> &example.outputs; <screen> <![CDATA[ string(3) "foo" string(3) "bar" ]]> </screen> </example> </para> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>get_parent_class</function></member> <member><function>get_class</function></member> <member><function>is_subclass_of</function></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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc-kr/reference/classobj/functions/get-declared-interfaces.xml?view=markup&rev=1.1 Index: phpdoc-kr/reference/classobj/functions/get-declared-interfaces.xml +++ phpdoc-kr/reference/classobj/functions/get-declared-interfaces.xml <?xml version='1.0' encoding='utf-8'?> <!-- EN-Revision: 1.8 Maintainer: progcom Status: ready --> <refentry xml:id="function.get-declared-interfaces" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>get_declared_interfaces</refname> <refpurpose>선언된 모든 인터페이스의 배열을 반환</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <methodsynopsis> <type>array</type><methodname>get_declared_interfaces</methodname> <void/> </methodsynopsis> <para> 선언된 인터페이스를 얻습니다. </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> 현재 스크립트에서 선언된 인터페이스명의 배열을 반환합니다. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title><function>get_declared_interfaces</function> 예제</title> <programlisting role="php"> <![CDATA[ <?php print_r(get_declared_interfaces()); ?> ]]> </programlisting> &example.outputs.similar; <screen> <![CDATA[ Array ( [0] => Traversable [1] => IteratorAggregate [2] => Iterator [3] => ArrayAccess [4] => reflector [5] => RecursiveIterator [6] => SeekableIterator ) ]]> </screen> </example> </para> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>get_declared_classes</function></member> <member><function>class_implements</function></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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc-kr/reference/classobj/functions/interface-exists.xml?view=markup&rev=1.1 Index: phpdoc-kr/reference/classobj/functions/interface-exists.xml +++ phpdoc-kr/reference/classobj/functions/interface-exists.xml <?xml version="1.0" encoding="utf-8"?> <!-- EN-Revision: 1.5 Maintainer: progcom Status: ready --> <refentry xml:id="function.interface-exists" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>interface_exists</refname> <refpurpose>인터페이스가 정의되었는지 확인</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <methodsynopsis> <type>bool</type><methodname>interface_exists</methodname> <methodparam><type>string</type><parameter>interface_name</parameter></methodparam> <methodparam choice="opt"><type>bool</type><parameter>autoload</parameter></methodparam> </methodsynopsis> <para> 주어진 인터페이스가 정의되었는지 확인합니다. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>interface_name</parameter></term> <listitem> <para> 인터페이스명 </para> </listitem> </varlistentry> <varlistentry> <term><parameter>autoload</parameter></term> <listitem> <para> &link.autoload; 호출 여부, 기본값은 꺼짐 </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> 주어진 <parameter>interface_name</parameter>이 정의되었으면 &true;, 아니면 &false;를 반환합니다. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title><function>interface_exists</function> 예제</title> <programlisting role="php"> <![CDATA[ <?php // 사용하기 전에 인터페이스가 존재하는지 확인 if (interface_exists('MyInterface')) { class MyClass implements MyInterface { // 메쏘드 } } ?> ]]> </programlisting> </example> </para> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>class_exists</function></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:"../../../../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 --> http://cvs.php.net/viewvc.cgi/phpdoc-kr/reference/classobj/functions/property-exists.xml?view=markup&rev=1.1 Index: phpdoc-kr/reference/classobj/functions/property-exists.xml +++ phpdoc-kr/reference/classobj/functions/property-exists.xml <?xml version="1.0" encoding="utf-8"?> <!-- EN-Revision: 1.9 Maintainer: progcom Status: ready --> <refentry xml:id="function.property-exists" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>property_exists</refname> <refpurpose> 객체나 클래스가 프로퍼티를 가졌는지 확인 </refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <methodsynopsis> <type>bool</type><methodname>property_exists</methodname> <methodparam><type>mixed</type><parameter>class</parameter></methodparam> <methodparam><type>string</type><parameter>property</parameter></methodparam> </methodsynopsis> <para> 주어진 <parameter>property</parameter>가 지정한 클래스에 존재하는지 확인합니다. </para> <note> <para> <function>isset</function>과 다르게, <function>property_exists</function>는 프로퍼티가 &null; 값을 가지고 있어도 &true;를 반환합니다. </para> </note> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>class</parameter></term> <listitem> <para> 확인할 클래스명이나 클래스의 객체 </para> </listitem> </varlistentry> <varlistentry> <term><parameter>property</parameter></term> <listitem> <para> 프로퍼티명 </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> 프로퍼티가 존재하면 &true;, 존재하지 않으면 &false;, 오류시엔 &null;을 반환합니다. </para> </refsect1> <refsect1 role="changelog"> &reftitle.changelog; <para> <informaltable> <tgroup cols="2"> <thead> <row> <entry>&Version;</entry> <entry>&Description;</entry> </row> </thead> <tbody> <row> <entry>5.3.0</entry> <entry> 이 함수는 접근성에 관계 없이 프로퍼티의 존재성을 확인합니다. </entry> </row> </tbody> </tgroup> </informaltable> </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title><function>property_exists</function> 예제</title> <programlisting role="php"> <![CDATA[ <?php class myClass { public $mine; private $xpto; static protected $test; static function test() { var_dump(property_exists('myClass', 'xpto')); //true } } var_dump(property_exists('myClass', 'mine')); //true var_dump(property_exists(new myClass, 'mine')); //true var_dump(property_exists('myClass', 'xpto')); //true, as of PHP 5.3.0 var_dump(property_exists('myClass', 'bar')); //false var_dump(property_exists('myClass', 'test')); //true, as of PHP 5.3.0 myClass::test(); ?> ]]> </programlisting> </example> </para> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>method_exists</function></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:"../../../../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.kr (#812) next »