159 |
jpm |
1 |
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
2 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
|
3 |
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
|
4 |
<head>
|
|
|
5 |
<!-- template designed by Marco Von Ballmoos -->
|
|
|
6 |
<title>File Source for Url.php</title>
|
|
|
7 |
<meta http-equiv='Content-Type' content='text/html; charset=UTF-8'/>
|
|
|
8 |
<link rel="stylesheet" href="../media/stylesheet.css" />
|
|
|
9 |
</head>
|
|
|
10 |
<body>
|
|
|
11 |
<h1>Source for file Url.php</h1>
|
|
|
12 |
<p>Documentation is available at <a href="../Framework/_Url.php.html">Url.php</a></p>
|
|
|
13 |
<div class="src-code">
|
|
|
14 |
<div class="src-code"><ol><li><div class="src-line"><a name="a1"></a><span class="src-php"><?php</span></div></li>
|
|
|
15 |
<li><div class="src-line"><a name="a2"></a><span class="src-comm">// declare(encoding='UTF-8');</span></div></li>
|
|
|
16 |
<li><div class="src-line"><a name="a3"></a><span class="src-doc">/**</span></div></li>
|
|
|
17 |
<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>
|
|
|
18 |
<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>
|
|
|
19 |
<li><div class="src-line"><a name="a6"></a><span class="src-doc">*</span></div></li>
|
|
|
20 |
<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>
|
|
|
21 |
<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>
|
|
|
22 |
<li><div class="src-line"><a name="a9"></a><span class="src-doc">// Auteur principal</span></div></li>
|
|
|
23 |
<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>
|
|
|
24 |
<li><div class="src-line"><a name="a11"></a><span class="src-doc">// Autre auteurs</span></div></li>
|
|
|
25 |
<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>
|
|
|
26 |
<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>
|
|
|
27 |
<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>
|
|
|
28 |
<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>
|
|
|
29 |
<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>
|
|
|
30 |
<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>
|
|
|
31 |
<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>
|
|
|
32 |
<li><div class="src-line"><a name="a19"></a><span class="src-doc">*</span></div></li>
|
|
|
33 |
<li><div class="src-line"><a name="a20"></a><span class="src-doc">*/</span></div></li>
|
|
|
34 |
<li><div class="src-line"><a name="a21"></a><span class="src-key">class </span><a href="../Framework/Url.html">Url</a></div></li>
|
|
|
35 |
<li><div class="src-line"><a name="a22"></a><span class="src-sym">{</span></div></li>
|
|
|
36 |
<li><div class="src-line"><a name="a23"></a> <span class="src-doc">/**</span></div></li>
|
|
|
37 |
<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>
|
|
|
38 |
<li><div class="src-line"><a name="a25"></a><span class="src-doc"> * à true.</span></div></li>
|
|
|
39 |
<li><div class="src-line"><a name="a26"></a><span class="src-doc"> */</span></div></li>
|
|
|
40 |
<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>
|
|
|
41 |
<li><div class="src-line"><a name="a28"></a> </div></li>
|
|
|
42 |
<li><div class="src-line"><a name="a29"></a> <span class="src-doc">/**</span></div></li>
|
|
|
43 |
<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>
|
|
|
44 |
<li><div class="src-line"><a name="a31"></a><span class="src-doc"> */</span></div></li>
|
|
|
45 |
<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>
|
|
|
46 |
<li><div class="src-line"><a name="a33"></a> </div></li>
|
|
|
47 |
<li><div class="src-line"><a name="a34"></a> <span class="src-doc">/**</span></div></li>
|
|
|
48 |
<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>
|
|
|
49 |
<li><div class="src-line"><a name="a36"></a><span class="src-doc"> */</span></div></li>
|
|
|
50 |
<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>
|
|
|
51 |
<li><div class="src-line"><a name="a38"></a> </div></li>
|
|
|
52 |
<li><div class="src-line"><a name="a39"></a> <span class="src-doc">/**</span></div></li>
|
|
|
53 |
<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>
|
|
|
54 |
<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>
|
|
|
55 |
<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>
|
|
|
56 |
<li><div class="src-line"><a name="a43"></a><span class="src-doc"> */</span></div></li>
|
|
|
57 |
<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>
|
|
|
58 |
<li><div class="src-line"><a name="a45"></a> </div></li>
|
|
|
59 |
<li><div class="src-line"><a name="a46"></a> <span class="src-doc">/**</span></div></li>
|
|
|
60 |
<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>
|
|
|
61 |
<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>
|
|
|
62 |
<li><div class="src-line"><a name="a49"></a><span class="src-doc"> */</span></div></li>
|
|
|
63 |
<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>
|
|
|
64 |
<li><div class="src-line"><a name="a51"></a> </div></li>
|
|
|
65 |
<li><div class="src-line"><a name="a52"></a> <span class="src-doc">/**</span></div></li>
|
|
|
66 |
<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>
|
|
|
67 |
<li><div class="src-line"><a name="a54"></a><span class="src-doc"> * vis à vis de $_GET</span></div></li>
|
|
|
68 |
<li><div class="src-line"><a name="a55"></a><span class="src-doc"> */</span></div></li>
|
|
|
69 |
<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>
|
|
|
70 |
<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>
|
|
|
71 |
<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>
|
|
|
72 |
<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>
|
|
|
73 |
<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>
|
|
|
74 |
<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>
|
|
|
75 |
<li><div class="src-line"><a name="a62"></a> </div></li>
|
|
|
76 |
<li><div class="src-line"><a name="a63"></a> <span class="src-doc">/**</span></div></li>
|
|
|
77 |
<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>
|
|
|
78 |
<li><div class="src-line"><a name="a65"></a><span class="src-doc"> */</span></div></li>
|
|
|
79 |
<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>
|
|
|
80 |
<li><div class="src-line"><a name="a67"></a> </div></li>
|
|
|
81 |
<li><div class="src-line"><a name="a68"></a> <span class="src-doc">/**</span></div></li>
|
|
|
82 |
<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>
|
|
|
83 |
<li><div class="src-line"><a name="a70"></a><span class="src-doc"> */</span></div></li>
|
|
|
84 |
<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>
|
|
|
85 |
<li><div class="src-line"><a name="a72"></a> </div></li>
|
|
|
86 |
<li><div class="src-line"><a name="a73"></a> <span class="src-doc">/**</span></div></li>
|
|
|
87 |
<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>
|
|
|
88 |
<li><div class="src-line"><a name="a75"></a><span class="src-doc"> */</span></div></li>
|
|
|
89 |
<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>
|
|
|
90 |
<li><div class="src-line"><a name="a77"></a> </div></li>
|
|
|
91 |
<li><div class="src-line"><a name="a78"></a> <span class="src-doc">/**</span></div></li>
|
|
|
92 |
<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>
|
|
|
93 |
<li><div class="src-line"><a name="a80"></a><span class="src-doc"> */</span></div></li>
|
|
|
94 |
<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>
|
|
|
95 |
<li><div class="src-line"><a name="a82"></a> </div></li>
|
|
|
96 |
<li><div class="src-line"><a name="a83"></a> <span class="src-doc">/**</span></div></li>
|
|
|
97 |
<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>
|
|
|
98 |
<li><div class="src-line"><a name="a85"></a><span class="src-doc"> */</span></div></li>
|
|
|
99 |
<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>
|
|
|
100 |
<li><div class="src-line"><a name="a87"></a> </div></li>
|
|
|
101 |
<li><div class="src-line"><a name="a88"></a> <span class="src-doc">/**</span></div></li>
|
|
|
102 |
<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>
|
|
|
103 |
<li><div class="src-line"><a name="a90"></a><span class="src-doc"> */</span></div></li>
|
|
|
104 |
<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>
|
|
|
105 |
<li><div class="src-line"><a name="a92"></a> </div></li>
|
|
|
106 |
<li><div class="src-line"><a name="a93"></a> <span class="src-doc">/**</span></div></li>
|
|
|
107 |
<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>
|
|
|
108 |
<li><div class="src-line"><a name="a95"></a><span class="src-doc"> */</span></div></li>
|
|
|
109 |
<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>
|
|
|
110 |
<li><div class="src-line"><a name="a97"></a> </div></li>
|
|
|
111 |
<li><div class="src-line"><a name="a98"></a> <span class="src-doc">/**</span></div></li>
|
|
|
112 |
<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>
|
|
|
113 |
<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>
|
|
|
114 |
<li><div class="src-line"><a name="a101"></a><span class="src-doc"> */</span></div></li>
|
|
|
115 |
<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>
|
|
|
116 |
<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>
|
|
|
117 |
<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>
|
|
|
118 |
<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>
|
|
|
119 |
<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>
|
|
|
120 |
<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>
|
|
|
121 |
<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>
|
|
|
122 |
<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>
|
|
|
123 |
<li><div class="src-line"><a name="a110"></a> <span class="src-sym">}</span></div></li>
|
|
|
124 |
<li><div class="src-line"><a name="a111"></a> <span class="src-sym">}</span></div></li>
|
|
|
125 |
<li><div class="src-line"><a name="a112"></a> </div></li>
|
|
|
126 |
<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>
|
|
|
127 |
<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>
|
|
|
128 |
<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>
|
|
|
129 |
<li><div class="src-line"><a name="a116"></a> <span class="src-sym">}</span></div></li>
|
|
|
130 |
<li><div class="src-line"><a name="a117"></a> </div></li>
|
|
|
131 |
<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>
|
|
|
132 |
<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>
|
|
|
133 |
<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>
|
|
|
134 |
<li><div class="src-line"><a name="a121"></a> <span class="src-sym">}</span></div></li>
|
|
|
135 |
<li><div class="src-line"><a name="a122"></a> </div></li>
|
|
|
136 |
<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>
|
|
|
137 |
<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>
|
|
|
138 |
<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>
|
|
|
139 |
<li><div class="src-line"><a name="a126"></a> </div></li>
|
|
|
140 |
<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>
|
|
|
141 |
<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>
|
|
|
142 |
<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>
|
|
|
143 |
<li><div class="src-line"><a name="a130"></a> <span class="src-sym">}</span></div></li>
|
|
|
144 |
<li><div class="src-line"><a name="a131"></a> </div></li>
|
|
|
145 |
<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>
|
|
|
146 |
<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>
|
|
|
147 |
<li><div class="src-line"><a name="a134"></a> <span class="src-sym">}</span></div></li>
|
|
|
148 |
<li><div class="src-line"><a name="a135"></a> <span class="src-sym">}</span></div></li>
|
|
|
149 |
<li><div class="src-line"><a name="a136"></a> </div></li>
|
|
|
150 |
<li><div class="src-line"><a name="a137"></a> <span class="src-doc">/**</span></div></li>
|
|
|
151 |
<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>
|
|
|
152 |
<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>
|
|
|
153 |
<li><div class="src-line"><a name="a140"></a><span class="src-doc"> *</span></div></li>
|
|
|
154 |
<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>
|
|
|
155 |
<li><div class="src-line"><a name="a142"></a><span class="src-doc"> */</span></div></li>
|
|
|
156 |
<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>
|
|
|
157 |
<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>
|
|
|
158 |
<li><div class="src-line"><a name="a145"></a> <span class="src-sym">}</span></div></li>
|
|
|
159 |
<li><div class="src-line"><a name="a146"></a> </div></li>
|
|
|
160 |
<li><div class="src-line"><a name="a147"></a> <span class="src-doc">/**</span></div></li>
|
|
|
161 |
<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>
|
|
|
162 |
<li><div class="src-line"><a name="a149"></a><span class="src-doc"> *</span></div></li>
|
|
|
163 |
<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>
|
|
|
164 |
<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>
|
|
|
165 |
<li><div class="src-line"><a name="a152"></a><span class="src-doc"> */</span></div></li>
|
|
|
166 |
<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>
|
|
|
167 |
<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>
|
|
|
168 |
<li><div class="src-line"><a name="a155"></a> <span class="src-sym">}</span></div></li>
|
|
|
169 |
<li><div class="src-line"><a name="a156"></a> </div></li>
|
|
|
170 |
<li><div class="src-line"><a name="a157"></a> <span class="src-doc">/**</span></div></li>
|
|
|
171 |
<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>
|
|
|
172 |
<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>
|
|
|
173 |
<li><div class="src-line"><a name="a160"></a><span class="src-doc"> *</span></div></li>
|
|
|
174 |
<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>
|
|
|
175 |
<li><div class="src-line"><a name="a162"></a><span class="src-doc"> */</span></div></li>
|
|
|
176 |
<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>
|
|
|
177 |
<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>
|
|
|
178 |
<li><div class="src-line"><a name="a165"></a> <span class="src-sym">}</span></div></li>
|
|
|
179 |
<li><div class="src-line"><a name="a166"></a> </div></li>
|
|
|
180 |
<li><div class="src-line"><a name="a167"></a> <span class="src-doc">/**</span></div></li>
|
|
|
181 |
<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>
|
|
|
182 |
<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>
|
|
|
183 |
<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>
|
|
|
184 |
<li><div class="src-line"><a name="a171"></a><span class="src-doc"> *</span></div></li>
|
|
|
185 |
<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>
|
|
|
186 |
<li><div class="src-line"><a name="a173"></a><span class="src-doc"> */</span></div></li>
|
|
|
187 |
<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>
|
|
|
188 |
<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>
|
|
|
189 |
<li><div class="src-line"><a name="a176"></a> <span class="src-sym">}</span></div></li>
|
|
|
190 |
<li><div class="src-line"><a name="a177"></a> </div></li>
|
|
|
191 |
<li><div class="src-line"><a name="a178"></a> <span class="src-doc">/**</span></div></li>
|
|
|
192 |
<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>
|
|
|
193 |
<li><div class="src-line"><a name="a180"></a><span class="src-doc"> * autorité ne contient pas de "@"</span></div></li>
|
|
|
194 |
<li><div class="src-line"><a name="a181"></a><span class="src-doc"> *</span></div></li>
|
|
|
195 |
<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>
|
|
|
196 |
<li><div class="src-line"><a name="a183"></a><span class="src-doc"> */</span></div></li>
|
|
|
197 |
<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>
|
|
|
198 |
<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>
|
|
|
199 |
<li><div class="src-line"><a name="a186"></a> <span class="src-sym">}</span></div></li>
|
|
|
200 |
<li><div class="src-line"><a name="a187"></a> </div></li>
|
|
|
201 |
<li><div class="src-line"><a name="a188"></a> <span class="src-doc">/**</span></div></li>
|
|
|
202 |
<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>
|
|
|
203 |
<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>
|
|
|
204 |
<li><div class="src-line"><a name="a191"></a><span class="src-doc"> *</span></div></li>
|
|
|
205 |
<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>
|
|
|
206 |
<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>
|
|
|
207 |
<li><div class="src-line"><a name="a194"></a><span class="src-doc"> *</span></div></li>
|
|
|
208 |
<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>
|
|
|
209 |
<li><div class="src-line"><a name="a196"></a><span class="src-doc"> */</span></div></li>
|
|
|
210 |
<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>
|
|
|
211 |
<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>
|
|
|
212 |
<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>
|
|
|
213 |
<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>
|
|
|
214 |
<li><div class="src-line"><a name="a201"></a> <span class="src-sym">}</span></div></li>
|
|
|
215 |
<li><div class="src-line"><a name="a202"></a> <span class="src-sym">}</span></div></li>
|
|
|
216 |
<li><div class="src-line"><a name="a203"></a> </div></li>
|
|
|
217 |
<li><div class="src-line"><a name="a204"></a> <span class="src-doc">/**</span></div></li>
|
|
|
218 |
<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>
|
|
|
219 |
<li><div class="src-line"><a name="a206"></a><span class="src-doc"> * l'URL est relative.</span></div></li>
|
|
|
220 |
<li><div class="src-line"><a name="a207"></a><span class="src-doc"> *</span></div></li>
|
|
|
221 |
<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>
|
|
|
222 |
<li><div class="src-line"><a name="a209"></a><span class="src-doc"> */</span></div></li>
|
|
|
223 |
<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>
|
|
|
224 |
<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>
|
|
|
225 |
<li><div class="src-line"><a name="a212"></a> <span class="src-sym">}</span></div></li>
|
|
|
226 |
<li><div class="src-line"><a name="a213"></a> </div></li>
|
|
|
227 |
<li><div class="src-line"><a name="a214"></a> <span class="src-doc">/**</span></div></li>
|
|
|
228 |
<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>
|
|
|
229 |
<li><div class="src-line"><a name="a216"></a><span class="src-doc"> *</span></div></li>
|
|
|
230 |
<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>
|
|
|
231 |
<li><div class="src-line"><a name="a218"></a><span class="src-doc"> */</span></div></li>
|
|
|
232 |
<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>
|
|
|
233 |
<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>
|
|
|
234 |
<li><div class="src-line"><a name="a221"></a> <span class="src-sym">}</span></div></li>
|
|
|
235 |
<li><div class="src-line"><a name="a222"></a> </div></li>
|
|
|
236 |
<li><div class="src-line"><a name="a223"></a> <span class="src-doc">/**</span></div></li>
|
|
|
237 |
<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>
|
|
|
238 |
<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>
|
|
|
239 |
<li><div class="src-line"><a name="a226"></a><span class="src-doc"> *</span></div></li>
|
|
|
240 |
<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>
|
|
|
241 |
<li><div class="src-line"><a name="a228"></a><span class="src-doc"> */</span></div></li>
|
|
|
242 |
<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>
|
|
|
243 |
<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>
|
|
|
244 |
<li><div class="src-line"><a name="a231"></a> <span class="src-sym">}</span></div></li>
|
|
|
245 |
<li><div class="src-line"><a name="a232"></a> </div></li>
|
|
|
246 |
<li><div class="src-line"><a name="a233"></a> <span class="src-doc">/**</span></div></li>
|
|
|
247 |
<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>
|
|
|
248 |
<li><div class="src-line"><a name="a235"></a><span class="src-doc"> *</span></div></li>
|
|
|
249 |
<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>
|
|
|
250 |
<li><div class="src-line"><a name="a237"></a><span class="src-doc"> */</span></div></li>
|
|
|
251 |
<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>
|
|
|
252 |
<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>
|
|
|
253 |
<li><div class="src-line"><a name="a240"></a> <span class="src-sym">}</span></div></li>
|
|
|
254 |
<li><div class="src-line"><a name="a241"></a> </div></li>
|
|
|
255 |
<li><div class="src-line"><a name="a242"></a> <span class="src-doc">/**</span></div></li>
|
|
|
256 |
<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>
|
|
|
257 |
<li><div class="src-line"><a name="a244"></a><span class="src-doc"> * false si celle-ci est absente.</span></div></li>
|
|
|
258 |
<li><div class="src-line"><a name="a245"></a><span class="src-doc"> *</span></div></li>
|
|
|
259 |
<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>
|
|
|
260 |
<li><div class="src-line"><a name="a247"></a><span class="src-doc"> */</span></div></li>
|
|
|
261 |
<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>
|
|
|
262 |
<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>
|
|
|
263 |
<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>
|
|
|
264 |
<li><div class="src-line"><a name="a251"></a> <span class="src-sym">}</span></div></li>
|
|
|
265 |
<li><div class="src-line"><a name="a252"></a> </div></li>
|
|
|
266 |
<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>
|
|
|
267 |
<li><div class="src-line"><a name="a254"></a> </div></li>
|
|
|
268 |
<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>
|
|
|
269 |
<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>
|
|
|
270 |
<li><div class="src-line"><a name="a257"></a> <span class="src-sym">}</span></div></li>
|
|
|
271 |
<li><div class="src-line"><a name="a258"></a> </div></li>
|
|
|
272 |
<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>
|
|
|
273 |
<li><div class="src-line"><a name="a260"></a> </div></li>
|
|
|
274 |
<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>
|
|
|
275 |
<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>
|
|
|
276 |
<li><div class="src-line"><a name="a263"></a> <span class="src-sym">}</span></div></li>
|
|
|
277 |
<li><div class="src-line"><a name="a264"></a> </div></li>
|
|
|
278 |
<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>
|
|
|
279 |
<li><div class="src-line"><a name="a266"></a> <span class="src-sym">}</span></div></li>
|
|
|
280 |
<li><div class="src-line"><a name="a267"></a> </div></li>
|
|
|
281 |
<li><div class="src-line"><a name="a268"></a> <span class="src-doc">/**</span></div></li>
|
|
|
282 |
<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>
|
|
|
283 |
<li><div class="src-line"><a name="a270"></a><span class="src-doc"> *</span></div></li>
|
|
|
284 |
<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>
|
|
|
285 |
<li><div class="src-line"><a name="a272"></a><span class="src-doc"> */</span></div></li>
|
|
|
286 |
<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>
|
|
|
287 |
<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>
|
|
|
288 |
<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>
|
|
|
289 |
<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>
|
|
|
290 |
<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>
|
|
|
291 |
<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>
|
|
|
292 |
<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>
|
|
|
293 |
<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>
|
|
|
294 |
<li><div class="src-line"><a name="a281"></a> <span class="src-sym">}</span></div></li>
|
|
|
295 |
<li><div class="src-line"><a name="a282"></a> </div></li>
|
|
|
296 |
<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>
|
|
|
297 |
<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>
|
|
|
298 |
<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>
|
|
|
299 |
<li><div class="src-line"><a name="a286"></a> <span class="src-sym">}</span></div></li>
|
|
|
300 |
<li><div class="src-line"><a name="a287"></a> <span class="src-sym">}</span></div></li>
|
|
|
301 |
<li><div class="src-line"><a name="a288"></a> <span class="src-sym">}</span></div></li>
|
|
|
302 |
<li><div class="src-line"><a name="a289"></a> </div></li>
|
|
|
303 |
<li><div class="src-line"><a name="a290"></a> <span class="src-doc">/**</span></div></li>
|
|
|
304 |
<li><div class="src-line"><a name="a291"></a><span class="src-doc"> * Renvoie la partie chemin (chemin) (éventuellement vide).</span></div></li>
|
|
|
305 |
<li><div class="src-line"><a name="a292"></a><span class="src-doc"> *</span></div></li>
|
|
|
306 |
<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>
|
|
|
307 |
<li><div class="src-line"><a name="a294"></a><span class="src-doc"> */</span></div></li>
|
|
|
308 |
<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>
|
|
|
309 |
<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>
|
|
|
310 |
<li><div class="src-line"><a name="a297"></a> <span class="src-sym">}</span></div></li>
|
|
|
311 |
<li><div class="src-line"><a name="a298"></a> </div></li>
|
|
|
312 |
<li><div class="src-line"><a name="a299"></a> <span class="src-doc">/**</span></div></li>
|
|
|
313 |
<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>
|
|
|
314 |
<li><div class="src-line"><a name="a301"></a><span class="src-doc"> *</span></div></li>
|
|
|
315 |
<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>
|
|
|
316 |
<li><div class="src-line"><a name="a303"></a><span class="src-doc"> */</span></div></li>
|
|
|
317 |
<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>
|
|
|
318 |
<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>
|
|
|
319 |
<li><div class="src-line"><a name="a306"></a> <span class="src-sym">}</span></div></li>
|
|
|
320 |
<li><div class="src-line"><a name="a307"></a> </div></li>
|
|
|
321 |
<li><div class="src-line"><a name="a308"></a> <span class="src-doc">/**</span></div></li>
|
|
|
322 |
<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>
|
|
|
323 |
<li><div class="src-line"><a name="a310"></a><span class="src-doc"> * n'est pas présent dans l'url.</span></div></li>
|
|
|
324 |
<li><div class="src-line"><a name="a311"></a><span class="src-doc"> *</span></div></li>
|
|
|
325 |
<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>
|
|
|
326 |
<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>
|
|
|
327 |
<li><div class="src-line"><a name="a314"></a><span class="src-doc"> */</span></div></li>
|
|
|
328 |
<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>
|
|
|
329 |
<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>
|
|
|
330 |
<li><div class="src-line"><a name="a317"></a> <span class="src-sym">}</span></div></li>
|
|
|
331 |
<li><div class="src-line"><a name="a318"></a> </div></li>
|
|
|
332 |
<li><div class="src-line"><a name="a319"></a> <span class="src-doc">/**</span></div></li>
|
|
|
333 |
<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>
|
|
|
334 |
<li><div class="src-line"><a name="a321"></a><span class="src-doc"> *</span></div></li>
|
|
|
335 |
<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>
|
|
|
336 |
<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>
|
|
|
337 |
<li><div class="src-line"><a name="a324"></a><span class="src-doc"> */</span></div></li>
|
|
|
338 |
<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>
|
|
|
339 |
<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>
|
|
|
340 |
<li><div class="src-line"><a name="a327"></a> <span class="src-sym">}</span></div></li>
|
|
|
341 |
<li><div class="src-line"><a name="a328"></a> </div></li>
|
|
|
342 |
<li><div class="src-line"><a name="a329"></a> <span class="src-doc">/**</span></div></li>
|
|
|
343 |
<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>
|
|
|
344 |
<li><div class="src-line"><a name="a331"></a><span class="src-doc"> *</span></div></li>
|
|
|
345 |
<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>
|
|
|
346 |
<li><div class="src-line"><a name="a333"></a><span class="src-doc"> */</span></div></li>
|
|
|
347 |
<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>
|
|
|
348 |
<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>
|
|
|
349 |
<li><div class="src-line"><a name="a336"></a> <span class="src-sym">}</span></div></li>
|
|
|
350 |
<li><div class="src-line"><a name="a337"></a> </div></li>
|
|
|
351 |
<li><div class="src-line"><a name="a338"></a> <span class="src-doc">/**</span></div></li>
|
|
|
352 |
<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>
|
|
|
353 |
<li><div class="src-line"><a name="a340"></a><span class="src-doc"> *</span></div></li>
|
|
|
354 |
<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>
|
|
|
355 |
<li><div class="src-line"><a name="a342"></a><span class="src-doc"> */</span></div></li>
|
|
|
356 |
<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>
|
|
|
357 |
<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>
|
|
|
358 |
<li><div class="src-line"><a name="a345"></a> <span class="src-sym">}</span></div></li>
|
|
|
359 |
<li><div class="src-line"><a name="a346"></a> </div></li>
|
|
|
360 |
<li><div class="src-line"><a name="a347"></a> <span class="src-doc">/**</span></div></li>
|
|
|
361 |
<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>
|
|
|
362 |
<li><div class="src-line"><a name="a349"></a><span class="src-doc"> * dans le $_GET d'un script PHP</span></div></li>
|
|
|
363 |
<li><div class="src-line"><a name="a350"></a><span class="src-doc"> *</span></div></li>
|
|
|
364 |
<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>
|
|
|
365 |
<li><div class="src-line"><a name="a352"></a><span class="src-doc"> */</span></div></li>
|
|
|
366 |
<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>
|
|
|
367 |
<li><div class="src-line"><a name="a354"></a> <span class="src-var">$pattern </span>= <span class="src-str">'/' </span>.</div></li>
|
|
|
368 |
<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>
|
|
|
369 |
<li><div class="src-line"><a name="a356"></a> <span class="src-str">'/'</span><span class="src-sym">;</span></div></li>
|
|
|
370 |
<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>
|
|
|
371 |
<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>
|
|
|
372 |
<li><div class="src-line"><a name="a359"></a> </div></li>
|
|
|
373 |
<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>
|
|
|
374 |
<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>
|
|
|
375 |
<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>
|
|
|
376 |
<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>
|
|
|
377 |
<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>
|
|
|
378 |
<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>
|
|
|
379 |
<li><div class="src-line"><a name="a366"></a> <span class="src-sym">}</span></div></li>
|
|
|
380 |
<li><div class="src-line"><a name="a367"></a> </div></li>
|
|
|
381 |
<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>
|
|
|
382 |
<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>
|
|
|
383 |
<li><div class="src-line"><a name="a370"></a> <span class="src-sym">}</span></div></li>
|
|
|
384 |
<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>
|
|
|
385 |
<li><div class="src-line"><a name="a372"></a> </div></li>
|
|
|
386 |
<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>
|
|
|
387 |
<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>
|
|
|
388 |
<li><div class="src-line"><a name="a375"></a> </div></li>
|
|
|
389 |
<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>
|
|
|
390 |
<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>
|
|
|
391 |
<li><div class="src-line"><a name="a378"></a> </div></li>
|
|
|
392 |
<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>
|
|
|
393 |
<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>
|
|
|
394 |
<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>
|
|
|
395 |
<li><div class="src-line"><a name="a382"></a> <span class="src-sym">}</span></div></li>
|
|
|
396 |
<li><div class="src-line"><a name="a383"></a> </div></li>
|
|
|
397 |
<li><div class="src-line"><a name="a384"></a> <span class="src-comm">// Ajout des données</span></div></li>
|
|
|
398 |
<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>
|
|
|
399 |
<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>
|
|
|
400 |
<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>
|
|
|
401 |
<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>
|
|
|
402 |
<li><div class="src-line"><a name="a389"></a> <span class="src-sym">}</span></div></li>
|
|
|
403 |
<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>
|
|
|
404 |
<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>
|
|
|
405 |
<li><div class="src-line"><a name="a392"></a> <span class="src-sym">) </span><span class="src-sym">{</span></div></li>
|
|
|
406 |
<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>
|
|
|
407 |
<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>
|
|
|
408 |
<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>
|
|
|
409 |
<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>
|
|
|
410 |
<li><div class="src-line"><a name="a397"></a> <span class="src-sym">}</span></div></li>
|
|
|
411 |
<li><div class="src-line"><a name="a398"></a> <span class="src-sym">}</span></div></li>
|
|
|
412 |
<li><div class="src-line"><a name="a399"></a> </div></li>
|
|
|
413 |
<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>
|
|
|
414 |
<li><div class="src-line"><a name="a401"></a> <span class="src-sym">}</span></div></li>
|
|
|
415 |
<li><div class="src-line"><a name="a402"></a> </div></li>
|
|
|
416 |
<li><div class="src-line"><a name="a403"></a> <span class="src-doc">/**</span></div></li>
|
|
|
417 |
<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>
|
|
|
418 |
<li><div class="src-line"><a name="a405"></a><span class="src-doc"> *</span></div></li>
|
|
|
419 |
<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>
|
|
|
420 |
<li><div class="src-line"><a name="a407"></a><span class="src-doc"> */</span></div></li>
|
|
|
421 |
<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>
|
|
|
422 |
<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>
|
|
|
423 |
<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>
|
|
|
424 |
<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>
|
|
|
425 |
<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>
|
|
|
426 |
<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>
|
|
|
427 |
<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>
|
|
|
428 |
<li><div class="src-line"><a name="a415"></a> <span class="src-sym">}</span></div></li>
|
|
|
429 |
<li><div class="src-line"><a name="a416"></a> </div></li>
|
|
|
430 |
<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>
|
|
|
431 |
<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>
|
|
|
432 |
<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>
|
|
|
433 |
<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>
|
|
|
434 |
<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>
|
|
|
435 |
<li><div class="src-line"><a name="a422"></a> <span class="src-sym">}</span></div></li>
|
|
|
436 |
<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>
|
|
|
437 |
<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>
|
|
|
438 |
<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>
|
|
|
439 |
<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>
|
|
|
440 |
<li><div class="src-line"><a name="a427"></a> <span class="src-sym">}</span></div></li>
|
|
|
441 |
<li><div class="src-line"><a name="a428"></a> <span class="src-sym">}</span></div></li>
|
|
|
442 |
<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>
|
|
|
443 |
<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>
|
|
|
444 |
<li><div class="src-line"><a name="a431"></a> <span class="src-sym">}</span></div></li>
|
|
|
445 |
<li><div class="src-line"><a name="a432"></a> <span class="src-sym">}</span></div></li>
|
|
|
446 |
<li><div class="src-line"><a name="a433"></a> </div></li>
|
|
|
447 |
<li><div class="src-line"><a name="a434"></a> <span class="src-doc">/**</span></div></li>
|
|
|
448 |
<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>
|
|
|
449 |
<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>
|
|
|
450 |
<li><div class="src-line"><a name="a437"></a><span class="src-doc"> *</span></div></li>
|
|
|
451 |
<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>
|
|
|
452 |
<li><div class="src-line"><a name="a439"></a><span class="src-doc"> */</span></div></li>
|
|
|
453 |
<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>
|
|
|
454 |
<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>
|
|
|
455 |
<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>
|
|
|
456 |
<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>
|
|
|
457 |
<li><div class="src-line"><a name="a444"></a> <span class="src-sym">}</span></div></li>
|
|
|
458 |
<li><div class="src-line"><a name="a445"></a> </div></li>
|
|
|
459 |
<li><div class="src-line"><a name="a446"></a> <span class="src-doc">/**</span></div></li>
|
|
|
460 |
<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>
|
|
|
461 |
<li><div class="src-line"><a name="a448"></a><span class="src-doc"> *</span></div></li>
|
|
|
462 |
<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>
|
|
|
463 |
<li><div class="src-line"><a name="a450"></a><span class="src-doc"> */</span></div></li>
|
|
|
464 |
<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>
|
|
|
465 |
<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>
|
|
|
466 |
<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>
|
|
|
467 |
<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>
|
|
|
468 |
<li><div class="src-line"><a name="a455"></a> <span class="src-sym">}</span></div></li>
|
|
|
469 |
<li><div class="src-line"><a name="a456"></a> </div></li>
|
|
|
470 |
<li><div class="src-line"><a name="a457"></a> <span class="src-doc">/**</span></div></li>
|
|
|
471 |
<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>
|
|
|
472 |
<li><div class="src-line"><a name="a459"></a><span class="src-doc"> *</span></div></li>
|
|
|
473 |
<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>
|
|
|
474 |
<li><div class="src-line"><a name="a461"></a><span class="src-doc"> */</span></div></li>
|
|
|
475 |
<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>
|
|
|
476 |
<li><div class="src-line"><a name="a463"></a> <span class="src-comm">// Voir RFC 3986, section 5.3</span></div></li>
|
|
|
477 |
<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>
|
|
|
478 |
<li><div class="src-line"><a name="a465"></a> </div></li>
|
|
|
479 |
<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>
|
|
|
480 |
<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>
|
|
|
481 |
<li><div class="src-line"><a name="a468"></a> <span class="src-sym">}</span></div></li>
|
|
|
482 |
<li><div class="src-line"><a name="a469"></a> </div></li>
|
|
|
483 |
<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>
|
|
|
484 |
<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>
|
|
|
485 |
<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>
|
|
|
486 |
<li><div class="src-line"><a name="a473"></a> <span class="src-sym">}</span></div></li>
|
|
|
487 |
<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>
|
|
|
488 |
<li><div class="src-line"><a name="a475"></a> </div></li>
|
|
|
489 |
<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>
|
|
|
490 |
<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>
|
|
|
491 |
<li><div class="src-line"><a name="a478"></a> <span class="src-sym">}</span></div></li>
|
|
|
492 |
<li><div class="src-line"><a name="a479"></a> </div></li>
|
|
|
493 |
<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>
|
|
|
494 |
<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>
|
|
|
495 |
<li><div class="src-line"><a name="a482"></a> <span class="src-sym">}</span></div></li>
|
|
|
496 |
<li><div class="src-line"><a name="a483"></a> </div></li>
|
|
|
497 |
<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>
|
|
|
498 |
<li><div class="src-line"><a name="a485"></a> <span class="src-sym">}</span></div></li>
|
|
|
499 |
<li><div class="src-line"><a name="a486"></a> </div></li>
|
|
|
500 |
<li><div class="src-line"><a name="a487"></a> <span class="src-doc">/**</span></div></li>
|
|
|
501 |
<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>
|
|
|
502 |
<li><div class="src-line"><a name="a489"></a><span class="src-doc"> * comparaison d'URLs</span></div></li>
|
|
|
503 |
<li><div class="src-line"><a name="a490"></a><span class="src-doc"> *</span></div></li>
|
|
|
504 |
<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>
|
|
|
505 |
<li><div class="src-line"><a name="a492"></a><span class="src-doc"> */</span></div></li>
|
|
|
506 |
<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>
|
|
|
507 |
<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>
|
|
|
508 |
<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>
|
|
|
509 |
<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>
|
|
|
510 |
<li><div class="src-line"><a name="a497"></a> <span class="src-sym">}</span></div></li>
|
|
|
511 |
<li><div class="src-line"><a name="a498"></a> </div></li>
|
|
|
512 |
<li><div class="src-line"><a name="a499"></a> <span class="src-doc">/**</span></div></li>
|
|
|
513 |
<li><div class="src-line"><a name="a500"></a><span class="src-doc"> * Renvoie une instance normalisée de Url</span></div></li>
|
|
|
514 |
<li><div class="src-line"><a name="a501"></a><span class="src-doc"> *</span></div></li>
|
|
|
515 |
<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>
|
|
|
516 |
<li><div class="src-line"><a name="a503"></a><span class="src-doc"> */</span></div></li>
|
|
|
517 |
<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>
|
|
|
518 |
<li><div class="src-line"><a name="a505"></a> <span class="src-comm">// See RFC 3886, section 6</span></div></li>
|
|
|
519 |
<li><div class="src-line"><a name="a506"></a> </div></li>
|
|
|
520 |
<li><div class="src-line"><a name="a507"></a> <span class="src-comm">// les cchémas sont insesibles à la casse</span></div></li>
|
|
|
521 |
<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>
|
|
|
522 |
<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>
|
|
|
523 |
<li><div class="src-line"><a name="a510"></a> <span class="src-sym">}</span></div></li>
|
|
|
524 |
<li><div class="src-line"><a name="a511"></a> </div></li>
|
|
|
525 |
<li><div class="src-line"><a name="a512"></a> <span class="src-comm">// les noms d'hotes sont insensibles à la casse</span></div></li>
|
|
|
526 |
<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>
|
|
|
527 |
<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>
|
|
|
528 |
<li><div class="src-line"><a name="a515"></a> <span class="src-sym">}</span></div></li>
|
|
|
529 |
<li><div class="src-line"><a name="a516"></a> </div></li>
|
|
|
530 |
<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>
|
|
|
531 |
<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>
|
|
|
532 |
<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>
|
|
|
533 |
<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>
|
|
|
534 |
<li><div class="src-line"><a name="a521"></a> </div></li>
|
|
|
535 |
<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>
|
|
|
536 |
<li><div class="src-line"><a name="a523"></a> <span class="src-sym">}</span></div></li>
|
|
|
537 |
<li><div class="src-line"><a name="a524"></a> </div></li>
|
|
|
538 |
<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>
|
|
|
539 |
<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>
|
|
|
540 |
<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>
|
|
|
541 |
<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>
|
|
|
542 |
<li><div class="src-line"><a name="a529"></a> <span class="src-sym">}</span></div></li>
|
|
|
543 |
<li><div class="src-line"><a name="a530"></a> <span class="src-sym">}</span></div></li>
|
|
|
544 |
<li><div class="src-line"><a name="a531"></a> </div></li>
|
|
|
545 |
<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>
|
|
|
546 |
<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>
|
|
|
547 |
<li><div class="src-line"><a name="a534"></a> </div></li>
|
|
|
548 |
<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>
|
|
|
549 |
<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>
|
|
|
550 |
<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>
|
|
|
551 |
<li><div class="src-line"><a name="a538"></a> <span class="src-sym">}</span></div></li>
|
|
|
552 |
<li><div class="src-line"><a name="a539"></a> <span class="src-sym">}</span></div></li>
|
|
|
553 |
<li><div class="src-line"><a name="a540"></a> </div></li>
|
|
|
554 |
<li><div class="src-line"><a name="a541"></a> <span class="src-doc">/**</span></div></li>
|
|
|
555 |
<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>
|
|
|
556 |
<li><div class="src-line"><a name="a543"></a><span class="src-doc"> *</span></div></li>
|
|
|
557 |
<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>
|
|
|
558 |
<li><div class="src-line"><a name="a545"></a><span class="src-doc"> */</span></div></li>
|
|
|
559 |
<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>
|
|
|
560 |
<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>
|
|
|
561 |
<li><div class="src-line"><a name="a548"></a> <span class="src-sym">}</span></div></li>
|
|
|
562 |
<li><div class="src-line"><a name="a549"></a> </div></li>
|
|
|
563 |
<li><div class="src-line"><a name="a550"></a> <span class="src-doc">/**</span></div></li>
|
|
|
564 |
<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>
|
|
|
565 |
<li><div class="src-line"><a name="a552"></a><span class="src-doc"> * cette URL.</span></div></li>
|
|
|
566 |
<li><div class="src-line"><a name="a553"></a><span class="src-doc"> *</span></div></li>
|
|
|
567 |
<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>
|
|
|
568 |
<li><div class="src-line"><a name="a555"></a><span class="src-doc"> *</span></div></li>
|
|
|
569 |
<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>
|
|
|
570 |
<li><div class="src-line"><a name="a557"></a><span class="src-doc"> */</span></div></li>
|
|
|
571 |
<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>
|
|
|
572 |
<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>
|
|
|
573 |
<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>
|
|
|
574 |
<li><div class="src-line"><a name="a561"></a> <span class="src-sym">}</span></div></li>
|
|
|
575 |
<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>
|
|
|
576 |
<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>
|
|
|
577 |
<li><div class="src-line"><a name="a564"></a> <span class="src-sym">}</span></div></li>
|
|
|
578 |
<li><div class="src-line"><a name="a565"></a> </div></li>
|
|
|
579 |
<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>
|
|
|
580 |
<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>
|
|
|
581 |
<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>
|
|
|
582 |
<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>
|
|
|
583 |
<li><div class="src-line"><a name="a570"></a> <span class="src-sym">}</span></div></li>
|
|
|
584 |
<li><div class="src-line"><a name="a571"></a> </div></li>
|
|
|
585 |
<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>
|
|
|
586 |
<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>
|
|
|
587 |
<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>
|
|
|
588 |
<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>
|
|
|
589 |
<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>
|
|
|
590 |
<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>
|
|
|
591 |
<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>
|
|
|
592 |
<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>
|
|
|
593 |
<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>
|
|
|
594 |
<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>
|
|
|
595 |
<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>
|
|
|
596 |
<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>
|
|
|
597 |
<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>
|
|
|
598 |
<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>
|
|
|
599 |
<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>
|
|
|
600 |
<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>
|
|
|
601 |
<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>
|
|
|
602 |
<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>
|
|
|
603 |
<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>
|
|
|
604 |
<li><div class="src-line"><a name="a591"></a> <span class="src-sym">}</span></div></li>
|
|
|
605 |
<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>
|
|
|
606 |
<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>
|
|
|
607 |
<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>
|
|
|
608 |
<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>
|
|
|
609 |
<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>
|
|
|
610 |
<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>
|
|
|
611 |
<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>
|
|
|
612 |
<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>
|
|
|
613 |
<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>
|
|
|
614 |
<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>
|
|
|
615 |
<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>
|
|
|
616 |
<li><div class="src-line"><a name="a603"></a> <span class="src-sym">}</span></div></li>
|
|
|
617 |
<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>
|
|
|
618 |
<li><div class="src-line"><a name="a605"></a> <span class="src-sym">}</span></div></li>
|
|
|
619 |
<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>
|
|
|
620 |
<li><div class="src-line"><a name="a607"></a> <span class="src-sym">}</span></div></li>
|
|
|
621 |
<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>
|
|
|
622 |
<li><div class="src-line"><a name="a609"></a> <span class="src-sym">}</span></div></li>
|
|
|
623 |
<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>
|
|
|
624 |
<li><div class="src-line"><a name="a611"></a> <span class="src-sym">}</span></div></li>
|
|
|
625 |
<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>
|
|
|
626 |
<li><div class="src-line"><a name="a613"></a> <span class="src-sym">}</span></div></li>
|
|
|
627 |
<li><div class="src-line"><a name="a614"></a> </div></li>
|
|
|
628 |
<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>
|
|
|
629 |
<li><div class="src-line"><a name="a616"></a> </div></li>
|
|
|
630 |
<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>
|
|
|
631 |
<li><div class="src-line"><a name="a618"></a> <span class="src-sym">}</span></div></li>
|
|
|
632 |
<li><div class="src-line"><a name="a619"></a> </div></li>
|
|
|
633 |
<li><div class="src-line"><a name="a620"></a> <span class="src-doc">/**</span></div></li>
|
|
|
634 |
<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>
|
|
|
635 |
<li><div class="src-line"><a name="a622"></a><span class="src-doc"> * "/foo/../bar/baz" => "/bar/baz"</span></div></li>
|
|
|
636 |
<li><div class="src-line"><a name="a623"></a><span class="src-doc"> *</span></div></li>
|
|
|
637 |
<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>
|
|
|
638 |
<li><div class="src-line"><a name="a625"></a><span class="src-doc"> *</span></div></li>
|
|
|
639 |
<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>
|
|
|
640 |
<li><div class="src-line"><a name="a627"></a><span class="src-doc"> */</span></div></li>
|
|
|
641 |
<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>
|
|
|
642 |
<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>
|
|
|
643 |
<li><div class="src-line"><a name="a630"></a> </div></li>
|
|
|
644 |
<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>
|
|
|
645 |
<li><div class="src-line"><a name="a632"></a> <span class="src-comm">// cette méthode</span></div></li>
|
|
|
646 |
<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>
|
|
|
647 |
<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>
|
|
|
648 |
<li><div class="src-line"><a name="a635"></a> <span class="src-comm">// Étape A</span></div></li>
|
|
|
649 |
<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>
|
|
|
650 |
<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>
|
|
|
651 |
<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>
|
|
|
652 |
<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>
|
|
|
653 |
<li><div class="src-line"><a name="a640"></a> </div></li>
|
|
|
654 |
<li><div class="src-line"><a name="a641"></a> <span class="src-comm">// Étape B</span></div></li>
|
|
|
655 |
<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>
|
|
|
656 |
<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>
|
|
|
657 |
<li><div class="src-line"><a name="a644"></a> </div></li>
|
|
|
658 |
<li><div class="src-line"><a name="a645"></a> <span class="src-comm">// Étape C</span></div></li>
|
|
|
659 |
<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>
|
|
|
660 |
<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>
|
|
|
661 |
<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>
|
|
|
662 |
<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>
|
|
|
663 |
<li><div class="src-line"><a name="a650"></a> </div></li>
|
|
|
664 |
<li><div class="src-line"><a name="a651"></a> <span class="src-comm">// Étape D</span></div></li>
|
|
|
665 |
<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>
|
|
|
666 |
<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>
|
|
|
667 |
<li><div class="src-line"><a name="a654"></a> </div></li>
|
|
|
668 |
<li><div class="src-line"><a name="a655"></a> <span class="src-comm">// Étape E</span></div></li>
|
|
|
669 |
<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>
|
|
|
670 |
<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>
|
|
|
671 |
<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>
|
|
|
672 |
<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>
|
|
|
673 |
<li><div class="src-line"><a name="a660"></a> <span class="src-sym">}</span></div></li>
|
|
|
674 |
<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>
|
|
|
675 |
<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>
|
|
|
676 |
<li><div class="src-line"><a name="a663"></a> <span class="src-sym">}</span></div></li>
|
|
|
677 |
<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>
|
|
|
678 |
<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>
|
|
|
679 |
<li><div class="src-line"><a name="a666"></a> <span class="src-sym">}</span></div></li>
|
|
|
680 |
<li><div class="src-line"><a name="a667"></a> <span class="src-sym">}</span></div></li>
|
|
|
681 |
<li><div class="src-line"><a name="a668"></a> </div></li>
|
|
|
682 |
<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>
|
|
|
683 |
<li><div class="src-line"><a name="a670"></a> <span class="src-sym">}</span></div></li>
|
|
|
684 |
<li><div class="src-line"><a name="a671"></a> </div></li>
|
|
|
685 |
<li><div class="src-line"><a name="a672"></a> <span class="src-doc">/**</span></div></li>
|
|
|
686 |
<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>
|
|
|
687 |
<li><div class="src-line"><a name="a674"></a><span class="src-doc"> * en cours d'éxécution</span></div></li>
|
|
|
688 |
<li><div class="src-line"><a name="a675"></a><span class="src-doc"> *</span></div></li>
|
|
|
689 |
<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>
|
|
|
690 |
<li><div class="src-line"><a name="a677"></a><span class="src-doc"> */</span></div></li>
|
|
|
691 |
<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>
|
|
|
692 |
<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>
|
|
|
693 |
<li><div class="src-line"><a name="a680"></a> <span class="src-comm">// ALERT - pas d'URL en cours</span></div></li>
|
|
|
694 |
<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>
|
|
|
695 |
<li><div class="src-line"><a name="a682"></a> <span class="src-sym">}</span></div></li>
|
|
|
696 |
<li><div class="src-line"><a name="a683"></a> </div></li>
|
|
|
697 |
<li><div class="src-line"><a name="a684"></a> <span class="src-comm">// on part d'une URL relative</span></div></li>
|
|
|
698 |
<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>
|
|
|
699 |
<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>
|
|
|
700 |
<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>
|
|
|
701 |
<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>
|
|
|
702 |
<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>
|
|
|
703 |
<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>
|
|
|
704 |
<li><div class="src-line"><a name="a691"></a> </div></li>
|
|
|
705 |
<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>
|
|
|
706 |
<li><div class="src-line"><a name="a693"></a> <span class="src-sym">}</span></div></li>
|
|
|
707 |
<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>
|
|
|
708 |
<li><div class="src-line"><a name="a695"></a> <span class="src-sym">}</span></div></li>
|
|
|
709 |
<li><div class="src-line"><a name="a696"></a> </div></li>
|
|
|
710 |
<li><div class="src-line"><a name="a697"></a> <span class="src-doc">/**</span></div></li>
|
|
|
711 |
<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>
|
|
|
712 |
<li><div class="src-line"><a name="a699"></a><span class="src-doc"> *</span></div></li>
|
|
|
713 |
<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>
|
|
|
714 |
<li><div class="src-line"><a name="a701"></a><span class="src-doc"> */</span></div></li>
|
|
|
715 |
<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>
|
|
|
716 |
<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>
|
|
|
717 |
<li><div class="src-line"><a name="a704"></a> <span class="src-sym">}</span></div></li>
|
|
|
718 |
<li><div class="src-line"><a name="a705"></a> </div></li>
|
|
|
719 |
<li><div class="src-line"><a name="a706"></a> <span class="src-doc">/**</span></div></li>
|
|
|
720 |
<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>
|
|
|
721 |
<li><div class="src-line"><a name="a708"></a><span class="src-doc"> * récupérer la requête en cours</span></div></li>
|
|
|
722 |
<li><div class="src-line"><a name="a709"></a><span class="src-doc"> *</span></div></li>
|
|
|
723 |
<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>
|
|
|
724 |
<li><div class="src-line"><a name="a711"></a><span class="src-doc"> */</span></div></li>
|
|
|
725 |
<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>
|
|
|
726 |
<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>
|
|
|
727 |
<li><div class="src-line"><a name="a714"></a> <span class="src-comm">// ALERTE - pas d'URL en cours</span></div></li>
|
|
|
728 |
<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>
|
|
|
729 |
<li><div class="src-line"><a name="a716"></a> <span class="src-sym">}</span></div></li>
|
|
|
730 |
<li><div class="src-line"><a name="a717"></a> </div></li>
|
|
|
731 |
<li><div class="src-line"><a name="a718"></a> <span class="src-comm">// On part d'une URL relative</span></div></li>
|
|
|
732 |
<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>
|
|
|
733 |
<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>
|
|
|
734 |
<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>
|
|
|
735 |
<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>
|
|
|
736 |
<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>
|
|
|
737 |
<li><div class="src-line"><a name="a724"></a> <span class="src-sym">}</span></div></li>
|
|
|
738 |
<li><div class="src-line"><a name="a725"></a> </div></li>
|
|
|
739 |
<li><div class="src-line"><a name="a726"></a> <span class="src-doc">/**</span></div></li>
|
|
|
740 |
<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>
|
|
|
741 |
<li><div class="src-line"><a name="a728"></a><span class="src-doc"> *</span></div></li>
|
|
|
742 |
<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>
|
|
|
743 |
<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>
|
|
|
744 |
<li><div class="src-line"><a name="a731"></a><span class="src-doc"> *</span></div></li>
|
|
|
745 |
<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>
|
|
|
746 |
<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>
|
|
|
747 |
<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>
|
|
|
748 |
<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>
|
|
|
749 |
<li><div class="src-line"><a name="a736"></a><span class="src-doc"> */</span></div></li>
|
|
|
750 |
<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>
|
|
|
751 |
<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>
|
|
|
752 |
<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>
|
|
|
753 |
<li><div class="src-line"><a name="a740"></a> <span class="src-sym">}</span></div></li>
|
|
|
754 |
<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>
|
|
|
755 |
<li><div class="src-line"><a name="a742"></a> <span class="src-sym">}</span></div></li>
|
|
|
756 |
<li><div class="src-line"><a name="a743"></a> </div></li>
|
|
|
757 |
<li><div class="src-line"><a name="a744"></a> <span class="src-doc">/**</span></div></li>
|
|
|
758 |
<li><div class="src-line"><a name="a745"></a><span class="src-doc"> * Renvoie la valeur de l'option specifiée.</span></div></li>
|
|
|
759 |
<li><div class="src-line"><a name="a746"></a><span class="src-doc"> *</span></div></li>
|
|
|
760 |
<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>
|
|
|
761 |
<li><div class="src-line"><a name="a748"></a><span class="src-doc"> *</span></div></li>
|
|
|
762 |
<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>
|
|
|
763 |
<li><div class="src-line"><a name="a750"></a><span class="src-doc"> */</span></div></li>
|
|
|
764 |
<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>
|
|
|
765 |
<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>
|
|
|
766 |
<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>
|
|
|
767 |
<li><div class="src-line"><a name="a754"></a> <span class="src-sym">}</span></div></li>
|
|
|
768 |
<li><div class="src-line"><a name="a755"></a> </div></li>
|
|
|
769 |
<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>
|
|
|
770 |
<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>
|
|
|
771 |
<li><div class="src-line"><a name="a758"></a> <span class="src-sym">}</span></div></li>
|
|
|
772 |
<li><div class="src-line"><a name="a759"></a><span class="src-sym">}</span></div></li>
|
|
|
773 |
</ol></div>
|
|
|
774 |
</div>
|
|
|
775 |
<p class="notes" id="credit">
|
|
|
776 |
Documentation generated on Thu, 04 Mar 2010 19:27:28 +0100 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.3</a>
|
|
|
777 |
</p>
|
|
|
778 |
</body>
|
|
|
779 |
</html>
|