svn: /pear/peardoc/trunk/en/package/ networking/net-url-mapper/check-ip.xml networking/net-url-mapper/example.xml networking/net-url-mapper/features.xml networking/net-url-mapper/intro.xml networking/net-url-mapper.xml networking-entities.xml

[email protected] (Till Klampaeckel)
Newsgroups php.pear.doc
Message-ID <[email protected]>
till                                     Sun, 04 Oct 2009 14:22:37 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=289184

Log:
checking in initial docs for Net_URL_Mapper

Changed paths:
    A + pear/peardoc/trunk/en/package/networking/net-url-mapper/
        (from pear/peardoc/trunk/en/package/networking/net-checkip/:r289179)
    D   pear/peardoc/trunk/en/package/networking/net-url-mapper/check-ip.xml
    A + pear/peardoc/trunk/en/package/networking/net-url-mapper/example.xml
        (from pear/peardoc/trunk/en/package/networking/net-checkip/check-ip.xml:r289179)
    A + pear/peardoc/trunk/en/package/networking/net-url-mapper/features.xml
        (from pear/peardoc/trunk/en/package/networking/net-checkip/check-ip.xml:r289179)
    A + pear/peardoc/trunk/en/package/networking/net-url-mapper/intro.xml
        (from pear/peardoc/trunk/en/package/networking/net-checkip/check-ip.xml:r289179)
    A + pear/peardoc/trunk/en/package/networking/net-url-mapper.xml
        (from pear/peardoc/trunk/en/package/networking/net-checkip.xml:r289179)
    U   pear/peardoc/trunk/en/package/networking-entities.xml
svn-diffs-289184.txt (text/x-diff, 10.6 KB)
Property changes on: pear/peardoc/trunk/en/package/networking/net-url-mapper
___________________________________________________________________
Added: svn:mergeinfo
   +

Deleted: pear/peardoc/trunk/en/package/networking/net-url-mapper/check-ip.xml
===================================================================
--- pear/peardoc/trunk/en/package/networking/net-checkip/check-ip.xml	2009-10-04 11:56:44 UTC (rev 289179)
+++ pear/peardoc/trunk/en/package/networking/net-url-mapper/check-ip.xml	2009-10-04 14:22:37 UTC (rev 289184)
@@ -1,61 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<refentry xmlns="http://docbook.org/ns/docbook" version="lillet" xml:id="package.networking.net-checkip.check-ip">
-   <refnamediv>
-    <refname>Net_CheckIP::check_ip()</refname>
-    <refpurpose>Validation of IPv4 addresses</refpurpose>
-   </refnamediv>
-   <refsynopsisdiv>
-    <funcsynopsis>
-     <funcsynopsisinfo>
-      require_once 'Net/CheckIP.php';
-     </funcsynopsisinfo>
-     <funcprototype>
-     <funcdef>boolean <function>Net_CheckIP::check_ip</function></funcdef>
-     <paramdef choice="req">string <parameter>$ip</parameter></paramdef>
-     </funcprototype>
-    </funcsynopsis>
-   </refsynopsisdiv>
-   <refsection xml:id="package.networking.net-queckip.check-ip.desc">
-    &title.desc;
-    <para>
-     This function can validate if a given string has a valid IPv4 syntax.
-    </para>
-   </refsection>
-   <refsection xml:id="package.networking.net-checkip.check-ip.parameter">
-    &title.param;
-    <para>
-     <itemizedlist>
-      <listitem>
-       <para>
-        <parameter>string $ip</parameter> - the IP address to check
-       </para>
-      </listitem>
-     </itemizedlist>
-    </para>
-   </refsection>
-   <refsection xml:id="package.networking.net-checkip.check-ip.return">
-    &title.returns;
-    <para>
-     <parameter>boolean</parameter> - &true;, if syntax is valid
-    </para>
-   </refsection>
-   <refsection xml:id="package.networking.net-checkip.check-ip.note">
-    &title.note;
-    &note.canstatic;
-   </refsection>
-   <refsection xml:id="package.networking.net-checkip.check-ip.example">
-    &title.example;
-    <example><info><title>Using <function>check_ip</function></title></info>
-
-      <programlisting role="php">
-     <![CDATA[
-require_once "Net_CheckIP/CheckIP.php";
-
-if (Net_CheckIP::check_ip("your_ip_goes_here")) {
-    // Syntax of the IP is ok
-}
-]]>
-     </programlisting>
-    </example>
-   </refsection>
-  </refentry>

Copied: pear/peardoc/trunk/en/package/networking/net-url-mapper/example.xml (from rev 289179, pear/peardoc/trunk/en/package/networking/net-checkip/check-ip.xml)
===================================================================
--- pear/peardoc/trunk/en/package/networking/net-url-mapper/example.xml	                        (rev 0)
+++ pear/peardoc/trunk/en/package/networking/net-url-mapper/example.xml	2009-10-04 14:22:37 UTC (rev 289184)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<chapter xmlns="http://docbook.org/ns/docbook" version="lillet"
+ xml:id="package.networking.net-url-mapper.example"
+>
+ <info>
+  <title>Examples for Net_URL_Mapper</title>
+ </info>
+
+ <para>
+EXAMPLEZ
+ </para>
+
+</chapter>
\ No newline at end of file


Property changes on: pear/peardoc/trunk/en/package/networking/net-url-mapper/example.xml
___________________________________________________________________
Added: cvs2svn:cvs-rev
   + 1.5
Added: svn:mergeinfo
   +

Copied: pear/peardoc/trunk/en/package/networking/net-url-mapper/features.xml (from rev 289179, pear/peardoc/trunk/en/package/networking/net-checkip/check-ip.xml)
===================================================================
--- pear/peardoc/trunk/en/package/networking/net-url-mapper/features.xml	                        (rev 0)
+++ pear/peardoc/trunk/en/package/networking/net-url-mapper/features.xml	2009-10-04 14:22:37 UTC (rev 289184)
@@ -0,0 +1,105 @@
+<?xml version="1.0" encoding="utf-8"?>
+<chapter xmlns="http://docbook.org/ns/docbook" version="lillet"
+ xml:id="package.networking.net-url-mapper.features"
+ xmlns:phd="http://www.php.net/ns/phd"
+>
+ <info>
+  <title>Net_URL_Mapper Features</title>
+ </info>
+
+ <para>
+ Net_URL_Mapper can handle different type of mapping:
+ </para>
+
+ <phd:toc phd:element="package.networking.net-url-mapper.features"/>
+
+ <para>
+  In the following examples we assume that URLs are mapped to a desginated controller
+  and an action. But the <literal>controller</literal> and <literal>action</literal>
+  keys provided could be called anything and are not mandatory.
+ </para>
+
+ <section
+  xml:id="package.networking.net-url-mapper.features.static"
+  phd:chunk="false"
+ >
+
+  <info><title>Static path parts</title></info>
+
+  <para>
+   The following code snippet maps the URL <literal>/home</literal>:
+  </para>
+
+  <example>
+   <programlisting role="php">
+     <![CDATA[
+require_once 'Net/URL/Mapper.php';
+
+$m = Net_URL_Mapper::getInstance();
+$m->connect('home', array('controller' => 'index', 'action' => 'index'));
+var_dump($m->match($_SERVER['REQUEST_URI']));
+
+     ]]>
+   </programlisting>
+  </example>
+ </section>
+
+ <section
+  xml:id="package.networking.net-url-mapper.features.dynamic"
+  phd:chunk="false"
+ >
+  <info><title>Dynamic path parts</title></info>
+
+  <para>
+   The following code snippet maps a URL such as <literal>/news/1</literal>,
+   <literal>/news/2</literal> to a designated controller and action.
+  </para>
+  <example>
+   <programlisting role="php">
+     <![CDATA[
+require_once 'Net/URL/Mapper.php';
+
+$m = Net_URL_Mapper::getInstance();
+$m->connect('news/:id', array('controller' => 'news', 'action' => 'read'));
+var_dump($m->match($_SERVER['REQUEST_URI']));
+
+     ]]>
+   </programlisting>
+  </example>
+ </section>
+
+ <section
+  xml:id="package.networking.net-url-mapper.features.wildcard"
+  phd:chunk="false"
+ >
+  <info><title>Wildcard path parts</title></info>
+
+  <para>
+   The following code snippet maps all URLs with <literal>/content</literal> to a
+   controller called <literal>content</literal> and an action called <literal>
+   display</literal>. Optionally, we'll determine the section on the page using a
+   wildcard. The default for section is <literal>#toc</literal> (Table Of Contents).
+  </para>
+  <example>
+   <programlisting role="php">
+     <![CDATA[
+require_once 'Net/URL/Mapper.php';
+
+$m = Net_URL_Mapper::getInstance();
+
+$path     = 'content/*(section)';
+$defaults = array(
+    'controller' => 'content',
+    'action'     => 'display',
+    'section'    => '#toc',
+);
+
+$m->connect($path, $defaults);
+var_dump($m->match($_SERVER['REQUEST_URI']));
+
+     ]]>
+   </programlisting>
+  </example>
+ </section>
+
+</chapter>
\ No newline at end of file


Property changes on: pear/peardoc/trunk/en/package/networking/net-url-mapper/features.xml
___________________________________________________________________
Added: cvs2svn:cvs-rev
   + 1.5
Added: svn:mergeinfo
   +

Copied: pear/peardoc/trunk/en/package/networking/net-url-mapper/intro.xml (from rev 289179, pear/peardoc/trunk/en/package/networking/net-checkip/check-ip.xml)
===================================================================
--- pear/peardoc/trunk/en/package/networking/net-url-mapper/intro.xml	                        (rev 0)
+++ pear/peardoc/trunk/en/package/networking/net-url-mapper/intro.xml	2009-10-04 14:22:37 UTC (rev 289184)
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<chapter xmlns="http://docbook.org/ns/docbook"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ version="lillet"
+ xml:id="package.networking.net-url-mapper.intro"
+>
+ <info>
+  <title>An Introduction to Net_URL_Mapper</title>
+ </info>
+
+ <para>
+  <classname>Net_URL_Mapper</classname> makes it easy to map an URL to application logic.
+ </para>
+
+ <para>
+  The URL syntax is similar to what can be found in <link xlink:href="http://wiki.rubyonrails.com/rails/pages/Routes">Ruby on Rails</link>
+  or <link xlink:href="http://routes.groovie.org/manual.html">Python Routes module</link>. The API and the design are different and try to
+  offer a more OO approach while making use of interesting PHP5 only features. The URL syntax and the possibilities it offers are also
+  more advanced and elegant than what can be found in the <link xlink:href="http://framework.zend.com/manual/en/zend.controller.html">Zend
+  Framework Controller</link> at the moment.
+ </para>
+
+ <para>
+  Net_URL_Mapper does not perform the dispatching so it can be used with your own dispatcher. This way, it is a lot more flexible and
+  reusable, and consequently more compliant with PEAR objectives. Net_URL_Mapper objectives are to provide a simple, common and
+  flexible way to build nice URLs for your web applications and then use the results to do something. Dealing with Net_URL_Mapper
+  results is left as an excercise to the developers.
+ </para>
+
+</chapter>
\ No newline at end of file


Property changes on: pear/peardoc/trunk/en/package/networking/net-url-mapper/intro.xml
___________________________________________________________________
Added: cvs2svn:cvs-rev
   + 1.5
Added: svn:mergeinfo
   +

Copied: pear/peardoc/trunk/en/package/networking/net-url-mapper.xml (from rev 289179, pear/peardoc/trunk/en/package/networking/net-checkip.xml)
===================================================================
--- pear/peardoc/trunk/en/package/networking/net-url-mapper.xml	                        (rev 0)
+++ pear/peardoc/trunk/en/package/networking/net-url-mapper.xml	2009-10-04 14:22:37 UTC (rev 289184)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<book xmlns="http://docbook.org/ns/docbook" version="lillet" xml:id="package.networking.net-url-mapper">
+ <info>
+  <title>Net_URL_Mapper</title>
+  <abstract>
+   <para>
+    A package to map (and generate) pretty urls.
+   </para>
+  </abstract>
+ </info>
+
+ &package.networking.net-url-mapper.intro;
+ &package.networking.net-url-mapper.features;
+ &package.networking.net-url-mapper.example;
+
+</book>


Property changes on: pear/peardoc/trunk/en/package/networking/net-url-mapper.xml
___________________________________________________________________
Added: cvs2svn:cvs-rev
   + 1.6
Added: svn:mergeinfo
   +

Modified: pear/peardoc/trunk/en/package/networking-entities.xml
===================================================================
--- pear/peardoc/trunk/en/package/networking-entities.xml	2009-10-04 13:34:57 UTC (rev 289183)
+++ pear/peardoc/trunk/en/package/networking-entities.xml	2009-10-04 14:22:37 UTC (rev 289184)
@@ -21,6 +21,7 @@
 &package.networking.net-socket;
 &package.networking.net-traceroute;
 &package.networking.net-url;
+&package.networking.net-url-mapper;
 &package.networking.net-whois;
 &package.networking.net-wifi;
 &package.networking.uri-template;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.