|
|
@@ -1,6 +1,6 @@
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
<!-- Reviewed: no -->
|
|
|
-<!-- EN-Revision: 20799 -->
|
|
|
+<!-- EN-Revision: 22081 -->
|
|
|
<sect1 id="zend.uri.chapter">
|
|
|
<title>Zend_Uri</title>
|
|
|
|
|
|
@@ -51,8 +51,11 @@ $uri = Zend_Uri::factory('http');
|
|
|
<para>
|
|
|
新しい <acronym>URI</acronym> を作成するには、スキームのみを
|
|
|
<methodname>Zend_Uri::factory()</methodname> に渡します
|
|
|
- <footnote><para>現時点では、
|
|
|
- <classname>Zend_Uri</classname> がサポートしているスキームは <acronym>HTTP</acronym> および <acronym>HTTPS</acronym> だけです。</para></footnote>。
|
|
|
+ <footnote><para>
|
|
|
+ 現時点では、
|
|
|
+ <acronym>HTTP</acronym> および <acronym>HTTPS</acronym> に対する組み込みサポートだけを
|
|
|
+ <classname>Zend_Uri</classname> では提供しています。
|
|
|
+ </para></footnote>。
|
|
|
サポートしていないスキームが渡された場合は、
|
|
|
<classname>Zend_Uri_Exception</classname> がスローされます。
|
|
|
</para>
|
|
|
@@ -62,6 +65,40 @@ $uri = Zend_Uri::factory('http');
|
|
|
<methodname>Zend_Uri::factory()</methodname> は自分自身のサブクラスを返します。
|
|
|
これは、指定したスキームに特化したものとなります。
|
|
|
</para>
|
|
|
+
|
|
|
+ <sect3>
|
|
|
+ <title>Creating a New Custom-Class URI</title>
|
|
|
+
|
|
|
+ <para>
|
|
|
+ Starting from Zend Framework 1.10.5, you can specify a custom class to be
|
|
|
+ used when creating the Zend_Uri instance, as a second parameter to the
|
|
|
+ <methodname>Zend_Uri::factory()</methodname> method.
|
|
|
+ This enables you to subclass Zend_Uri and create your own custom URI classes,
|
|
|
+ and instantiate new URI objects based on your own custom classes.
|
|
|
+ </para>
|
|
|
+
|
|
|
+ <para>
|
|
|
+ The 2nd parameter passed to <methodname>Zend_Uri::factory()</methodname> must
|
|
|
+ be a string with the name of a class extending <classname>Zend_Uri</classname>.
|
|
|
+ The class must either be alredy-loaded, or loadable using <methodname>Zend_Loader::loadClass()</methodname> -
|
|
|
+ that is, it must follow the Zend Framework class and file naming conventions, and
|
|
|
+ must be in your include_path.
|
|
|
+ </para>
|
|
|
+
|
|
|
+ <example id="zend.uri.creation.custom.example-1">
|
|
|
+ <title>Creating a URI using a custom class</title>
|
|
|
+
|
|
|
+ <programlisting language="php"><![CDATA[
|
|
|
+// Create a new 'ftp' URI based on a custom class
|
|
|
+$ftpUri = Zend_Uri::factory(
|
|
|
+ 'ftp://user@ftp.example.com/path/file',
|
|
|
+ 'MyLibrary_Uri_Ftp'
|
|
|
+);
|
|
|
+
|
|
|
+// $ftpUri is an instance of MyLibrary_Uri_Ftp, which is a subclass of Zend_Uri
|
|
|
+]]></programlisting>
|
|
|
+ </example>
|
|
|
+ </sect3>
|
|
|
</sect2>
|
|
|
|
|
|
<sect2 id="zend.uri.manipulation">
|