cvs: phpdoc /kr/features error-handling.xml file-upload.xml

From: Date: Thu, 18 Jan 2001 06:10:31 +0000
Subject: cvs: phpdoc /kr/features error-handling.xml file-upload.xml
Groups: php.doc 
Request: Send a blank email to phpdoc+get-969333713@lists.php.net to get a copy of this message
regina Wed Jan 17 22:10:31 2001 EDT Modified files: /phpdoc/kr/features error-handling.xml file-upload.xml Log:

Index: phpdoc/kr/features/error-handling.xml diff -u phpdoc/kr/features/error-handling.xml:1.2 phpdoc/kr/features/error-handling.xml:1.3 --- phpdoc/kr/features/error-handling.xml:1.2 Tue Jan 9 03:27:54 2001 +++ phpdoc/kr/features/error-handling.xml Wed Jan 17 22:10:31 2001 @@ -36,7 +36,7 @@ <entry>8</entry> <entry>E_NOTICE </entry> <entry> - Notices (무시할 수 있는 알림이지만 버그의 가능성을 가지고 있는 경우) + Notices (알림-무시할 수 있는 알림이지만 버그의 가능성을 가지고 있는 경우) </entry> <entry/> </row> @@ -95,61 +95,52 @@ </table> </para> <para> - The above values (either numerical or symbolic) are used to build - up a bitmask that specifies which errors to report. You can use the - <link linkend="language.operators.bitwise">bitwise operators</link> - to combine these values or mask out certain types of errors. Note - that only '|', '~', '!', and '&amp;' will be understood within - <filename>php.ini</filename>, however, and that no bitwise - operators will be understood within <filename>php3.ini</filename>. + 위의 값(숫자, 상수 모두)은 레포트하기 원하는 내용의 비트를 설정하기 위해 조합하여 사용할 수 있다. + 원하는 값을 조합해내기 위해 <link linkend="language.operators.bitwise">bitwise operators</link>에 + 있는 비트 조작 연산자를 사용한다. 단 <filename>php.ini</filename> 파일에서는 '|', '~', '!', '&amp;'의 + 네개의 연산자만 사용가능하고, <filename>php3.ini</filename>에서는 어떤 비트단위 연산자도 사용할 수 없다. </para> <para> - In PHP 4, the default <link linkend="ini.error-reporting">error_reporting</link> setting is - <literal>E_ALL &amp; ~E_NOTICE</literal>, meaning to display all errors - and warnings which are not E_NOTICE-level. In PHP 3, the default - setting is <literal>(E_ERROR | E_WARNING | E_PARSE)</literal>, - meaning the same thing. Note, however, that since constants are not - supported in PHP 3's <filename>php3.ini</filename>, the <link linkend="ini.error-reporting">error_reporting</link> setting there - must be numeric; hence, it is <literal>7</literal>. + PHP4에서 <link linkend="ini.error-reporting">error_reporting</link>의 기본값은 + <literal>E_ALL &amp; ~E_NOTICE</literal>이다. 즉, 모든 에러와 경고를 출력하지만 알림(notice)는 레포팅하지 않는다. + PHP3에서의 기본값은 <literal>(E_ERROR | E_WARNING | E_PARSE)</literal>이다. + 내용적으로는 PHP4와 같다. + PHP3의 <filename>php3.ini</filename>에서는 상수를 사용한 설정을 사용할 수 없으므로, + <link linkend="ini.error-reporting">error_reporting</link>의 값은 반드시 숫자여야 한다. + 그러므로 기본값은 <literal>7</literal>이다. </para> <para> - The initial setting can be changed in the ini file with the <link linkend="ini.error-reporting">error_reporting</link> directive, in - your Apache <filename>httpd.conf</filename> file with the - php_error_reporting (php3_error_reporting for PHP 3) directive, and - lastly it may be set at runtime within a script by using the - <function>error_reporting</function> function. + 초기 설정은 ini 파일에 있는 <link linkend="ini.error-reporting">error_reporting</link> 지시자를 사용하여 변할 수 있고, + 아파치의 <filename>httpd.conf</filename>파일에서 php_error_reporting (PHP3에서는 php3_error_reporting) 지시자를 + 사용하여 설정할 수도 있다. 또한, 스크립트 실행중에 <function>error_reporting</function> 함수를 사용하여 설정할 수도 있다. </para> <warning> <para> - When upgrading code or servers from PHP 3 to PHP 4 you should - check these settings and calls to - <function>error_reporting</function> or you might disable - reporting the new error types, especially E_COMPILE_ERROR. This - may lead to empty documents without any feedback of what happened - or where to look for the problem. + PHP3에서 PHP4로 프로그램 코드나 서버 자체를 이전할 경우, + 이 설정과 <function>error_reporting</function> 함수의 호출 내역을 반드시 확인하거나, + E_COMPILE_ERROR를 포함한 새로운 에러 타입에 대한 레포팅을 불가능하게 하여야 한다. + 자칫하면 어떤 문제가 어디서 발생했는가에 대한 정보없이 빈 문서를 만들어 낼 수도 있으므로 주의하자. </para> </warning> <para> - 모든 <link linkend="language.expressions">PHP 표현식(expression)</link>은 "@"를 앞에 붙이고 호출되면 error reporting을 하지 않는다. - 만약 <link linkend="ini.track-errors">track_errors</link> 옵션이 Enabled로 되어 있고 해당 문장에서 에러가 발생했다면, - $php_errormsg라는 전역변수에 에러 메시지가 담겨 있게 된다. + 모든 <link linkend="language.expressions">PHP 표현식(expression)</link>은 "@"를 앞에 붙이고 호출되면 + error reporting을 하지 않는다. 만약 <link linkend="ini.track-errors">track_errors</link> 옵션이 Enabled로 + 되어 있고 해당 문장에서 에러가 발생했다면, $php_errormsg라는 전역변수에 에러 메시지가 담겨 있게 된다. </para> <warning> <para> - Currently the <link linkend="language.operators.errorcontrol">@ - error-control operator</link> prefix will even disable error - reporting for critical errors that will terminate script - execution. Among other things, this means that if you use <link linkend="language.operators.errorcontrol">@</link> to suppress - errors from a certain function and either it isn't available or - has been mistyped, the script will die right there with no - indication as to why. + 현재 <link linkend="language.operators.errorcontrol">@ + error-control operator</link> 선행자(prefix)는 스크립트를 중단시킬 정도의 + 치명적인 에러에 대해서도 에러 레포팅을 하지 않게 한다. + 특히 <link linkend="language.operators.errorcontrol">@</link>이 특정 함수의 에러레포팅을 + 억제 하려고 사용된 경우에, 이 함수가 존재 하지 않거나, 이름을 잘못 쓴 경우 해당 스크립트는 + 아무런 이유를 표시하지 않고 죽어버리게 된다. </para> </warning> <para> - Below we can see an example of using the error handling capabilities in - PHP. We define a error handling function which logs the information into - a file (using an XML format), and e-mails the developer in case a critical - error in the logic happens. + 아래에 PHP에서 에러를 다루는 기능에 대한 사용 예를 적어 놓았다. + 이 예에서 우리는 파일로(XML 포맷을 사용) 해당 정보의 로그를 남기고, + 논리적인 문제로 치명적인 에러가 생긴경우는 개발자에게 e-mail을 보내는 에러 핸들링 함수를 정의하였다. <example> <title>Using error handling in a script</title> <programlisting role="php"> @@ -254,9 +245,8 @@ ?&gt; </programlisting> </example> - This is just a simple example showing how to use the - <link linkend="ref.errorfunc">Error Handling and Logging - functions</link>. + 이것은 <link linkend="ref.errorfunc">Error Handling and Logging functions</link>에 + 있는 함수들을 어떻게 사용하는 가를 보여주는 간단한 예이다. </para> <para> See also <function>error_reporting</function>, Index: phpdoc/kr/features/file-upload.xml diff -u phpdoc/kr/features/file-upload.xml:1.3 phpdoc/kr/features/file-upload.xml:1.4 --- phpdoc/kr/features/file-upload.xml:1.3 Wed Jan 10 02:46:55 2001 +++ phpdoc/kr/features/file-upload.xml Wed Jan 17 22:10:31 2001 @@ -30,13 +30,12 @@ 이 값은 PHP html이 받아들이는 최대 파일 크기를 Byte단위로 나타냅니다. </para> <para> - In PHP 3, the following variables will be defined within the - destination script upon a successful upload, assuming that <link linkend="ini.register-globals">register_globals</link> is turned - on in <filename>php3.ini</filename>. If <link linkend="ini.track-vars">track_vars</link> is turned on, they will - also be available in PHP 3 within the global array - <varname>$HTTP_POST_VARS</varname>. Note that the following - variable names assume the use of the file upload name 'userfile', - as used in the example above: + PHP3에서는 업로드가 완료되면 실행될 스크립트에는 다음 변수들이 설정된다. + (물론 <filename>php3.ini</filename> 파일에 <link linkend="ini.register-globals">register_globals</link>가 + 켜져있어야 한다.) + 또한 만약 <link linkend="ini.track-vars">track_vars</link>가 켜져있으면, + 전역변수 <varname>$HTTP_POST_VARS</varname> 내에도 이 변수들이 설정된다. + 다음 예제에 있는 변수명들은 업로드시 'userfile'이라는 필드명을 사용한 것으로 가정한다.: <itemizedlist> <listitem> @@ -65,18 +64,14 @@ 위의 예제에서 우리는 그 이름은 "userfile"이라고 정했다. </para> <para> - - In PHP 4, the behaviour is slightly different, in that the new - global array <varname>$HTTP_POST_FILES</varname> is provided to - contain the uploaded file information. This is still only - available if <link linkend="ini.track-vars">track_vars</link> is - turned on, but <link linkend="ini.track-vars">track_vars</link> is - always turned on in versions of PHP after PHP 4.0.2. + PHP4에서는 동작이 약간 다르다. PHP4에서는 엄로드된 파일에 대한 정보를 가지고 있는 + <varname>$HTTP_POST_FILES</varname> 전역 배열을 지원한다. + 이 변수는 <link linkend="ini.track-vars">track_vars</link>가 켜져 있어야만 사용가능하지만, + PHP 4.0.2 이후에서는 항상 켜져 있으므로 걱정할 필요는 없다. </para> <para> - The contents of <varname>$HTTP_POST_FILES</varname> are as - follows. Note that this assumes the use of the file upload name - 'userfile', as used in the example above: + <varname>$HTTP_POST_FILES</varname>의 내용은 다음과 같다. + 위에 있는 예와 같이 업로드시 'userfile'이라는 필드명을 사용한 것으로 가정한다.: <variablelist> <varlistentry> <term> @@ -84,7 +79,7 @@ </term> <listitem> <para> - The original name of the file on the client machine. + 클라이언트에서의 원래 파일명 </para> </listitem> </varlistentry> @@ -94,9 +89,8 @@ </term> <listitem> <para> - The mime type of the file, if the browser provided this - information. An example would be - <literal>&quot;image/gif&quot;</literal>. + 해당 파일의 mime 타입. 브라우저가 이 타입 대한 정보를 가지고 있는 경우에만 설정된다. + (예 : <literal>&quot;image/gif&quot;</literal>) </para> </listitem> </varlistentry> @@ -106,7 +100,7 @@ </term> <listitem> <para> - The size, in bytes, of the uploaded file. + 업로드된 파일의 크기. byte 단위이다. </para> </listitem> </varlistentry> @@ -116,15 +110,14 @@ </term> <listitem> <para> - The temporary filename of the file in which the uploaded file - was stored on the server. + 업로드가 완료된후 서버에 저장된 파일의 파일명. (임시파일이다.) </para> </listitem> </varlistentry> </variablelist> </para> <para> - 업로드된 File은 <filename>php.ini</filename>의 + 업로드된 파일은 <filename>php.ini</filename>의 <link linkend="ini.upload-tmp-dir">upload_tmp_dir</link>지시자가 특정 디렉토리를 지정하지 않으면, 기본적으로 우선 서버의 default temporary directory에 저장된다. 이 디폴트 디렉토리는 PHP가 돌아가는 컴퓨터의 환경변수 <envar>TMPDIR</envar>을 설정하여 변경할 수 있다. @@ -132,10 +125,8 @@ <example> <title>Validating file uploads</title> <para> - The following examples are for versions of PHP 3 greater than - 3.0.16, and versions of PHP 4 greater than 4.0.2. See the - function entries for <function>is_uploaded_file</function> and - <function>move_uploaded_file</function>. + 다음 예제는 PHP3 3.0.16 이상이나 PHP4 4.0.2 이상에서만 실행이 가능하다. + 그리고 <function>is_uploaded_file</function>과 <function>move_uploaded_file</function>함수를 살펴보자. </para> <programlisting role="php"> &lt;?php @@ -149,13 +140,13 @@ ?> </programlisting> <para> + 이전 버전의 PHP에서는 다음과 같은 처리하여야 한다. 가 필요하다. For earlier versions of PHP, you'll need to do something like the following. <note> <para> - This will <emphasis>not</emphasis> work in versions of PHP 4 - after 4.0.2. It depends on internal functionality of PHP which - changed after that version. + 이 예제는 PHP4 4.0.2이후 버전에서는 동작하지 <emphasis>않는다.</emphasis> + 4.0.2이후 부터는 내부적으로 처리하는 방법이 달라졌기 때문이다. </para> </note> </para> @@ -181,10 +172,10 @@ </example> </para> <simpara> - 업로드된 파일을 다루는 PHP 스크립트는 그 파일을 다루는 작업을 설정해 줄 필요가 있다. - 예를들어, 여러분은 <varname>$file_size</varname> 변수를 사용하여 너무 작거나 큰 파일을 버릴 수도 있다. - 또한 여러분은 <varname>$file_type</varname> 변수를 가지고 특정한 타입에 맞지 않는 파일을 버릴 수 있다. - 어떤 로직이던, 여러분은 임시 디렉토리에 있는 파일을 지우거나 나중에 필요할 경우에는 다른 곳에 이동시켜야 한다. + 업로드된 파일을 다루는 PHP 스크립트는 그 파일을 다루는 작업을 설정해 줄 필요가 있다. + 예를들어, <varname>$file_size</varname> 변수를 사용하여 너무 작거나 큰 파일을 버릴 수도 있다. + 또한 <varname>$file_type</varname> 변수를 가지고 특정한 타입에 맞지 않는 파일을 버릴 수 있다. + 어떤 로직이던, 임시 디렉토리에 있는 파일을 지우거나 나중에 필요할 경우에는 다른 곳에 이동시켜야 한다. </simpara> <simpara> 만약 임시 디렉토리에 있는 파일을 해당 request가 끝날 때 까지도 지우거나 이동시키지 않았다면, @@ -199,8 +190,8 @@ 기본값은 2메가 바이트이다. </simpara> <simpara> - Not validating which file you operate on may mean that users can access - sensitive information in other directories. + 업로드된 파일에 대한 검사를 게을리하면 일반 사용자들이 시스템이나 + 다른 디렉토리내의 보안에 관한 정보에 접근할 수도 있으니 주의하기 바란다. </simpara> <simpara> CERN httpd 서버는 client로부터 입력받은 mime header의 앞쪽 여백을 모두 strip off 시켜버리므로,
« previous php.doc (#969333713) next »