cvs: peardoc /en/package networking.xml /en/package/networking uri-template.xml /en/package/networking/uri-template intro.xml

From: Date: Fri, 15 Feb 2008 17:44:49 +0000
Subject: cvs: peardoc /en/package networking.xml /en/package/networking uri-template.xml /en/package/networking/uri-template intro.xml
Groups: php.pear.doc 
Request: Send a blank email to pear-doc+get-10485@lists.php.net to get a copy of this message
mj Fri Feb 15 17:44:49 2008 UTC Added files: /peardoc/en/package/networking uri-template.xml /peardoc/en/package/networking/uri-template intro.xml Modified files: /peardoc/en/package networking.xml Log: * Added documentation for URI_Template. http://cvs.php.net/viewvc.cgi/peardoc/en/package/networking.xml?r1=1.22&r2=1.23&diff_format=u Index: peardoc/en/package/networking.xml diff -u peardoc/en/package/networking.xml:1.22 peardoc/en/package/networking.xml:1.23 --- peardoc/en/package/networking.xml:1.22 Tue May 8 01:54:02 2007 +++ peardoc/en/package/networking.xml Fri Feb 15 17:44:49 2008 @@ -1,4 +1,4 @@ -<!-- $Revision: 1.22 $ --> +<!-- $Revision: 1.23 $ --> <chapter id="package.networking"> <title>Networking</title> @@ -33,6 +33,7 @@ &package.networking.net-traceroute; &package.networking.net-whois; &package.networking.net-wifi; + &package.networking.uri-template; </chapter> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/peardoc/en/package/networking/uri-template.xml?view=markup&rev=1.1 Index: peardoc/en/package/networking/uri-template.xml +++ peardoc/en/package/networking/uri-template.xml <!-- $Revision: 1.1 $ --> <sect1 id="package.networking.uri-template"> <title>URI_Template</title> <para> This package contains a parser for URI Templates as defined in the <ulink url="http://bitworking.org/projects/URI-Templates/">URI Template draft</ulink> that is currently being proposed to the IETF. </para> <warning> <para> Please note that the standardization initiative regarding URI Templates is not yet finished. Thus the API and the inner workings of this package may undergo major revisions in the future. </para> </warning> &package.networking.uri-template.intro; </sect1> <!-- 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 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/peardoc/en/package/networking/uri-template/intro.xml?view=markup&rev=1.1 Index: peardoc/en/package/networking/uri-template/intro.xml +++ peardoc/en/package/networking/uri-template/intro.xml <!-- $Revision: 1.1 $ --> <refentry id="package.networking.uri-template.intro"> <refnamediv> <refname>Introduction</refname> <refpurpose> Introduction to <classname>URI_Template</classname> </refpurpose> </refnamediv> <refsect1 id="package.networking.uri-template.intro.overview"> <title>Overview</title> <para> URI Templates are strings that contain embedded variables that are transformed into URIs after embedded variables are substituted. </para> <para> More information about URI Templates can be found at the following locations: </para> <itemizedlist> <listitem> <para> <ulink url="http://bitworking.org/projects/URI-Templates/"> URI Template project page </ulink> </para> </listitem> <listitem> <para> <ulink url="http://www.xml.com/pub/a/2005/04/06/restful.html">Constructing or Traversing URIs?</ulink> on XML.com </para> </listitem> <listitem> <para> <ulink url="http://blog.unto.net/work/uri-templates-draft/">DeWitt Clinton</ulink> </para> </listitem> <listitem> <para> <ulink url="http://www.mnot.net/blog/2006/10/04/uri_templating">Mark Nottingham</ulink> </para> </listitem> <listitem> <para> <ulink url="http://www.snellspace.com/wp/?p=467">James Snell</ulink> </para> </listitem> </itemizedlist> <para> In a nutshell, URI Templates allow actors to specify a certain structure for URIs in order to make it possible for other actors to fill the structure with concrete information later. Joe Gregorio has posted an <ulink url="http://bitworking.org/news/296/How-To-Do-RESTful-Partial-Updates"> example</ulink> of a possible use case. </para> </refsect1> <refsect1 id="package.networking.uri-template.intro.setup"> <title>Setup</title> <refsect2> <title>Requirements</title> <para> <classname>URI_Template</classname> requires <ulink url="&url.php;">PHP 5</ulink>. </para> </refsect2> <refsect2> <title>Installation</title> <para> The <classname>URI_Template</classname> package can be installed using the PEAR installer command <command>pear install URI_Template</command>. </para> <para> Alternative installation methods for situations where one has no access to the <command>pear</command> installer command can be found in the general <link linkend="installation">installation chapter</link>. </para> </refsect2> <refsect2> <title>Uninstallation</title> <para> Uninstalling the package can be done with <command>pear uninstall URI_Template</command>. </para> </refsect2> </refsect1> <refsect1 id="package.networking.uri-templates.intro.examples"> <title>Example</title> <example> <title></title> <programlisting role="php"> require_once "URI/Template.php"; $values = array("a" => "foo", "b" => "bar", "data" => "10,20,30", "points" => array(10, 20, 30), "list0" => array(), "str0" => "", "reserved" => ":/?#[]@!$&amp;'()*+,;=", "a_b" => "baz"); $t = new URI_Template("/{-append|/|a}{-opt|data|points}{-neg|@|a}{-prefix|#|b}"); echo $t->substitute($values); /* /foo/data#bar */ $t = new URI_Template("relative/{reserved}/"); echo $t->substitute($values); /* relative/%3A%2F%3F%23%5B%5D%40%21%24%26%27%28%29%2A%2B%2C%3B%3D/ */ $t = new URI_Template("http://example.org/{foo=%25}/"); echo $t->substitute($values); /* http://example.org/%25/ */ $t = new URI_Template("http://example.org/?{-join|&amp;|a,data}"); echo $t->substitute($values); /* http://example.org/?a=foo&amp;data=10%2C20%2C30 */ $t = new URI_Template("http://example.org/?d={-listjoin|,|points}&amp;{-join|&amp;|a,b}"); echo $t->substitute($values); /* http://example.org/?d=10,20,30&amp;a=foo&amp;b=bar */ $t = new URI_Template("http://example.org/?d={-listjoin|,|list0}&amp;{-join|&amp;|foo}"); echo $t->substitute(array()); /* http://example.org/?d=&amp; */ $t = new URI_Template("http://example.org/?d={-listjoin|&amp;d=|points}"); echo $t->substitute($values); /* http://example.org/?d=10&amp;d=20&amp;d=30 */ $t = new URI_Template("http://example.org/{a}{b}/{a_b}"); echo $t->substitute($values); /* http://example.org/foobar/baz */ $t = new URI_Template("http://example.org/{a}{-prefix|/-/|a}/"); echo $t->substitute($values); /* http://example.org/foo/-/foo/ */ </programlisting> </example> </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 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.pear.doc (#10485) next »