cvs: phpdoc-kr /language namespaces.xml

From: Date: Thu, 04 Dec 2008 14:50:33 +0000
Subject: cvs: phpdoc-kr /language namespaces.xml
Groups: php.doc.kr 
Request: Send a blank email to doc-kr+get-803@lists.php.net to get a copy of this message
acidd15 Thu Dec 4 14:50:33 2008 UTC Modified files: /phpdoc-kr/language namespaces.xml Log: translate "namespace definition" http://cvs.php.net/viewvc.cgi/phpdoc-kr/language/namespaces.xml?r1=1.2&r2=1.3&diff_format=u Index: phpdoc-kr/language/namespaces.xml diff -u phpdoc-kr/language/namespaces.xml:1.2 phpdoc-kr/language/namespaces.xml:1.3 --- phpdoc-kr/language/namespaces.xml:1.2 Mon Nov 24 06:23:50 2008 +++ phpdoc-kr/language/namespaces.xml Thu Dec 4 14:50:33 2008 @@ -7,34 +7,33 @@ <sect1 xml:id="language.namespaces.rationale"> <title>네임스페이스에 관하여</title> <simpara> - PHP에서의 네임스페이스는 광범위한 PHP 라이브러리들 사이에서 발생하는 + PHP에서 네임스페이스는 광범위한 PHP 라이브러리들 사이에 발생하는 스코프 문제를 해결하기 위해 디자인되었다. - PHP에서는 모든 클래스 정의가 전역이다. 앞서 말한바와 같이 라이브러리 - 개발자가 어떤 유틸리티 및 공용 API 클래스 라이브러리를 만들때 + PHP에서는 모든 클래스 정의가 전역이다. 그러므로 라이브러리 + 개발자가 어떤 유틸리티 및 공용 API 클래스 라이브러리를 만들때는 다른 라이브러리들에 비슷한 기능이 존재하는지 알아야하고 이런 - 라이브러리들이 함께 사용되기 위해서는 고유한 이름을 선택해야 한다. + 라이브러리들이 함께 사용되기 위해서는 고유한 이름을 지어야만 한다. - 보통은 클래스 이름 앞에 고유한 문자열을 덧붙이거나 - 예를 들면 데이터베이스 클래스는 <classname>My_Library_DB</classname> 등과 할수 있을것이다. + 보통은 클래스 이름 앞에 고유한 식별 문자열을 덧붙인다 - 예를 들면 데이터베이스 클래스는 + <classname>My_Library_DB</classname> 등과 같이 할수 있을것이다. - 라이브러리가 늘어날수록, 고유한 문자열을 붙이는것도 늘어나서 매우 긴 이름을 가지게 된다. + 이 경우에는 라이브러리가 늘어날수록, 고유한 문자열을 붙이는것도 늘어나서 매우 긴 이름을 가지게 될것이다. </simpara> <simpara> - The namespaces allow the developer to manage naming scopes without using the - long names each time the class is referred to, and solve the problem of - shared globals space without making code unreadable. + 매번 클래스를 참조할때마다 긴이름을 사용하지않고, + 그리고 코드를 알아보기 어렵기 만들지 않으면서 + 전역공간을 공유하기 위한 문제를 해결하기 위해 네임스페이스는 개발자가 네이밍 스코프를 관리할수 있도록 허용한다. </simpara> <simpara> - Namespaces are available in PHP as of PHP 5.3.0. This section is experimental - and subject to changes. - </simpara> + 네임스페이스는 PHP 5.3.0 버전부터 존재한다. 네임스페이스는 실험단계이고 변경이 될 수 있다. + </simpara> </sect1> <sect1 xml:id="language.namespaces.definition"> - <title>Namespace definition</title> + <title>네임스페이스 정의</title> <para> - The namespace is declared using <literal>namespace</literal> - keyword, which should be at the very beginning of the file. Example: + 네임스페이스는 <literal>namespace</literal> 키워드를 사용해 정의할 수 있으며, 파일의 맨처음에 위치해야만 한다. 예: <example> <title>Defining namespace</title> <programlisting role="php"> @@ -52,74 +51,67 @@ ]]> </programlisting> </example> - Same namespace name can be used in multiple files. + 동일한 네임스페이스명도 여러 파일안에서 사용할 수 있다. </para> <para> - Namespace can contain class, constant and function definitions, but no free code. + 네임스페이스는 클래스, 상수 및 함수 정의를 포함할 수 있지만 그 이외의 구조를 가지는 코드는 포함할 수가 없다. </para> <para> - Namespace definition does the following: + 네임스페이스 정의는 다음과 같이 할수 있다: <itemizedlist> <listitem> <simpara> - Inside namespace, all class, function and constant names in definitions are - automatically prefixed with namespace name. The class name is always the - full name, i.e. in the example above the class is called - <classname>MyProject::DB::Connection</classname>. + 네임스페이스 내부에 정의한 모든 클래스, 함수와 상수명들 앞에는 자동으로 네임스페이스명이 붙는다. + 클래스명은 항상 풀네임(full name)이며, i.e. 앞의 예제에 있는 클래스를 호출하면 + <classname>MyProject::DB::Connection</classname> 이 된다. </simpara> </listitem> <listitem> <simpara> - Constant definitions create constant which is composed of namespace name and constant name. - Like class constants, namespace constant can only contains static values. + 상수 정의는, 네임스페이스명과 상수명으로 조합하여 상수를 만든다. + 클래스 상수와 같이, 네임스페이스 상수도 정적인 값만 가질수 있다. </simpara> </listitem> <listitem> <para> - Unqualified class name (i.e., name not containing <literal>::</literal>) - is resolved at runtime following this procedure: + 수식이 되지 않은 클래스명은 (i.e., <literal>::</literal> 를 포함하지 않는) 실행시에 다음순서에 의해 처리가 이루어진다. <orderedlist> <listitem> <simpara> - Class is looked up inside the current namespace (i.e. prefixing the - name with the current namespace name) without attempting to - <link linkend="language.oop5.autoload">autoload</link>. + 클래스는 <link linkend="language.oop5.autoload">autoload</link> 하지 않고, + 현재 네임스페이스(i.e. 현재 네임스페이스명을 앞에 붙여) 내부를 찾는다. </simpara> </listitem> <listitem> <simpara> - Class is looked up inside the global namespace without attempting to - autoload. + 클래스는 autoload 하지 않고, 전역 네임스페이스 내부를 찾는다. </simpara> </listitem> <listitem> <simpara> - Autoloading for name in current namespace is attempted. + 현재 네임스페이스에서 autoload 한다. </simpara> </listitem> <listitem> - <simpara>If previous failed, lookup fails.</simpara> + <simpara>앞의 단계가 모두 실패하면, 클래스를 찾는것은 실패한다.</simpara> </listitem> </orderedlist> </para> </listitem> <listitem> <para> - Unqualified function name (i.e., name not containing - <literal>::</literal>) is looked up at runtime first in the current namespace - and then in the global space. + 수식이 되지 않은 함수명은 (i.e., <literal>::</literal> 를 포함하지 않는) 첫 실행시 차례대로 현재 네임스페이스와 전역공간에서 찾는다. </para> </listitem> <listitem> <para> - Unqualified constant names are looked up first at current namespace and then - among globally defined constants. + 수식이 되지 않은 상수 이름들은 차례대로 현재 내임스페이스와 전역에 정의된 상수들 사이에서 우선적으로 찾는다. </para> </listitem> </itemizedlist> - See also the full <link linkend="language.namespaces.rules">name resolution rules</link>. + 완전한 <link linkend="language.namespaces.rules">이름 분석 규칙</link>도 참고하기 바란다. </para> </sect1>

« previous php.doc.kr (#803) next »