Subversion Repositories Applications.framework

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
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 Debug.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 Debug.php</h1>
12
<p>Documentation is available at <a href="../Framework/_Debug.php.html">Debug.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">&lt;?php</span></div></li>
15
<li><div class="src-line"><a name="a2"></a><span class="src-comm">//&nbsp;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">&nbsp;*&nbsp;Classe&nbsp;fournissant&nbsp;des&nbsp;fonctions&nbsp;de&nbsp;débogage&nbsp;équivalante&nbsp;à&nbsp;var_dump&nbsp;et&nbsp;print_r.</span></div></li>
18
<li><div class="src-line"><a name="a5"></a><span class="src-doc">&nbsp;*&nbsp;L'affichage&nbsp;et&nbsp;l'utilisation&nbsp;de&nbsp;ces&nbsp;fonctions&nbsp;sont&nbsp;améliorés&nbsp;via&nbsp;cette&nbsp;classe.</span></div></li>
19
<li><div class="src-line"><a name="a6"></a><span class="src-doc">&nbsp;*&nbsp;Cette&nbsp;classe&nbsp;est&nbsp;inspirée&nbsp;de&nbsp;la&nbsp;classe&nbsp;Zend_Debug.</span></div></li>
20
<li><div class="src-line"><a name="a7"></a><span class="src-doc">&nbsp;*</span></div></li>
21
<li><div class="src-line"><a name="a8"></a><span class="src-doc">&nbsp;*&nbsp;PHP&nbsp;version&nbsp;5</span></div></li>
22
<li><div class="src-line"><a name="a9"></a><span class="src-doc">&nbsp;*</span></div></li>
23
<li><div class="src-line"><a name="a10"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@category</span><span class="src-doc">&nbsp;Debogage</span></div></li>
24
<li><div class="src-line"><a name="a11"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@package</span><span class="src-doc">&nbsp;Framework</span></div></li>
25
<li><div class="src-line"><a name="a12"></a><span class="src-doc">&nbsp;//&nbsp;Auteur&nbsp;principal&nbsp;:</span></div></li>
26
<li><div class="src-line"><a name="a13"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@author</span><span class="src-doc">&nbsp;Jean-Pascal&nbsp;MILCENT&nbsp;&lt;jpm@tela-botanica.org&gt;</span></div></li>
27
<li><div class="src-line"><a name="a14"></a><span class="src-doc">&nbsp;//&nbsp;Autres&nbsp;auteurs&nbsp;:</span></div></li>
28
<li><div class="src-line"><a name="a15"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@license</span><span class="src-doc">&nbsp;GPL&nbsp;v3&nbsp;&lt;http://www.gnu.org/licenses/gpl.txt&gt;</span></div></li>
29
<li><div class="src-line"><a name="a16"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@license</span><span class="src-doc">&nbsp;CECILL&nbsp;v2&nbsp;&lt;http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt&gt;</span></div></li>
30
<li><div class="src-line"><a name="a17"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@version</span><span class="src-doc">&nbsp;$$Id:&nbsp;Debug.php&nbsp;153&nbsp;2010-03-04&nbsp;10:48:32Z&nbsp;jpm&nbsp;$$</span></div></li>
31
<li><div class="src-line"><a name="a18"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@copyright</span><span class="src-doc">&nbsp;1999-2009&nbsp;Tela&nbsp;Botanica&nbsp;(accueil@tela-botanica.org)</span></div></li>
32
<li><div class="src-line"><a name="a19"></a><span class="src-doc">&nbsp;*/</span></div></li>
33
<li><div class="src-line"><a name="a20"></a><span class="src-key">class&nbsp;</span><a href="../Framework/Debug.html">Debug</a>&nbsp;<span class="src-sym">{</span></div></li>
34
<li><div class="src-line"><a name="a21"></a>&nbsp;</div></li>
35
<li><div class="src-line"><a name="a22"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
36
<li><div class="src-line"><a name="a23"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;mode&nbsp;de&nbsp;php&nbsp;(cli&nbsp;ou&nbsp;sapi)</span></div></li>
37
<li><div class="src-line"><a name="a24"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
38
<li><div class="src-line"><a name="a25"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">protected&nbsp;</span><span class="src-key">static&nbsp;</span><span class="src-var">$mode&nbsp;</span>=&nbsp;<span class="src-id">null</span><span class="src-sym">;</span></div></li>
39
<li><div class="src-line"><a name="a26"></a>&nbsp;</div></li>
40
<li><div class="src-line"><a name="a27"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
41
<li><div class="src-line"><a name="a28"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Accesseur&nbsp;pour&nbsp;le&nbsp;mode</span></div></li>
42
<li><div class="src-line"><a name="a29"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc">le&nbsp;mode&nbsp;de&nbsp;php</span></div></li>
43
<li><div class="src-line"><a name="a30"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
44
<li><div class="src-line"><a name="a31"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">static&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Framework/Debug.html#methodgetMode">getMode</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
45
<li><div class="src-line"><a name="a32"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(</span><span class="src-id">self</span><span class="src-sym">::</span><span class="src-var">$mode&nbsp;</span>===&nbsp;<span class="src-id">null</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
46
<li><div class="src-line"><a name="a33"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-id">self</span><span class="src-sym">::</span><span class="src-var">$mode&nbsp;</span>=&nbsp;<span class="src-id">PHP_SAPI</span><span class="src-sym">;</span></div></li>
47
<li><div class="src-line"><a name="a34"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
48
<li><div class="src-line"><a name="a35"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-id">self</span><span class="src-sym">::</span><span class="src-var">$mode</span><span class="src-sym">;</span></div></li>
49
<li><div class="src-line"><a name="a36"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
50
<li><div class="src-line"><a name="a37"></a>&nbsp;</div></li>
51
<li><div class="src-line"><a name="a38"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
52
<li><div class="src-line"><a name="a39"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Equivalent&nbsp;de&nbsp;var_dump</span></div></li>
53
<li><div class="src-line"><a name="a40"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">mixed&nbsp;</span><span class="src-doc-var">$variable&nbsp;</span><span class="src-doc">la&nbsp;variable&nbsp;à&nbsp;dumper</span></div></li>
54
<li><div class="src-line"><a name="a41"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$mot_cle&nbsp;</span><span class="src-doc">le&nbsp;mot&nbsp;cle&nbsp;à&nbsp;associer&nbsp;à&nbsp;la&nbsp;variable</span></div></li>
55
<li><div class="src-line"><a name="a42"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">boolean&nbsp;</span><span class="src-doc-var">$echo&nbsp;</span><span class="src-doc">si&nbsp;true&nbsp;on&nbsp;affiche&nbsp;le&nbsp;résultat,&nbsp;si&nbsp;false&nbsp;on&nbsp;ne&nbsp;renvoie&nbsp;que&nbsp;la&nbsp;chaine&nbsp;sans&nbsp;l'afficher</span></div></li>
56
<li><div class="src-line"><a name="a43"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc">la&nbsp;chaine&nbsp;à&nbsp;afficher&nbsp;representant&nbsp;le&nbsp;dump&nbsp;ou&nbsp;null&nbsp;si&nbsp;echo</span></div></li>
57
<li><div class="src-line"><a name="a44"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
58
<li><div class="src-line"><a name="a45"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">static&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Framework/Debug.html#methoddump">dump</a><span class="src-sym">(</span><span class="src-var">$variable</span><span class="src-sym">,&nbsp;</span><span class="src-var">$mot_cle&nbsp;</span>=&nbsp;<span class="src-id">null</span><span class="src-sym">,&nbsp;</span><span class="src-var">$echo&nbsp;</span>=&nbsp;<span class="src-id">true</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
59
<li><div class="src-line"><a name="a46"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;var_dump&nbsp;de&nbsp;la&nbsp;variable&nbsp;dans&nbsp;un&nbsp;buffer&nbsp;et&nbsp;récupération&nbsp;de&nbsp;la&nbsp;sortie</span></div></li>
60
<li><div class="src-line"><a name="a47"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-id">ob_start</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
61
<li><div class="src-line"><a name="a48"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/var_dump">var_dump</a><span class="src-sym">(</span><span class="src-var">$variable</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
62
<li><div class="src-line"><a name="a49"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$sortie&nbsp;</span>=&nbsp;<a href="http://www.php.net/ob_get_clean">ob_get_clean</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
63
<li><div class="src-line"><a name="a50"></a>&nbsp;</div></li>
64
<li><div class="src-line"><a name="a51"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Pré-traitement&nbsp;de&nbsp;la&nbsp;sortie</span></div></li>
65
<li><div class="src-line"><a name="a52"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$sortie&nbsp;</span>=&nbsp;<a href="http://www.php.net/preg_replace">preg_replace</a><span class="src-sym">(</span><span class="src-str">&quot;/\]\=\&gt;\n(\s+)/m&quot;</span><span class="src-sym">,&nbsp;</span><span class="src-str">&quot;]&nbsp;=&gt;&nbsp;&quot;</span><span class="src-sym">,&nbsp;</span><span class="src-var">$sortie</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
66
<li><div class="src-line"><a name="a53"></a>&nbsp;</div></li>
67
<li><div class="src-line"><a name="a54"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Traitement&nbsp;général&nbsp;du&nbsp;débogage</span></div></li>
68
<li><div class="src-line"><a name="a55"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-id">self</span><span class="src-sym">::</span><span class="src-id">traiterDebogage</span><span class="src-sym">(</span><span class="src-var">$mot_cle</span><span class="src-sym">,&nbsp;</span><span class="src-var">$sortie</span><span class="src-sym">,&nbsp;</span><span class="src-var">$echo</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
69
<li><div class="src-line"><a name="a56"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
70
<li><div class="src-line"><a name="a57"></a>&nbsp;</div></li>
71
<li><div class="src-line"><a name="a58"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
72
<li><div class="src-line"><a name="a59"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Equivalent&nbsp;de&nbsp;print_r</span></div></li>
73
<li><div class="src-line"><a name="a60"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">mixed&nbsp;</span><span class="src-doc-var">$variable&nbsp;</span><span class="src-doc">la&nbsp;variable&nbsp;à&nbsp;afficher</span></div></li>
74
<li><div class="src-line"><a name="a61"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$mot_cle&nbsp;</span><span class="src-doc">le&nbsp;mot&nbsp;cle&nbsp;à&nbsp;associer</span></div></li>
75
<li><div class="src-line"><a name="a62"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">boolean&nbsp;</span><span class="src-doc-var">$echo&nbsp;</span><span class="src-doc">faire&nbsp;un&nbsp;echo&nbsp;ou&nbsp;non</span></div></li>
76
<li><div class="src-line"><a name="a63"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc">la&nbsp;chaine&nbsp;contenant&nbsp;la&nbsp;variable&nbsp;printée&nbsp;ou&nbsp;null&nbsp;si&nbsp;echo</span></div></li>
77
<li><div class="src-line"><a name="a64"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
78
<li><div class="src-line"><a name="a65"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">static&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Framework/Debug.html#methodprintr">printr</a><span class="src-sym">(</span><span class="src-var">$variable</span><span class="src-sym">,&nbsp;</span><span class="src-var">$mot_cle&nbsp;</span>=&nbsp;<span class="src-id">null</span><span class="src-sym">,&nbsp;</span><span class="src-var">$echo&nbsp;</span>=&nbsp;<span class="src-id">true</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
79
<li><div class="src-line"><a name="a66"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Récupération&nbsp;de&nbsp;la&nbsp;sortie</span></div></li>
80
<li><div class="src-line"><a name="a67"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$sortie&nbsp;</span>=&nbsp;<a href="http://www.php.net/print_r">print_r</a><span class="src-sym">(</span><span class="src-var">$variable</span><span class="src-sym">,&nbsp;</span><span class="src-id">true</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
81
<li><div class="src-line"><a name="a68"></a>&nbsp;</div></li>
82
<li><div class="src-line"><a name="a69"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Traitement&nbsp;général&nbsp;du&nbsp;débogage</span></div></li>
83
<li><div class="src-line"><a name="a70"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-id">self</span><span class="src-sym">::</span><span class="src-id">traiterDebogage</span><span class="src-sym">(</span><span class="src-var">$mot_cle</span><span class="src-sym">,&nbsp;</span><span class="src-var">$sortie</span><span class="src-sym">,&nbsp;</span><span class="src-var">$echo</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
84
<li><div class="src-line"><a name="a71"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
85
<li><div class="src-line"><a name="a72"></a>&nbsp;</div></li>
86
<li><div class="src-line"><a name="a73"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
87
<li><div class="src-line"><a name="a74"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Traite&nbsp;une&nbsp;chaine&nbsp;de&nbsp;débogage&nbsp;et&nbsp;les&nbsp;mots&nbsp;clés&nbsp;associés</span></div></li>
88
<li><div class="src-line"><a name="a75"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc">&nbsp;</span><span class="src-doc-var">$mot_cle&nbsp;</span><span class="src-doc">le&nbsp;mot&nbsp;à&nbsp;associer&nbsp;à&nbsp;la&nbsp;chaine</span></div></li>
89
<li><div class="src-line"><a name="a76"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc">&nbsp;</span><span class="src-doc-var">$sortie&nbsp;</span><span class="src-doc">le&nbsp;chaine&nbsp;de&nbsp;debogage</span></div></li>
90
<li><div class="src-line"><a name="a77"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">boolean&nbsp;</span><span class="src-doc-var">$echo&nbsp;</span><span class="src-doc">faire&nbsp;un&nbsp;echo&nbsp;du&nbsp;resultat&nbsp;ou&nbsp;non</span></div></li>
91
<li><div class="src-line"><a name="a78"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc">la&nbsp;chaine&nbsp;de&nbsp;debogage&nbsp;formatée&nbsp;ou&nbsp;bien&nbsp;null&nbsp;si&nbsp;echo</span></div></li>
92
<li><div class="src-line"><a name="a79"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
93
<li><div class="src-line"><a name="a80"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">private&nbsp;</span><span class="src-key">static&nbsp;</span><span class="src-key">function&nbsp;</span><span class="src-id">traiterDebogage</span><span class="src-sym">(</span><span class="src-var">$mot_cle</span><span class="src-sym">,&nbsp;</span><span class="src-var">$sortie</span><span class="src-sym">,&nbsp;</span><span class="src-var">$echo</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
94
<li><div class="src-line"><a name="a81"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Formate&nbsp;le&nbsp;mot-clé</span></div></li>
95
<li><div class="src-line"><a name="a82"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$mot_cle&nbsp;</span>=&nbsp;<span class="src-id">self</span><span class="src-sym">::</span><span class="src-id">formaterMotCle</span><span class="src-sym">(</span><span class="src-var">$mot_cle</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
96
<li><div class="src-line"><a name="a83"></a>&nbsp;</div></li>
97
<li><div class="src-line"><a name="a84"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Traitement&nbsp;de&nbsp;la&nbsp;sortie</span></div></li>
98
<li><div class="src-line"><a name="a85"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$sortie&nbsp;</span>=&nbsp;<span class="src-id">self</span><span class="src-sym">::</span><span class="src-id">traiterSortieSuivantMode</span><span class="src-sym">(</span><span class="src-var">$mot_cle</span><span class="src-sym">,&nbsp;</span><span class="src-var">$sortie</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
99
<li><div class="src-line"><a name="a86"></a>&nbsp;</div></li>
100
<li><div class="src-line"><a name="a87"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Affichage&nbsp;et/ou&nbsp;retour</span></div></li>
101
<li><div class="src-line"><a name="a88"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(</span><span class="src-var">$echo</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
102
<li><div class="src-line"><a name="a89"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;<span class="src-var">$sortie</span><span class="src-sym">;</span></div></li>
103
<li><div class="src-line"><a name="a90"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-id">null</span><span class="src-sym">;</span></div></li>
104
<li><div class="src-line"><a name="a91"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}&nbsp;</span><span class="src-key">else&nbsp;</span><span class="src-sym">{</span></div></li>
105
<li><div class="src-line"><a name="a92"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$sortie</span><span class="src-sym">;</span></div></li>
106
<li><div class="src-line"><a name="a93"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
107
<li><div class="src-line"><a name="a94"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
108
<li><div class="src-line"><a name="a95"></a>&nbsp;</div></li>
109
<li><div class="src-line"><a name="a96"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
110
<li><div class="src-line"><a name="a97"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;formate&nbsp;un&nbsp;mot&nbsp;clé&nbsp;donné</span></div></li>
111
<li><div class="src-line"><a name="a98"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$mot_cle&nbsp;</span><span class="src-doc">le&nbsp;mot&nbsp;clé&nbsp;à&nbsp;formaté</span></div></li>
112
<li><div class="src-line"><a name="a99"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc">le&nbsp;mot&nbsp;clé&nbsp;formaté&nbsp;ou&nbsp;bien&nbsp;un&nbsp;chaine&nbsp;vide&nbsp;le&nbsp;mot&nbsp;clé&nbsp;est&nbsp;null&nbsp;ou&nbsp;vide</span></div></li>
113
<li><div class="src-line"><a name="a100"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
114
<li><div class="src-line"><a name="a101"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">private&nbsp;</span><span class="src-key">static&nbsp;</span><span class="src-key">function&nbsp;</span><span class="src-id">formaterMotCle</span><span class="src-sym">(</span><span class="src-var">$mot_cle</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
115
<li><div class="src-line"><a name="a102"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-sym">(</span><span class="src-var">$mot_cle&nbsp;</span>===&nbsp;<span class="src-id">null</span><span class="src-sym">)&nbsp;</span>?&nbsp;<span class="src-str">''&nbsp;</span>:&nbsp;<a href="http://www.php.net/rtrim">rtrim</a><span class="src-sym">(</span><span class="src-var">$mot_cle</span><span class="src-sym">)</span>.<span class="src-str">'&nbsp;'</span><span class="src-sym">;</span></div></li>
116
<li><div class="src-line"><a name="a103"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
117
<li><div class="src-line"><a name="a104"></a>&nbsp;</div></li>
118
<li><div class="src-line"><a name="a105"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
119
<li><div class="src-line"><a name="a106"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;traite&nbsp;la&nbsp;sortie&nbsp;de&nbsp;la&nbsp;chaine&nbsp;de&nbsp;débogage&nbsp;suivant&nbsp;le&nbsp;mode&nbsp;de&nbsp;php</span></div></li>
120
<li><div class="src-line"><a name="a107"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$mot_cle&nbsp;</span><span class="src-doc">le&nbsp;mot&nbsp;clé&nbsp;associé&nbsp;à&nbsp;la&nbsp;chaine</span></div></li>
121
<li><div class="src-line"><a name="a108"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc">&nbsp;</span><span class="src-doc-var">$sortie&nbsp;</span><span class="src-doc">la&nbsp;chaine&nbsp;de&nbsp;débogage</span></div></li>
122
<li><div class="src-line"><a name="a109"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc">la&nbsp;sortie&nbsp;formatée&nbsp;pour&nbsp;le&nbsp;mode&nbsp;en&nbsp;cours</span></div></li>
123
<li><div class="src-line"><a name="a110"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
124
<li><div class="src-line"><a name="a111"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">private&nbsp;</span><span class="src-key">static&nbsp;</span><span class="src-key">function&nbsp;</span><span class="src-id">traiterSortieSuivantMode</span><span class="src-sym">(</span><span class="src-var">$mot_cle</span><span class="src-sym">,&nbsp;</span><span class="src-var">$sortie</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
125
<li><div class="src-line"><a name="a112"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$corps&nbsp;</span>=&nbsp;<span class="src-var">$mot_cle</span>.<span class="src-id">PHP_EOL</span>.<span class="src-var">$sortie</span><span class="src-sym">;</span></div></li>
126
<li><div class="src-line"><a name="a113"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(</span><span class="src-id">self</span><span class="src-sym">::</span><span class="src-id">getMode</span><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span>==&nbsp;<span class="src-str">'cli'</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
127
<li><div class="src-line"><a name="a114"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$sortie&nbsp;</span>=&nbsp;<span class="src-id">PHP_EOL</span>.<span class="src-var">$corps</span>.<span class="src-id">PHP_EOL</span><span class="src-sym">;</span></div></li>
128
<li><div class="src-line"><a name="a115"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}&nbsp;</span><span class="src-key">else&nbsp;</span><span class="src-sym">{</span></div></li>
129
<li><div class="src-line"><a name="a116"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$sortie&nbsp;</span>=&nbsp;<span class="src-str">'&lt;pre&gt;'</span>.<span class="src-var">$corps</span>.<span class="src-str">'&lt;/pre&gt;'</span><span class="src-sym">;</span></div></li>
130
<li><div class="src-line"><a name="a117"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
131
<li><div class="src-line"><a name="a118"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$sortie</span><span class="src-sym">;</span></div></li>
132
<li><div class="src-line"><a name="a119"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
133
<li><div class="src-line"><a name="a120"></a><span class="src-sym">}</span></div></li>
134
<li><div class="src-line"><a name="a121"></a><span class="src-php">?&gt;</span></div></li>
135
</ol></div>
136
</div>
137
	<p class="notes" id="credit">
138
		Documentation generated on Thu, 04 Mar 2010 19:27:21 +0100 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.3</a>
139
	</p>
140
	</body>
141
</html>