Explorar el Código

[DOCUMANTATION] Japanese:new Zend_Filter_RealPath

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@15716 44c647ce-9c0f-0410-b52a-842ac1e357ba
yoshida@zend.co.jp hace 16 años
padre
commit
eb85304ba7
Se han modificado 1 ficheros con 47 adiciones y 0 borrados
  1. 47 0
      documentation/manual/ja/module_specs/Zend_Filter-RealPath.xml

+ 47 - 0
documentation/manual/ja/module_specs/Zend_Filter-RealPath.xml

@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Reviewed: no -->
+<!-- EN-Revision: 15715 -->
+<sect2 id="zend.filter.set.realpath">
+    <title>RealPath</title>
+
+    <para>
+        このフィルタは与えられたリンクとパス名を解決して、正規化された絶対パス名を返します。
+        <filename>'/./'</filename>や<filename>'/../'</filename>への参照、
+        及び、入力パスの余分な<filename>'/'</filename>記号は取り除かれます。
+        結果のパスにはいかなるシンボリックリンクも無く、
+        <filename>'/./'</filename>や<filename>'/../'</filename>文字もありません。
+    </para>
+
+    <para>
+        たとえばファイルが存在しない場合、
+        <classname>Zend_Filter_RealPath</classname>は失敗すると<code>FALSE</code>を返します。
+        もし最後のパスのコンポーネントだけが存在しない場合、
+        BSDシステムでは<classname>Zend_Filter_RealPath</classname>は失敗しますが、
+        他のシステムでは<constant>FALSE</constant>を返します。
+    </para>
+
+    <programlisting language="php"><![CDATA[
+$filter = new Zend_Filter_RealPath();
+$path   = '/www/var/path/../../mypath';
+$filtered = $filter->filter();
+
+// '/www/mypath' を返します。
+]]></programlisting>
+
+    <para>
+        それらが存在しないとき、
+        たとえば、生成したいパスのために実際のパスを取得したいとき、
+        パスを得るためにしばしば役に立ちます。
+        初期化で<constant>FALSE</constant>を渡すこともできますし、
+        それを設定するために<methodname>setExists()</methodname>を使うこともできます。
+    </para>
+
+    <programlisting language="php"><![CDATA[
+$filter = new Zend_Filter_RealPath(false);
+$path   = '/www/var/path/../../non/existing/path';
+$filtered = $filter->filter();
+
+// file_exists または realpath が false を返すときでも '/www/non/existing/path' を返します。
+]]></programlisting>
+
+</sect2>