Go to most recent revision | Blame | Last modification | View Log | RSS feed
<html>
<head>
<title>File Source for Url.php</title>
<meta http-equiv='Content-Type' content='text/html; charset=UTF-8'/>
<link rel="stylesheet" type="text/css" href="../media/style.css">
</head>
<body>
<table border="0" cellspacing="0" cellpadding="0" height="48" width="100%">
<tr>
<td class="header_top">Framework</td>
</tr>
<tr><td class="header_line"><img src="../media/empty.png" width="1" height="1" border="0" alt="" /></td></tr>
<tr>
<td class="header_menu">
[ <a href="../classtrees_Framework.html" class="menu">class tree: Framework</a> ]
[ <a href="../elementindex_Framework.html" class="menu">index: Framework</a> ]
[ <a href="../elementindex.html" class="menu">all elements</a> ]
</td>
</tr>
<tr><td class="header_line"><img src="../media/empty.png" width="1" height="1" border="0" alt="" /></td></tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr valign="top">
<td width="200" class="menu">
<b>Packages:</b><br />
<a href="../li_Framework.html">Framework</a><br />
<br /><br />
</td>
<td>
<table cellpadding="10" cellspacing="0" width="100%" border="0"><tr><td valign="top">
<h1 align="center">Source for file Url.php</h1>
<p>Documentation is available at <a href="../Framework/_Url.php.html">Url.php</a></p>
<div class="src-code">
<ol><li><div class="src-line"><a name="a1"></a><span class="src-php"><?php</span></div></li>
<li><div class="src-line"><a name="a2"></a><span class="src-comm">// declare(encoding='UTF-8');</span></div></li>
<li><div class="src-line"><a name="a3"></a><span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a4"></a><span class="src-doc">* classe Url, gérant le découpage des paramètres, leurs modification etc...</span></div></li>
<li><div class="src-line"><a name="a5"></a><span class="src-doc">* Traduction et conversion d'une classe (NET_Url2) issue de Pear</span></div></li>
<li><div class="src-line"><a name="a6"></a><span class="src-doc">*</span></div></li>
<li><div class="src-line"><a name="a7"></a><span class="src-doc">* </span><span class="src-doc-coretag">@category</span><span class="src-doc"> Php5</span></div></li>
<li><div class="src-line"><a name="a8"></a><span class="src-doc">* </span><span class="src-doc-coretag">@package</span><span class="src-doc"> Framework</span></div></li>
<li><div class="src-line"><a name="a9"></a><span class="src-doc">// Auteur principal</span></div></li>
<li><div class="src-line"><a name="a10"></a><span class="src-doc">* </span><span class="src-doc-coretag">@author</span><span class="src-doc"> Christian Schmidt <schmidt@php.net></span></div></li>
<li><div class="src-line"><a name="a11"></a><span class="src-doc">// Autre auteurs</span></div></li>
<li><div class="src-line"><a name="a12"></a><span class="src-doc">* </span><span class="src-doc-coretag">@author</span><span class="src-doc"> Aurélien PERONNET <aurelien@tela-botanica.org></span></div></li>
<li><div class="src-line"><a name="a13"></a><span class="src-doc">* </span><span class="src-doc-coretag">@author</span><span class="src-doc"> Jean-Pascal MILCENT <jpm@tela-botanica.org></span></div></li>
<li><div class="src-line"><a name="a14"></a><span class="src-doc">* </span><span class="src-doc-coretag">@copyright</span><span class="src-doc"> 2009 Tela-Botanica</span></div></li>
<li><div class="src-line"><a name="a15"></a><span class="src-doc">* </span><span class="src-doc-coretag">@license</span><span class="src-doc"> http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL</span></div></li>
<li><div class="src-line"><a name="a16"></a><span class="src-doc">* </span><span class="src-doc-coretag">@license</span><span class="src-doc"> http://www.gnu.org/licenses/gpl.html Licence GNU-GPL</span></div></li>
<li><div class="src-line"><a name="a17"></a><span class="src-doc">* </span><span class="src-doc-coretag">@version</span><span class="src-doc"> SVN: $Id: Url.php 150 2010-03-03 15:49:06Z jpm $</span></div></li>
<li><div class="src-line"><a name="a18"></a><span class="src-doc">* </span><span class="src-doc-coretag">@link</span><span class="src-doc"> /doc/framework/</span></div></li>
<li><div class="src-line"><a name="a19"></a><span class="src-doc">*</span></div></li>
<li><div class="src-line"><a name="a20"></a><span class="src-doc">*/</span></div></li>
<li><div class="src-line"><a name="a21"></a><span class="src-key">class </span><a href="../Framework/Url.html">Url</a></div></li>
<li><div class="src-line"><a name="a22"></a><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a23"></a> <span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a24"></a><span class="src-doc"> * Parsing strict dans resoudre() (voir RFC 3986, section 5.2.2). Par défaut</span></div></li>
<li><div class="src-line"><a name="a25"></a><span class="src-doc"> * à true.</span></div></li>
<li><div class="src-line"><a name="a26"></a><span class="src-doc"> */</span></div></li>
<li><div class="src-line"><a name="a27"></a> <span class="src-key">const </span><span class="src-id">OPTION_STRICTE </span>= <span class="src-str">'strict'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a28"></a> </div></li>
<li><div class="src-line"><a name="a29"></a> <span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a30"></a><span class="src-doc"> * Répresenter les tableaux dans les requêtes en utilisant la notation php []. Par défaut à true.</span></div></li>
<li><div class="src-line"><a name="a31"></a><span class="src-doc"> */</span></div></li>
<li><div class="src-line"><a name="a32"></a> <span class="src-key">const </span><span class="src-id">OPTION_UTILISER_CROCHETS </span>= <span class="src-str">'use_brackets'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a33"></a> </div></li>
<li><div class="src-line"><a name="a34"></a> <span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a35"></a><span class="src-doc"> * URL-encoder les clés des variables dans les requêtes. Par défaut à true.</span></div></li>
<li><div class="src-line"><a name="a36"></a><span class="src-doc"> */</span></div></li>
<li><div class="src-line"><a name="a37"></a> <span class="src-key">const </span><span class="src-id">OPTION_ENCODER_CLES </span>= <span class="src-str">'encode_keys'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a38"></a> </div></li>
<li><div class="src-line"><a name="a39"></a> <span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a40"></a><span class="src-doc"> * Séparateurs de variables lors du parsing de la requête. Chaque caractère</span></div></li>
<li><div class="src-line"><a name="a41"></a><span class="src-doc"> * est considéré comme un séparateur. Par défaut, spécifié par le paramêtre</span></div></li>
<li><div class="src-line"><a name="a42"></a><span class="src-doc"> * arg_separator.input dans php.ini (par défaut "&").</span></div></li>
<li><div class="src-line"><a name="a43"></a><span class="src-doc"> */</span></div></li>
<li><div class="src-line"><a name="a44"></a> <span class="src-key">const </span><span class="src-id">OPTION_SEPARATEUR_ENTREE </span>= <span class="src-str">'input_separator'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a45"></a> </div></li>
<li><div class="src-line"><a name="a46"></a> <span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a47"></a><span class="src-doc"> * Séparateur de variables lors de la génération de la requête. Par défaut, spécifié</span></div></li>
<li><div class="src-line"><a name="a48"></a><span class="src-doc"> * par le paramètre arg_separator.output dans php.ini (par défaut "&").</span></div></li>
<li><div class="src-line"><a name="a49"></a><span class="src-doc"> */</span></div></li>
<li><div class="src-line"><a name="a50"></a> <span class="src-key">const </span><span class="src-id">OPTION_SEPARATEUR_SORTIE </span>= <span class="src-str">'output_separator'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a51"></a> </div></li>
<li><div class="src-line"><a name="a52"></a> <span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a53"></a><span class="src-doc"> * Options par défaut correspondant au comportement de php</span></div></li>
<li><div class="src-line"><a name="a54"></a><span class="src-doc"> * vis à vis de $_GET</span></div></li>
<li><div class="src-line"><a name="a55"></a><span class="src-doc"> */</span></div></li>
<li><div class="src-line"><a name="a56"></a> <span class="src-key">private </span><span class="src-var">$options </span>= <span class="src-key">array</span><span class="src-sym">(</span></div></li>
<li><div class="src-line"><a name="a57"></a> <span class="src-id">self</span><span class="src-sym">::</span><span class="src-id">OPTION_STRICTE </span>=> <span class="src-id">true</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"><a name="a58"></a> <span class="src-id">self</span><span class="src-sym">::</span><span class="src-id">OPTION_UTILISER_CROCHETS </span>=> <span class="src-id">true</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"><a name="a59"></a> <span class="src-id">self</span><span class="src-sym">::</span><span class="src-id">OPTION_ENCODER_CLES </span>=> <span class="src-id">true</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"><a name="a60"></a> <span class="src-id">self</span><span class="src-sym">::</span><span class="src-id">OPTION_SEPARATEUR_ENTREE </span>=> <span class="src-str">'x&'</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"><a name="a61"></a> <span class="src-id">self</span><span class="src-sym">::</span><span class="src-id">OPTION_SEPARATEUR_SORTIE </span>=> <span class="src-str">'x&'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a62"></a> </div></li>
<li><div class="src-line"><a name="a63"></a> <span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a64"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@var </span><span class="src-doc"> </span><span class="src-doc-type">string</span><span class="src-doc">|</span><span class="src-doc-type">bool</span></div></li>
<li><div class="src-line"><a name="a65"></a><span class="src-doc"> */</span></div></li>
<li><div class="src-line"><a name="a66"></a> <span class="src-key">private </span><span class="src-var">$schema </span>= <span class="src-id">false</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a67"></a> </div></li>
<li><div class="src-line"><a name="a68"></a> <span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a69"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@var </span><span class="src-doc"> </span><span class="src-doc-type">string</span><span class="src-doc">|</span><span class="src-doc-type">bool</span></div></li>
<li><div class="src-line"><a name="a70"></a><span class="src-doc"> */</span></div></li>
<li><div class="src-line"><a name="a71"></a> <span class="src-key">private </span><span class="src-var">$infoUtilisateur </span>= <span class="src-id">false</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a72"></a> </div></li>
<li><div class="src-line"><a name="a73"></a> <span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a74"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@var </span><span class="src-doc"> </span><span class="src-doc-type">string</span><span class="src-doc">|</span><span class="src-doc-type">bool</span></div></li>
<li><div class="src-line"><a name="a75"></a><span class="src-doc"> */</span></div></li>
<li><div class="src-line"><a name="a76"></a> <span class="src-key">private </span><span class="src-var">$hote </span>= <span class="src-id">false</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a77"></a> </div></li>
<li><div class="src-line"><a name="a78"></a> <span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a79"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@var </span><span class="src-doc"> </span><span class="src-doc-type">int</span><span class="src-doc">|</span><span class="src-doc-type">bool</span></div></li>
<li><div class="src-line"><a name="a80"></a><span class="src-doc"> */</span></div></li>
<li><div class="src-line"><a name="a81"></a> <span class="src-key">private </span><span class="src-var">$port </span>= <span class="src-id">false</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a82"></a> </div></li>
<li><div class="src-line"><a name="a83"></a> <span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a84"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@var </span><span class="src-doc"> </span><span class="src-doc-type">string </span></div></li>
<li><div class="src-line"><a name="a85"></a><span class="src-doc"> */</span></div></li>
<li><div class="src-line"><a name="a86"></a> <span class="src-key">private </span><span class="src-var">$chemin </span>= <span class="src-str">''</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a87"></a> </div></li>
<li><div class="src-line"><a name="a88"></a> <span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a89"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@var </span><span class="src-doc"> </span><span class="src-doc-type">string</span><span class="src-doc">|</span><span class="src-doc-type">bool</span></div></li>
<li><div class="src-line"><a name="a90"></a><span class="src-doc"> */</span></div></li>
<li><div class="src-line"><a name="a91"></a> <span class="src-key">private </span><span class="src-var">$requete </span>= <span class="src-id">false</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a92"></a> </div></li>
<li><div class="src-line"><a name="a93"></a> <span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a94"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@var </span><span class="src-doc"> </span><span class="src-doc-type">string</span><span class="src-doc">|</span><span class="src-doc-type">bool</span></div></li>
<li><div class="src-line"><a name="a95"></a><span class="src-doc"> */</span></div></li>
<li><div class="src-line"><a name="a96"></a> <span class="src-key">private </span><span class="src-var">$fragment </span>= <span class="src-id">false</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a97"></a> </div></li>
<li><div class="src-line"><a name="a98"></a> <span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a99"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$url </span><span class="src-doc"> une URL relative ou absolue</span></div></li>
<li><div class="src-line"><a name="a100"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">array </span><span class="src-doc"> </span><span class="src-doc-var">$options </span></div></li>
<li><div class="src-line"><a name="a101"></a><span class="src-doc"> */</span></div></li>
<li><div class="src-line"><a name="a102"></a> <span class="src-key">public </span><span class="src-key">function </span><a href="../Framework/Url.html#method__construct">__construct</a><span class="src-sym">(</span><span class="src-var">$url</span><span class="src-sym">, </span><span class="src-var">$options </span>= <span class="src-id">null</span><span class="src-sym">) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a103"></a> <span class="src-var">$this</span><span class="src-sym">-></span><a href="../Framework/Url.html#methodsetOption">setOption</a><span class="src-sym">(</span><span class="src-id">self</span><span class="src-sym">::</span><span class="src-id">OPTION_SEPARATEUR_ENTREE</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"><a name="a104"></a> <span class="src-id"><a href="../Framework/Config.html">Config</a></span><span class="src-sym">::</span><a href="../Framework/Config.html#methodget">get</a><span class="src-sym">(</span><span class="src-str">'fw_url_arg_separateur_entree'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a105"></a> <span class="src-var">$this</span><span class="src-sym">-></span><a href="../Framework/Url.html#methodsetOption">setOption</a><span class="src-sym">(</span><span class="src-id">self</span><span class="src-sym">::</span><span class="src-id">OPTION_SEPARATEUR_SORTIE</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"><a name="a106"></a> <span class="src-id"><a href="../Framework/Config.html">Config</a></span><span class="src-sym">::</span><a href="../Framework/Config.html#methodget">get</a><span class="src-sym">(</span><span class="src-str">'fw_url_arg_separateur_sortie'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a107"></a> <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(</span><span class="src-var">$options</span><span class="src-sym">)) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a108"></a> <span class="src-key">foreach </span><span class="src-sym">(</span><span class="src-var">$options </span><span class="src-key">as </span><span class="src-var">$nomOption </span>=> <span class="src-var">$valeur</span><span class="src-sym">) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a109"></a> <span class="src-var">$this</span><span class="src-sym">-></span><a href="../Framework/Url.html#methodsetOption">setOption</a><span class="src-sym">(</span><span class="src-var">$nomOption</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a110"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a111"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a112"></a> </div></li>
<li><div class="src-line"><a name="a113"></a> <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/preg_match">preg_match</a><span class="src-sym">(</span><span class="src-str">'@^([a-z][a-z0-9.+-]*):@i'</span><span class="src-sym">, </span><span class="src-var">$url</span><span class="src-sym">, </span><span class="src-var">$reg</span><span class="src-sym">)) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a114"></a> <span class="src-var">$this</span><span class="src-sym">-></span><span class="src-var">schema </span>= <span class="src-var">$reg</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a115"></a> <span class="src-var">$url </span>= <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$url</span><span class="src-sym">, </span><a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$reg</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a116"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a117"></a> </div></li>
<li><div class="src-line"><a name="a118"></a> <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/preg_match">preg_match</a><span class="src-sym">(</span><span class="src-str">'@^//([^/#?]+)@'</span><span class="src-sym">, </span><span class="src-var">$url</span><span class="src-sym">, </span><span class="src-var">$reg</span><span class="src-sym">)) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a119"></a> <span class="src-var">$this</span><span class="src-sym">-></span><a href="../Framework/Url.html#methodsetAutorite">setAutorite</a><span class="src-sym">(</span><span class="src-var">$reg</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a120"></a> <span class="src-var">$url </span>= <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$url</span><span class="src-sym">, </span><a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$reg</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a121"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a122"></a> </div></li>
<li><div class="src-line"><a name="a123"></a> <span class="src-var">$i </span>= <a href="http://www.php.net/strcspn">strcspn</a><span class="src-sym">(</span><span class="src-var">$url</span><span class="src-sym">, </span><span class="src-str">'?#'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a124"></a> <span class="src-var">$this</span><span class="src-sym">-></span><span class="src-var">chemin </span>= <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$url</span><span class="src-sym">, </span><span class="src-num">0</span><span class="src-sym">, </span><span class="src-var">$i</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a125"></a> <span class="src-var">$url </span>= <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$url</span><span class="src-sym">, </span><span class="src-var">$i</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a126"></a> </div></li>
<li><div class="src-line"><a name="a127"></a> <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/preg_match">preg_match</a><span class="src-sym">(</span><span class="src-str">'@^\?([^#]*)@'</span><span class="src-sym">, </span><span class="src-var">$url</span><span class="src-sym">, </span><span class="src-var">$reg</span><span class="src-sym">)) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a128"></a> <span class="src-var">$this</span><span class="src-sym">-></span><span class="src-var">requete </span>= <span class="src-var">$reg</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a129"></a> <span class="src-var">$url </span>= <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$url</span><span class="src-sym">, </span><a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$reg</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a130"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a131"></a> </div></li>
<li><div class="src-line"><a name="a132"></a> <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$url</span><span class="src-sym">) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a133"></a> <span class="src-var">$this</span><span class="src-sym">-></span><span class="src-var">fragment </span>= <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$url</span><span class="src-sym">, </span><span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a134"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a135"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a136"></a> </div></li>
<li><div class="src-line"><a name="a137"></a> <span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a138"></a><span class="src-doc"> * Retourne le schéma, c.a.d. "http" ou "urn", ou false si aucun schéma n'est</span></div></li>
<li><div class="src-line"><a name="a139"></a><span class="src-doc"> * spécifié, i.e. l'url est une url relative</span></div></li>
<li><div class="src-line"><a name="a140"></a><span class="src-doc"> *</span></div></li>
<li><div class="src-line"><a name="a141"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@return </span><span class="src-doc"> </span><span class="src-doc-type">string</span><span class="src-doc">|</span><span class="src-doc-type">bool</span></div></li>
<li><div class="src-line"><a name="a142"></a><span class="src-doc"> */</span></div></li>
<li><div class="src-line"><a name="a143"></a> <span class="src-key">public </span><span class="src-key">function </span><a href="../Framework/Url.html#methodgetSchema">getSchema</a><span class="src-sym">(</span><span class="src-sym">) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a144"></a> <span class="src-key">return </span><span class="src-var">$this</span><span class="src-sym">-></span><span class="src-var">schema</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a145"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a146"></a> </div></li>
<li><div class="src-line"><a name="a147"></a> <span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a148"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string</span><span class="src-doc">|</span><span class="src-doc-type">bool</span><span class="src-doc-var">$schema </span></div></li>
<li><div class="src-line"><a name="a149"></a><span class="src-doc"> *</span></div></li>
<li><div class="src-line"><a name="a150"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@return </span><span class="src-doc-type">void </span></div></li>
<li><div class="src-line"><a name="a151"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@see</span><span class="src-doc"> getSchema()</span></div></li>
<li><div class="src-line"><a name="a152"></a><span class="src-doc"> */</span></div></li>
<li><div class="src-line"><a name="a153"></a> <span class="src-key">public </span><span class="src-key">function </span><a href="../Framework/Url.html#methodsetSchema">setSchema</a><span class="src-sym">(</span><span class="src-var">$schema</span><span class="src-sym">) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a154"></a> <span class="src-var">$this</span><span class="src-sym">-></span><span class="src-var">schema </span>= <span class="src-var">$schema</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a155"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a156"></a> </div></li>
<li><div class="src-line"><a name="a157"></a> <span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a158"></a><span class="src-doc"> * renvoie la partie user de la partie infoUtilisateur (partie précédant le premier</span></div></li>
<li><div class="src-line"><a name="a159"></a><span class="src-doc"> * ":"), ou false si aucune partie infoUtilisateur n'est définie.</span></div></li>
<li><div class="src-line"><a name="a160"></a><span class="src-doc"> *</span></div></li>
<li><div class="src-line"><a name="a161"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@return </span><span class="src-doc"> </span><span class="src-doc-type">string</span><span class="src-doc">|</span><span class="src-doc-type">bool</span></div></li>
<li><div class="src-line"><a name="a162"></a><span class="src-doc"> */</span></div></li>
<li><div class="src-line"><a name="a163"></a> <span class="src-key">public </span><span class="src-key">function </span><a href="../Framework/Url.html#methodgetUtilisateur">getUtilisateur</a><span class="src-sym">(</span><span class="src-sym">) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a164"></a> <span class="src-key">return </span><span class="src-var">$this</span><span class="src-sym">-></span><span class="src-var">infoUtilisateur </span>!== <span class="src-id">false </span>? <a href="http://www.php.net/preg_replace">preg_replace</a><span class="src-sym">(</span><span class="src-str">'@:.*$@'</span><span class="src-sym">, </span><span class="src-str">''</span><span class="src-sym">, </span><span class="src-var">$this</span><span class="src-sym">-></span><span class="src-var">infoUtilisateur</span><span class="src-sym">) </span>: <span class="src-id">false</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a165"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a166"></a> </div></li>
<li><div class="src-line"><a name="a167"></a> <span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a168"></a><span class="src-doc"> * renvoie la partie mot de passe de la partie infoUtilisateur (partie après le premier</span></div></li>
<li><div class="src-line"><a name="a169"></a><span class="src-doc"> * ":"), , ou false si aucune partie infoUtilisateur n'est définie (i.e. l'URL ne contient</span></div></li>
<li><div class="src-line"><a name="a170"></a><span class="src-doc"> * pas de "@" en face du nom d'hôte) ou si la partie infoUtilisateur ne contient pas de ":".</span></div></li>
<li><div class="src-line"><a name="a171"></a><span class="src-doc"> *</span></div></li>
<li><div class="src-line"><a name="a172"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@return </span><span class="src-doc"> </span><span class="src-doc-type">string</span><span class="src-doc">|</span><span class="src-doc-type">bool</span></div></li>
<li><div class="src-line"><a name="a173"></a><span class="src-doc"> */</span></div></li>
<li><div class="src-line"><a name="a174"></a> <span class="src-key">public </span><span class="src-key">function </span><a href="../Framework/Url.html#methodgetMotDePasse">getMotDePasse</a><span class="src-sym">(</span><span class="src-sym">) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a175"></a> <span class="src-key">return </span><span class="src-var">$this</span><span class="src-sym">-></span><span class="src-var">infoUtilisateur </span>!== <span class="src-id">false </span>? <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><a href="http://www.php.net/strstr">strstr</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-></span><span class="src-var">infoUtilisateur</span><span class="src-sym">, </span><span class="src-str">':'</span><span class="src-sym">)</span><span class="src-sym">, </span><span class="src-num">1</span><span class="src-sym">) </span>: <span class="src-id">false</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a176"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a177"></a> </div></li>
<li><div class="src-line"><a name="a178"></a> <span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a179"></a><span class="src-doc"> * Renvoie la partie userinfio, ou false si celle-ci n'existe pas, i.e. si la partie</span></div></li>
<li><div class="src-line"><a name="a180"></a><span class="src-doc"> * autorité ne contient pas de "@"</span></div></li>
<li><div class="src-line"><a name="a181"></a><span class="src-doc"> *</span></div></li>
<li><div class="src-line"><a name="a182"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@return </span><span class="src-doc"> </span><span class="src-doc-type">string</span><span class="src-doc">|</span><span class="src-doc-type">bool</span></div></li>
<li><div class="src-line"><a name="a183"></a><span class="src-doc"> */</span></div></li>
<li><div class="src-line"><a name="a184"></a> <span class="src-key">public </span><span class="src-key">function </span><a href="../Framework/Url.html#methodgetInfoUtilisateur">getInfoUtilisateur</a><span class="src-sym">(</span><span class="src-sym">) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a185"></a> <span class="src-key">return </span><span class="src-var">$this</span><span class="src-sym">-></span><span class="src-var">infoUtilisateur</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a186"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a187"></a> </div></li>
<li><div class="src-line"><a name="a188"></a> <span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a189"></a><span class="src-doc"> * Setteur pour la partie infoUtilisateur. Si deux argument sont passé, ils sont combinés</span></div></li>
<li><div class="src-line"><a name="a190"></a><span class="src-doc"> * dans la partie infoUtilisateur de cette manière username ":" password.</span></div></li>
<li><div class="src-line"><a name="a191"></a><span class="src-doc"> *</span></div></li>
<li><div class="src-line"><a name="a192"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string</span><span class="src-doc">|</span><span class="src-doc-type">bool</span><span class="src-doc-var">$infoUtilisateur </span><span class="src-doc">infoUtilisateur ou username</span></div></li>
<li><div class="src-line"><a name="a193"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string</span><span class="src-doc">|</span><span class="src-doc-type">bool</span><span class="src-doc-var">$motDePasse </span></div></li>
<li><div class="src-line"><a name="a194"></a><span class="src-doc"> *</span></div></li>
<li><div class="src-line"><a name="a195"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@return </span><span class="src-doc-type">void </span></div></li>
<li><div class="src-line"><a name="a196"></a><span class="src-doc"> */</span></div></li>
<li><div class="src-line"><a name="a197"></a> <span class="src-key">public </span><span class="src-key">function </span><a href="../Framework/Url.html#methodsetInfoUtilisateur">setInfoUtilisateur</a><span class="src-sym">(</span><span class="src-var">$infoUtilisateur</span><span class="src-sym">, </span><span class="src-var">$motDePasse </span>= <span class="src-id">false</span><span class="src-sym">) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a198"></a> <span class="src-var">$this</span><span class="src-sym">-></span><span class="src-var">infoUtilisateur </span>= <span class="src-var">$infoUtilisateur</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a199"></a> <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$motDePasse </span>!== <span class="src-id">false</span><span class="src-sym">) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a200"></a> <span class="src-var">$this</span><span class="src-sym">-></span><span class="src-var">infoUtilisateur </span>.= <span class="src-str">':' </span>. <span class="src-var">$motDePasse</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a201"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a202"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a203"></a> </div></li>
<li><div class="src-line"><a name="a204"></a> <span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a205"></a><span class="src-doc"> * Renvoie la partie hôte, ou false s'il n'y a pas de partie autorité, c.a.d.</span></div></li>
<li><div class="src-line"><a name="a206"></a><span class="src-doc"> * l'URL est relative.</span></div></li>
<li><div class="src-line"><a name="a207"></a><span class="src-doc"> *</span></div></li>
<li><div class="src-line"><a name="a208"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@return </span><span class="src-doc"> </span><span class="src-doc-type">string</span><span class="src-doc">|</span><span class="src-doc-type">bool</span></div></li>
<li><div class="src-line"><a name="a209"></a><span class="src-doc"> */</span></div></li>
<li><div class="src-line"><a name="a210"></a> <span class="src-key">public </span><span class="src-key">function </span><a href="../Framework/Url.html#methodgetHote">getHote</a><span class="src-sym">(</span><span class="src-sym">) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a211"></a> <span class="src-key">return </span><span class="src-var">$this</span><span class="src-sym">-></span><span class="src-var">hote</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a212"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a213"></a> </div></li>
<li><div class="src-line"><a name="a214"></a> <span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a215"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string</span><span class="src-doc">|</span><span class="src-doc-type">bool</span><span class="src-doc-var">$hote </span></div></li>
<li><div class="src-line"><a name="a216"></a><span class="src-doc"> *</span></div></li>
<li><div class="src-line"><a name="a217"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@return </span><span class="src-doc-type">void </span></div></li>
<li><div class="src-line"><a name="a218"></a><span class="src-doc"> */</span></div></li>
<li><div class="src-line"><a name="a219"></a> <span class="src-key">public </span><span class="src-key">function </span><a href="../Framework/Url.html#methodsetHote">setHote</a><span class="src-sym">(</span><span class="src-var">$hote</span><span class="src-sym">) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a220"></a> <span class="src-var">$this</span><span class="src-sym">-></span><span class="src-var">hote </span>= <span class="src-var">$hote</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a221"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a222"></a> </div></li>
<li><div class="src-line"><a name="a223"></a> <span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a224"></a><span class="src-doc"> * Renvoie le numéro de port, ou false si aucun numéro de port n'est spécifié,</span></div></li>
<li><div class="src-line"><a name="a225"></a><span class="src-doc"> * i.e. le port par défaut doit utilisé.</span></div></li>
<li><div class="src-line"><a name="a226"></a><span class="src-doc"> *</span></div></li>
<li><div class="src-line"><a name="a227"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@return </span><span class="src-doc"> </span><span class="src-doc-type">int</span><span class="src-doc">|</span><span class="src-doc-type">bool</span></div></li>
<li><div class="src-line"><a name="a228"></a><span class="src-doc"> */</span></div></li>
<li><div class="src-line"><a name="a229"></a> <span class="src-key">public </span><span class="src-key">function </span><a href="../Framework/Url.html#methodgetPort">getPort</a><span class="src-sym">(</span><span class="src-sym">) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a230"></a> <span class="src-key">return </span><span class="src-var">$this</span><span class="src-sym">-></span><span class="src-var">port</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a231"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a232"></a> </div></li>
<li><div class="src-line"><a name="a233"></a> <span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a234"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">int</span><span class="src-doc">|</span><span class="src-doc-type">bool</span><span class="src-doc-var">$port </span></div></li>
<li><div class="src-line"><a name="a235"></a><span class="src-doc"> *</span></div></li>
<li><div class="src-line"><a name="a236"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@return </span><span class="src-doc-type">void </span></div></li>
<li><div class="src-line"><a name="a237"></a><span class="src-doc"> */</span></div></li>
<li><div class="src-line"><a name="a238"></a> <span class="src-key">public </span><span class="src-key">function </span><a href="../Framework/Url.html#methodsetPort">setPort</a><span class="src-sym">(</span><span class="src-var">$port</span><span class="src-sym">) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a239"></a> <span class="src-var">$this</span><span class="src-sym">-></span><span class="src-var">port </span>= <a href="http://www.php.net/intval">intval</a><span class="src-sym">(</span><span class="src-var">$port</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a240"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a241"></a> </div></li>
<li><div class="src-line"><a name="a242"></a> <span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a243"></a><span class="src-doc"> * Renvoie la partie autorité, i.e. [ infoUtilisateur "@" ] hote [ ":" port ], ou</span></div></li>
<li><div class="src-line"><a name="a244"></a><span class="src-doc"> * false si celle-ci est absente.</span></div></li>
<li><div class="src-line"><a name="a245"></a><span class="src-doc"> *</span></div></li>
<li><div class="src-line"><a name="a246"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@return </span><span class="src-doc-type">string</span><span class="src-doc">|</span><span class="src-doc-type">bool</span></div></li>
<li><div class="src-line"><a name="a247"></a><span class="src-doc"> */</span></div></li>
<li><div class="src-line"><a name="a248"></a> <span class="src-key">public </span><span class="src-key">function </span><a href="../Framework/Url.html#methodgetAutorite">getAutorite</a><span class="src-sym">(</span><span class="src-sym">) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a249"></a> <span class="src-key">if </span><span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$this</span><span class="src-sym">-></span><span class="src-var">hote</span><span class="src-sym">) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a250"></a> <span class="src-key">return </span><span class="src-id">false</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a251"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a252"></a> </div></li>
<li><div class="src-line"><a name="a253"></a> <span class="src-var">$autorite </span>= <span class="src-str">''</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a254"></a> </div></li>
<li><div class="src-line"><a name="a255"></a> <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-></span><span class="src-var">infoUtilisateur </span>!== <span class="src-id">false</span><span class="src-sym">) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a256"></a> <span class="src-var">$autorite </span>.= <span class="src-var">$this</span><span class="src-sym">-></span><span class="src-var">infoUtilisateur </span>. <span class="src-str">'@'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a257"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a258"></a> </div></li>
<li><div class="src-line"><a name="a259"></a> <span class="src-var">$autorite </span>.= <span class="src-var">$this</span><span class="src-sym">-></span><span class="src-var">hote</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a260"></a> </div></li>
<li><div class="src-line"><a name="a261"></a> <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-></span><span class="src-var">port </span>!== <span class="src-id">false</span><span class="src-sym">) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a262"></a> <span class="src-var">$autorite </span>.= <span class="src-str">':' </span>. <span class="src-var">$this</span><span class="src-sym">-></span><span class="src-var">port</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a263"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a264"></a> </div></li>
<li><div class="src-line"><a name="a265"></a> <span class="src-key">return </span><span class="src-var">$autorite</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a266"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a267"></a> </div></li>
<li><div class="src-line"><a name="a268"></a> <span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a269"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string</span><span class="src-doc">|</span><span class="src-doc-type">false</span><span class="src-doc-var">$autorite </span></div></li>
<li><div class="src-line"><a name="a270"></a><span class="src-doc"> *</span></div></li>
<li><div class="src-line"><a name="a271"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@return </span><span class="src-doc-type">void </span></div></li>
<li><div class="src-line"><a name="a272"></a><span class="src-doc"> */</span></div></li>
<li><div class="src-line"><a name="a273"></a> <span class="src-key">public </span><span class="src-key">function </span><a href="../Framework/Url.html#methodsetAutorite">setAutorite</a><span class="src-sym">(</span><span class="src-var">$autorite</span><span class="src-sym">) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a274"></a> <span class="src-var">$this</span><span class="src-sym">-></span><span class="src-var">user </span>= <span class="src-id">false</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a275"></a> <span class="src-var">$this</span><span class="src-sym">-></span><span class="src-var">pass </span>= <span class="src-id">false</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a276"></a> <span class="src-var">$this</span><span class="src-sym">-></span><span class="src-var">hote </span>= <span class="src-id">false</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a277"></a> <span class="src-var">$this</span><span class="src-sym">-></span><span class="src-var">port </span>= <span class="src-id">false</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a278"></a> <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/preg_match">preg_match</a><span class="src-sym">(</span><span class="src-str">'@^(([^\@]+)\@)?([^:]+)(:(\d*))?$@'</span><span class="src-sym">, </span><span class="src-var">$autorite</span><span class="src-sym">, </span><span class="src-var">$reg</span><span class="src-sym">)) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a279"></a> <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$reg</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]</span><span class="src-sym">) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a280"></a> <span class="src-var">$this</span><span class="src-sym">-></span><span class="src-var">infoUtilisateur </span>= <span class="src-var">$reg</span><span class="src-sym">[</span><span class="src-num">2</span><span class="src-sym">]</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a281"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a282"></a> </div></li>
<li><div class="src-line"><a name="a283"></a> <span class="src-var">$this</span><span class="src-sym">-></span><span class="src-var">hote </span>= <span class="src-var">$reg</span><span class="src-sym">[</span><span class="src-num">3</span><span class="src-sym">]</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a284"></a> <span class="src-key">if </span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$reg</span><span class="src-sym">[</span><span class="src-num">5</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a285"></a> <span class="src-var">$this</span><span class="src-sym">-></span><span class="src-var">port </span>= <a href="http://www.php.net/intval">intval</a><span class="src-sym">(</span><span class="src-var">$reg</span><span class="src-sym">[</span><span class="src-num">5</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a286"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a287"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a288"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a289"></a> </div></li>
<li><div class="src-line"><a name="a290"></a> <span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a291"></a><span class="src-doc"> * Renvoie la partie chemin (chemin) (éventuellement vide).</span></div></li>
<li><div class="src-line"><a name="a292"></a><span class="src-doc"> *</span></div></li>
<li><div class="src-line"><a name="a293"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@return </span><span class="src-doc-type">string </span></div></li>
<li><div class="src-line"><a name="a294"></a><span class="src-doc"> */</span></div></li>
<li><div class="src-line"><a name="a295"></a> <span class="src-key">public </span><span class="src-key">function </span><a href="../Framework/Url.html#methodgetChemin">getChemin</a><span class="src-sym">(</span><span class="src-sym">) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a296"></a> <span class="src-key">return </span><span class="src-var">$this</span><span class="src-sym">-></span><span class="src-var">chemin</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a297"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a298"></a> </div></li>
<li><div class="src-line"><a name="a299"></a> <span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a300"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$chemin </span></div></li>
<li><div class="src-line"><a name="a301"></a><span class="src-doc"> *</span></div></li>
<li><div class="src-line"><a name="a302"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@return </span><span class="src-doc-type">void </span></div></li>
<li><div class="src-line"><a name="a303"></a><span class="src-doc"> */</span></div></li>
<li><div class="src-line"><a name="a304"></a> <span class="src-key">public </span><span class="src-key">function </span><a href="../Framework/Url.html#methodsetChemin">setChemin</a><span class="src-sym">(</span><span class="src-var">$chemin</span><span class="src-sym">) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a305"></a> <span class="src-var">$this</span><span class="src-sym">-></span><span class="src-var">chemin </span>= <span class="src-var">$chemin</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a306"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a307"></a> </div></li>
<li><div class="src-line"><a name="a308"></a> <span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a309"></a><span class="src-doc"> * renvoie la chaine de requête (requete string) (sans le premier "?"), ou false si "?"</span></div></li>
<li><div class="src-line"><a name="a310"></a><span class="src-doc"> * n'est pas présent dans l'url.</span></div></li>
<li><div class="src-line"><a name="a311"></a><span class="src-doc"> *</span></div></li>
<li><div class="src-line"><a name="a312"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@return </span><span class="src-doc"> </span><span class="src-doc-type">string</span><span class="src-doc">|</span><span class="src-doc-type">bool</span></div></li>
<li><div class="src-line"><a name="a313"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@see</span><span class="src-doc"> self::getVariablesRequete()</span></div></li>
<li><div class="src-line"><a name="a314"></a><span class="src-doc"> */</span></div></li>
<li><div class="src-line"><a name="a315"></a> <span class="src-key">public </span><span class="src-key">function </span><a href="../Framework/Url.html#methodgetRequete">getRequete</a><span class="src-sym">(</span><span class="src-sym">) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a316"></a> <span class="src-key">return </span><span class="src-var">$this</span><span class="src-sym">-></span><span class="src-var">requete</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a317"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a318"></a> </div></li>
<li><div class="src-line"><a name="a319"></a> <span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a320"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string</span><span class="src-doc">|</span><span class="src-doc-type">bool</span><span class="src-doc-var">$requete </span></div></li>
<li><div class="src-line"><a name="a321"></a><span class="src-doc"> *</span></div></li>
<li><div class="src-line"><a name="a322"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@return </span><span class="src-doc-type">void </span></div></li>
<li><div class="src-line"><a name="a323"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@see</span><span class="src-doc"> self::setVariablesRequete()</span></div></li>
<li><div class="src-line"><a name="a324"></a><span class="src-doc"> */</span></div></li>
<li><div class="src-line"><a name="a325"></a> <span class="src-key">public </span><span class="src-key">function </span><a href="../Framework/Url.html#methodsetRequete">setRequete</a><span class="src-sym">(</span><span class="src-var">$requete</span><span class="src-sym">) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a326"></a> <span class="src-var">$this</span><span class="src-sym">-></span><span class="src-var">requete </span>= <span class="src-var">$requete</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a327"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a328"></a> </div></li>
<li><div class="src-line"><a name="a329"></a> <span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a330"></a><span class="src-doc"> * Renvoie le nom du fragment, ou false si "#" n'est pas present dans l'URL.</span></div></li>
<li><div class="src-line"><a name="a331"></a><span class="src-doc"> *</span></div></li>
<li><div class="src-line"><a name="a332"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@return </span><span class="src-doc"> </span><span class="src-doc-type">string</span><span class="src-doc">|</span><span class="src-doc-type">bool</span></div></li>
<li><div class="src-line"><a name="a333"></a><span class="src-doc"> */</span></div></li>
<li><div class="src-line"><a name="a334"></a> <span class="src-key">public </span><span class="src-key">function </span><a href="../Framework/Url.html#methodgetFragment">getFragment</a><span class="src-sym">(</span><span class="src-sym">) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a335"></a> <span class="src-key">return </span><span class="src-var">$this</span><span class="src-sym">-></span><span class="src-var">fragment</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a336"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a337"></a> </div></li>
<li><div class="src-line"><a name="a338"></a> <span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a339"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string</span><span class="src-doc">|</span><span class="src-doc-type">bool</span><span class="src-doc-var">$fragment </span></div></li>
<li><div class="src-line"><a name="a340"></a><span class="src-doc"> *</span></div></li>
<li><div class="src-line"><a name="a341"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@return </span><span class="src-doc-type">void </span></div></li>
<li><div class="src-line"><a name="a342"></a><span class="src-doc"> */</span></div></li>
<li><div class="src-line"><a name="a343"></a> <span class="src-key">public </span><span class="src-key">function </span><a href="../Framework/Url.html#methodsetFragment">setFragment</a><span class="src-sym">(</span><span class="src-var">$fragment</span><span class="src-sym">) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a344"></a> <span class="src-var">$this</span><span class="src-sym">-></span><span class="src-var">fragment </span>= <span class="src-var">$fragment</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a345"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a346"></a> </div></li>
<li><div class="src-line"><a name="a347"></a> <span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a348"></a><span class="src-doc"> * Renvoie la requete string sous forme d'un tableau de variables telles qu'elles apparaitraient</span></div></li>
<li><div class="src-line"><a name="a349"></a><span class="src-doc"> * dans le $_GET d'un script PHP</span></div></li>
<li><div class="src-line"><a name="a350"></a><span class="src-doc"> *</span></div></li>
<li><div class="src-line"><a name="a351"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@return </span><span class="src-doc"> </span><span class="src-doc-type">array </span></div></li>
<li><div class="src-line"><a name="a352"></a><span class="src-doc"> */</span></div></li>
<li><div class="src-line"><a name="a353"></a> <span class="src-key">public </span><span class="src-key">function </span><a href="../Framework/Url.html#methodgetVariablesRequete">getVariablesRequete</a><span class="src-sym">(</span><span class="src-sym">) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a354"></a> <span class="src-var">$pattern </span>= <span class="src-str">'/' </span>.</div></li>
<li><div class="src-line"><a name="a355"></a> <a href="http://www.php.net/preg_quote">preg_quote</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-></span><a href="../Framework/Url.html#methodgetOption">getOption</a><span class="src-sym">(</span><span class="src-id">self</span><span class="src-sym">::</span><span class="src-id">OPTION_SEPARATEUR_ENTREE</span><span class="src-sym">)</span><span class="src-sym">, </span><span class="src-str">'/'</span><span class="src-sym">) </span>.</div></li>
<li><div class="src-line"><a name="a356"></a> <span class="src-str">'/'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a357"></a> <span class="src-var">$parties </span>= <a href="http://www.php.net/preg_split">preg_split</a><span class="src-sym">(</span><span class="src-var">$pattern</span><span class="src-sym">, </span><span class="src-var">$this</span><span class="src-sym">-></span><span class="src-var">requete</span><span class="src-sym">, </span>-<span class="src-num">1</span><span class="src-sym">, </span><span class="src-id">PREG_SPLIT_NO_EMPTY</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a358"></a> <span class="src-var">$retour </span>= <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a359"></a> </div></li>
<li><div class="src-line"><a name="a360"></a> <span class="src-key">foreach </span><span class="src-sym">(</span><span class="src-var">$parties </span><span class="src-key">as </span><span class="src-var">$partie</span><span class="src-sym">) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a361"></a> <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$partie</span><span class="src-sym">, </span><span class="src-str">'='</span><span class="src-sym">) </span>!== <span class="src-id">false</span><span class="src-sym">) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a362"></a> list<span class="src-sym">(</span><span class="src-var">$cle</span><span class="src-sym">, </span><span class="src-var">$valeur</span><span class="src-sym">) </span>= <a href="http://www.php.net/explode">explode</a><span class="src-sym">(</span><span class="src-str">'='</span><span class="src-sym">, </span><span class="src-var">$partie</span><span class="src-sym">, </span><span class="src-num">2</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a363"></a> <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a364"></a> <span class="src-var">$cle </span>= <span class="src-var">$partie</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a365"></a> <span class="src-var">$valeur </span>= <span class="src-id">null</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a366"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a367"></a> </div></li>
<li><div class="src-line"><a name="a368"></a> <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-></span><a href="../Framework/Url.html#methodgetOption">getOption</a><span class="src-sym">(</span><span class="src-id">self</span><span class="src-sym">::</span><span class="src-id">OPTION_ENCODER_CLES</span><span class="src-sym">)) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a369"></a> <span class="src-var">$cle </span>= <a href="http://www.php.net/rawurldecode">rawurldecode</a><span class="src-sym">(</span><span class="src-var">$cle</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a370"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a371"></a> <span class="src-var">$valeur </span>= <a href="http://www.php.net/rawurldecode">rawurldecode</a><span class="src-sym">(</span><span class="src-var">$valeur</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a372"></a> </div></li>
<li><div class="src-line"><a name="a373"></a> <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-></span><a href="../Framework/Url.html#methodgetOption">getOption</a><span class="src-sym">(</span><span class="src-id">self</span><span class="src-sym">::</span><span class="src-id">OPTION_UTILISER_CROCHETS</span><span class="src-sym">) </span>&&</div></li>
<li><div class="src-line"><a name="a374"></a> <a href="http://www.php.net/preg_match">preg_match</a><span class="src-sym">(</span><span class="src-str">'#^(.*)\[([0-9a-z_-]*)\]#i'</span><span class="src-sym">, </span><span class="src-var">$cle</span><span class="src-sym">, </span><span class="src-var">$matches</span><span class="src-sym">)) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a375"></a> </div></li>
<li><div class="src-line"><a name="a376"></a> <span class="src-var">$cle </span>= <span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a377"></a> <span class="src-var">$idx </span>= <span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-num">2</span><span class="src-sym">]</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a378"></a> </div></li>
<li><div class="src-line"><a name="a379"></a> <span class="src-comm">// On s'assure que c'est bien un tableau</span></div></li>
<li><div class="src-line"><a name="a380"></a> <span class="src-key">if </span><span class="src-sym">(</span><span class="src-key">empty</span><span class="src-sym">(</span><span class="src-var">$retour</span><span class="src-sym">[</span><span class="src-var">$cle</span><span class="src-sym">]</span><span class="src-sym">) </span>|| <span class="src-sym">!</span><a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(</span><span class="src-var">$retour</span><span class="src-sym">[</span><span class="src-var">$cle</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a381"></a> <span class="src-var">$retour</span><span class="src-sym">[</span><span class="src-var">$cle</span><span class="src-sym">] </span>= <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a382"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a383"></a> </div></li>
<li><div class="src-line"><a name="a384"></a> <span class="src-comm">// Ajout des données</span></div></li>
<li><div class="src-line"><a name="a385"></a> <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$idx </span>=== <span class="src-str">''</span><span class="src-sym">) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a386"></a> <span class="src-var">$retour</span><span class="src-sym">[</span><span class="src-var">$cle</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-sym">] </span>= <span class="src-var">$valeur</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a387"></a> <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a388"></a> <span class="src-var">$retour</span><span class="src-sym">[</span><span class="src-var">$cle</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$idx</span><span class="src-sym">] </span>= <span class="src-var">$valeur</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a389"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a390"></a> <span class="src-sym">} </span><span class="src-key">elseif </span><span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$this</span><span class="src-sym">-></span><a href="../Framework/Url.html#methodgetOption">getOption</a><span class="src-sym">(</span><span class="src-id">self</span><span class="src-sym">::</span><span class="src-id">OPTION_UTILISER_CROCHETS</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a391"></a> && <span class="src-sym">!</span><span class="src-key">empty</span><span class="src-sym">(</span><span class="src-var">$retour</span><span class="src-sym">[</span><span class="src-var">$cle</span><span class="src-sym">]</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a392"></a> <span class="src-sym">) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a393"></a> <span class="src-var">$retour</span><span class="src-sym">[</span><span class="src-var">$cle</span><span class="src-sym">] </span>= (array) <span class="src-var">$retour</span><span class="src-sym">[</span><span class="src-var">$cle</span><span class="src-sym">]</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a394"></a> <span class="src-var">$retour</span><span class="src-sym">[</span><span class="src-var">$cle</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-sym">] </span>= <span class="src-var">$valeur</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a395"></a> <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a396"></a> <span class="src-var">$retour</span><span class="src-sym">[</span><span class="src-var">$cle</span><span class="src-sym">] </span>= <span class="src-var">$valeur</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a397"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a398"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a399"></a> </div></li>
<li><div class="src-line"><a name="a400"></a> <span class="src-key">return </span><span class="src-var">$retour</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a401"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a402"></a> </div></li>
<li><div class="src-line"><a name="a403"></a> <span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a404"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">array </span><span class="src-doc-var">$tableau </span><span class="src-doc">(nom => valeur) tableau</span></div></li>
<li><div class="src-line"><a name="a405"></a><span class="src-doc"> *</span></div></li>
<li><div class="src-line"><a name="a406"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@return </span><span class="src-doc-type">void </span></div></li>
<li><div class="src-line"><a name="a407"></a><span class="src-doc"> */</span></div></li>
<li><div class="src-line"><a name="a408"></a> <span class="src-key">public </span><span class="src-key">function </span><a href="../Framework/Url.html#methodsetVariablesRequete">setVariablesRequete</a><span class="src-sym">(</span><span class="src-key">array </span><span class="src-var">$tableau</span><span class="src-sym">) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a409"></a> <span class="src-key">if </span><span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$tableau</span><span class="src-sym">) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a410"></a> <span class="src-var">$this</span><span class="src-sym">-></span><span class="src-var">requete </span>= <span class="src-id">false</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a411"></a> <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a412"></a> <span class="src-key">foreach </span><span class="src-sym">(</span><span class="src-var">$tableau </span><span class="src-key">as </span><span class="src-var">$nom </span>=> <span class="src-var">$valeur</span><span class="src-sym">) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a413"></a> <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-></span><span class="src-id">getOption</span><span class="src-sym">(</span><span class="src-id">self</span><span class="src-sym">::</span><span class="src-id">OPTION_ENCODER_CLES</span><span class="src-sym">)) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a414"></a> <span class="src-var">$nom </span>= <span class="src-id">rawurlencode</span><span class="src-sym">(</span><span class="src-var">$nom</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a415"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a416"></a> </div></li>
<li><div class="src-line"><a name="a417"></a> <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(</span><span class="src-var">$valeur</span><span class="src-sym">)) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a418"></a> <span class="src-key">foreach </span><span class="src-sym">(</span><span class="src-var">$valeur </span><span class="src-key">as </span><span class="src-var">$k </span>=> <span class="src-var">$v</span><span class="src-sym">) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a419"></a> <span class="src-var">$parties</span><span class="src-sym">[</span><span class="src-sym">] </span>= <span class="src-var">$this</span><span class="src-sym">-></span><a href="../Framework/Url.html#methodgetOption">getOption</a><span class="src-sym">(</span><span class="src-id">self</span><span class="src-sym">::</span><span class="src-id">OPTION_UTILISER_CROCHETS</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a420"></a> ? <a href="http://www.php.net/sprintf">sprintf</a><span class="src-sym">(</span><span class="src-str">'%s[%s]=%s'</span><span class="src-sym">, </span><span class="src-var">$nom</span><span class="src-sym">, </span><span class="src-var">$k</span><span class="src-sym">, </span><span class="src-var">$v</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a421"></a> : <span class="src-sym">(</span><span class="src-var">$nom </span>. <span class="src-str">'=' </span>. <span class="src-var">$v</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a422"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a423"></a> <span class="src-sym">} </span><span class="src-key">elseif </span><span class="src-sym">(</span><span class="src-sym">!</span><a href="http://www.php.net/is_null">is_null</a><span class="src-sym">(</span><span class="src-var">$valeur</span><span class="src-sym">)) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a424"></a> <span class="src-var">$parties</span><span class="src-sym">[</span><span class="src-sym">] </span>= <span class="src-var">$nom </span>. <span class="src-str">'=' </span>. <span class="src-var">$valeur</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a425"></a> <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a426"></a> <span class="src-var">$parties</span><span class="src-sym">[</span><span class="src-sym">] </span>= <span class="src-var">$nom</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a427"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a428"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a429"></a> <span class="src-var">$this</span><span class="src-sym">-></span><span class="src-id">requete </span>= <a href="http://www.php.net/implode">implode</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-></span><a href="../Framework/Url.html#methodgetOption">getOption</a><span class="src-sym">(</span><span class="src-id">self</span><span class="src-sym">::</span><span class="src-id">OPTION_SEPARATEUR_SORTIE</span><span class="src-sym">)</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"><a name="a430"></a> <span class="src-var">$parties</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a431"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a432"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a433"></a> </div></li>
<li><div class="src-line"><a name="a434"></a> <span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a435"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$nom </span></div></li>
<li><div class="src-line"><a name="a436"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">mixed </span><span class="src-doc"> </span><span class="src-doc-var">$valeur </span></div></li>
<li><div class="src-line"><a name="a437"></a><span class="src-doc"> *</span></div></li>
<li><div class="src-line"><a name="a438"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@return </span><span class="src-doc"> </span><span class="src-doc-type">array </span></div></li>
<li><div class="src-line"><a name="a439"></a><span class="src-doc"> */</span></div></li>
<li><div class="src-line"><a name="a440"></a> <span class="src-key">public </span><span class="src-key">function </span><a href="../Framework/Url.html#methodsetVariableRequete">setVariableRequete</a><span class="src-sym">(</span><span class="src-var">$nom</span><span class="src-sym">, </span><span class="src-var">$valeur</span><span class="src-sym">) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a441"></a> <span class="src-var">$tableau </span>= <span class="src-var">$this</span><span class="src-sym">-></span><a href="../Framework/Url.html#methodgetVariablesRequete">getVariablesRequete</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a442"></a> <span class="src-var">$tableau</span><span class="src-sym">[</span><span class="src-var">$nom</span><span class="src-sym">] </span>= <span class="src-var">$valeur</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a443"></a> <span class="src-var">$this</span><span class="src-sym">-></span><a href="../Framework/Url.html#methodsetVariablesRequete">setVariablesRequete</a><span class="src-sym">(</span><span class="src-var">$tableau</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a444"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a445"></a> </div></li>
<li><div class="src-line"><a name="a446"></a> <span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a447"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$nom </span></div></li>
<li><div class="src-line"><a name="a448"></a><span class="src-doc"> *</span></div></li>
<li><div class="src-line"><a name="a449"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@return </span><span class="src-doc-type">void </span></div></li>
<li><div class="src-line"><a name="a450"></a><span class="src-doc"> */</span></div></li>
<li><div class="src-line"><a name="a451"></a> <span class="src-key">public </span><span class="src-key">function </span><a href="../Framework/Url.html#methodunsetVariableRequete">unsetVariableRequete</a><span class="src-sym">(</span><span class="src-var">$nom</span><span class="src-sym">) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a452"></a> <span class="src-var">$tableau </span>= <span class="src-var">$this</span><span class="src-sym">-></span><a href="../Framework/Url.html#methodgetVariablesRequete">getVariablesRequete</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a453"></a> unset<span class="src-sym">(</span><span class="src-var">$tableau</span><span class="src-sym">[</span><span class="src-var">$nom</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a454"></a> <span class="src-var">$this</span><span class="src-sym">-></span><a href="../Framework/Url.html#methodsetVariablesRequete">setVariablesRequete</a><span class="src-sym">(</span><span class="src-var">$tableau</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a455"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a456"></a> </div></li>
<li><div class="src-line"><a name="a457"></a> <span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a458"></a><span class="src-doc"> * Renvoie un représentation sous forme de chaine de l'URL</span></div></li>
<li><div class="src-line"><a name="a459"></a><span class="src-doc"> *</span></div></li>
<li><div class="src-line"><a name="a460"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@return </span><span class="src-doc"> </span><span class="src-doc-type">string </span></div></li>
<li><div class="src-line"><a name="a461"></a><span class="src-doc"> */</span></div></li>
<li><div class="src-line"><a name="a462"></a> <span class="src-key">public </span><span class="src-key">function </span><a href="../Framework/Url.html#methodgetURL">getURL</a><span class="src-sym">(</span><span class="src-sym">) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a463"></a> <span class="src-comm">// Voir RFC 3986, section 5.3</span></div></li>
<li><div class="src-line"><a name="a464"></a> <span class="src-var">$url </span>= <span class="src-str">""</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a465"></a> </div></li>
<li><div class="src-line"><a name="a466"></a> <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-></span><span class="src-id">schema </span>!== <span class="src-id">false</span><span class="src-sym">) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a467"></a> <span class="src-var">$url </span>.= <span class="src-var">$this</span><span class="src-sym">-></span><span class="src-id">schema </span>. <span class="src-str">':'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a468"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a469"></a> </div></li>
<li><div class="src-line"><a name="a470"></a> <span class="src-var">$autorite </span>= <span class="src-var">$this</span><span class="src-sym">-></span><a href="../Framework/Url.html#methodgetAutorite">getAutorite</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a471"></a> <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$autorite </span>!== <span class="src-id">false</span><span class="src-sym">) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a472"></a> <span class="src-var">$url </span>.= <span class="src-str">'//' </span>. <span class="src-var">$autorite</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a473"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a474"></a> <span class="src-var">$url </span>.= <span class="src-var">$this</span><span class="src-sym">-></span><span class="src-id">chemin</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a475"></a> </div></li>
<li><div class="src-line"><a name="a476"></a> <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-></span><span class="src-id">requete </span>!== <span class="src-id">false</span><span class="src-sym">) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a477"></a> <span class="src-var">$url </span>.= <span class="src-str">'?' </span>. <span class="src-var">$this</span><span class="src-sym">-></span><span class="src-id">requete</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a478"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a479"></a> </div></li>
<li><div class="src-line"><a name="a480"></a> <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-></span><span class="src-id">fragment </span>!== <span class="src-id">false</span><span class="src-sym">) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a481"></a> <span class="src-var">$url </span>.= <span class="src-str">'#' </span>. <span class="src-var">$this</span><span class="src-sym">-></span><span class="src-id">fragment</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a482"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a483"></a> </div></li>
<li><div class="src-line"><a name="a484"></a> <span class="src-key">return </span><span class="src-var">$url</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a485"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a486"></a> </div></li>
<li><div class="src-line"><a name="a487"></a> <span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a488"></a><span class="src-doc"> * Renvoie une représentation de cette URL sous forme de chaine normalisée. Utile pour la</span></div></li>
<li><div class="src-line"><a name="a489"></a><span class="src-doc"> * comparaison d'URLs</span></div></li>
<li><div class="src-line"><a name="a490"></a><span class="src-doc"> *</span></div></li>
<li><div class="src-line"><a name="a491"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@return </span><span class="src-doc"> </span><span class="src-doc-type">string </span></div></li>
<li><div class="src-line"><a name="a492"></a><span class="src-doc"> */</span></div></li>
<li><div class="src-line"><a name="a493"></a> <span class="src-key">public </span><span class="src-key">function </span><a href="../Framework/Url.html#methodgetURLNormalisee">getURLNormalisee</a><span class="src-sym">(</span><span class="src-sym">) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a494"></a> <span class="src-var">$url </span>= <span class="src-key">clone </span><span class="src-var">$this</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a495"></a> <span class="src-var">$url</span><span class="src-sym">-></span><a href="../Framework/Url.html#methodnormaliser">normaliser</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a496"></a> <span class="src-key">return </span><span class="src-var">$url</span><span class="src-sym">-></span><span class="src-id">getUrl</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a497"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a498"></a> </div></li>
<li><div class="src-line"><a name="a499"></a> <span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a500"></a><span class="src-doc"> * Renvoie une instance normalisée de Url</span></div></li>
<li><div class="src-line"><a name="a501"></a><span class="src-doc"> *</span></div></li>
<li><div class="src-line"><a name="a502"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@return </span><span class="src-doc"> </span><span class="src-doc-type">Url </span></div></li>
<li><div class="src-line"><a name="a503"></a><span class="src-doc"> */</span></div></li>
<li><div class="src-line"><a name="a504"></a> <span class="src-key">public </span><span class="src-key">function </span><a href="../Framework/Url.html#methodnormaliser">normaliser</a><span class="src-sym">(</span><span class="src-sym">) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a505"></a> <span class="src-comm">// See RFC 3886, section 6</span></div></li>
<li><div class="src-line"><a name="a506"></a> </div></li>
<li><div class="src-line"><a name="a507"></a> <span class="src-comm">// les cchémas sont insesibles à la casse</span></div></li>
<li><div class="src-line"><a name="a508"></a> <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-></span><span class="src-id">schema</span><span class="src-sym">) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a509"></a> <span class="src-var">$this</span><span class="src-sym">-></span><span class="src-id">schema </span>= <a href="http://www.php.net/strtolower">strtolower</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-></span><span class="src-id">schema</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a510"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a511"></a> </div></li>
<li><div class="src-line"><a name="a512"></a> <span class="src-comm">// les noms d'hotes sont insensibles à la casse</span></div></li>
<li><div class="src-line"><a name="a513"></a> <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-></span><span class="src-id">hote</span><span class="src-sym">) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a514"></a> <span class="src-var">$this</span><span class="src-sym">-></span><span class="src-id">hote </span>= <a href="http://www.php.net/strtolower">strtolower</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-></span><span class="src-id">hote</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a515"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a516"></a> </div></li>
<li><div class="src-line"><a name="a517"></a> <span class="src-comm">// Supprimer le numéro de port par défaut pour les schemas connus (RFC 3986, section 6.2.3)</span></div></li>
<li><div class="src-line"><a name="a518"></a> <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-></span><span class="src-id">port </span>&&</div></li>
<li><div class="src-line"><a name="a519"></a> <span class="src-var">$this</span><span class="src-sym">-></span><span class="src-id">schema </span>&&</div></li>
<li><div class="src-line"><a name="a520"></a> <span class="src-var">$this</span><span class="src-sym">-></span><span class="src-id">port </span>== <a href="http://www.php.net/getservbyname">getservbyname</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-></span><span class="src-id">schema</span><span class="src-sym">, </span><span class="src-str">'tcp'</span><span class="src-sym">)) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a521"></a> </div></li>
<li><div class="src-line"><a name="a522"></a> <span class="src-var">$this</span><span class="src-sym">-></span><span class="src-id">port </span>= <span class="src-id">false</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a523"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a524"></a> </div></li>
<li><div class="src-line"><a name="a525"></a> <span class="src-comm">// normalisation dans le cas d'un encodage avec %XX pourcentage (RFC 3986, section 6.2.2.1)</span></div></li>
<li><div class="src-line"><a name="a526"></a> <span class="src-key">foreach </span><span class="src-sym">(</span><span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'infoUtilisateur'</span><span class="src-sym">, </span><span class="src-str">'hote'</span><span class="src-sym">, </span><span class="src-str">'chemin'</span><span class="src-sym">) </span><span class="src-key">as </span><span class="src-var">$partie</span><span class="src-sym">) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a527"></a> <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-></span><span class="src-var">$partie</span><span class="src-sym">) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a528"></a> <span class="src-var">$this</span><span class="src-sym">-></span><span class="src-var">$partie </span>= <a href="http://www.php.net/preg_replace">preg_replace</a><span class="src-sym">(</span><span class="src-str">'/%[0-9a-f]{2}/ie'</span><span class="src-sym">, </span><span class="src-str">'strtoupper("\0")'</span><span class="src-sym">, </span><span class="src-var">$this</span><span class="src-sym">-></span><span class="src-var">$partie</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a529"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a530"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a531"></a> </div></li>
<li><div class="src-line"><a name="a532"></a> <span class="src-comm">// normalisation des segments du chemin (RFC 3986, section 6.2.2.3)</span></div></li>
<li><div class="src-line"><a name="a533"></a> <span class="src-var">$this</span><span class="src-sym">-></span><span class="src-id">chemin </span>= <span class="src-id">self</span><span class="src-sym">::</span><span class="src-id">supprimerSegmentsAPoints</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-></span><span class="src-id">chemin</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a534"></a> </div></li>
<li><div class="src-line"><a name="a535"></a> <span class="src-comm">// normalisation basée sur le schéma (RFC 3986, section 6.2.3)</span></div></li>
<li><div class="src-line"><a name="a536"></a> <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-></span><span class="src-id">hote </span>&& <span class="src-sym">!</span><span class="src-var">$this</span><span class="src-sym">-></span><span class="src-id">chemin</span><span class="src-sym">) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a537"></a> <span class="src-var">$this</span><span class="src-sym">-></span><span class="src-id">chemin </span>= <span class="src-str">'/'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a538"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a539"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a540"></a> </div></li>
<li><div class="src-line"><a name="a541"></a> <span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a542"></a><span class="src-doc"> * Renvoie vrai ou faux suivant que l'instance en cours représente une URL relative ou absolue.</span></div></li>
<li><div class="src-line"><a name="a543"></a><span class="src-doc"> *</span></div></li>
<li><div class="src-line"><a name="a544"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@return </span><span class="src-doc"> </span><span class="src-doc-type">bool </span></div></li>
<li><div class="src-line"><a name="a545"></a><span class="src-doc"> */</span></div></li>
<li><div class="src-line"><a name="a546"></a> <span class="src-key">public </span><span class="src-key">function </span><a href="../Framework/Url.html#methodetreAbsolue">etreAbsolue</a><span class="src-sym">(</span><span class="src-sym">) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a547"></a> <span class="src-key">return </span>(bool) <span class="src-var">$this</span><span class="src-sym">-></span><span class="src-id">schema</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a548"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a549"></a> </div></li>
<li><div class="src-line"><a name="a550"></a> <span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a551"></a><span class="src-doc"> * Renvoie une instance de Url représentant une URL absolue relative à</span></div></li>
<li><div class="src-line"><a name="a552"></a><span class="src-doc"> * cette URL.</span></div></li>
<li><div class="src-line"><a name="a553"></a><span class="src-doc"> *</span></div></li>
<li><div class="src-line"><a name="a554"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">Url</span><span class="src-doc">|</span><span class="src-doc-type">string</span><span class="src-doc-var">$reference </span><span class="src-doc">URL relative</span></div></li>
<li><div class="src-line"><a name="a555"></a><span class="src-doc"> *</span></div></li>
<li><div class="src-line"><a name="a556"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@return </span><span class="src-doc-type">Url </span></div></li>
<li><div class="src-line"><a name="a557"></a><span class="src-doc"> */</span></div></li>
<li><div class="src-line"><a name="a558"></a> <span class="src-key">public </span><span class="src-key">function </span><a href="../Framework/Url.html#methodresoudre">resoudre</a><span class="src-sym">(</span><span class="src-var">$reference</span><span class="src-sym">) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a559"></a> <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/is_string">is_string</a><span class="src-sym">(</span><span class="src-var">$reference</span><span class="src-sym">)) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a560"></a> <span class="src-var">$reference </span>= <span class="src-key">new </span><span class="src-id">self</span><span class="src-sym">(</span><span class="src-var">$reference</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a561"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a562"></a> <span class="src-key">if </span><span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$this</span><span class="src-sym">-></span><a href="../Framework/Url.html#methodetreAbsolue">etreAbsolue</a><span class="src-sym">(</span><span class="src-sym">)) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a563"></a> throw <span class="src-key">new </span><span class="src-id">Exception</span><span class="src-sym">(</span><span class="src-str">'L\'URL de base doit être absolue !'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a564"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a565"></a> </div></li>
<li><div class="src-line"><a name="a566"></a> <span class="src-comm">// Un parseur non strict peut choisir d'ignorer un schema dans la référence</span></div></li>
<li><div class="src-line"><a name="a567"></a> <span class="src-comm">// si celui ci est identique au schéma de base de l'URI.</span></div></li>
<li><div class="src-line"><a name="a568"></a> <span class="src-key">if </span><span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$this</span><span class="src-sym">-></span><a href="../Framework/Url.html#methodgetOption">getOption</a><span class="src-sym">(</span><span class="src-id">self</span><span class="src-sym">::</span><span class="src-id">OPTION_STRICTE</span><span class="src-sym">) </span>&& <span class="src-var">$reference</span><span class="src-sym">-></span><span class="src-id">schema </span>== <span class="src-var">$this</span><span class="src-sym">-></span><span class="src-id">schema</span><span class="src-sym">) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a569"></a> <span class="src-var">$reference</span><span class="src-sym">-></span><span class="src-id">schema </span>= <span class="src-id">false</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a570"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a571"></a> </div></li>
<li><div class="src-line"><a name="a572"></a> <span class="src-var">$cible </span>= <span class="src-key">new </span><span class="src-id">self</span><span class="src-sym">(</span><span class="src-str">''</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a573"></a> <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$reference</span><span class="src-sym">-></span><span class="src-id">schema </span>!== <span class="src-id">false</span><span class="src-sym">) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a574"></a> <span class="src-var">$cible</span><span class="src-sym">-></span><span class="src-id">schema </span>= <span class="src-var">$reference</span><span class="src-sym">-></span><span class="src-id">schema</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a575"></a> <span class="src-var">$cible</span><span class="src-sym">-></span><a href="../Framework/Url.html#methodsetAutorite">setAutorite</a><span class="src-sym">(</span><span class="src-var">$reference</span><span class="src-sym">-></span><a href="../Framework/Url.html#methodgetAutorite">getAutorite</a><span class="src-sym">(</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a576"></a> <span class="src-var">$cible</span><span class="src-sym">-></span><span class="src-id">chemin </span>= <span class="src-id">self</span><span class="src-sym">::</span><span class="src-id">supprimerSegmentsAPoints</span><span class="src-sym">(</span><span class="src-var">$reference</span><span class="src-sym">-></span><span class="src-id">chemin</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a577"></a> <span class="src-var">$cible</span><span class="src-sym">-></span><span class="src-id">requete </span>= <span class="src-var">$reference</span><span class="src-sym">-></span><span class="src-id">requete</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a578"></a> <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a579"></a> <span class="src-var">$autorite </span>= <span class="src-var">$reference</span><span class="src-sym">-></span><a href="../Framework/Url.html#methodgetAutorite">getAutorite</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a580"></a> <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$autorite </span>!== <span class="src-id">false</span><span class="src-sym">) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a581"></a> <span class="src-var">$cible</span><span class="src-sym">-></span><a href="../Framework/Url.html#methodsetAutorite">setAutorite</a><span class="src-sym">(</span><span class="src-var">$autorite</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a582"></a> <span class="src-var">$cible</span><span class="src-sym">-></span><span class="src-id">chemin </span>= <span class="src-id">self</span><span class="src-sym">::</span><span class="src-id">supprimerSegmentsAPoints</span><span class="src-sym">(</span><span class="src-var">$reference</span><span class="src-sym">-></span><span class="src-id">chemin</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a583"></a> <span class="src-var">$cible</span><span class="src-sym">-></span><span class="src-id">requete </span>= <span class="src-var">$reference</span><span class="src-sym">-></span><span class="src-id">requete</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a584"></a> <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a585"></a> <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$reference</span><span class="src-sym">-></span><span class="src-id">chemin </span>== <span class="src-str">''</span><span class="src-sym">) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a586"></a> <span class="src-var">$cible</span><span class="src-sym">-></span><span class="src-id">chemin </span>= <span class="src-var">$this</span><span class="src-sym">-></span><span class="src-id">chemin</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a587"></a> <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$reference</span><span class="src-sym">-></span><span class="src-id">requete </span>!== <span class="src-id">false</span><span class="src-sym">) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a588"></a> <span class="src-var">$cible</span><span class="src-sym">-></span><span class="src-id">requete </span>= <span class="src-var">$reference</span><span class="src-sym">-></span><span class="src-id">requete</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a589"></a> <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a590"></a> <span class="src-var">$cible</span><span class="src-sym">-></span><span class="src-id">requete </span>= <span class="src-var">$this</span><span class="src-sym">-></span><span class="src-id">requete</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a591"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a592"></a> <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a593"></a> <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$reference</span><span class="src-sym">-></span><span class="src-id">chemin</span><span class="src-sym">, </span><span class="src-num">0</span><span class="src-sym">, </span><span class="src-num">1</span><span class="src-sym">) </span>== <span class="src-str">'/'</span><span class="src-sym">) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a594"></a> <span class="src-var">$cible</span><span class="src-sym">-></span><span class="src-id">chemin </span>= <span class="src-id">self</span><span class="src-sym">::</span><span class="src-id">supprimerSegmentsAPoints</span><span class="src-sym">(</span><span class="src-var">$reference</span><span class="src-sym">-></span><span class="src-id">chemin</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a595"></a> <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a596"></a> <span class="src-comm">// Concaténation chemins (RFC 3986, section 5.2.3)</span></div></li>
<li><div class="src-line"><a name="a597"></a> <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-></span><span class="src-id">hote </span>!== <span class="src-id">false </span>&& <span class="src-var">$this</span><span class="src-sym">-></span><span class="src-id">chemin </span>== <span class="src-str">''</span><span class="src-sym">) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a598"></a> <span class="src-var">$cible</span><span class="src-sym">-></span><span class="src-id">chemin </span>= <span class="src-str">'/' </span>. <span class="src-var">$this</span><span class="src-sym">-></span><span class="src-id">chemin</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a599"></a> <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a600"></a> <span class="src-var">$i </span>= <a href="http://www.php.net/strrpos">strrpos</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-></span><span class="src-id">chemin</span><span class="src-sym">, </span><span class="src-str">'/'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a601"></a> <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$i </span>!== <span class="src-id">false</span><span class="src-sym">) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a602"></a> <span class="src-var">$cible</span><span class="src-sym">-></span><span class="src-id">chemin </span>= <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-></span><span class="src-id">chemin</span><span class="src-sym">, </span><span class="src-num">0</span><span class="src-sym">, </span><span class="src-var">$i </span>+ <span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a603"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a604"></a> <span class="src-var">$cible</span><span class="src-sym">-></span><span class="src-id">chemin </span>.= <span class="src-var">$reference</span><span class="src-sym">-></span><span class="src-id">chemin</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a605"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a606"></a> <span class="src-var">$cible</span><span class="src-sym">-></span><span class="src-id">chemin </span>= <span class="src-id">self</span><span class="src-sym">::</span><span class="src-id">supprimerSegmentsAPoints</span><span class="src-sym">(</span><span class="src-var">$cible</span><span class="src-sym">-></span><span class="src-id">chemin</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a607"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a608"></a> <span class="src-var">$cible</span><span class="src-sym">-></span><span class="src-id">requete </span>= <span class="src-var">$reference</span><span class="src-sym">-></span><span class="src-id">requete</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a609"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a610"></a> <span class="src-var">$cible</span><span class="src-sym">-></span><a href="../Framework/Url.html#methodsetAutorite">setAutorite</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-></span><a href="../Framework/Url.html#methodgetAutorite">getAutorite</a><span class="src-sym">(</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a611"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a612"></a> <span class="src-var">$cible</span><span class="src-sym">-></span><span class="src-id">schema </span>= <span class="src-var">$this</span><span class="src-sym">-></span><span class="src-id">schema</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a613"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a614"></a> </div></li>
<li><div class="src-line"><a name="a615"></a> <span class="src-var">$cible</span><span class="src-sym">-></span><span class="src-id">fragment </span>= <span class="src-var">$reference</span><span class="src-sym">-></span><span class="src-id">fragment</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a616"></a> </div></li>
<li><div class="src-line"><a name="a617"></a> <span class="src-key">return </span><span class="src-var">$cible</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a618"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a619"></a> </div></li>
<li><div class="src-line"><a name="a620"></a> <span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a621"></a><span class="src-doc"> * La suppression des segments à points est décrite dans la RFC 3986, section 5.2.4, e.g.</span></div></li>
<li><div class="src-line"><a name="a622"></a><span class="src-doc"> * "/foo/../bar/baz" => "/bar/baz"</span></div></li>
<li><div class="src-line"><a name="a623"></a><span class="src-doc"> *</span></div></li>
<li><div class="src-line"><a name="a624"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$chemin </span><span class="src-doc">un chemin</span></div></li>
<li><div class="src-line"><a name="a625"></a><span class="src-doc"> *</span></div></li>
<li><div class="src-line"><a name="a626"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@return </span><span class="src-doc-type">string </span><span class="src-doc">un chemin</span></div></li>
<li><div class="src-line"><a name="a627"></a><span class="src-doc"> */</span></div></li>
<li><div class="src-line"><a name="a628"></a> <span class="src-key">private </span><span class="src-key">static </span><span class="src-key">function </span><span class="src-id">supprimerSegmentsAPoints</span><span class="src-sym">(</span><span class="src-var">$chemin</span><span class="src-sym">) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a629"></a> <span class="src-var">$sortie </span>= <span class="src-str">''</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a630"></a> </div></li>
<li><div class="src-line"><a name="a631"></a> <span class="src-comm">// Assurons de ne pas nous retrouver piégés dans une boucle infinie due à un bug de</span></div></li>
<li><div class="src-line"><a name="a632"></a> <span class="src-comm">// cette méthode</span></div></li>
<li><div class="src-line"><a name="a633"></a> <span class="src-var">$j </span>= <span class="src-num">0</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a634"></a> <span class="src-key">while </span><span class="src-sym">(</span><span class="src-var">$chemin </span>&& <span class="src-var">$j</span>++ < <span class="src-num">100</span><span class="src-sym">) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a635"></a> <span class="src-comm">// Étape A</span></div></li>
<li><div class="src-line"><a name="a636"></a> <span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$chemin</span><span class="src-sym">, </span><span class="src-num">0</span><span class="src-sym">, </span><span class="src-num">2</span><span class="src-sym">) </span>== <span class="src-str">'./'</span><span class="src-sym">) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a637"></a> <span class="src-var">$chemin </span>= <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$chemin</span><span class="src-sym">, </span><span class="src-num">2</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a638"></a> <span class="src-sym">} </span><span class="src-key">elseif </span><span class="src-sym">(</span><a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$chemin</span><span class="src-sym">, </span><span class="src-num">0</span><span class="src-sym">, </span><span class="src-num">3</span><span class="src-sym">) </span>== <span class="src-str">'../'</span><span class="src-sym">) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a639"></a> <span class="src-var">$chemin </span>= <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$chemin</span><span class="src-sym">, </span><span class="src-num">3</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a640"></a> </div></li>
<li><div class="src-line"><a name="a641"></a> <span class="src-comm">// Étape B</span></div></li>
<li><div class="src-line"><a name="a642"></a> <span class="src-sym">} </span><span class="src-key">elseif </span><span class="src-sym">(</span><a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$chemin</span><span class="src-sym">, </span><span class="src-num">0</span><span class="src-sym">, </span><span class="src-num">3</span><span class="src-sym">) </span>== <span class="src-str">'/./' </span>|| <span class="src-var">$chemin </span>== <span class="src-str">'/.'</span><span class="src-sym">) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a643"></a> <span class="src-var">$chemin </span>= <span class="src-str">'/' </span>. <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$chemin</span><span class="src-sym">, </span><span class="src-num">3</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a644"></a> </div></li>
<li><div class="src-line"><a name="a645"></a> <span class="src-comm">// Étape C</span></div></li>
<li><div class="src-line"><a name="a646"></a> <span class="src-sym">} </span><span class="src-key">elseif </span><span class="src-sym">(</span><a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$chemin</span><span class="src-sym">, </span><span class="src-num">0</span><span class="src-sym">, </span><span class="src-num">4</span><span class="src-sym">) </span>== <span class="src-str">'/../' </span>|| <span class="src-var">$chemin </span>== <span class="src-str">'/..'</span><span class="src-sym">) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a647"></a> <span class="src-var">$chemin </span>= <span class="src-str">'/' </span>. <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$chemin</span><span class="src-sym">, </span><span class="src-num">4</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a648"></a> <span class="src-var">$i </span>= <a href="http://www.php.net/strrpos">strrpos</a><span class="src-sym">(</span><span class="src-var">$sortie</span><span class="src-sym">, </span><span class="src-str">'/'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a649"></a> <span class="src-var">$sortie </span>= <span class="src-var">$i </span>=== <span class="src-id">false </span>? <span class="src-str">'' </span>: <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$sortie</span><span class="src-sym">, </span><span class="src-num">0</span><span class="src-sym">, </span><span class="src-var">$i</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a650"></a> </div></li>
<li><div class="src-line"><a name="a651"></a> <span class="src-comm">// Étape D</span></div></li>
<li><div class="src-line"><a name="a652"></a> <span class="src-sym">} </span><span class="src-key">elseif </span><span class="src-sym">(</span><span class="src-var">$chemin </span>== <span class="src-str">'.' </span>|| <span class="src-var">$chemin </span>== <span class="src-str">'..'</span><span class="src-sym">) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a653"></a> <span class="src-var">$chemin </span>= <span class="src-str">''</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a654"></a> </div></li>
<li><div class="src-line"><a name="a655"></a> <span class="src-comm">// Étape E</span></div></li>
<li><div class="src-line"><a name="a656"></a> <span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a657"></a> <span class="src-var">$i </span>= <a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$chemin</span><span class="src-sym">, </span><span class="src-str">'/'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a658"></a> <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$i </span>=== <span class="src-num">0</span><span class="src-sym">) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a659"></a> <span class="src-var">$i </span>= <a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$chemin</span><span class="src-sym">, </span><span class="src-str">'/'</span><span class="src-sym">, </span><span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a660"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a661"></a> <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$i </span>=== <span class="src-id">false</span><span class="src-sym">) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a662"></a> <span class="src-var">$i </span>= <a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$chemin</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a663"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a664"></a> <span class="src-var">$sortie </span>.= <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$chemin</span><span class="src-sym">, </span><span class="src-num">0</span><span class="src-sym">, </span><span class="src-var">$i</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a665"></a> <span class="src-var">$chemin </span>= <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$chemin</span><span class="src-sym">, </span><span class="src-var">$i</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a666"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a667"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a668"></a> </div></li>
<li><div class="src-line"><a name="a669"></a> <span class="src-key">return </span><span class="src-var">$sortie</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a670"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a671"></a> </div></li>
<li><div class="src-line"><a name="a672"></a> <span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a673"></a><span class="src-doc"> * Renvoie une instance de Url representant l'URL canonique du script PHP</span></div></li>
<li><div class="src-line"><a name="a674"></a><span class="src-doc"> * en cours d'éxécution</span></div></li>
<li><div class="src-line"><a name="a675"></a><span class="src-doc"> *</span></div></li>
<li><div class="src-line"><a name="a676"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@return </span><span class="src-doc"> </span><span class="src-doc-type">string </span></div></li>
<li><div class="src-line"><a name="a677"></a><span class="src-doc"> */</span></div></li>
<li><div class="src-line"><a name="a678"></a> <span class="src-key">public </span><span class="src-key">static </span><span class="src-key">function </span><a href="../Framework/Url.html#methodgetCanonique">getCanonique</a><span class="src-sym">(</span><span class="src-sym">) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a679"></a> <span class="src-key">if </span><span class="src-sym">(</span><span class="src-sym">!</span>isset<span class="src-sym">(</span><span class="src-var">$_SERVER</span><span class="src-sym">[</span><span class="src-str">'REQUEST_METHOD'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a680"></a> <span class="src-comm">// ALERT - pas d'URL en cours</span></div></li>
<li><div class="src-line"><a name="a681"></a> throw <span class="src-key">new </span><span class="src-id">Exception</span><span class="src-sym">(</span><span class="src-str">'Le script n\'a pas été appellé à travers un serveur web'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a682"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a683"></a> </div></li>
<li><div class="src-line"><a name="a684"></a> <span class="src-comm">// on part d'une URL relative</span></div></li>
<li><div class="src-line"><a name="a685"></a> <span class="src-var">$url </span>= <span class="src-key">new </span><span class="src-id">self</span><span class="src-sym">(</span><span class="src-var">$_SERVER</span><span class="src-sym">[</span><span class="src-str">'PHP_SELF'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a686"></a> <span class="src-var">$url</span><span class="src-sym">-></span><span class="src-id">schema </span>= isset<span class="src-sym">(</span><span class="src-var">$_SERVER</span><span class="src-sym">[</span><span class="src-str">'HTTPS'</span><span class="src-sym">]</span><span class="src-sym">) </span>? <span class="src-str">'https' </span>: <span class="src-str">'http'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a687"></a> <span class="src-var">$url</span><span class="src-sym">-></span><span class="src-id">hote </span>= <span class="src-var">$_SERVER</span><span class="src-sym">[</span><span class="src-str">'SERVER_NAME'</span><span class="src-sym">]</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a688"></a> <span class="src-var">$port </span>= <a href="http://www.php.net/intval">intval</a><span class="src-sym">(</span><span class="src-var">$_SERVER</span><span class="src-sym">[</span><span class="src-str">'SERVER_PORT'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a689"></a> <span class="src-key">if </span><span class="src-sym">(</span><span class="src-var">$url</span><span class="src-sym">-></span><span class="src-id">schema </span>== <span class="src-str">'http' </span>&& <span class="src-var">$port </span>!= <span class="src-num">80 </span>||</div></li>
<li><div class="src-line"><a name="a690"></a> <span class="src-var">$url</span><span class="src-sym">-></span><span class="src-id">schema </span>== <span class="src-str">'https' </span>&& <span class="src-var">$port </span>!= <span class="src-num">443</span><span class="src-sym">) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a691"></a> </div></li>
<li><div class="src-line"><a name="a692"></a> <span class="src-var">$url</span><span class="src-sym">-></span><span class="src-id">port </span>= <span class="src-var">$port</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a693"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a694"></a> <span class="src-key">return </span><span class="src-var">$url</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a695"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a696"></a> </div></li>
<li><div class="src-line"><a name="a697"></a> <span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a698"></a><span class="src-doc"> * Renvoie l'URL utilisée pour récupérer la requête en cours</span></div></li>
<li><div class="src-line"><a name="a699"></a><span class="src-doc"> *</span></div></li>
<li><div class="src-line"><a name="a700"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@return </span><span class="src-doc"> </span><span class="src-doc-type">string </span></div></li>
<li><div class="src-line"><a name="a701"></a><span class="src-doc"> */</span></div></li>
<li><div class="src-line"><a name="a702"></a> <span class="src-key">public </span><span class="src-key">static </span><span class="src-key">function </span><a href="../Framework/Url.html#methodgetURLDemande">getURLDemande</a><span class="src-sym">(</span><span class="src-sym">) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a703"></a> <span class="src-key">return </span><span class="src-id">self</span><span class="src-sym">::</span><span class="src-id">getDemande</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">-></span><span class="src-id">getUrl</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a704"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a705"></a> </div></li>
<li><div class="src-line"><a name="a706"></a> <span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a707"></a><span class="src-doc"> * Renvoie une instance de Url representant l'URL utilisée pour</span></div></li>
<li><div class="src-line"><a name="a708"></a><span class="src-doc"> * récupérer la requête en cours</span></div></li>
<li><div class="src-line"><a name="a709"></a><span class="src-doc"> *</span></div></li>
<li><div class="src-line"><a name="a710"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@return </span><span class="src-doc"> </span><span class="src-doc-type">Url </span></div></li>
<li><div class="src-line"><a name="a711"></a><span class="src-doc"> */</span></div></li>
<li><div class="src-line"><a name="a712"></a> <span class="src-key">public </span><span class="src-key">static </span><span class="src-key">function </span><a href="../Framework/Url.html#methodgetDemande">getDemande</a><span class="src-sym">(</span><span class="src-sym">) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a713"></a> <span class="src-key">if </span><span class="src-sym">(</span><span class="src-sym">!</span>isset<span class="src-sym">(</span><span class="src-var">$_SERVER</span><span class="src-sym">[</span><span class="src-str">'REQUEST_METHOD'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a714"></a> <span class="src-comm">// ALERTE - pas d'URL en cours</span></div></li>
<li><div class="src-line"><a name="a715"></a> throw <span class="src-key">new </span><span class="src-id">Exception</span><span class="src-sym">(</span><span class="src-str">'Le script n\'a pas été appellé à travers un serveur web'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a716"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a717"></a> </div></li>
<li><div class="src-line"><a name="a718"></a> <span class="src-comm">// On part d'une URL relative</span></div></li>
<li><div class="src-line"><a name="a719"></a> <span class="src-var">$url </span>= <span class="src-key">new </span><span class="src-id">self</span><span class="src-sym">(</span><span class="src-var">$_SERVER</span><span class="src-sym">[</span><span class="src-str">'REQUEST_URI'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a720"></a> <span class="src-var">$url</span><span class="src-sym">-></span><span class="src-id">schema </span>= isset<span class="src-sym">(</span><span class="src-var">$_SERVER</span><span class="src-sym">[</span><span class="src-str">'HTTPS'</span><span class="src-sym">]</span><span class="src-sym">) </span>? <span class="src-str">'https' </span>: <span class="src-str">'http'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a721"></a> <span class="src-comm">// On met à jour les valeurs de l'hote et si possible du port</span></div></li>
<li><div class="src-line"><a name="a722"></a> <span class="src-var">$url</span><span class="src-sym">-></span><a href="../Framework/Url.html#methodsetAutorite">setAutorite</a><span class="src-sym">(</span><span class="src-var">$_SERVER</span><span class="src-sym">[</span><span class="src-str">'HTTP_hote'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a723"></a> <span class="src-key">return </span><span class="src-var">$url</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a724"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a725"></a> </div></li>
<li><div class="src-line"><a name="a726"></a> <span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a727"></a><span class="src-doc"> * Met à jour la valeur de l'option spécifiée.</span></div></li>
<li><div class="src-line"><a name="a728"></a><span class="src-doc"> *</span></div></li>
<li><div class="src-line"><a name="a729"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$nomOption </span><span class="src-doc">une des constantes commençant par self::OPTION_</span></div></li>
<li><div class="src-line"><a name="a730"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">mixed </span><span class="src-doc"> </span><span class="src-doc-var">$valeur </span><span class="src-doc"> valeur de l'option</span></div></li>
<li><div class="src-line"><a name="a731"></a><span class="src-doc"> *</span></div></li>
<li><div class="src-line"><a name="a732"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@return </span><span class="src-doc-type">void </span></div></li>
<li><div class="src-line"><a name="a733"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@see</span><span class="src-doc"> self::OPTION_STRICTE</span></div></li>
<li><div class="src-line"><a name="a734"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@see</span><span class="src-doc"> self::OPTION_UTILISER_CROCHETS</span></div></li>
<li><div class="src-line"><a name="a735"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@see</span><span class="src-doc"> self::OPTION_ENCODER_CLES</span></div></li>
<li><div class="src-line"><a name="a736"></a><span class="src-doc"> */</span></div></li>
<li><div class="src-line"><a name="a737"></a> <span class="src-key">function </span><a href="../Framework/Url.html#methodsetOption">setOption</a><span class="src-sym">(</span><span class="src-var">$nomOption</span><span class="src-sym">, </span><span class="src-var">$valeur</span><span class="src-sym">) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a738"></a> <span class="src-key">if </span><span class="src-sym">(</span><span class="src-sym">!</span><a href="http://www.php.net/array_key_exists">array_key_exists</a><span class="src-sym">(</span><span class="src-var">$nomOption</span><span class="src-sym">, </span><span class="src-var">$this</span><span class="src-sym">-></span><span class="src-id">options</span><span class="src-sym">)) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a739"></a> <span class="src-key">return </span><span class="src-id">false</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a740"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a741"></a> <span class="src-var">$this</span><span class="src-sym">-></span><span class="src-id">options</span><span class="src-sym">[</span><span class="src-var">$nomOption</span><span class="src-sym">] </span>= <span class="src-var">$valeur</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a742"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a743"></a> </div></li>
<li><div class="src-line"><a name="a744"></a> <span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a745"></a><span class="src-doc"> * Renvoie la valeur de l'option specifiée.</span></div></li>
<li><div class="src-line"><a name="a746"></a><span class="src-doc"> *</span></div></li>
<li><div class="src-line"><a name="a747"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc-var">$nomOption </span><span class="src-doc">Nom de l'option demandée</span></div></li>
<li><div class="src-line"><a name="a748"></a><span class="src-doc"> *</span></div></li>
<li><div class="src-line"><a name="a749"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@return </span><span class="src-doc"> </span><span class="src-doc-type">mixed </span></div></li>
<li><div class="src-line"><a name="a750"></a><span class="src-doc"> */</span></div></li>
<li><div class="src-line"><a name="a751"></a> <span class="src-key">function </span><a href="../Framework/Url.html#methodgetOption">getOption</a><span class="src-sym">(</span><span class="src-var">$nomOption</span><span class="src-sym">) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a752"></a> <span class="src-key">return </span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-></span><span class="src-id">options</span><span class="src-sym">[</span><span class="src-var">$nomOption</span><span class="src-sym">]</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a753"></a> ? <span class="src-var">$this</span><span class="src-sym">-></span><span class="src-id">options</span><span class="src-sym">[</span><span class="src-var">$nomOption</span><span class="src-sym">] </span>: <span class="src-id">false</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a754"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a755"></a> </div></li>
<li><div class="src-line"><a name="a756"></a> <span class="src-key">public </span><span class="src-key">function </span><a href="../Framework/Url.html#method__toString">__toString</a><span class="src-sym">(</span><span class="src-sym">) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a757"></a> <span class="src-key">return </span><span class="src-var">$this</span><span class="src-sym">-></span><a href="../Framework/Url.html#methodgetURL">getURL</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a758"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a759"></a><span class="src-sym">}</span></div></li>
</ol>
</div>
<div class="credit">
<hr />
Documentation generated on Thu, 04 Mar 2010 19:27:38 +0100 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
</div>
</td></tr></table>
</td>
</tr>
</table>
</body>
</html>