Subversion Repositories Applications.framework

Compare Revisions

No changes between revisions

Ignore whitespace Rev 467 → Rev 476

/branches/v0.2-buhl/doc/PhpDoc/phpdoc-cache-52/phpdoc-cache-file_95ac810071946135cd004f6a2d287311.dat
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/branches/v0.2-buhl/doc/PhpDoc/files/SquelettePhp.php.txt
4,17 → 4,15
* Classe SquelettePhp, traitant les squelette Php utilisant la syntaxe courte php ou pas.
* Ces méthodes sont statiques.
*
* @category php5
* @category PHP 5.2
* @package Framework
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
* @copyright 2010 Tela-Botanica
* @license http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
* @license http://www.gnu.org/licenses/gpl.html Licence GNU-GPL
* @version SVN: $$Id: SquelettePhp.php 153 2010-03-04 10:48:32Z jpm $$
* @link /doc/framework/
* @copyright Copyright (c) 2009, Tela Botanica (accueil@tela-botanica.org)
* @license GNU-GPL-v3 <http://www.gnu.org/licenses/gpl.html>
* @license CECILL-v2 <http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt>
*/
class SquelettePhp {
 
/**
* Fonction prenant en paramètre un chemin de fichier squelette et un tableau associatif de données,
* en extrait les variables, charge le squelette et retourne le résultat des deux combinés.
54,7 → 52,7
// Retourne le contenu
return $sortie;
}
 
/**
* Fonction chargeant le contenu du squelette et remplaçant les tags court php (<?= ...) par un tag long avec echo.
*
/branches/v0.2-buhl/doc/PhpDoc/files/Registre.php.txt
4,17 → 4,12
* Classe registre, qui permet un accès à différentes variables à travers les autres classes.
* C'est un singleton
*
* PHP Version 5
*
* @category Class
* @package Framework
* @author Jean-Pascal Milcent <jmp@tela-botanica.org>
* @copyright 2009 Tela-Botanica
* @license http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
* @license http://www.gnu.org/licenses/gpl.html Licence GNU-GPL
* @version SVN: $$Id: Registre.php 120 2009-09-01 12:21:14Z aurelien $$
* @link /doc/framework/
*
* @category PHP 5.2
* @package Framework
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
* @copyright Copyright (c) 2009, Tela Botanica (accueil@tela-botanica.org)
* @license GNU-GPL-v3 <http://www.gnu.org/licenses/gpl.html>
* @license CECILL-v2 <http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt>
*/
class Registre {
 
/branches/v0.2-buhl/doc/PhpDoc/files/Chronometre.php.txt
1,32 → 1,25
<?php
// declare(encoding='UTF-8');
/** Classe Chronometre() - Permet de stocker et d'afficher
* les temps d'éxécution de script.
/** Classe Chronometre() - Permet de stocker et d'afficher les temps d'éxécution de script.
*
* Cette classe permet de réaliser un ensemble
* de mesure de temps prises à
* différents endroits d'un script.
* Ces mesures peuvent ensuite être affichées au
* sein d'un tableau XHTML.
* Cette classe permet de réaliser un ensemble de mesure de temps prises à différents endroits d'un script.
* Ces mesures peuvent ensuite être affichées au sein d'un tableau XHTML.
*
*
* PHP Version 5
*
* @category PHP
* @package Framework
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
* @copyright 2009 Tela-Botanica
* @license http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
* @version Release: <package_version>
* @link /doc/framework/
* @category PHP 5.2
* @package Framework
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
* @copyright Copyright (c) 2009, Tela Botanica (accueil@tela-botanica.org)
* @license GNU-GPL-v3 <http://www.gnu.org/licenses/gpl.html>
* @license CECILL-v2 <http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt>
*/
class Chronometre {
/*** Attributs : ***/
private $_temps = array();
private static $instance = null;
private static $temps = array();
 
/** Constructeur : **/
public function __construct() {
$this->setTemps(array('depart' => microtime()));
private function __construct() {
self::setTemps('depart', microtime());
}
 
/** Accesseurs :
35,12 → 28,12
*
* @return int le temps écoulé
*/
public function getTemps($cle = null) {
private static function getTemps($cle = null) {
$temps = '';
if (!is_null($cle)) {
$temps = $this->_temps[$cle];
$temps = self::$temps[$cle];
} else {
$temps = $this->_temps;
$temps = self::$temps;
}
return $temps;
}
51,39 → 44,46
*
* @return null
*/
public function setTemps($moment = array ()) {
array_push($this->_temps, $moment);
private static function setTemps($cle, $moment) {
array_push(self::$temps, array($cle => $moment));
}
 
/*** Méthodes : ***/
 
/** Méthode afficherChrono() -
/**
* Effectue un chronometrage.
*
* @param string le nom du point de chronométrage
* @return null
*/
public static function chrono($cle) {
$moment = microtime();
self::verifierCreationInstance();
self::setTemps($cle, $moment);
}
 
/**
* Permet d'afficher les temps d'éxécution de différentes parties d'un script.
*
* Cette fonction permet d'afficher un ensemble de
* mesure de temps prises à différents endroits d'un script.
* Ces mesures sont affichées au sein d'un tableau XHTML
* dont on peut controler l'indentation des balises.
* Pour un site en production, il suffit d'ajouter un style
* #chrono {display:none;} dans la css. De cette façon,
* le tableau ne s'affichera pas. Le webmaster lui pourra
* rajouter sa propre feuille de style affichant le tableau.
* Cette fonction permet d'afficher un ensemble de mesure de temps prises à différents endroits d'un script.
* Ces mesures sont affichées au sein d'un tableau XHTML dont on peut controler l'indentation des balises.
* Pour un site en production, il suffit d'ajouter un style #chrono {display:none;} dans la css.
* De cette façon, le tableau ne s'affichera pas. Le webmaster lui pourra rajouter sa propre feuille de style
* affichant le tableau.
* Le développeur initial de cette fonction est Loic d'Anterroches.
* Elle a été modifiée par Jean-Pascal Milcent.
* Elle utilise une variable gobale : $_CHRONO_
*
* @author Loic d'Anterroches
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
*
* @param int $indentation_origine l'indentation de base.
* @param int $indentation le pas d'indentation.
* @return string la chaine XHTML de mesure des temps.
*/
public function afficherChrono($indentation_origine = 8, $indentation = 4) {
public static function afficherChrono($indentation_origine = 8, $indentation = 4) {
self::verifierCreationInstance();
// Création du chrono de fin
$GLOBALS['_SCRIPT_']['chrono']->setTemps(array (
'fin' => microtime()
));
self::setTemps('fin', microtime());
 
// Début création de l'affichage
$sortie = str_repeat(' ', $indentation_origine) .
105,13 → 105,13
$total_tps_ecoule = 0;
 
// Récupération de la premiére mesure
$tab_depart = & $this->getTemps(0);
$tab_depart = self::getTemps(0);
list ($usec, $sec) = explode(' ', $tab_depart['depart']);
 
// Ce temps correspond à tps_fin
$tps_debut = ((float) $usec + (float) $sec);
 
foreach ($this->getTemps() as $tab_temps) {
foreach (self::getTemps() as $tab_temps) {
foreach ($tab_temps as $cle => $valeur) {
list ($usec, $sec) = explode(' ', $valeur);
$tps_fin = ((float) $usec + (float) $sec);
148,5 → 148,14
 
return $sortie;
}
 
/**
* Vérifie si l'instance de classe à été crée, si non la crée
*/
private static function verifierCreationInstance() {
if (empty(self::$instance)) {
self::$instance = new Chronometre();
}
}
}
?>
/branches/v0.2-buhl/doc/PhpDoc/files/Debug.php.txt
5,20 → 5,18
* L'affichage et l'utilisation de ces fonctions sont améliorés via cette classe.
* Cette classe est inspirée de la classe Zend_Debug.
*
* PHP version 5
*
* @category Debogage
* @package Framework
// Auteur principal :
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
// Autres auteurs :
* @license GPL v3 <http://www.gnu.org/licenses/gpl.txt>
* @license CECILL v2 <http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt>
* @version $$Id: Debug.php 167 2010-03-19 17:12:08Z jpm $$
* @copyright 1999-2009 Tela Botanica (accueil@tela-botanica.org)
* @category PHP 5.2
* @package Framework
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
* @copyright Copyright (c) 2009, Tela Botanica (accueil@tela-botanica.org)
* @license GNU-GPL-v3 <http://www.gnu.org/licenses/gpl.html>
* @license CECILL-v2 <http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt>
*/
class Debug {
 
const MODE_ECHO = 'echo';
const MODE_NOTICE = 'e_user_notice';
 
/**
* mode de php (cli ou sapi)
*/
42,7 → 40,7
* @param boolean $echo si true on affiche le résultat, si false on ne renvoie que la chaine sans l'afficher
* @return string la chaine à afficher representant le dump ou null si echo
*/
public static function dump($variable, $mot_cle = null, $echo = true) {
public static function dump($variable, $mot_cle = null, $echo = false) {
// var_dump de la variable dans un buffer et récupération de la sortie
ob_start();
var_dump($variable);
56,13 → 54,13
}
 
/**
* Equivalent de print_r
* Equivalent de print_r.
* @param mixed $variable la variable à afficher
* @param string $mot_cle le mot cle à associer
* @param boolean $echo faire un echo ou non
* @return string la chaine contenant la variable printée ou null si echo
*/
public static function printr($variable, $mot_cle = null, $echo = true) {
public static function printr($variable, $mot_cle = null, $echo = false) {
// Récupération de la sortie
$sortie = print_r($variable, true);
 
85,10 → 83,14
$sortie = self::traiterSortieSuivantMode($mot_cle, $sortie);
 
// Affichage et/ou retour
self::verifierParametresConfig();
if (Config::get('fw_debogage') == true) {
if ($echo) {
if ($echo === true || Config::get('fw_debogage_mode') == self::MODE_ECHO) {
echo $sortie;
return null;
} else if (Config::get('fw_debogage_mode') == self::MODE_NOTICE) {
trigger_error($sortie, E_USER_NOTICE);
return null;
} else {
return $sortie;
}
119,5 → 121,23
}
return $sortie;
}
 
/**
* Vérifie que tous les paramêtres de config nécessaires au fonctionnement de cette classe existe dans les fichiers
* de configurations.
*/
private static function verifierParametresConfig() {
$ok = true;
$parametres = array('fw_debogage', 'fw_debogage_mode');
foreach ($parametres as $param) {
if (is_null(Config::get($param))) {
$classe = get_class();
$m = "L'utilisation de la classe $classe nécessite de définir '$param' dans un fichier de configuration.";
trigger_error($m, E_USER_WARNING);
$ok = false;
}
}
return $ok;
}
}
?>
/branches/v0.2-buhl/doc/PhpDoc/files/Url.php.html
113,12 → 113,12
<ul class="dropdown-menu">
<li>
<a href="../reports/errors.html">
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">54</span>
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">70</span>
</a>
</li>
<li>
<a href="../reports/markers.html">
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">0</span>
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">0</span>
</a>
</li>
</ul>
138,10 → 138,10
<div class="accordion" style="margin-bottom: 0">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-1374440870"></a>
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-2010076840"></a>
<a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
</div>
<div id="namespace-1374440870" class="accordion-body collapse in">
<div id="namespace-2010076840" class="accordion-body collapse in">
<div class="accordion-inner">
 
154,6 → 154,7
<li class="class"><a href="../classes/GestionnaireException.html">GestionnaireException</a></li>
<li class="class"><a href="../classes/Modele.html">Modele</a></li>
<li class="class"><a href="../classes/Registre.html">Registre</a></li>
<li class="class"><a href="../classes/I18n.html">I18n</a></li>
<li class="class"><a href="../classes/Config.html">Config</a></li>
<li class="class"><a href="../classes/Application.html">Application</a></li>
<li class="class"><a href="../classes/Log.html">Log</a></li>
252,7 → 253,7
<section class="span10 offset1">
<hr />
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
on March 12th, 2014 at 16:55.
on March 18th, 2014 at 19:19.
</section>
</section>
</section>
/branches/v0.2-buhl/doc/PhpDoc/files/Application.php.html
113,12 → 113,12
<ul class="dropdown-menu">
<li>
<a href="../reports/errors.html">
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">54</span>
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">70</span>
</a>
</li>
<li>
<a href="../reports/markers.html">
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">0</span>
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">0</span>
</a>
</li>
</ul>
138,10 → 138,10
<div class="accordion" style="margin-bottom: 0">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-282241088"></a>
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-1889817542"></a>
<a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
</div>
<div id="namespace-282241088" class="accordion-body collapse in">
<div id="namespace-1889817542" class="accordion-body collapse in">
<div class="accordion-inner">
 
154,6 → 154,7
<li class="class"><a href="../classes/GestionnaireException.html">GestionnaireException</a></li>
<li class="class"><a href="../classes/Modele.html">Modele</a></li>
<li class="class"><a href="../classes/Registre.html">Registre</a></li>
<li class="class"><a href="../classes/I18n.html">I18n</a></li>
<li class="class"><a href="../classes/Config.html">Config</a></li>
<li class="class"><a href="../classes/Application.html">Application</a></li>
<li class="class"><a href="../classes/Log.html">Log</a></li>
252,7 → 253,7
<section class="span10 offset1">
<hr />
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
on March 12th, 2014 at 16:55.
on March 18th, 2014 at 19:19.
</section>
</section>
</section>
/branches/v0.2-buhl/doc/PhpDoc/files/Config.php.html
113,12 → 113,12
<ul class="dropdown-menu">
<li>
<a href="../reports/errors.html">
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">54</span>
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">70</span>
</a>
</li>
<li>
<a href="../reports/markers.html">
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">0</span>
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">0</span>
</a>
</li>
</ul>
138,10 → 138,10
<div class="accordion" style="margin-bottom: 0">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-136517501"></a>
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-597024655"></a>
<a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
</div>
<div id="namespace-136517501" class="accordion-body collapse in">
<div id="namespace-597024655" class="accordion-body collapse in">
<div class="accordion-inner">
 
154,6 → 154,7
<li class="class"><a href="../classes/GestionnaireException.html">GestionnaireException</a></li>
<li class="class"><a href="../classes/Modele.html">Modele</a></li>
<li class="class"><a href="../classes/Registre.html">Registre</a></li>
<li class="class"><a href="../classes/I18n.html">I18n</a></li>
<li class="class"><a href="../classes/Config.html">Config</a></li>
<li class="class"><a href="../classes/Application.html">Application</a></li>
<li class="class"><a href="../classes/Log.html">Log</a></li>
252,7 → 253,7
<section class="span10 offset1">
<hr />
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
on March 12th, 2014 at 16:55.
on March 18th, 2014 at 19:19.
</section>
</section>
</section>
/branches/v0.2-buhl/doc/PhpDoc/files/Modele.php.html
113,12 → 113,12
<ul class="dropdown-menu">
<li>
<a href="../reports/errors.html">
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">54</span>
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">70</span>
</a>
</li>
<li>
<a href="../reports/markers.html">
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">0</span>
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">0</span>
</a>
</li>
</ul>
138,10 → 138,10
<div class="accordion" style="margin-bottom: 0">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-44830500"></a>
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-364808530"></a>
<a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
</div>
<div id="namespace-44830500" class="accordion-body collapse in">
<div id="namespace-364808530" class="accordion-body collapse in">
<div class="accordion-inner">
 
154,6 → 154,7
<li class="class"><a href="../classes/GestionnaireException.html">GestionnaireException</a></li>
<li class="class"><a href="../classes/Modele.html">Modele</a></li>
<li class="class"><a href="../classes/Registre.html">Registre</a></li>
<li class="class"><a href="../classes/I18n.html">I18n</a></li>
<li class="class"><a href="../classes/Config.html">Config</a></li>
<li class="class"><a href="../classes/Application.html">Application</a></li>
<li class="class"><a href="../classes/Log.html">Log</a></li>
252,7 → 253,7
<section class="span10 offset1">
<hr />
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
on March 12th, 2014 at 16:55.
on March 18th, 2014 at 19:19.
</section>
</section>
</section>
/branches/v0.2-buhl/doc/PhpDoc/files/GestionnaireException.php.html
113,12 → 113,12
<ul class="dropdown-menu">
<li>
<a href="../reports/errors.html">
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">54</span>
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">70</span>
</a>
</li>
<li>
<a href="../reports/markers.html">
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">0</span>
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">0</span>
</a>
</li>
</ul>
138,10 → 138,10
<div class="accordion" style="margin-bottom: 0">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-1175767752"></a>
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-137626116"></a>
<a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
</div>
<div id="namespace-1175767752" class="accordion-body collapse in">
<div id="namespace-137626116" class="accordion-body collapse in">
<div class="accordion-inner">
 
154,6 → 154,7
<li class="class"><a href="../classes/GestionnaireException.html">GestionnaireException</a></li>
<li class="class"><a href="../classes/Modele.html">Modele</a></li>
<li class="class"><a href="../classes/Registre.html">Registre</a></li>
<li class="class"><a href="../classes/I18n.html">I18n</a></li>
<li class="class"><a href="../classes/Config.html">Config</a></li>
<li class="class"><a href="../classes/Application.html">Application</a></li>
<li class="class"><a href="../classes/Log.html">Log</a></li>
252,7 → 253,7
<section class="span10 offset1">
<hr />
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
on March 12th, 2014 at 16:55.
on March 18th, 2014 at 19:19.
</section>
</section>
</section>
/branches/v0.2-buhl/doc/PhpDoc/files/Controleur.php.txt
5,21 → 5,18
* qui devrait être appelée de l'extérieur.
* Elle est abstraite donc doit obligatoirement être étendue.
*
* @category php5
* @category PHP 5.2
* @package Framework
* @author Aurélien PERONNET <aurelien@tela-botanica.org>
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
* @copyright 2009 Tela-Botanica
* @license http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
* @license http://www.gnu.org/licenses/gpl.html Licence GNU-GPL
* @version SVN: $Id: Controleur.php 191 2010-04-29 15:34:49Z jpm $
* @link /doc/framework/
*
* @copyright Copyright (c) 2009, Tela Botanica (accueil@tela-botanica.org)
* @license GNU-GPL-v3 <http://www.gnu.org/licenses/gpl.html>
* @license CECILL-v2 <http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt>
*/
abstract class Controleur {
/** Variable statique indiquant que les tableaux _GET et _POST ont déjà été encodé au format de l'appli. */
private static $encodage = false;
 
/** Registre global, normalement accessible partout */
private $registre;
 
113,9 → 110,35
$_GET = $this->encoderTableau($_GET, Config::get('appli_encodage'), Config::get('sortie_encodage'));
self::$encodage = true;
}
 
// traitement des magic quotes
$this->verifierEtTraiterSlashTableauRequete();
}
 
/**
* Procédure vérifiant l'activation des magic quotes et remplace les slash dans les tableaux de requete
*/
private function verifierEtTraiterSlashTableauRequete() {
 
if ( get_magic_quotes_gpc() ) {
 
if (!function_exists('stripslashes_deep')) {
function stripslashes_deep( $value ) {
 
return ( is_array($value) )
? array_map('stripslashes_deep', $value)
: stripslashes($value);
 
} // end of 'stripslashes_deep()'
 
$_GET = array_map('stripslashes_deep', $_GET);
$_POST = array_map('stripslashes_deep', $_POST);
$_COOKIE = array_map('stripslashes_deep', $_COOKIE);
}
}
}
 
/**
* Fonction récursive transcodant toutes les valeurs d'un tableau de leur encodage d'entrée vers un encodage de sortie donné
* @param $tableau Array Un tableau de données à encoder
* @param $encodage_sortie String l'encodage vers lequel on doit transcoder
/branches/v0.2-buhl/doc/PhpDoc/files/Url.php.txt
1,23 → 1,18
<?php
// declare(encoding='UTF-8');
/**
* classe Url, gérant le découpage des paramètres, leurs modification etc...
* Traduction et conversion d'une classe (NET_Url2) issue de Pear
*
* @category Php5
* @package Framework
// Auteur principal
* @author Christian Schmidt <schmidt@php.net>
// Autre auteurs
* @author Aurélien PERONNET <aurelien@tela-botanica.org>
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
* @copyright 2009 Tela-Botanica
* @license http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
* @license http://www.gnu.org/licenses/gpl.html Licence GNU-GPL
* @version SVN: $Id: Url.php 171 2010-03-23 11:23:38Z jpm $
* @link /doc/framework/
*
*/
* classe Url, gérant le découpage des paramètres, leurs modification etc...
* Traduction et conversion d'une classe (NET_Url2) issue de Pear
*
* @category PHP 5.2
* @package Framework
* @author Christian SCHMIDT<schmidt@php.net>
* @author Aurélien PERONNET <aurelien@tela-botanica.org>
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
* @copyright Copyright (c) 2009, Tela Botanica (accueil@tela-botanica.org)
* @license GNU-GPL-v3 <http://www.gnu.org/licenses/gpl.html>
* @license CECILL-v2 <http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt>
*/
class Url
{
/**
453,7 → 448,7
unset($tableau[$nom]);
$this->setVariablesRequete($tableau);
}
 
/**
* @param array $noms tableau des noms de variable à supprimer de l'url.
*
/branches/v0.2-buhl/doc/PhpDoc/files/Application.php.txt
3,17 → 3,12
/**
* Classe fournissant des informations au Framework sur l'application.
*
* PHP version 5
*
* @category Debogage
* @package Framework
// Auteur principal :
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
// Autres auteurs :
* @license GPL v3 <http://www.gnu.org/licenses/gpl.txt>
* @license CECILL v2 <http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt>
* @version $Id: Application.php 456 2014-02-06 11:07:43Z jpm $
* @copyright 1999-2009 Tela Botanica (accueil@tela-botanica.org)
* @category PHP 5.2
* @package Framework
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
* @copyright Copyright (c) 2009, Tela Botanica (accueil@tela-botanica.org)
* @license GNU-GPL-v3 <http://www.gnu.org/licenses/gpl.html>
* @license CECILL-v2 <http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt>
*/
class Application {
 
/branches/v0.2-buhl/doc/PhpDoc/files/I18n.php.html
New file
0,0 → 1,264
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
<meta charset="utf-8"/>
<title>TBFramework - v0.2</title>
<meta name="author" content=""/>
<meta name="description" content=""/>
 
<link href="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.no-icons.min.css" rel="stylesheet">
<link href="https://netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.min.css" rel="stylesheet">
<link href="../css/prism.css" rel="stylesheet" media="all"/>
<link href="../css/template.css" rel="stylesheet" media="all"/>
<!--[if lt IE 9]>
<script src="https://html5shim.googlecode.com/svn/trunk/html5.js" type="text/javascript"></script>
<![endif]-->
<script src="https://code.jquery.com/jquery-1.10.2.min.js" type="text/javascript"></script>
<script src="https://code.jquery.com/ui/1.10.3/jquery-ui.min.js" type="text/javascript"></script>
<script src="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js"></script>
<script src="../js/jquery.smooth-scroll.js"></script>
<script src="../js/prism.min.js"></script>
<!-- TODO: Add http://jscrollpane.kelvinluck.com/ to style the scrollbars for browsers not using webkit-->
<script type="text/javascript">
function loadExternalCodeSnippets() {
Array.prototype.slice.call(document.querySelectorAll('pre[data-src]')).forEach(function (pre) {
var src = pre.getAttribute('data-src');
var extension = (src.match(/\.(\w+)$/) || [, ''])[1];
var language = 'php';
 
var code = document.createElement('code');
code.className = 'language-' + language;
 
pre.textContent = '';
 
code.textContent = 'Loading…';
 
pre.appendChild(code);
 
var xhr = new XMLHttpRequest();
 
xhr.open('GET', src, true);
 
xhr.onreadystatechange = function () {
if (xhr.readyState == 4) {
 
if (xhr.status < 400 && xhr.responseText) {
code.textContent = xhr.responseText;
 
Prism.highlightElement(code);
}
else if (xhr.status >= 400) {
code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;
}
else {
code.textContent = '✖ Error: File does not exist or is empty';
}
}
};
 
xhr.send(null);
});
}
 
$(document).ready(function(){
loadExternalCodeSnippets();
});
$('#source-view').on('shown', function () {
loadExternalCodeSnippets();
})
</script>
 
<link rel="shortcut icon" href="../images/favicon.ico"/>
<link rel="apple-touch-icon" href="../images/apple-touch-icon.png"/>
<link rel="apple-touch-icon" sizes="72x72" href="../images/apple-touch-icon-72x72.png"/>
<link rel="apple-touch-icon" sizes="114x114" href="../images/apple-touch-icon-114x114.png"/>
</head>
<body>
 
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<i class="icon-ellipsis-vertical"></i>
</a>
<a class="brand" href="../index.html">TBFramework - v0.2</a>
 
<div class="nav-collapse">
<ul class="nav pull-right">
<li class="dropdown">
<a href="../index.html" class="dropdown-toggle" data-toggle="dropdown">
API Documentation <b class="caret"></b>
</a>
<ul class="dropdown-menu">
</ul>
</li>
<li class="dropdown" id="charts-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Charts <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="../graphs/class.html">
<i class="icon-list-alt"></i>&#160;Class hierarchy diagram
</a>
</li>
</ul>
</li>
<li class="dropdown" id="reports-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Reports <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="../reports/errors.html">
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">70</span>
</a>
</li>
<li>
<a href="../reports/markers.html">
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">0</span>
</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<!--<div class="go_to_top">-->
<!--<a href="#___" style="color: inherit">Back to top&#160;&#160;<i class="icon-upload icon-white"></i></a>-->
<!--</div>-->
</div>
 
<div id="___" class="container-fluid">
<section class="row-fluid">
<div class="span2 sidebar">
<div class="accordion" style="margin-bottom: 0">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-591793363"></a>
<a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
</div>
<div id="namespace-591793363" class="accordion-body collapse in">
<div class="accordion-inner">
 
<ul>
<li class="class"><a href="../classes/Url.html">Url</a></li>
<li class="class"><a href="../classes/Debug.html">Debug</a></li>
<li class="class"><a href="../classes/Chronometre.html">Chronometre</a></li>
<li class="class"><a href="../classes/SquelettePhp.html">SquelettePhp</a></li>
<li class="class"><a href="../classes/Controleur.html">Controleur</a></li>
<li class="class"><a href="../classes/GestionnaireException.html">GestionnaireException</a></li>
<li class="class"><a href="../classes/Modele.html">Modele</a></li>
<li class="class"><a href="../classes/Registre.html">Registre</a></li>
<li class="class"><a href="../classes/I18n.html">I18n</a></li>
<li class="class"><a href="../classes/Config.html">Config</a></li>
<li class="class"><a href="../classes/Application.html">Application</a></li>
<li class="class"><a href="../classes/Log.html">Log</a></li>
</ul>
</div>
</div>
</div>
</div>
 
</div>
</section>
<section class="row-fluid">
<div class="span10 offset2">
<div class="row-fluid">
<div class="span8 content file">
<nav>
</nav>
 
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal"><i class="icon-code"></i></a>
<h1><small></small>I18n.php</h1>
<p><em></em></p>
 
<h2>Classes</h2>
<table class="table table-hover">
<tr>
<td><a href="../classes/I18n.html">I18n</a></td>
<td><em>I18n permet de traduire une application à partir de données stockées dans des fichiers ini.</em></td>
</tr>
</table>
</div>
 
<aside class="span4 detailsbar">
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr><td colspan="2"><em>None found</em></td></tr>
</table>
 
</aside>
</div>
 
</div>
</section>
 
<div id="source-view" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="source-view-label" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="source-view-label"></h3>
</div>
<div class="modal-body">
<pre data-src="../files/I18n.php.txt" class="language-php line-numbers"></pre>
</div>
</div>
 
<footer class="row-fluid">
<section class="span10 offset2">
<section class="row-fluid">
<section class="span10 offset1">
<section class="row-fluid footer-sections">
<section class="span4">
<h1><i class="icon-code"></i></h1>
<div>
<ul>
</ul>
</div>
</section>
<section class="span4">
<h1><i class="icon-bar-chart"></i></h1>
<div>
<ul>
<li><a href="../graphs/class.html">Class Hierarchy Diagram</a></li>
</ul>
</div>
</section>
<section class="span4">
<h1><i class="icon-pushpin"></i></h1>
<div>
<ul>
<li><a href="../reports/errors.html">Errors</a></li>
<li><a href="../reports/markers.html">Markers</a></li>
</ul>
</div>
</section>
</section>
</section>
</section>
<section class="row-fluid">
<section class="span10 offset1">
<hr />
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
on March 18th, 2014 at 19:19.
</section>
</section>
</section>
</footer>
</div>
 
</body>
</html>
/branches/v0.2-buhl/doc/PhpDoc/files/autoload.inc.php.html
113,12 → 113,12
<ul class="dropdown-menu">
<li>
<a href="../reports/errors.html">
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">54</span>
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">70</span>
</a>
</li>
<li>
<a href="../reports/markers.html">
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">0</span>
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">0</span>
</a>
</li>
</ul>
138,10 → 138,10
<div class="accordion" style="margin-bottom: 0">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-700663673"></a>
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-1979790633"></a>
<a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
</div>
<div id="namespace-700663673" class="accordion-body collapse in">
<div id="namespace-1979790633" class="accordion-body collapse in">
<div class="accordion-inner">
 
154,6 → 154,7
<li class="class"><a href="../classes/GestionnaireException.html">GestionnaireException</a></li>
<li class="class"><a href="../classes/Modele.html">Modele</a></li>
<li class="class"><a href="../classes/Registre.html">Registre</a></li>
<li class="class"><a href="../classes/I18n.html">I18n</a></li>
<li class="class"><a href="../classes/Config.html">Config</a></li>
<li class="class"><a href="../classes/Application.html">Application</a></li>
<li class="class"><a href="../classes/Log.html">Log</a></li>
176,7 → 177,7
<h1><small></small>autoload.inc.php</h1>
<p><em>Fichier contenant la fonction de chargement automatique de classes, il doit toujours rester à la racine
du framework car il initialise le chemin de l&#039;application en se basant sur son propre emplacement.</em></p>
<p>PHP Version 5.1.2</p>
 
194,7 → 195,7
category
</th>
<td>
<p>Fichier_De_Fonctions</p>
<p>PHP 5.2</p>
</td>
</tr>
<tr>
202,36 → 203,27
author
</th>
<td>
<p>Aurelien PERONNET <a href="mailto:aurelien@tela-botanica.org">aurelien@tela-botanica.org</a>
// Autres auteurs :</p>
<p>Aurelien PERONNET <a href="mailto:aurelien@tela-botanica.org">aurelien@tela-botanica.org</a></p>
<p>Jean-Pascal MILCENT <a href="mailto:jpm@tela-botanica.org">jpm@tela-botanica.org</a></p>
</td>
</tr>
<tr>
<th>
license
copyright
</th>
<td>
<p>GPL v3 <a href="http://www.gnu.org/licenses/gpl.txt">http://www.gnu.org/licenses/gpl.txt</a></p>
<p>CECILL v2 <a href="http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt">http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt</a></p>
<p>Copyright (c) 2009, Tela Botanica (accueil@tela-botanica.org)</p>
</td>
</tr>
<tr>
<th>
version
license
</th>
<td>
<p>$$Id: autoload.inc.php 188 2010-04-29 12:09:17Z jpm $$</p>
<p>GPL v3 <a href="http://www.gnu.org/licenses/gpl.txt">http://www.gnu.org/licenses/gpl.txt</a></p>
<p>CECILL v2 <a href="http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt">http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt</a></p>
</td>
</tr>
<tr>
<th>
copyright
</th>
<td>
<p>1999-2009 Tela Botanica (accueil@tela-botanica.org)</p>
</td>
</tr>
</table>
 
</aside>
442,7 → 434,7
<section class="span10 offset1">
<hr />
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
on March 12th, 2014 at 16:55.
on March 18th, 2014 at 19:19.
</section>
</section>
</section>
/branches/v0.2-buhl/doc/PhpDoc/files/Modele.php.txt
1,23 → 1,18
<?php
// declare(encoding='UTF-8');
/**
* Classe modèle, donc d'accés au données, elle ne devrait pas être appelée de l'extérieur.
* Elle fait office d'abstraction légère de base de données en utilisant diveres possibilités
* d'abstraction de base de données (PDO, mysql, mysqli, sqlite)
* Elle est abstraite donc doit obligatoirement être étendue.
*
* PHP Version 5
*
* @category Class
* @package Framework
* @author aurelien <aurelien@tela-botanica.org>
* @copyright 2009 Tela-Botanica
* @license http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
* @license http://www.gnu.org/licenses/gpl.html Licence GNU-GPL
* @version SVN: $$Id: Modele.php 426 2013-04-30 16:58:14Z jpm $$
* @link /doc/framework/
*
*/
* Classe modèle, donc d'accés au données, elle ne devrait pas être appelée de l'extérieur.
* Elle fait office d'abstraction légère de base de données en utilisant diveres possibilités
* d'abstraction de base de données (PDO, mysql, mysqli, sqlite)
* Elle est abstraite donc doit obligatoirement être étendue.
*
* @category PHP 5.2
* @package Framework
* @author Aurélien PERONNET <aurelien@tela-botanica.org>
* @copyright Copyright (c) 2009, Tela Botanica (accueil@tela-botanica.org)
* @license GNU-GPL-v3 <http://www.gnu.org/licenses/gpl.html>
* @license CECILL-v2 <http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt>
*/
abstract class Modele {
 
/**
/branches/v0.2-buhl/doc/PhpDoc/files/Config.php.txt
5,15 → 5,12
* Elle offre l'accès en lecture seule aux paramètres de config.
* C'est une Singleton.
*
* PHP Version 5
*
* @category PHP
* @package Framework
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
* @copyright 2009 Tela-Botanica
* @license GPL-v3 et CECILL-v2
* @version SVN: <svn_id>
* @link /doc/framework/
* @category PHP 5.2
* @package Framework
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
* @copyright Copyright (c) 2009, Tela Botanica (accueil@tela-botanica.org)
* @license GNU-GPL-v3 <http://www.gnu.org/licenses/gpl.html>
* @license CECILL-v2 <http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt>
*/
 
class Config {
93,7 → 90,7
* @param string $fichier_ini nom du fichier ini à parser
* @return array tableau contenant les paramètres du fichier ini
*/
private static function parserFichierIni($fichier_ini) {
public static function parserFichierIni($fichier_ini) {
$retour = false;
if (file_exists($fichier_ini)) {
$ini = parse_ini_file($fichier_ini, true);
/branches/v0.2-buhl/doc/PhpDoc/files/GestionnaireException.php.txt
5,20 → 5,17
* C'est un Singleton.
*
* @category PHP 5.2
* @package Framework
* @package Framework
* @author Aurélien PERONNET <aurelien@tela-botanica.org>
* @author Jean-Pascal MILCENT <jmp@tela-botanica.org>
* @copyright Copyright (c) 2009, Tela Botanica (accueil@tela-botanica.org)
* @license http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
* @license http://www.gnu.org/licenses/gpl.html Licence GNU-GPL
* @version $Id: GestionnaireException.php 342 2011-06-06 13:58:53Z jpm $$
* @link /doc/framework/
*
* @license GNU-GPL-v3 <http://www.gnu.org/licenses/gpl.html>
* @license CECILL-v2 <http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt>
*/
class GestionnaireException {
 
const MODE_CLI = 'cli';
 
/** Liste des exceptions enregistrées */
private static $exceptions = array();
 
40,12 → 37,12
// Désactivation des balises HTML dans les messages d'erreur de PHP en mode ligne de commande
if (self::$mode == self::MODE_CLI) {
ini_set('html_errors', 0);
}
}
 
set_exception_handler(array(get_class(),'gererException'));
set_error_handler(array(get_class(),'gererErreur'));
}
 
/** Configure le Gestionnaire d'exceptions et d'erreur à partir des paramêtres de config. */
public static function configurer() {
self::$contexte = Config::get('fw_debogage_contexte');
52,21 → 49,8
self::$logger = Config::get('fw_log_debogage');
self::$afficher = Config::get('fw_debogage');
}
/**
* Renvoie le nombre d'exceptions et d'erreurs levées.
* @see getExceptions() pour obtenir les exceptions formatées.
* @since 0.3
* @return int le nombre d'exception actuellement levées
*/
public static function getExceptionsNbre() {
return count(self::$exceptions);
}
/**
* Renvoie le booleen définissant si l'on affiche le contexte ou non
* @return bool true si on affiche le contexte sinon false.
*/
 
/** Renvoie le booleen définissant si l'on affiche le contexte ou non */
public static function getContexte() {
return self::$contexte;
}
80,16 → 64,14
}
 
/**
* Fonction de gestion des exceptions, remplace le handler par défaut.
* Si une boucle génère de multiple exception (ou erreur) identique une seule sera stockée.
* Fonction de gestion des exceptions, remplace le handler par défaut
* @param Exception $e l'exception à traiter
*/
public static function gererException(Exception $e) {
$cle = hash('md5', $e->getMessage().'-'.$e->getFile().'-'.$e->getLine());
if (!isset(self::$exceptions[$cle])) {
self::$exceptions[$cle] = $e;
self::loggerException($e);
}
// pour le moment on se contente de l'ajouter au tableau et de les afficher
self::$exceptions[] = $e;
// Log si nécéssaire
self::loggerException($e);
}
 
/**
104,123 → 86,70
// Si un rapport d'erreur existe, création d'une exception
if (error_reporting() != 0) {
$e = new ErrorException($message, 0, $niveau, $fichier, $ligne);
self::gererException($e);
// que l'on donne au tableau d'exceptions
self::$exceptions[] = $e;
// Log si nécéssaire
self::loggerException($e);
}
return null;
}
 
/**
* Renvoie les exceptions au format (X)HTML ou bien au format texte suivant le mode d'utilisation de PHP.
* @since 0.3
* @deprecated
* @see getExceptionsFormatees()
* @return string les exceptions formatées en texte ou (X)HTML.
* Renvoie les exceptions au format (X)HTML
* ou bien au format texte suivant le mode d'utilisation de PHP
*/
public static function getExceptions() {
return self::getExceptionsFormatees();
}
/**
* Renvoie les exceptions au format (X)HTML ou bien au format texte suivant le mode d'utilisation de PHP.
* @since 0.3
* @return string les exceptions formatées en texte ou (X)HTML.
*/
public static function getExceptionsFormatees() {
$retour = '';
if (self::getExceptionsNbre() > 0) {
foreach (self::$exceptions as $cle => $e) {
switch (self::$mode) {
case self::MODE_CLI :
$retour .= self::formaterExceptionTxt($e);
break;
default:
$retour .= self::formaterExceptionXhtml($e);
}
// Nous vidons le tableau des exceptions au fur et à mesure pour éviter le réaffichage avec le destructeur.
unset(self::$exceptions[$cle]);
foreach (self::$exceptions as $cle => $e) {
switch (self::$mode) {
case self::MODE_CLI :
$retour .= $e->getMessage()."\n";
$retour .= 'Fichier : '.$e->getFile()."\n";
$retour .= 'Ligne : '.$e->getLine()."\n";
if (self::getContexte()) {
$retour .= 'Contexte : '."\n".print_r($e->getTraceAsString(), true)."\n";
}
break;
default:
$retour .= '<div class="debogage">'."\n";
$retour .= $e->getMessage()."\n";
$retour .= '<span class="debogage_fichier">'.'Fichier : '.$e->getFile().'</span>'."\n";
$retour .= '<span class="debogage_ligne">'.'Ligne : '.$e->getLine().'</span>'."\n";
if (self::getContexte()) {
$retour .= '<pre>'."\n";
$retour .= '<strong>Contexte : </strong>'."\n".print_r($e->getTraceAsString(), true)."\n";
$retour .= '</pre>'."\n";
}
$retour .= '</div>'."\n";
}
// Nous vidons le tableau des exceptions au fur et à mesure
unset(self::$exceptions[$cle]);
}
return $retour;
}
/**
* Renvoie le tableau d'objets Exception générées par le script PHP triées du niveau de sévérité le plus élevé au moins élevé.
* Format du tableau :
* array{sévérité_1 = array{Exception1, Exception2, Exception3,...}, sévérité_1 = array{Exception1, Exception2, ...}, ...};
* ATTENTION : si vous utilisez cette méthode, c'est à vous de gérer l'affichage des Exceptions. Le gestionnaire d'exception
* n'enverra plus rien au navigateur ou à la console.
* @since 0.3
* @return array le tableau trié d'objet Exception.
*/
public static function getExceptionsTriees() {
$retour = array();
if (self::getExceptionsNbre() > 0) {
foreach (self::$exceptions as $cle => $e) {
$retour[$e->getSeverity()][] = $e;
// Nous vidons le tableau des exceptions au fur et à mesure pour éviter le réaffichage avec le destructeur.
unset(self::$exceptions[$cle]);
}
ksort($retour);
}
return $retour;
}
 
/**
* Logue une exception donnée sous une forme lisible si self::logger vaut true.
* @param Exception $e l'exception à logger
*/
private static function loggerException(Exception $e) {
private static function loggerException($e) {
if (self::$logger) {
$message = self::formaterExceptionTxt($e);
Log::ajouterEntree('erreurs', $message);
$erreur = '';
$erreur .= $e->getMessage()."\n";
$erreur .= 'Fichier : '.$e->getFile()."\n";
$erreur .= 'Ligne : '.$e->getLine()."\n";
if (self::getContexte()) {
$erreur .= 'Contexte : '."\n".print_r($e->getTraceAsString(), true)."\n";
}
$erreur .= "\n";
Log::ajouterEntree('erreurs', $erreur);
}
}
/**
* Formate en texte une exception passée en paramètre.
* @since 0.3
* @param Exception l'exception à formater.
*/
public static function formaterExceptionTxt(Exception $e) {
$message = '';
$message .= $e->getMessage()."\n";
$message .= 'Fichier : '.$e->getFile()."\n";
$message .= 'Ligne : '.$e->getLine()."\n";
if (self::getContexte()) {
$message .= 'Contexte : '."\n".print_r($e->getTraceAsString(), true)."\n";
}
$message .= "\n";
return $message;
}
/**
* Formate en (X)HTML une exception passée en paramètre.
* @since 0.3
* @param Exception l'exception à formater.
*/
public static function formaterExceptionXhtml(Exception $e) {
$message = '';
$message .= '<div class="debogage">'."\n";
$message .= $e->getMessage()."\n";
$message .= '<span class="debogage_fichier">'.'Fichier : '.$e->getFile().'</span>'."\n";
$message .= '<span class="debogage_ligne">'.'Ligne : '.$e->getLine().'</span>'."\n";
if (self::getContexte()) {
$message .= '<pre>'."\n";
$message .= '<strong>Contexte : </strong>'."\n".print_r($e->getTraceAsString(), true)."\n";
$message .= '</pre>'."\n";
}
$message .= '</div>'."\n";
return $message;
}
/**
* Lors de la destruction de la classe si des exceptions n'ont pas été affichées, et si le débogage est à true, elles sont
* affichées.
*/
 
public function __destruct() {
// Si des erreurs n'ont pas été affichée nous forçons leur affichage
if (self::$afficher && self::getExceptionsNbre() > 0) {
echo self::getExceptionsFormatees();
if (self::$afficher && count(self::$exceptions) > 0) {
echo self::getExceptions();
}
}
 
/branches/v0.2-buhl/doc/PhpDoc/files/Log.php.html
113,12 → 113,12
<ul class="dropdown-menu">
<li>
<a href="../reports/errors.html">
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">54</span>
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">70</span>
</a>
</li>
<li>
<a href="../reports/markers.html">
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">0</span>
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">0</span>
</a>
</li>
</ul>
138,10 → 138,10
<div class="accordion" style="margin-bottom: 0">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-1245416206"></a>
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-2101350971"></a>
<a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
</div>
<div id="namespace-1245416206" class="accordion-body collapse in">
<div id="namespace-2101350971" class="accordion-body collapse in">
<div class="accordion-inner">
 
154,6 → 154,7
<li class="class"><a href="../classes/GestionnaireException.html">GestionnaireException</a></li>
<li class="class"><a href="../classes/Modele.html">Modele</a></li>
<li class="class"><a href="../classes/Registre.html">Registre</a></li>
<li class="class"><a href="../classes/I18n.html">I18n</a></li>
<li class="class"><a href="../classes/Config.html">Config</a></li>
<li class="class"><a href="../classes/Application.html">Application</a></li>
<li class="class"><a href="../classes/Log.html">Log</a></li>
252,7 → 253,7
<section class="span10 offset1">
<hr />
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
on March 12th, 2014 at 16:55.
on March 18th, 2014 at 19:19.
</section>
</section>
</section>
/branches/v0.2-buhl/doc/PhpDoc/files/SquelettePhp.php.html
113,12 → 113,12
<ul class="dropdown-menu">
<li>
<a href="../reports/errors.html">
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">54</span>
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">70</span>
</a>
</li>
<li>
<a href="../reports/markers.html">
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">0</span>
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">0</span>
</a>
</li>
</ul>
138,10 → 138,10
<div class="accordion" style="margin-bottom: 0">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-353027973"></a>
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-245145037"></a>
<a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
</div>
<div id="namespace-353027973" class="accordion-body collapse in">
<div id="namespace-245145037" class="accordion-body collapse in">
<div class="accordion-inner">
 
154,6 → 154,7
<li class="class"><a href="../classes/GestionnaireException.html">GestionnaireException</a></li>
<li class="class"><a href="../classes/Modele.html">Modele</a></li>
<li class="class"><a href="../classes/Registre.html">Registre</a></li>
<li class="class"><a href="../classes/I18n.html">I18n</a></li>
<li class="class"><a href="../classes/Config.html">Config</a></li>
<li class="class"><a href="../classes/Application.html">Application</a></li>
<li class="class"><a href="../classes/Log.html">Log</a></li>
252,7 → 253,7
<section class="span10 offset1">
<hr />
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
on March 12th, 2014 at 16:55.
on March 18th, 2014 at 19:19.
</section>
</section>
</section>
/branches/v0.2-buhl/doc/PhpDoc/files/Registre.php.html
113,12 → 113,12
<ul class="dropdown-menu">
<li>
<a href="../reports/errors.html">
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">54</span>
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">70</span>
</a>
</li>
<li>
<a href="../reports/markers.html">
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">0</span>
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">0</span>
</a>
</li>
</ul>
138,10 → 138,10
<div class="accordion" style="margin-bottom: 0">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-1548000857"></a>
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-1451477007"></a>
<a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
</div>
<div id="namespace-1548000857" class="accordion-body collapse in">
<div id="namespace-1451477007" class="accordion-body collapse in">
<div class="accordion-inner">
 
154,6 → 154,7
<li class="class"><a href="../classes/GestionnaireException.html">GestionnaireException</a></li>
<li class="class"><a href="../classes/Modele.html">Modele</a></li>
<li class="class"><a href="../classes/Registre.html">Registre</a></li>
<li class="class"><a href="../classes/I18n.html">I18n</a></li>
<li class="class"><a href="../classes/Config.html">Config</a></li>
<li class="class"><a href="../classes/Application.html">Application</a></li>
<li class="class"><a href="../classes/Log.html">Log</a></li>
252,7 → 253,7
<section class="span10 offset1">
<hr />
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
on March 12th, 2014 at 16:55.
on March 18th, 2014 at 19:19.
</section>
</section>
</section>
/branches/v0.2-buhl/doc/PhpDoc/files/Chronometre.php.html
113,12 → 113,12
<ul class="dropdown-menu">
<li>
<a href="../reports/errors.html">
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">54</span>
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">70</span>
</a>
</li>
<li>
<a href="../reports/markers.html">
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">0</span>
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">0</span>
</a>
</li>
</ul>
138,10 → 138,10
<div class="accordion" style="margin-bottom: 0">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-64918610"></a>
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-972677940"></a>
<a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
</div>
<div id="namespace-64918610" class="accordion-body collapse in">
<div id="namespace-972677940" class="accordion-body collapse in">
<div class="accordion-inner">
 
154,6 → 154,7
<li class="class"><a href="../classes/GestionnaireException.html">GestionnaireException</a></li>
<li class="class"><a href="../classes/Modele.html">Modele</a></li>
<li class="class"><a href="../classes/Registre.html">Registre</a></li>
<li class="class"><a href="../classes/I18n.html">I18n</a></li>
<li class="class"><a href="../classes/Config.html">Config</a></li>
<li class="class"><a href="../classes/Application.html">Application</a></li>
<li class="class"><a href="../classes/Log.html">Log</a></li>
183,8 → 184,7
<table class="table table-hover">
<tr>
<td><a href="../classes/Chronometre.html">Chronometre</a></td>
<td><em>Classe Chronometre() - Permet de stocker et d&#039;afficher
les temps d&#039;éxécution de script.</em></td>
<td><em>Classe Chronometre() - Permet de stocker et d&#039;afficher les temps d&#039;éxécution de script.</em></td>
</tr>
</table>
</div>
253,7 → 253,7
<section class="span10 offset1">
<hr />
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
on March 12th, 2014 at 16:55.
on March 18th, 2014 at 19:19.
</section>
</section>
</section>
/branches/v0.2-buhl/doc/PhpDoc/files/Debug.php.html
113,12 → 113,12
<ul class="dropdown-menu">
<li>
<a href="../reports/errors.html">
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">54</span>
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">70</span>
</a>
</li>
<li>
<a href="../reports/markers.html">
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">0</span>
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">0</span>
</a>
</li>
</ul>
138,10 → 138,10
<div class="accordion" style="margin-bottom: 0">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-1736475191"></a>
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-1664890481"></a>
<a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
</div>
<div id="namespace-1736475191" class="accordion-body collapse in">
<div id="namespace-1664890481" class="accordion-body collapse in">
<div class="accordion-inner">
 
154,6 → 154,7
<li class="class"><a href="../classes/GestionnaireException.html">GestionnaireException</a></li>
<li class="class"><a href="../classes/Modele.html">Modele</a></li>
<li class="class"><a href="../classes/Registre.html">Registre</a></li>
<li class="class"><a href="../classes/I18n.html">I18n</a></li>
<li class="class"><a href="../classes/Config.html">Config</a></li>
<li class="class"><a href="../classes/Application.html">Application</a></li>
<li class="class"><a href="../classes/Log.html">Log</a></li>
252,7 → 253,7
<section class="span10 offset1">
<hr />
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
on March 12th, 2014 at 16:55.
on March 18th, 2014 at 19:19.
</section>
</section>
</section>
/branches/v0.2-buhl/doc/PhpDoc/files/I18n.php.txt
New file
0,0 → 1,248
<?php
// declare(encoding='UTF-8');
/**
* I18n permet de traduire une application à partir de données stockées dans des fichiers ini.
* Si vous souhaitez utiliser le fonctionnement par défaut vous devrez :
* - déposer les fichiers ini dans le dossier définit par la variable de config "chemin_i18n".
* - nommer les fichiers selon la forme "locale.ini" (Ex.: fr.ini ou fr_CH.ini ).
*
* Elle offre l'accès en lecture seule aux paramètres de des fichiers ini.
* C'est une Singleton. Une seule classe de traduction peut être instanciée par Application.
*
* @category PHP 5.2
* @package Framework
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
* @copyright Copyright (c) 2010, Tela Botanica (accueil@tela-botanica.org)
* @license GNU-GPL-v3 <http://www.gnu.org/licenses/gpl.html>
* @license CECILL-v2 <http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt>
*/
 
class I18n {
/** Format de traduction utilisant les fichier .ini */
const FORMAT_INI = '.ini';
 
/** Instance de la classe pointant sur elle même (pour le pattern singleton) */
private static $instance = null;
 
/** Fichiers de traduction disponibles. */
private static $traductions = array();
 
/** Langue courrante utilisée par l'application. */
private static $langue = null;
 
private function __construct() {
self::verifierParametresConfig();
self::trouverLangue();
}
 
/**
* Accesseur pour la valeur d'une traduction
* @param string $param le nom du paramètre
* @return string la valeur du paramètre
*/
public static function get($identifiant, $langue = null) {
self::verifierCreationInstance();
$texte = '';
 
// Récupération de la langue actuellement demandée
$langue_a_charger = self::$langue;
if (!is_null($langue)) {
$langue_a_charger = $langue;
}
 
if (!isset(self::$traductions[$langue_a_charger])) {
// Tentative de chargement du fichier de traduction
$chargement = self::charger($langue_a_charger);
if ($chargement === false) {
$m = "Le fichier d'i18n pour la langue '$langue_a_charger' demandée n'a pas été trouvé.";
self::ajouterErreur($m);
}
}
 
// Recherche de la langue dans le tableau des traductions
if (isset(self::$traductions[$langue_a_charger]) && self::$traductions[$langue_a_charger] !== false) {
// Recherche de la traduction demandée
$valeur = self::getValeur($identifiant, self::$traductions[$langue_a_charger]);
if ($valeur !== false) {
$texte = $valeur;
} else {
$m = "Le traduction n'existe pas pour l'identifiant '$identifiant' demandé.";
self::ajouterErreur($m);
}
}
 
return $texte;
}
 
/**
* Charge un fichier ini dans le tableau des paramètres de l'appli
* @param string $fichier_ini le nom du fichier à charger
* @return boolean true, si le fichier a été trouvé et correctement chargé, sinon false.
*/
public static function charger($langue, $fichier = null, $format = self::FORMAT_INI) {
self::verifierCreationInstance();
$ok = false;
 
// Création du chemin vers le fichier de traduction par défaut
if (is_null($fichier)) {
$fichier = Config::get('chemin_i18n').$langue.$format;
}
 
// Chargement
if ($format == self::FORMAT_INI) {
$ok = self::chargerFichierIni($fichier, $langue);
} else {
$m = "Le format '$format' de fichier de traduction n'est pas pris en compte par le Framework.";
self::ajouterErreur($m);
}
 
return $ok;
}
 
/**
* Définit la langue utiliser pour rechercher une traduction.
* @param string $fichier_ini le nom du fichier à charger
* @return array le fichier ini parsé
*/
public static function setLangue($langue) {
self::verifierCreationInstance();
self::$langue = $langue;
}
 
/**
* Renvoie la valeur demandé grâce une chaine de paramètres
* @param string $param la chaine identifiante
* @param array $i18n le tableau de traductions
* @return mixed la valeur correspondante à la chaine identifiante si elle est trouvée, sinon false.
*/
private static function getValeur($param, $i18n) {
if ($param === null) {
return false;
} else {
if (isset($i18n[$param])) {
return $i18n[$param];
} else if (strpos($param, '.') !== false) {
$pieces = explode('.', $param, 2);
if (strlen($pieces[0]) && strlen($pieces[1])) {
if (isset($i18n[$pieces[0]])) {
if (is_array($i18n[$pieces[0]])) {
return self::getValeur($pieces[1], $i18n[$pieces[0]]);
}
}
}
} else {
return false;
}
}
}
 
/**
* Parse le fichier ini donné en paramètre
* @param string $fichier_ini nom du fichier ini à parser
* @param string $langue la langue correspondant au fichier
* @return boolean true si le chargement c'est bien passé, sinon false.
*/
private static function chargerFichierIni($fichier_ini, $langue) {
self::$traductions[$langue] = false;
if (file_exists($fichier_ini)) {
$ini = parse_ini_file($fichier_ini, true);
Debug::printr($ini, 'Avant :');
$ini = self::analyserTableauIni($ini);
Debug::printr($ini, 'Aprés :');
self::$traductions[$langue] = $ini;
}
return (self::$traductions[$langue] === false) ? false : true;
}
 
/**
* Analyse un tableau de traductions pour évaluer les clés.
* @param array $i18n le tableau de traductions
* @return array le tableau analysé et modifié si nécessaire.
*/
private static function analyserTableauIni($i18n = array()) {
//ATTENTION : il est important de passer la valeur par référence car nous la modifions dynamiquement dans la boucle
foreach ($i18n as $cle => &$valeur) {
if (is_array($valeur)) {
$i18n[$cle] = self::analyserTableauIni($valeur);
} else {
$i18n = self::evaluerCle($i18n, $cle, $valeur);
}
}
return $i18n;
}
 
/**
* Dans le cas des chaines de traduction à sous clé (ex.: cle.souscle), cette méthode
* évalue les valeurs correspondantes et créée les sous tableaux associés.
* @param array $i18n tableau de traductions (par référence)
* @param string $cle la cle dans le tableau
* @param string $valeur la valeur à affecter
*/
private static function evaluerCle($i18n, $cle, $valeur) {
if (strpos($cle, '.') !== false) {
unset($i18n[$cle]);
$pieces = explode('.', $cle, 2);
if (strlen($pieces[0]) && strlen($pieces[1])) {
if (isset($i18n[$pieces[0]]) && !is_array($i18n[$pieces[0]])) {
$m = "Ne peut pas créer de sous-clé pour '{$pieces[0]}' car la clé existe déjà";
trigger_error($m, E_USER_WARNING);
} else {
$i18n[$pieces[0]][$pieces[1]] = $valeur;
$i18n[$pieces[0]] = self::evaluerCle($i18n[$pieces[0]], $pieces[1], $valeur);
}
} else {
$m = "Clé invalide '$cle'";
trigger_error($m, E_USER_WARNING);
}
} else {
$i18n[$cle] = $valeur;
}
return $i18n;
}
 
/**
* Cherche l'information sur la langue demandée par l'application
*/
private static function trouverLangue() {
if (isset($_GET[Config::get('i18n_url_parametre')])) {
self::$langue = $_GET[Config::get('i18n_url_parametre')];
} else {
self::$langue = Config::get('i18n_langue_defaut');
}
}
 
/**
* Vérifie si l'instance de classe à été crée, si non la crée
*/
private static function verifierCreationInstance() {
if (empty(self::$instance)) {
self::$instance = new I18n();
}
}
 
/**
* Vérifie que tous les paramêtres de config nécessaires au fonctionnement de cette classe existe dans les fichiers
* de configurations.
*/
private static function verifierParametresConfig() {
$ok = true;
$parametres = array('chemin_i18n', 'i18n_url_parametre', 'i18n_langue_defaut');
foreach ($parametres as $param) {
if (is_null(Config::get($param))) {
$m = "L'utilisation de la classe I18n nécessite de définir '$param' dans un fichier de configuration.";
self::ajouterErreur($m);
$ok = false;
}
}
return $ok;
}
 
/**
* Ajouter une message d'erreur
*/
private static function ajouterErreur($m, $e = E_USER_WARNING) {
if (Config::get('fw_debogage') === true) {
trigger_error($m, $e);
}
}
}
Property changes:
Added: svn:eol-style
+native
\ No newline at end of property
/branches/v0.2-buhl/doc/PhpDoc/files/autoload.inc.php.txt
4,18 → 4,13
* Fichier contenant la fonction de chargement automatique de classes, il doit toujours rester à la racine
* du framework car il initialise le chemin de l'application en se basant sur son propre emplacement.
*
* PHP Version 5.1.2
*
* @category Fichier_De_Fonctions
* @package Framework
// Auteur principal :
* @category PHP 5.2
* @package Framework
* @author Aurelien PERONNET <aurelien@tela-botanica.org>
// Autres auteurs :
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
* @copyright Copyright (c) 2009, Tela Botanica (accueil@tela-botanica.org)
* @license GPL v3 <http://www.gnu.org/licenses/gpl.txt>
* @license CECILL v2 <http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt>
* @version $$Id: autoload.inc.php 188 2010-04-29 12:09:17Z jpm $$
* @copyright 1999-2009 Tela Botanica (accueil@tela-botanica.org)
*/
 
// Redéfinition de la constante DIRECTORY_SEPARATOR
/branches/v0.2-buhl/doc/PhpDoc/files/Controleur.php.html
113,12 → 113,12
<ul class="dropdown-menu">
<li>
<a href="../reports/errors.html">
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">54</span>
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">70</span>
</a>
</li>
<li>
<a href="../reports/markers.html">
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">0</span>
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">0</span>
</a>
</li>
</ul>
138,10 → 138,10
<div class="accordion" style="margin-bottom: 0">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-86748986"></a>
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-451161788"></a>
<a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
</div>
<div id="namespace-86748986" class="accordion-body collapse in">
<div id="namespace-451161788" class="accordion-body collapse in">
<div class="accordion-inner">
 
154,6 → 154,7
<li class="class"><a href="../classes/GestionnaireException.html">GestionnaireException</a></li>
<li class="class"><a href="../classes/Modele.html">Modele</a></li>
<li class="class"><a href="../classes/Registre.html">Registre</a></li>
<li class="class"><a href="../classes/I18n.html">I18n</a></li>
<li class="class"><a href="../classes/Config.html">Config</a></li>
<li class="class"><a href="../classes/Application.html">Application</a></li>
<li class="class"><a href="../classes/Log.html">Log</a></li>
203,8 → 204,56
</div>
 
<div class="row-fluid">
<section class="span8 content file">
<h2>Functions</h2>
</section>
<aside class="span4 detailsbar"></aside>
</div>
 
<div class="row-fluid">
<div class="span8 content class">
<a id="method_stripslashes_deep" name="method_stripslashes_deep" class="anchor"></a>
<article class="method">
<h3 class=" ">stripslashes_deep()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">stripslashes_deep( <span class="argument">$value</span>)</pre>
<p><em></em></p>
 
<h4>Parameters</h4>
<table class="table table-condensed table-hover">
<tr>
<td></td>
<td>$value</td>
<td></td>
</tr>
</table>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
<dt>File</dt>
<dd><a href=""><div class="path-wrapper">Controleur.php</div></a></dd>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr>
<th>
todo
</th>
<td>
</td>
</tr>
</table>
</aside>
</div>
 
</div>
</section>
 
<div id="source-view" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="source-view-label" aria-hidden="true">
253,7 → 302,7
<section class="span10 offset1">
<hr />
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
on March 12th, 2014 at 16:55.
on March 18th, 2014 at 19:19.
</section>
</section>
</section>
/branches/v0.2-buhl/doc/PhpDoc/files/Log.php.txt
5,11 → 5,10
*
* @category PHP 5.2
* @package Framework
* @author aurelien <aurelien@tela-botanica.org>
* @copyright 2009 Tela-Botanica
* @license http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
* @version SVN: $Id: Log.php 255 2010-12-23 10:37:30Z jpm $
* @link /doc/framework/
* @author Aurélien PERONNET <aurelien@tela-botanica.org>
* @copyright Copyright (c) 2009, Tela Botanica (accueil@tela-botanica.org)
* @license GNU-GPL-v3 <http://www.gnu.org/licenses/gpl.html>
* @license CECILL-v2 <http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt>
*/
 
class Log {
67,7 → 66,7
self::desactiverEcriture();
}
}
 
/**
* Configure le Log à partir des paramêtres de config.
*/
111,7 → 110,7
 
/**
* Vérifie la présence d'un fichier dans le tableau, ses droits d'écriture, l'ouvre si nécessaire.
*
*
* @param string $nomFichier le nom du fichier dont on doit vérifier la présence
* @return boolean true si le fichier est ouvert ou maintenant accessible, false sinon
*/
/branches/v0.2-buhl/doc/PhpDoc/phpdoc-cache-ee/phpdoc-cache-file_e965cec598c00a2d5d5168fd61752edc.dat
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/branches/v0.2-buhl/doc/PhpDoc/index.html
65,12 → 65,12
<ul class="dropdown-menu">
<li>
<a href="reports/errors.html">
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">54</span>
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">70</span>
</a>
</li>
<li>
<a href="reports/markers.html">
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">0</span>
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">0</span>
</a>
</li>
</ul>
90,10 → 90,10
<div class="accordion" style="margin-bottom: 0">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-1726218716"></a>
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-920245312"></a>
<a href="namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
</div>
<div id="namespace-1726218716" class="accordion-body collapse in">
<div id="namespace-920245312" class="accordion-body collapse in">
<div class="accordion-inner">
 
106,6 → 106,7
<li class="class"><a href="classes/GestionnaireException.html">GestionnaireException</a></li>
<li class="class"><a href="classes/Modele.html">Modele</a></li>
<li class="class"><a href="classes/Registre.html">Registre</a></li>
<li class="class"><a href="classes/I18n.html">I18n</a></li>
<li class="class"><a href="classes/Config.html">Config</a></li>
<li class="class"><a href="classes/Application.html">Application</a></li>
<li class="class"><a href="classes/Log.html">Log</a></li>
141,8 → 142,7
</tr>
<tr>
<td><a href="classes/Chronometre.html">Chronometre</a></td>
<td><em>Classe Chronometre() - Permet de stocker et d&#039;afficher
les temps d&#039;éxécution de script.</em></td>
<td><em>Classe Chronometre() - Permet de stocker et d&#039;afficher les temps d&#039;éxécution de script.</em></td>
</tr>
<tr>
<td><a href="classes/SquelettePhp.html">SquelettePhp</a></td>
166,6 → 166,10
<td><em>Classe registre, qui permet un accès à différentes variables à travers les autres classes.</em></td>
</tr>
<tr>
<td><a href="classes/I18n.html">I18n</a></td>
<td><em>I18n permet de traduire une application à partir de données stockées dans des fichiers ini.</em></td>
</tr>
<tr>
<td><a href="classes/Config.html">Config</a></td>
<td><em>Config permet de charger automatiquement les fichiers ini du Framework et de l&#039;application.</em></td>
</tr>
345,6 → 349,47
</aside>
</div>
 
<div class="row-fluid">
<div class="span8 content class">
<a id="method_stripslashes_deep" name="method_stripslashes_deep" class="anchor"></a>
<article class="method">
<h3 class=" ">stripslashes_deep()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">stripslashes_deep( <span class="argument">$value</span>)</pre>
<p><em></em></p>
 
<h4>Parameters</h4>
<table class="table table-condensed table-hover">
<tr>
<td></td>
<td>$value</td>
<td></td>
</tr>
</table>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
<dt>File</dt>
<dd><a href=""><div class="path-wrapper"></div></a></dd>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr>
<th>
todo
</th>
<td>
</td>
</tr>
</table>
</aside>
</div>
 
</div>
</section>
385,7 → 430,7
<section class="span10 offset1">
<hr />
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
on March 12th, 2014 at 16:55.
on March 18th, 2014 at 19:19.
</section>
</section>
</section>
/branches/v0.2-buhl/doc/PhpDoc/phpdoc-cache-a0/phpdoc-cache-file_fc563432a226bf5a590f5de8884da4af.dat
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/branches/v0.2-buhl/doc/PhpDoc/phpdoc-cache-98/phpdoc-cache-file_dd77e54ff89c835ae0f416f4edab9c35.dat
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/branches/v0.2-buhl/doc/PhpDoc/namespaces/default.html
65,12 → 65,12
<ul class="dropdown-menu">
<li>
<a href="../reports/errors.html">
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">54</span>
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">70</span>
</a>
</li>
<li>
<a href="../reports/markers.html">
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">0</span>
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">0</span>
</a>
</li>
</ul>
90,10 → 90,10
<div class="accordion" style="margin-bottom: 0">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-1589958502"></a>
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-555207737"></a>
<a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
</div>
<div id="namespace-1589958502" class="accordion-body collapse in">
<div id="namespace-555207737" class="accordion-body collapse in">
<div class="accordion-inner">
 
106,6 → 106,7
<li class="class"><a href="../classes/GestionnaireException.html">GestionnaireException</a></li>
<li class="class"><a href="../classes/Modele.html">Modele</a></li>
<li class="class"><a href="../classes/Registre.html">Registre</a></li>
<li class="class"><a href="../classes/I18n.html">I18n</a></li>
<li class="class"><a href="../classes/Config.html">Config</a></li>
<li class="class"><a href="../classes/Application.html">Application</a></li>
<li class="class"><a href="../classes/Log.html">Log</a></li>
141,8 → 142,7
</tr>
<tr>
<td><a href="../classes/Chronometre.html">Chronometre</a></td>
<td><em>Classe Chronometre() - Permet de stocker et d&#039;afficher
les temps d&#039;éxécution de script.</em></td>
<td><em>Classe Chronometre() - Permet de stocker et d&#039;afficher les temps d&#039;éxécution de script.</em></td>
</tr>
<tr>
<td><a href="../classes/SquelettePhp.html">SquelettePhp</a></td>
166,6 → 166,10
<td><em>Classe registre, qui permet un accès à différentes variables à travers les autres classes.</em></td>
</tr>
<tr>
<td><a href="../classes/I18n.html">I18n</a></td>
<td><em>I18n permet de traduire une application à partir de données stockées dans des fichiers ini.</em></td>
</tr>
<tr>
<td><a href="../classes/Config.html">Config</a></td>
<td><em>Config permet de charger automatiquement les fichiers ini du Framework et de l&#039;application.</em></td>
</tr>
345,6 → 349,47
</aside>
</div>
 
<div class="row-fluid">
<div class="span8 content class">
<a id="method_stripslashes_deep" name="method_stripslashes_deep" class="anchor"></a>
<article class="method">
<h3 class=" ">stripslashes_deep()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">stripslashes_deep( <span class="argument">$value</span>)</pre>
<p><em></em></p>
 
<h4>Parameters</h4>
<table class="table table-condensed table-hover">
<tr>
<td></td>
<td>$value</td>
<td></td>
</tr>
</table>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
<dt>File</dt>
<dd><a href=""><div class="path-wrapper"></div></a></dd>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr>
<th>
todo
</th>
<td>
</td>
</tr>
</table>
</aside>
</div>
 
</div>
</section>
385,7 → 430,7
<section class="span10 offset1">
<hr />
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
on March 12th, 2014 at 16:55.
on March 18th, 2014 at 19:19.
</section>
</section>
</section>
/branches/v0.2-buhl/doc/PhpDoc/phpdoc-cache-0d/phpdoc-cache-file_f90d35be0c8f3486d33aac180b8d39a1.dat
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/branches/v0.2-buhl/doc/PhpDoc/phpdoc-cache-c2/phpdoc-cache-file_9579b859d697ad3a2454bcf79031c3b8.dat
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/branches/v0.2-buhl/doc/PhpDoc/phpdoc-cache-f0/phpdoc-cache-file_19fba3fd5f6df8a705d3aef2a9c12310.dat
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/branches/v0.2-buhl/doc/PhpDoc/phpdoc-cache-1f/phpdoc-cache-file_9f2bd6a7e9dcd3958d86cf14c94230b3.dat
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/branches/v0.2-buhl/doc/PhpDoc/phpdoc-cache-e4/phpdoc-cache-file_5f5ad2f8f7f8dab5daffd639f8da7d02.dat
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/branches/v0.2-buhl/doc/PhpDoc/phpdoc-cache-e4/phpdoc-cache-file_5f5ad2f8f7f8dab5daffd639f8da7d02.dat
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/branches/v0.2-buhl/doc/PhpDoc/graphs/class.html
90,12 → 90,12
<ul class="dropdown-menu">
<li>
<a href="../reports/errors.html">
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">54</span>
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">70</span>
</a>
</li>
<li>
<a href="../reports/markers.html">
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">0</span>
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">0</span>
</a>
</li>
</ul>
154,7 → 154,7
<section class="span10 offset1">
<hr />
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
on March 12th, 2014 at 16:55.
on March 18th, 2014 at 19:19.
</section>
</section>
</section>
/branches/v0.2-buhl/doc/PhpDoc/phpdoc-cache-4e/phpdoc-cache-file_81b2d36b4ec79f521cf2d553522e2a5f.dat
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/branches/v0.2-buhl/doc/PhpDoc/phpdoc-cache-9a/phpdoc-cache-file_93fb3191e18da5e5dd0648f61d92959e.dat
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/branches/v0.2-buhl/doc/PhpDoc/phpdoc-cache-f5/phpdoc-cache-file_f503dc934ce8ca1b9cd46ef44f1dd267.dat
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/branches/v0.2-buhl/doc/PhpDoc/phpdoc-cache-10/phpdoc-cache-file_c0a000a74ba9d6fbb1338a30824c0cfe.dat
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/branches/v0.2-buhl/doc/PhpDoc/classes/Log.html
113,12 → 113,12
<ul class="dropdown-menu">
<li>
<a href="../reports/errors.html">
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">54</span>
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">70</span>
</a>
</li>
<li>
<a href="../reports/markers.html">
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">0</span>
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">0</span>
</a>
</li>
</ul>
138,10 → 138,10
<div class="accordion" style="margin-bottom: 0">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-334280751"></a>
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-578982708"></a>
<a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
</div>
<div id="namespace-334280751" class="accordion-body collapse in">
<div id="namespace-578982708" class="accordion-body collapse in">
<div class="accordion-inner">
 
154,6 → 154,7
<li class="class"><a href="../classes/GestionnaireException.html">GestionnaireException</a></li>
<li class="class"><a href="../classes/Modele.html">Modele</a></li>
<li class="class"><a href="../classes/Registre.html">Registre</a></li>
<li class="class"><a href="../classes/I18n.html">I18n</a></li>
<li class="class"><a href="../classes/Config.html">Config</a></li>
<li class="class"><a href="../classes/Application.html">Application</a></li>
<li class="class"><a href="../classes/Log.html">Log</a></li>
255,9 → 256,7
<dt>See also</dt>
<dd><a href="/doc/framework/"><div class="namespace-wrapper">/doc/framework/</div></a></dd>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
274,7 → 273,7
author
</th>
<td>
<p>aurelien <a href="mailto:aurelien@tela-botanica.org">aurelien@tela-botanica.org</a></p>
<p>Aurélien PERONNET <a href="mailto:aurelien@tela-botanica.org">aurelien@tela-botanica.org</a></p>
</td>
</tr>
<tr>
282,7 → 281,7
copyright
</th>
<td>
<p>2009 Tela-Botanica</p>
<p>Copyright (c) 2009, Tela Botanica (accueil@tela-botanica.org)</p>
</td>
</tr>
<tr>
290,19 → 289,12
license
</th>
<td>
<p><a href="http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt">http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt</a> Licence CECILL</p>
<p>GNU-GPL-v3 <a href="http://www.gnu.org/licenses/gpl.html">http://www.gnu.org/licenses/gpl.html</a></p>
<p>CECILL-v2 <a href="http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt">http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt</a></p>
</td>
</tr>
<tr>
<th>
version
</th>
<td>
</td>
</tr>
<tr>
<th>
todo
</th>
<td>
915,7 → 907,7
<section class="span10 offset1">
<hr />
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
on March 12th, 2014 at 16:55.
on March 18th, 2014 at 19:19.
</section>
</section>
</section>
/branches/v0.2-buhl/doc/PhpDoc/classes/Url.html
113,12 → 113,12
<ul class="dropdown-menu">
<li>
<a href="../reports/errors.html">
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">54</span>
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">70</span>
</a>
</li>
<li>
<a href="../reports/markers.html">
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">0</span>
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">0</span>
</a>
</li>
</ul>
138,10 → 138,10
<div class="accordion" style="margin-bottom: 0">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-231227172"></a>
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-839688948"></a>
<a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
</div>
<div id="namespace-231227172" class="accordion-body collapse in">
<div id="namespace-839688948" class="accordion-body collapse in">
<div class="accordion-inner">
 
154,6 → 154,7
<li class="class"><a href="../classes/GestionnaireException.html">GestionnaireException</a></li>
<li class="class"><a href="../classes/Modele.html">Modele</a></li>
<li class="class"><a href="../classes/Registre.html">Registre</a></li>
<li class="class"><a href="../classes/I18n.html">I18n</a></li>
<li class="class"><a href="../classes/Config.html">Config</a></li>
<li class="class"><a href="../classes/Application.html">Application</a></li>
<li class="class"><a href="../classes/Log.html">Log</a></li>
279,8 → 280,7
<dt>File</dt>
<dd><a href="../files/Url.php.html"><div class="path-wrapper">Url.php</div></a></dd>
<dt>Package</dt>
<dd><div class="namespace-wrapper">\Framework
// Auteur principal</div></dd>
<dd><div class="namespace-wrapper">\Framework</div></dd>
<dt>Class hierarchy</dt>
<dd class="hierarchy">
<div class="namespace-wrapper">\Url</div>
289,9 → 289,7
<dt>See also</dt>
<dd><a href="/doc/framework/"><div class="namespace-wrapper">/doc/framework/</div></a></dd>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
300,7 → 298,7
category
</th>
<td>
<p>Php5</p>
<p>PHP 5.2</p>
</td>
</tr>
<tr>
308,8 → 306,7
author
</th>
<td>
<p>Christian Schmidt <a href="mailto:schmidt@php.net">schmidt@php.net</a>
// Autre auteurs</p>
<p>Christian SCHMIDT<a href="mailto:schmidt@php.net">schmidt@php.net</a></p>
<p>Aurélien PERONNET <a href="mailto:aurelien@tela-botanica.org">aurelien@tela-botanica.org</a></p>
<p>Jean-Pascal MILCENT <a href="mailto:jpm@tela-botanica.org">jpm@tela-botanica.org</a></p>
</td>
319,7 → 316,7
copyright
</th>
<td>
<p>2009 Tela-Botanica</p>
<p>Copyright (c) 2009, Tela Botanica (accueil@tela-botanica.org)</p>
</td>
</tr>
<tr>
327,20 → 324,12
license
</th>
<td>
<p><a href="http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt">http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt</a> Licence CECILL</p>
<p><a href="http://www.gnu.org/licenses/gpl.html">http://www.gnu.org/licenses/gpl.html</a> Licence GNU-GPL</p>
<p>GNU-GPL-v3 <a href="http://www.gnu.org/licenses/gpl.html">http://www.gnu.org/licenses/gpl.html</a></p>
<p>CECILL-v2 <a href="http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt">http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt</a></p>
</td>
</tr>
<tr>
<th>
version
</th>
<td>
</td>
</tr>
<tr>
<th>
todo
</th>
<td>
2146,7 → 2135,7
<section class="span10 offset1">
<hr />
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
on March 12th, 2014 at 16:55.
on March 18th, 2014 at 19:19.
</section>
</section>
</section>
/branches/v0.2-buhl/doc/PhpDoc/classes/Application.html
113,12 → 113,12
<ul class="dropdown-menu">
<li>
<a href="../reports/errors.html">
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">54</span>
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">70</span>
</a>
</li>
<li>
<a href="../reports/markers.html">
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">0</span>
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">0</span>
</a>
</li>
</ul>
138,10 → 138,10
<div class="accordion" style="margin-bottom: 0">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-1550595792"></a>
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-211149678"></a>
<a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
</div>
<div id="namespace-1550595792" class="accordion-body collapse in">
<div id="namespace-211149678" class="accordion-body collapse in">
<div class="accordion-inner">
 
154,6 → 154,7
<li class="class"><a href="../classes/GestionnaireException.html">GestionnaireException</a></li>
<li class="class"><a href="../classes/Modele.html">Modele</a></li>
<li class="class"><a href="../classes/Registre.html">Registre</a></li>
<li class="class"><a href="../classes/I18n.html">I18n</a></li>
<li class="class"><a href="../classes/Config.html">Config</a></li>
<li class="class"><a href="../classes/Application.html">Application</a></li>
<li class="class"><a href="../classes/Log.html">Log</a></li>
176,7 → 177,7
 
<h1><small>\</small>Application</h1>
<p><em>Classe fournissant des informations au Framework sur l&#039;application.</em></p>
<p>PHP version 5</p>
 
<section id="summary">
<h2>Summary</h2>
237,8 → 238,7
<dt>File</dt>
<dd><a href="../files/Application.php.html"><div class="path-wrapper">Application.php</div></a></dd>
<dt>Package</dt>
<dd><div class="namespace-wrapper">\Framework
// Auteur principal :</div></dd>
<dd><div class="namespace-wrapper">\Framework</div></dd>
<dt>Class hierarchy</dt>
<dd class="hierarchy">
<div class="namespace-wrapper">\Application</div>
256,7 → 256,7
category
</th>
<td>
<p>Debogage</p>
<p>PHP 5.2</p>
</td>
</tr>
<tr>
264,37 → 264,28
author
</th>
<td>
<p>Jean-Pascal MILCENT <a href="mailto:jpm@tela-botanica.org">jpm@tela-botanica.org</a>
// Autres auteurs :</p>
<p>Jean-Pascal MILCENT <a href="mailto:jpm@tela-botanica.org">jpm@tela-botanica.org</a></p>
</td>
</tr>
<tr>
<th>
license
copyright
</th>
<td>
<p>GPL v3 <a href="http://www.gnu.org/licenses/gpl.txt">http://www.gnu.org/licenses/gpl.txt</a></p>
<p>CECILL v2 <a href="http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt">http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt</a></p>
<p>Copyright (c) 2009, Tela Botanica (accueil@tela-botanica.org)</p>
</td>
</tr>
<tr>
<th>
version
license
</th>
<td>
<p>$Id: Application.php 456 2014-02-06 11:07:43Z jpm $</p>
<p>GNU-GPL-v3 <a href="http://www.gnu.org/licenses/gpl.html">http://www.gnu.org/licenses/gpl.html</a></p>
<p>CECILL-v2 <a href="http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt">http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt</a></p>
</td>
</tr>
<tr>
<th>
copyright
</th>
<td>
<p>1999-2009 Tela Botanica (accueil@tela-botanica.org)</p>
</td>
</tr>
<tr>
<th>
todo
</th>
<td>
616,7 → 607,7
<section class="span10 offset1">
<hr />
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
on March 12th, 2014 at 16:55.
on March 18th, 2014 at 19:19.
</section>
</section>
</section>
/branches/v0.2-buhl/doc/PhpDoc/classes/SquelettePhp.html
113,12 → 113,12
<ul class="dropdown-menu">
<li>
<a href="../reports/errors.html">
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">54</span>
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">70</span>
</a>
</li>
<li>
<a href="../reports/markers.html">
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">0</span>
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">0</span>
</a>
</li>
</ul>
138,10 → 138,10
<div class="accordion" style="margin-bottom: 0">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-1089514397"></a>
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-1961389844"></a>
<a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
</div>
<div id="namespace-1089514397" class="accordion-body collapse in">
<div id="namespace-1961389844" class="accordion-body collapse in">
<div class="accordion-inner">
 
154,6 → 154,7
<li class="class"><a href="../classes/GestionnaireException.html">GestionnaireException</a></li>
<li class="class"><a href="../classes/Modele.html">Modele</a></li>
<li class="class"><a href="../classes/Registre.html">Registre</a></li>
<li class="class"><a href="../classes/I18n.html">I18n</a></li>
<li class="class"><a href="../classes/Config.html">Config</a></li>
<li class="class"><a href="../classes/Application.html">Application</a></li>
<li class="class"><a href="../classes/Log.html">Log</a></li>
242,9 → 243,7
<dt>See also</dt>
<dd><a href="/doc/framework/"><div class="namespace-wrapper">/doc/framework/</div></a></dd>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
253,7 → 252,7
category
</th>
<td>
<p>php5</p>
<p>PHP 5.2</p>
</td>
</tr>
<tr>
269,7 → 268,7
copyright
</th>
<td>
<p>2010 Tela-Botanica</p>
<p>Copyright (c) 2009, Tela Botanica (accueil@tela-botanica.org)</p>
</td>
</tr>
<tr>
277,20 → 276,12
license
</th>
<td>
<p><a href="http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt">http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt</a> Licence CECILL</p>
<p><a href="http://www.gnu.org/licenses/gpl.html">http://www.gnu.org/licenses/gpl.html</a> Licence GNU-GPL</p>
<p>GNU-GPL-v3 <a href="http://www.gnu.org/licenses/gpl.html">http://www.gnu.org/licenses/gpl.html</a></p>
<p>CECILL-v2 <a href="http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt">http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt</a></p>
</td>
</tr>
<tr>
<th>
version
</th>
<td>
<p>SVN: $$Id: SquelettePhp.php 153 2010-03-04 10:48:32Z jpm $$</p>
</td>
</tr>
<tr>
<th>
todo
</th>
<td>
449,7 → 440,7
<section class="span10 offset1">
<hr />
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
on March 12th, 2014 at 16:55.
on March 18th, 2014 at 19:19.
</section>
</section>
</section>
/branches/v0.2-buhl/doc/PhpDoc/classes/Registre.html
113,12 → 113,12
<ul class="dropdown-menu">
<li>
<a href="../reports/errors.html">
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">54</span>
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">70</span>
</a>
</li>
<li>
<a href="../reports/markers.html">
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">0</span>
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">0</span>
</a>
</li>
</ul>
138,10 → 138,10
<div class="accordion" style="margin-bottom: 0">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-152390243"></a>
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-1450018424"></a>
<a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
</div>
<div id="namespace-152390243" class="accordion-body collapse in">
<div id="namespace-1450018424" class="accordion-body collapse in">
<div class="accordion-inner">
 
154,6 → 154,7
<li class="class"><a href="../classes/GestionnaireException.html">GestionnaireException</a></li>
<li class="class"><a href="../classes/Modele.html">Modele</a></li>
<li class="class"><a href="../classes/Registre.html">Registre</a></li>
<li class="class"><a href="../classes/I18n.html">I18n</a></li>
<li class="class"><a href="../classes/Config.html">Config</a></li>
<li class="class"><a href="../classes/Application.html">Application</a></li>
<li class="class"><a href="../classes/Log.html">Log</a></li>
177,7 → 178,6
<h1><small>\</small>Registre</h1>
<p><em>Classe registre, qui permet un accès à différentes variables à travers les autres classes.</em></p>
<p>C'est un singleton</p>
<p>PHP Version 5</p>
 
<section id="summary">
<h2>Summary</h2>
248,9 → 248,7
<dt>See also</dt>
<dd><a href="/doc/framework/"><div class="namespace-wrapper">/doc/framework/</div></a></dd>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
259,7 → 257,7
category
</th>
<td>
<p>Class</p>
<p>PHP 5.2</p>
</td>
</tr>
<tr>
267,7 → 265,7
author
</th>
<td>
<p>Jean-Pascal Milcent <a href="mailto:jmp@tela-botanica.org">jmp@tela-botanica.org</a></p>
<p>Jean-Pascal MILCENT <a href="mailto:jpm@tela-botanica.org">jpm@tela-botanica.org</a></p>
</td>
</tr>
<tr>
275,7 → 273,7
copyright
</th>
<td>
<p>2009 Tela-Botanica</p>
<p>Copyright (c) 2009, Tela Botanica (accueil@tela-botanica.org)</p>
</td>
</tr>
<tr>
283,20 → 281,12
license
</th>
<td>
<p><a href="http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt">http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt</a> Licence CECILL</p>
<p><a href="http://www.gnu.org/licenses/gpl.html">http://www.gnu.org/licenses/gpl.html</a> Licence GNU-GPL</p>
<p>GNU-GPL-v3 <a href="http://www.gnu.org/licenses/gpl.html">http://www.gnu.org/licenses/gpl.html</a></p>
<p>CECILL-v2 <a href="http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt">http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt</a></p>
</td>
</tr>
<tr>
<th>
version
</th>
<td>
<p>SVN: $$Id: Registre.php 120 2009-09-01 12:21:14Z aurelien $$</p>
</td>
</tr>
<tr>
<th>
todo
</th>
<td>
658,7 → 648,7
<section class="span10 offset1">
<hr />
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
on March 12th, 2014 at 16:55.
on March 18th, 2014 at 19:19.
</section>
</section>
</section>
/branches/v0.2-buhl/doc/PhpDoc/classes/Chronometre.html
113,12 → 113,12
<ul class="dropdown-menu">
<li>
<a href="../reports/errors.html">
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">54</span>
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">70</span>
</a>
</li>
<li>
<a href="../reports/markers.html">
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">0</span>
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">0</span>
</a>
</li>
</ul>
138,10 → 138,10
<div class="accordion" style="margin-bottom: 0">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-461841465"></a>
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-783041917"></a>
<a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
</div>
<div id="namespace-461841465" class="accordion-body collapse in">
<div id="namespace-783041917" class="accordion-body collapse in">
<div class="accordion-inner">
 
154,6 → 154,7
<li class="class"><a href="../classes/GestionnaireException.html">GestionnaireException</a></li>
<li class="class"><a href="../classes/Modele.html">Modele</a></li>
<li class="class"><a href="../classes/Registre.html">Registre</a></li>
<li class="class"><a href="../classes/I18n.html">I18n</a></li>
<li class="class"><a href="../classes/Config.html">Config</a></li>
<li class="class"><a href="../classes/Application.html">Application</a></li>
<li class="class"><a href="../classes/Log.html">Log</a></li>
175,14 → 176,9
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal"><i class="icon-code"></i></a>
 
<h1><small>\</small>Chronometre</h1>
<p><em>Classe Chronometre() - Permet de stocker et d&#039;afficher
les temps d&#039;éxécution de script.</em></p>
<p>Cette classe permet de réaliser un ensemble
de mesure de temps prises à
différents endroits d'un script.
Ces mesures peuvent ensuite être affichées au
sein d'un tableau XHTML.</p>
<p>PHP Version 5</p>
<p><em>Classe Chronometre() - Permet de stocker et d&#039;afficher les temps d&#039;éxécution de script.</em></p>
<p>Cette classe permet de réaliser un ensemble de mesure de temps prises à différents endroits d'un script.
Ces mesures peuvent ensuite être affichées au sein d'un tableau XHTML.</p>
 
<section id="summary">
<h2>Summary</h2>
199,9 → 195,7
</section>
<section class="row-fluid public">
<section class="span4">
<a href="../classes/Chronometre.html#method___construct" class="">__construct()</a><br />
<a href="../classes/Chronometre.html#method_getTemps" class="">getTemps()</a><br />
<a href="../classes/Chronometre.html#method_setTemps" class="">setTemps()</a><br />
<a href="../classes/Chronometre.html#method_chrono" class="">chrono()</a><br />
<a href="../classes/Chronometre.html#method_afficherChrono" class="">afficherChrono()</a><br />
</section>
<section class="span4">
224,10 → 218,14
</section>
<section class="row-fluid private">
<section class="span4">
<em>No private methods found</em>
<a href="../classes/Chronometre.html#method___construct" class="">__construct()</a><br />
<a href="../classes/Chronometre.html#method_getTemps" class="">getTemps()</a><br />
<a href="../classes/Chronometre.html#method_setTemps" class="">setTemps()</a><br />
<a href="../classes/Chronometre.html#method_verifierCreationInstance" class="">verifierCreationInstance()</a><br />
</section>
<section class="span4">
<a href="../classes/Chronometre.html#property__temps" class="">$_temps</a><br />
<a href="../classes/Chronometre.html#property_instance" class="">$instance</a><br />
<a href="../classes/Chronometre.html#property_temps" class="">$temps</a><br />
</section>
<section class="span4">
<em>N/A</em>
251,9 → 249,7
<dt>See also</dt>
<dd><a href="/doc/framework/"><div class="namespace-wrapper">/doc/framework/</div></a></dd>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
262,7 → 258,7
category
</th>
<td>
<p>PHP</p>
<p>PHP 5.2</p>
</td>
</tr>
<tr>
278,7 → 274,7
copyright
</th>
<td>
<p>2009 Tela-Botanica</p>
<p>Copyright (c) 2009, Tela Botanica (accueil@tela-botanica.org)</p>
</td>
</tr>
<tr>
286,19 → 282,12
license
</th>
<td>
<p><a href="http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt">http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt</a> Licence CECILL</p>
<p>GNU-GPL-v3 <a href="http://www.gnu.org/licenses/gpl.html">http://www.gnu.org/licenses/gpl.html</a></p>
<p>CECILL-v2 <a href="http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt">http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt</a></p>
</td>
</tr>
<tr>
<th>
version
</th>
<td>
<p>Release: <package_version></p>
</td>
</tr>
<tr>
<th>
todo
</th>
<td>
319,10 → 308,10
 
<div class="row-fluid">
<div class="span8 content class">
<a id="property__temps" name="property__temps" class="anchor"></a>
<a id="property_instance" name="property_instance" class="anchor"></a>
<article class="property">
<h3 class="private ">$_temps</h3>
<pre class="signature">$_temps</pre>
<h3 class="private ">$instance</h3>
<pre class="signature">$instance</pre>
<p><em></em></p>
 
345,6 → 334,34
</aside>
</div>
 
<div class="row-fluid">
<div class="span8 content class">
<a id="property_temps" name="property_temps" class="anchor"></a>
<article class="property">
<h3 class="private ">$temps</h3>
<pre class="signature">$temps</pre>
<p><em></em></p>
 
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr>
<th>
todo
</th>
<td>
</td>
</tr>
</table>
</aside>
</div>
 
<a id="methods" name="methods"></a>
<div class="row-fluid">
354,9 → 371,114
 
<div class="row-fluid">
<div class="span8 content class">
<a id="method_chrono" name="method_chrono" class="anchor"></a>
<article class="method">
<h3 class="public ">chrono()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">chrono( <span class="argument">$cle</span>) : null</pre>
<p><em>Effectue un chronometrage.</em></p>
 
<h4>Parameters</h4>
<table class="table table-condensed table-hover">
<tr>
<td></td>
<td>$cle</td>
<td></td>
</tr>
</table>
<h4>Returns</h4>
null
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<span class="label label-info">static</span>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr>
<th>
todo
</th>
<td>
</td>
</tr>
</table>
</aside>
</div>
 
<div class="row-fluid">
<div class="span8 content class">
<a id="method_afficherChrono" name="method_afficherChrono" class="anchor"></a>
<article class="method">
<h3 class="public ">afficherChrono()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">afficherChrono(int <span class="argument">$indentation_origine</span>, int <span class="argument">$indentation</span>) : string</pre>
<p><em>Permet d&#039;afficher les temps d&#039;éxécution de différentes parties d&#039;un script.</em></p>
<p>Cette fonction permet d'afficher un ensemble de mesure de temps prises à différents endroits d'un script.
Ces mesures sont affichées au sein d'un tableau XHTML dont on peut controler l'indentation des balises.
Pour un site en production, il suffit d'ajouter un style #chrono {display:none;} dans la css.
De cette façon, le tableau ne s'affichera pas. Le webmaster lui pourra rajouter sa propre feuille de style
affichant le tableau.
Le développeur initial de cette fonction est Loic d'Anterroches.
Elle a été modifiée par Jean-Pascal Milcent.</p>
 
<h4>Parameters</h4>
<table class="table table-condensed table-hover">
<tr>
<td>int</td>
<td>$indentation_origine</td>
<td><p>l'indentation de base.</p></td>
</tr>
<tr>
<td>int</td>
<td>$indentation</td>
<td><p>le pas d'indentation.</p></td>
</tr>
</table>
<h4>Returns</h4>
string
&mdash; <p>la chaine XHTML de mesure des temps.</p>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<span class="label label-info">static</span>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr>
<th>
author
</th>
<td>
<p>Loic d'Anterroches</p>
<p>Jean-Pascal MILCENT <a href="mailto:jpm@tela-botanica.org">jpm@tela-botanica.org</a></p>
</td>
</tr>
<tr>
<th>
todo
</th>
<td>
</td>
</tr>
</table>
</aside>
</div>
 
<div class="row-fluid">
<div class="span8 content class">
<a id="method___construct" name="method___construct" class="anchor"></a>
<article class="method">
<h3 class="public ">__construct()</h3>
<h3 class="private ">__construct()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">__construct()</pre>
<p><em>Constructeur : *</em></p>
387,7 → 509,7
<div class="span8 content class">
<a id="method_getTemps" name="method_getTemps" class="anchor"></a>
<article class="method">
<h3 class="public ">getTemps()</h3>
<h3 class="private ">getTemps()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">getTemps(string <span class="argument">$cle</span>) : int</pre>
<p><em>Accesseurs :</em></p>
410,6 → 532,7
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<span class="label label-info">static</span>
<dl>
</dl>
<h2>Tags</h2>
429,9 → 552,9
<div class="span8 content class">
<a id="method_setTemps" name="method_setTemps" class="anchor"></a>
<article class="method">
<h3 class="public ">setTemps()</h3>
<h3 class="private ">setTemps()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">setTemps(\array() <span class="argument">$moment</span>) : null</pre>
<pre class="signature" style="margin-right: 54px;">setTemps( <span class="argument">$cle</span>, \array() <span class="argument">$moment</span>) : null</pre>
<p><em>Setteur pour la variable temps</em></p>
 
438,6 → 561,11
<h4>Parameters</h4>
<table class="table table-condensed table-hover">
<tr>
<td></td>
<td>$cle</td>
<td></td>
</tr>
<tr>
<td>\array()</td>
<td>$moment</td>
<td><p>ajoute des points de chronométrage au tableau _temps</p></td>
451,6 → 579,7
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<span class="label label-info">static</span>
<dl>
</dl>
<h2>Tags</h2>
468,47 → 597,21
 
<div class="row-fluid">
<div class="span8 content class">
<a id="method_afficherChrono" name="method_afficherChrono" class="anchor"></a>
<a id="method_verifierCreationInstance" name="method_verifierCreationInstance" class="anchor"></a>
<article class="method">
<h3 class="public ">afficherChrono()</h3>
<h3 class="private ">verifierCreationInstance()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">afficherChrono(int <span class="argument">$indentation_origine</span>, int <span class="argument">$indentation</span>) : string</pre>
<p><em>Méthode afficherChrono() -
Permet d&#039;afficher les temps d&#039;éxécution de différentes parties d&#039;un script.</em></p>
<p>Cette fonction permet d'afficher un ensemble de
mesure de temps prises à différents endroits d'un script.
Ces mesures sont affichées au sein d'un tableau XHTML
dont on peut controler l'indentation des balises.
Pour un site en production, il suffit d'ajouter un style</p>
<h1>chrono {display:none;} dans la css. De cette façon,</h1>
<p>le tableau ne s'affichera pas. Le webmaster lui pourra
rajouter sa propre feuille de style affichant le tableau.
Le développeur initial de cette fonction est Loic d'Anterroches.
Elle a été modifiée par Jean-Pascal Milcent.
Elle utilise une variable gobale : $<em>CHRONO</em></p>
<pre class="signature" style="margin-right: 54px;">verifierCreationInstance()</pre>
<p><em>Vérifie si l&#039;instance de classe à été crée, si non la crée</em></p>
 
<h4>Parameters</h4>
<table class="table table-condensed table-hover">
<tr>
<td>int</td>
<td>$indentation_origine</td>
<td><p>l'indentation de base.</p></td>
</tr>
<tr>
<td>int</td>
<td>$indentation</td>
<td><p>le pas d'indentation.</p></td>
</tr>
</table>
<h4>Returns</h4>
string
&mdash; <p>la chaine XHTML de mesure des temps.</p>
</article>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<span class="label label-info">static</span>
<dl>
</dl>
<h2>Tags</h2>
515,15 → 618,6
<table class="table table-condensed">
<tr>
<th>
author
</th>
<td>
<p>Loic d'Anterroches</p>
<p>Jean-Pascal MILCENT <a href="mailto:jpm@tela-botanica.org">jpm@tela-botanica.org</a></p>
</td>
</tr>
<tr>
<th>
todo
</th>
<td>
533,7 → 627,7
</aside>
</div>
 
</div>
</div>
</section>
 
<div id="source-view" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="source-view-label" aria-hidden="true">
582,7 → 676,7
<section class="span10 offset1">
<hr />
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
on March 12th, 2014 at 16:55.
on March 18th, 2014 at 19:19.
</section>
</section>
</section>
/branches/v0.2-buhl/doc/PhpDoc/classes/Config.html
113,12 → 113,12
<ul class="dropdown-menu">
<li>
<a href="../reports/errors.html">
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">54</span>
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">70</span>
</a>
</li>
<li>
<a href="../reports/markers.html">
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">0</span>
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">0</span>
</a>
</li>
</ul>
138,10 → 138,10
<div class="accordion" style="margin-bottom: 0">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-1806433338"></a>
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-1523942602"></a>
<a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
</div>
<div id="namespace-1806433338" class="accordion-body collapse in">
<div id="namespace-1523942602" class="accordion-body collapse in">
<div class="accordion-inner">
 
154,6 → 154,7
<li class="class"><a href="../classes/GestionnaireException.html">GestionnaireException</a></li>
<li class="class"><a href="../classes/Modele.html">Modele</a></li>
<li class="class"><a href="../classes/Registre.html">Registre</a></li>
<li class="class"><a href="../classes/I18n.html">I18n</a></li>
<li class="class"><a href="../classes/Config.html">Config</a></li>
<li class="class"><a href="../classes/Application.html">Application</a></li>
<li class="class"><a href="../classes/Log.html">Log</a></li>
178,7 → 179,6
<p><em>Config permet de charger automatiquement les fichiers ini du Framework et de l&#039;application.</em></p>
<p>Elle offre l'accès en lecture seule aux paramètres de config.
C'est une Singleton.</p>
<p>PHP Version 5</p>
 
<section id="summary">
<h2>Summary</h2>
195,6 → 195,7
</section>
<section class="row-fluid public">
<section class="span4">
<a href="../classes/Config.html#method_parserFichierIni" class="">parserFichierIni()</a><br />
<a href="../classes/Config.html#method_charger" class="">charger()</a><br />
<a href="../classes/Config.html#method_get" class="">get()</a><br />
<a href="../classes/Config.html#method_existe" class="">existe()</a><br />
221,7 → 222,6
<section class="span4">
<a href="../classes/Config.html#method___construct" class="">__construct()</a><br />
<a href="../classes/Config.html#method_chargerFichierContexte" class="">chargerFichierContexte()</a><br />
<a href="../classes/Config.html#method_parserFichierIni" class="">parserFichierIni()</a><br />
<a href="../classes/Config.html#method_fusionner" class="">fusionner()</a><br />
<a href="../classes/Config.html#method_getValeur" class="">getValeur()</a><br />
<a href="../classes/Config.html#method_existeValeur" class="">existeValeur()</a><br />
257,9 → 257,7
<dt>See also</dt>
<dd><a href="/doc/framework/"><div class="namespace-wrapper">/doc/framework/</div></a></dd>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
268,7 → 266,7
category
</th>
<td>
<p>PHP</p>
<p>PHP 5.2</p>
</td>
</tr>
<tr>
284,7 → 282,7
copyright
</th>
<td>
<p>2009 Tela-Botanica</p>
<p>Copyright (c) 2009, Tela Botanica (accueil@tela-botanica.org)</p>
</td>
</tr>
<tr>
292,19 → 290,12
license
</th>
<td>
<p>GPL-v3 et CECILL-v2</p>
<p>GNU-GPL-v3 <a href="http://www.gnu.org/licenses/gpl.html">http://www.gnu.org/licenses/gpl.html</a></p>
<p>CECILL-v2 <a href="http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt">http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt</a></p>
</td>
</tr>
<tr>
<th>
version
</th>
<td>
<p>SVN: <svn_id></p>
</td>
</tr>
<tr>
<th>
todo
</th>
<td>
388,6 → 379,49
 
<div class="row-fluid">
<div class="span8 content class">
<a id="method_parserFichierIni" name="method_parserFichierIni" class="anchor"></a>
<article class="method">
<h3 class="public ">parserFichierIni()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">parserFichierIni(string <span class="argument">$fichier_ini</span>) : array</pre>
<p><em>Parse le fichier ini donné en paramètre</em></p>
 
<h4>Parameters</h4>
<table class="table table-condensed table-hover">
<tr>
<td>string</td>
<td>$fichier_ini</td>
<td><p>nom du fichier ini à parser</p></td>
</tr>
</table>
<h4>Returns</h4>
array
&mdash; <p>tableau contenant les paramètres du fichier ini</p>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<span class="label label-info">static</span>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr>
<th>
todo
</th>
<td>
</td>
</tr>
</table>
</aside>
</div>
 
<div class="row-fluid">
<div class="span8 content class">
<a id="method_charger" name="method_charger" class="anchor"></a>
<article class="method">
<h3 class="public ">charger()</h3>
588,49 → 622,6
 
<div class="row-fluid">
<div class="span8 content class">
<a id="method_parserFichierIni" name="method_parserFichierIni" class="anchor"></a>
<article class="method">
<h3 class="private ">parserFichierIni()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">parserFichierIni(string <span class="argument">$fichier_ini</span>) : array</pre>
<p><em>Parse le fichier ini donné en paramètre</em></p>
 
<h4>Parameters</h4>
<table class="table table-condensed table-hover">
<tr>
<td>string</td>
<td>$fichier_ini</td>
<td><p>nom du fichier ini à parser</p></td>
</tr>
</table>
<h4>Returns</h4>
array
&mdash; <p>tableau contenant les paramètres du fichier ini</p>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<span class="label label-info">static</span>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr>
<th>
todo
</th>
<td>
</td>
</tr>
</table>
</aside>
</div>
 
<div class="row-fluid">
<div class="span8 content class">
<a id="method_fusionner" name="method_fusionner" class="anchor"></a>
<article class="method">
<h3 class="private ">fusionner()</h3>
1027,7 → 1018,7
<section class="span10 offset1">
<hr />
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
on March 12th, 2014 at 16:55.
on March 18th, 2014 at 19:19.
</section>
</section>
</section>
/branches/v0.2-buhl/doc/PhpDoc/classes/Modele.html
113,12 → 113,12
<ul class="dropdown-menu">
<li>
<a href="../reports/errors.html">
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">54</span>
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">70</span>
</a>
</li>
<li>
<a href="../reports/markers.html">
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">0</span>
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">0</span>
</a>
</li>
</ul>
138,10 → 138,10
<div class="accordion" style="margin-bottom: 0">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-1082738804"></a>
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-1802128692"></a>
<a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
</div>
<div id="namespace-1082738804" class="accordion-body collapse in">
<div id="namespace-1802128692" class="accordion-body collapse in">
<div class="accordion-inner">
 
154,6 → 154,7
<li class="class"><a href="../classes/GestionnaireException.html">GestionnaireException</a></li>
<li class="class"><a href="../classes/Modele.html">Modele</a></li>
<li class="class"><a href="../classes/Registre.html">Registre</a></li>
<li class="class"><a href="../classes/I18n.html">I18n</a></li>
<li class="class"><a href="../classes/Config.html">Config</a></li>
<li class="class"><a href="../classes/Application.html">Application</a></li>
<li class="class"><a href="../classes/Log.html">Log</a></li>
179,7 → 180,6
<p>Elle fait office d'abstraction légère de base de données en utilisant diveres possibilités
d'abstraction de base de données (PDO, mysql, mysqli, sqlite)
Elle est abstraite donc doit obligatoirement être étendue.</p>
<p>PHP Version 5</p>
 
<section id="summary">
<h2>Summary</h2>
262,9 → 262,7
<dt>See also</dt>
<dd><a href="/doc/framework/"><div class="namespace-wrapper">/doc/framework/</div></a></dd>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
273,7 → 271,7
category
</th>
<td>
<p>Class</p>
<p>PHP 5.2</p>
</td>
</tr>
<tr>
281,7 → 279,7
author
</th>
<td>
<p>aurelien <a href="mailto:aurelien@tela-botanica.org">aurelien@tela-botanica.org</a></p>
<p>Aurélien PERONNET <a href="mailto:aurelien@tela-botanica.org">aurelien@tela-botanica.org</a></p>
</td>
</tr>
<tr>
289,7 → 287,7
copyright
</th>
<td>
<p>2009 Tela-Botanica</p>
<p>Copyright (c) 2009, Tela Botanica (accueil@tela-botanica.org)</p>
</td>
</tr>
<tr>
297,20 → 295,12
license
</th>
<td>
<p><a href="http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt">http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt</a> Licence CECILL</p>
<p><a href="http://www.gnu.org/licenses/gpl.html">http://www.gnu.org/licenses/gpl.html</a> Licence GNU-GPL</p>
<p>GNU-GPL-v3 <a href="http://www.gnu.org/licenses/gpl.html">http://www.gnu.org/licenses/gpl.html</a></p>
<p>CECILL-v2 <a href="http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt">http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt</a></p>
</td>
</tr>
<tr>
<th>
version
</th>
<td>
<p>SVN: $$Id: Modele.php 426 2013-04-30 16:58:14Z jpm $$</p>
</td>
</tr>
<tr>
<th>
todo
</th>
<td>
1033,7 → 1023,7
<section class="span10 offset1">
<hr />
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
on March 12th, 2014 at 16:55.
on March 18th, 2014 at 19:19.
</section>
</section>
</section>
/branches/v0.2-buhl/doc/PhpDoc/classes/Debug.html
113,12 → 113,12
<ul class="dropdown-menu">
<li>
<a href="../reports/errors.html">
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">54</span>
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">70</span>
</a>
</li>
<li>
<a href="../reports/markers.html">
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">0</span>
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">0</span>
</a>
</li>
</ul>
138,10 → 138,10
<div class="accordion" style="margin-bottom: 0">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-1887367903"></a>
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-1722111506"></a>
<a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
</div>
<div id="namespace-1887367903" class="accordion-body collapse in">
<div id="namespace-1722111506" class="accordion-body collapse in">
<div class="accordion-inner">
 
154,6 → 154,7
<li class="class"><a href="../classes/GestionnaireException.html">GestionnaireException</a></li>
<li class="class"><a href="../classes/Modele.html">Modele</a></li>
<li class="class"><a href="../classes/Registre.html">Registre</a></li>
<li class="class"><a href="../classes/I18n.html">I18n</a></li>
<li class="class"><a href="../classes/Config.html">Config</a></li>
<li class="class"><a href="../classes/Application.html">Application</a></li>
<li class="class"><a href="../classes/Log.html">Log</a></li>
178,7 → 179,6
<p><em>Classe fournissant des fonctions de débogage équivalante à var_dump et print_r.</em></p>
<p>L'affichage et l'utilisation de ces fonctions sont améliorés via cette classe.
Cette classe est inspirée de la classe Zend_Debug.</p>
<p>PHP version 5</p>
 
<section id="summary">
<h2>Summary</h2>
203,7 → 203,8
<em>No public properties found</em>
</section>
<section class="span4">
<em>No constants found</em>
<a href="../classes/Debug.html#constant_MODE_ECHO" class="">MODE_ECHO</a><br />
<a href="../classes/Debug.html#constant_MODE_NOTICE" class="">MODE_NOTICE</a><br />
</section>
</section>
<section class="row-fluid protected">
222,6 → 223,7
<a href="../classes/Debug.html#method_traiterDebogage" class="">traiterDebogage()</a><br />
<a href="../classes/Debug.html#method_formaterMotCle" class="">formaterMotCle()</a><br />
<a href="../classes/Debug.html#method_traiterSortieSuivantMode" class="">traiterSortieSuivantMode()</a><br />
<a href="../classes/Debug.html#method_verifierParametresConfig" class="">verifierParametresConfig()</a><br />
</section>
<section class="span4">
<em>No private properties found</em>
239,8 → 241,7
<dt>File</dt>
<dd><a href="../files/Debug.php.html"><div class="path-wrapper">Debug.php</div></a></dd>
<dt>Package</dt>
<dd><div class="namespace-wrapper">\Framework
// Auteur principal :</div></dd>
<dd><div class="namespace-wrapper">\Framework</div></dd>
<dt>Class hierarchy</dt>
<dd class="hierarchy">
<div class="namespace-wrapper">\Debug</div>
258,7 → 259,7
category
</th>
<td>
<p>Debogage</p>
<p>PHP 5.2</p>
</td>
</tr>
<tr>
266,37 → 267,28
author
</th>
<td>
<p>Jean-Pascal MILCENT <a href="mailto:jpm@tela-botanica.org">jpm@tela-botanica.org</a>
// Autres auteurs :</p>
<p>Jean-Pascal MILCENT <a href="mailto:jpm@tela-botanica.org">jpm@tela-botanica.org</a></p>
</td>
</tr>
<tr>
<th>
license
copyright
</th>
<td>
<p>GPL v3 <a href="http://www.gnu.org/licenses/gpl.txt">http://www.gnu.org/licenses/gpl.txt</a></p>
<p>CECILL v2 <a href="http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt">http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt</a></p>
<p>Copyright (c) 2009, Tela Botanica (accueil@tela-botanica.org)</p>
</td>
</tr>
<tr>
<th>
version
license
</th>
<td>
<p>$$Id: Debug.php 167 2010-03-19 17:12:08Z jpm $$</p>
<p>GNU-GPL-v3 <a href="http://www.gnu.org/licenses/gpl.html">http://www.gnu.org/licenses/gpl.html</a></p>
<p>CECILL-v2 <a href="http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt">http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt</a></p>
</td>
</tr>
<tr>
<th>
copyright
</th>
<td>
<p>1999-2009 Tela Botanica (accueil@tela-botanica.org)</p>
</td>
</tr>
<tr>
<th>
todo
</th>
<td>
306,7 → 298,69
</aside>
</div>
 
<a id="constants" name="constants"></a>
<div class="row-fluid">
<div class="span8 content class">
<h2>Constants</h2>
</div>
<aside class="span4 detailsbar"></aside>
</div>
 
<div class="row-fluid">
<div class="span8 content class">
<a id="constant_MODE_ECHO" name="constant_MODE_ECHO" class="anchor"></a>
<article id="constant_MODE_ECHO" class="constant">
<h3 class="">MODE_ECHO</h3>
<pre class="signature">MODE_ECHO</pre>
<p><em></em></p>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr>
<th>
todo
</th>
<td>
</td>
</tr>
</table>
</aside>
</div>
 
<div class="row-fluid">
<div class="span8 content class">
<a id="constant_MODE_NOTICE" name="constant_MODE_NOTICE" class="anchor"></a>
<article id="constant_MODE_NOTICE" class="constant">
<h3 class="">MODE_NOTICE</h3>
<pre class="signature">MODE_NOTICE</pre>
<p><em></em></p>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr>
<th>
todo
</th>
<td>
</td>
</tr>
</table>
</aside>
</div>
 
<a id="properties" name="properties"></a>
<div class="row-fluid">
<div class="span8 content class">
445,7 → 499,7
<h3 class="public ">printr()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">printr(mixed <span class="argument">$variable</span>, string <span class="argument">$mot_cle</span>, boolean <span class="argument">$echo</span>) : string</pre>
<p><em>Equivalent de print_r</em></p>
<p><em>Equivalent de print_r.</em></p>
 
<h4>Parameters</h4>
635,6 → 689,39
</aside>
</div>
 
<div class="row-fluid">
<div class="span8 content class">
<a id="method_verifierParametresConfig" name="method_verifierParametresConfig" class="anchor"></a>
<article class="method">
<h3 class="private ">verifierParametresConfig()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">verifierParametresConfig()</pre>
<p><em>Vérifie que tous les paramêtres de config nécessaires au fonctionnement de cette classe existe dans les fichiers
de configurations.</em></p>
 
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<span class="label label-info">static</span>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr>
<th>
todo
</th>
<td>
</td>
</tr>
</table>
</aside>
</div>
 
</div>
</section>
 
684,7 → 771,7
<section class="span10 offset1">
<hr />
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
on March 12th, 2014 at 16:55.
on March 18th, 2014 at 19:19.
</section>
</section>
</section>
/branches/v0.2-buhl/doc/PhpDoc/classes/GestionnaireException.html
113,12 → 113,12
<ul class="dropdown-menu">
<li>
<a href="../reports/errors.html">
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">54</span>
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">70</span>
</a>
</li>
<li>
<a href="../reports/markers.html">
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">0</span>
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">0</span>
</a>
</li>
</ul>
138,10 → 138,10
<div class="accordion" style="margin-bottom: 0">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-921820162"></a>
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-1853400035"></a>
<a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
</div>
<div id="namespace-921820162" class="accordion-body collapse in">
<div id="namespace-1853400035" class="accordion-body collapse in">
<div class="accordion-inner">
 
154,6 → 154,7
<li class="class"><a href="../classes/GestionnaireException.html">GestionnaireException</a></li>
<li class="class"><a href="../classes/Modele.html">Modele</a></li>
<li class="class"><a href="../classes/Registre.html">Registre</a></li>
<li class="class"><a href="../classes/I18n.html">I18n</a></li>
<li class="class"><a href="../classes/Config.html">Config</a></li>
<li class="class"><a href="../classes/Application.html">Application</a></li>
<li class="class"><a href="../classes/Log.html">Log</a></li>
195,16 → 196,11
<section class="span4">
<a href="../classes/GestionnaireException.html#method_initialiser" class="">initialiser()</a><br />
<a href="../classes/GestionnaireException.html#method_configurer" class="">configurer()</a><br />
<a href="../classes/GestionnaireException.html#method_getExceptionsNbre" class="">getExceptionsNbre()</a><br />
<a href="../classes/GestionnaireException.html#method_getContexte" class="">getContexte()</a><br />
<a href="../classes/GestionnaireException.html#method_setContexte" class="">setContexte()</a><br />
<a href="../classes/GestionnaireException.html#method_gererException" class="">gererException()</a><br />
<a href="../classes/GestionnaireException.html#method_gererErreur" class="">gererErreur()</a><br />
<a href="../classes/GestionnaireException.html#method_getExceptions" class="deprecated">getExceptions()</a><br />
<a href="../classes/GestionnaireException.html#method_getExceptionsFormatees" class="">getExceptionsFormatees()</a><br />
<a href="../classes/GestionnaireException.html#method_getExceptionsTriees" class="">getExceptionsTriees()</a><br />
<a href="../classes/GestionnaireException.html#method_formaterExceptionTxt" class="">formaterExceptionTxt()</a><br />
<a href="../classes/GestionnaireException.html#method_formaterExceptionXhtml" class="">formaterExceptionXhtml()</a><br />
<a href="../classes/GestionnaireException.html#method_getExceptions" class="">getExceptions()</a><br />
<a href="../classes/GestionnaireException.html#method___destruct" class="">__destruct()</a><br />
</section>
<section class="span4">
258,9 → 254,7
<dt>See also</dt>
<dd><a href="/doc/framework/"><div class="namespace-wrapper">/doc/framework/</div></a></dd>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
294,20 → 288,12
license
</th>
<td>
<p><a href="http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt">http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt</a> Licence CECILL</p>
<p><a href="http://www.gnu.org/licenses/gpl.html">http://www.gnu.org/licenses/gpl.html</a> Licence GNU-GPL</p>
<p>GNU-GPL-v3 <a href="http://www.gnu.org/licenses/gpl.html">http://www.gnu.org/licenses/gpl.html</a></p>
<p>CECILL-v2 <a href="http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt">http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt</a></p>
</td>
</tr>
<tr>
<th>
version
</th>
<td>
<p>$Id: GestionnaireException.php 342 2011-06-06 13:58:53Z jpm $$</p>
</td>
</tr>
<tr>
<th>
todo
</th>
<td>
574,65 → 560,17
 
<div class="row-fluid">
<div class="span8 content class">
<a id="method_getExceptionsNbre" name="method_getExceptionsNbre" class="anchor"></a>
<article class="method">
<h3 class="public ">getExceptionsNbre()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">getExceptionsNbre() : int</pre>
<p><em>Renvoie le nombre d&#039;exceptions et d&#039;erreurs levées.</em></p>
 
<h4>Returns</h4>
int
&mdash; <p>le nombre d'exception actuellement levées</p>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<span class="label label-info">static</span>
<dl>
<dt>See also</dt>
<dd><a href=""><span class="namespace-wrapper">pour obtenir les exceptions formatées.</span></a></dd>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr>
<th>
since
</th>
<td>
0.3
</td>
</tr>
<tr>
<th>
todo
</th>
<td>
</td>
</tr>
</table>
</aside>
</div>
 
<div class="row-fluid">
<div class="span8 content class">
<a id="method_getContexte" name="method_getContexte" class="anchor"></a>
<article class="method">
<h3 class="public ">getContexte()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">getContexte() : bool</pre>
<pre class="signature" style="margin-right: 54px;">getContexte()</pre>
<p><em>Renvoie le booleen définissant si l&#039;on affiche le contexte ou non</em></p>
 
<h4>Returns</h4>
bool
&mdash; <p>true si on affiche le contexte sinon false.</p>
</article>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
699,8 → 637,8
<h3 class="public ">gererException()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">gererException(\Exception <span class="argument">$e</span>)</pre>
<p><em>Fonction de gestion des exceptions, remplace le handler par défaut.</em></p>
<p>Si une boucle génère de multiple exception (ou erreur) identique une seule sera stockée.</p>
<p><em>Fonction de gestion des exceptions, remplace le handler par défaut</em></p>
 
<h4>Parameters</h4>
<table class="table table-condensed table-hover">
796,160 → 734,15
<div class="span8 content class">
<a id="method_getExceptions" name="method_getExceptions" class="anchor"></a>
<article class="method">
<h3 class="public deprecated">getExceptions()</h3>
<h3 class="public ">getExceptions()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">getExceptions() : string</pre>
<p><em>Renvoie les exceptions au format (X)HTML ou bien au format texte suivant le mode d&#039;utilisation de PHP.</em></p>
<pre class="signature" style="margin-right: 54px;">getExceptions()</pre>
<p><em>Renvoie les exceptions au format (X)HTML
ou bien au format texte suivant le mode d&#039;utilisation de PHP</em></p>
 
<h4>Returns</h4>
string
&mdash; <p>les exceptions formatées en texte ou (X)HTML.</p>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<span class="label label-info">static</span>
<aside class="alert alert-block alert-error">
<h4>Deprecated</h4>
</aside>
<dl>
<dt>See also</dt>
<dd><a href=""><span class="namespace-wrapper"></span></a></dd>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr>
<th>
since
</th>
<td>
0.3
</td>
</tr>
<tr>
<th>
todo
</th>
<td>
</td>
</tr>
</table>
</aside>
</div>
 
<div class="row-fluid">
<div class="span8 content class">
<a id="method_getExceptionsFormatees" name="method_getExceptionsFormatees" class="anchor"></a>
<article class="method">
<h3 class="public ">getExceptionsFormatees()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">getExceptionsFormatees() : string</pre>
<p><em>Renvoie les exceptions au format (X)HTML ou bien au format texte suivant le mode d&#039;utilisation de PHP.</em></p>
 
<h4>Returns</h4>
string
&mdash; <p>les exceptions formatées en texte ou (X)HTML.</p>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<span class="label label-info">static</span>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr>
<th>
since
</th>
<td>
0.3
</td>
</tr>
<tr>
<th>
todo
</th>
<td>
</td>
</tr>
</table>
</aside>
</div>
 
<div class="row-fluid">
<div class="span8 content class">
<a id="method_getExceptionsTriees" name="method_getExceptionsTriees" class="anchor"></a>
<article class="method">
<h3 class="public ">getExceptionsTriees()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">getExceptionsTriees() : array</pre>
<p><em>Renvoie le tableau d&#039;objets Exception générées par le script PHP triées du niveau de sévérité le plus élevé au moins élevé.</em></p>
<p>Format du tableau :
array{sévérité_1 = array{Exception1, Exception2, Exception3,...}, sévérité_1 = array{Exception1, Exception2, ...}, ...};
ATTENTION : si vous utilisez cette méthode, c'est à vous de gérer l'affichage des Exceptions. Le gestionnaire d'exception
n'enverra plus rien au navigateur ou à la console.</p>
 
<h4>Returns</h4>
array
&mdash; <p>le tableau trié d'objet Exception.</p>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<span class="label label-info">static</span>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr>
<th>
since
</th>
<td>
0.3
</td>
</tr>
<tr>
<th>
todo
</th>
<td>
</td>
</tr>
</table>
</aside>
</div>
 
<div class="row-fluid">
<div class="span8 content class">
<a id="method_formaterExceptionTxt" name="method_formaterExceptionTxt" class="anchor"></a>
<article class="method">
<h3 class="public ">formaterExceptionTxt()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">formaterExceptionTxt(\Exception <span class="argument">$e</span>)</pre>
<p><em>Formate en texte une exception passée en paramètre.</em></p>
 
<h4>Parameters</h4>
<table class="table table-condensed table-hover">
<tr>
<td>\Exception</td>
<td>$e</td>
<td></td>
</tr>
</table>
</article>
</div>
<aside class="span4 detailsbar">
961,14 → 754,6
<table class="table table-condensed">
<tr>
<th>
since
</th>
<td>
0.3
</td>
</tr>
<tr>
<th>
todo
</th>
<td>
980,61 → 765,12
 
<div class="row-fluid">
<div class="span8 content class">
<a id="method_formaterExceptionXhtml" name="method_formaterExceptionXhtml" class="anchor"></a>
<article class="method">
<h3 class="public ">formaterExceptionXhtml()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">formaterExceptionXhtml(\Exception <span class="argument">$e</span>)</pre>
<p><em>Formate en (X)HTML une exception passée en paramètre.</em></p>
 
<h4>Parameters</h4>
<table class="table table-condensed table-hover">
<tr>
<td>\Exception</td>
<td>$e</td>
<td></td>
</tr>
</table>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<span class="label label-info">static</span>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr>
<th>
since
</th>
<td>
0.3
</td>
</tr>
<tr>
<th>
todo
</th>
<td>
</td>
</tr>
</table>
</aside>
</div>
 
<div class="row-fluid">
<div class="span8 content class">
<a id="method___destruct" name="method___destruct" class="anchor"></a>
<article class="method">
<h3 class="public ">__destruct()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">__destruct()</pre>
<p><em>Lors de la destruction de la classe si des exceptions n&#039;ont pas été affichées, et si le débogage est à true, elles sont
affichées.</em></p>
<p><em></em></p>
 
1147,7 → 883,7
<section class="span10 offset1">
<hr />
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
on March 12th, 2014 at 16:55.
on March 18th, 2014 at 19:19.
</section>
</section>
</section>
/branches/v0.2-buhl/doc/PhpDoc/classes/Controleur.html
113,12 → 113,12
<ul class="dropdown-menu">
<li>
<a href="../reports/errors.html">
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">54</span>
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">70</span>
</a>
</li>
<li>
<a href="../reports/markers.html">
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">0</span>
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">0</span>
</a>
</li>
</ul>
138,10 → 138,10
<div class="accordion" style="margin-bottom: 0">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-1764599828"></a>
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-608539113"></a>
<a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
</div>
<div id="namespace-1764599828" class="accordion-body collapse in">
<div id="namespace-608539113" class="accordion-body collapse in">
<div class="accordion-inner">
 
154,6 → 154,7
<li class="class"><a href="../classes/GestionnaireException.html">GestionnaireException</a></li>
<li class="class"><a href="../classes/Modele.html">Modele</a></li>
<li class="class"><a href="../classes/Registre.html">Registre</a></li>
<li class="class"><a href="../classes/I18n.html">I18n</a></li>
<li class="class"><a href="../classes/Config.html">Config</a></li>
<li class="class"><a href="../classes/Application.html">Application</a></li>
<li class="class"><a href="../classes/Log.html">Log</a></li>
221,7 → 222,7
</section>
<section class="row-fluid private">
<section class="span4">
<em>No private methods found</em>
<a href="../classes/Controleur.html#method_verifierEtTraiterSlashTableauRequete" class="">verifierEtTraiterSlashTableauRequete()</a><br />
</section>
<section class="span4">
<a href="../classes/Controleur.html#property_encodage" class="">$encodage</a><br />
250,9 → 251,7
<dt>See also</dt>
<dd><a href="/doc/framework/"><div class="namespace-wrapper">/doc/framework/</div></a></dd>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
261,7 → 260,7
category
</th>
<td>
<p>php5</p>
<p>PHP 5.2</p>
</td>
</tr>
<tr>
278,7 → 277,7
copyright
</th>
<td>
<p>2009 Tela-Botanica</p>
<p>Copyright (c) 2009, Tela Botanica (accueil@tela-botanica.org)</p>
</td>
</tr>
<tr>
286,20 → 285,12
license
</th>
<td>
<p><a href="http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt">http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt</a> Licence CECILL</p>
<p><a href="http://www.gnu.org/licenses/gpl.html">http://www.gnu.org/licenses/gpl.html</a> Licence GNU-GPL</p>
<p>GNU-GPL-v3 <a href="http://www.gnu.org/licenses/gpl.html">http://www.gnu.org/licenses/gpl.html</a></p>
<p>CECILL-v2 <a href="http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt">http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt</a></p>
</td>
</tr>
<tr>
<th>
version
</th>
<td>
</td>
</tr>
<tr>
<th>
todo
</th>
<td>
684,7 → 675,38
</aside>
</div>
 
</div>
<div class="row-fluid">
<div class="span8 content class">
<a id="method_verifierEtTraiterSlashTableauRequete" name="method_verifierEtTraiterSlashTableauRequete" class="anchor"></a>
<article class="method">
<h3 class="private ">verifierEtTraiterSlashTableauRequete()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">verifierEtTraiterSlashTableauRequete()</pre>
<p><em>Procédure vérifiant l&#039;activation des magic quotes et remplace les slash dans les tableaux de requete</em></p>
 
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr>
<th>
todo
</th>
<td>
</td>
</tr>
</table>
</aside>
</div>
 
</div>
</section>
 
<div id="source-view" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="source-view-label" aria-hidden="true">
733,7 → 755,7
<section class="span10 offset1">
<hr />
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
on March 12th, 2014 at 16:55.
on March 18th, 2014 at 19:19.
</section>
</section>
</section>
/branches/v0.2-buhl/doc/PhpDoc/classes/I18n.html
New file
0,0 → 1,1011
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
<meta charset="utf-8"/>
<title>TBFramework - v0.2</title>
<meta name="author" content=""/>
<meta name="description" content=""/>
 
<link href="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.no-icons.min.css" rel="stylesheet">
<link href="https://netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.min.css" rel="stylesheet">
<link href="../css/prism.css" rel="stylesheet" media="all"/>
<link href="../css/template.css" rel="stylesheet" media="all"/>
<!--[if lt IE 9]>
<script src="https://html5shim.googlecode.com/svn/trunk/html5.js" type="text/javascript"></script>
<![endif]-->
<script src="https://code.jquery.com/jquery-1.10.2.min.js" type="text/javascript"></script>
<script src="https://code.jquery.com/ui/1.10.3/jquery-ui.min.js" type="text/javascript"></script>
<script src="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js"></script>
<script src="../js/jquery.smooth-scroll.js"></script>
<script src="../js/prism.min.js"></script>
<!-- TODO: Add http://jscrollpane.kelvinluck.com/ to style the scrollbars for browsers not using webkit-->
<script type="text/javascript">
function loadExternalCodeSnippets() {
Array.prototype.slice.call(document.querySelectorAll('pre[data-src]')).forEach(function (pre) {
var src = pre.getAttribute('data-src');
var extension = (src.match(/\.(\w+)$/) || [, ''])[1];
var language = 'php';
 
var code = document.createElement('code');
code.className = 'language-' + language;
 
pre.textContent = '';
 
code.textContent = 'Loading…';
 
pre.appendChild(code);
 
var xhr = new XMLHttpRequest();
 
xhr.open('GET', src, true);
 
xhr.onreadystatechange = function () {
if (xhr.readyState == 4) {
 
if (xhr.status < 400 && xhr.responseText) {
code.textContent = xhr.responseText;
 
Prism.highlightElement(code);
}
else if (xhr.status >= 400) {
code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;
}
else {
code.textContent = '✖ Error: File does not exist or is empty';
}
}
};
 
xhr.send(null);
});
}
 
$(document).ready(function(){
loadExternalCodeSnippets();
});
$('#source-view').on('shown', function () {
loadExternalCodeSnippets();
})
</script>
 
<link rel="shortcut icon" href="../images/favicon.ico"/>
<link rel="apple-touch-icon" href="../images/apple-touch-icon.png"/>
<link rel="apple-touch-icon" sizes="72x72" href="../images/apple-touch-icon-72x72.png"/>
<link rel="apple-touch-icon" sizes="114x114" href="../images/apple-touch-icon-114x114.png"/>
</head>
<body>
 
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<i class="icon-ellipsis-vertical"></i>
</a>
<a class="brand" href="../index.html">TBFramework - v0.2</a>
 
<div class="nav-collapse">
<ul class="nav pull-right">
<li class="dropdown">
<a href="../index.html" class="dropdown-toggle" data-toggle="dropdown">
API Documentation <b class="caret"></b>
</a>
<ul class="dropdown-menu">
</ul>
</li>
<li class="dropdown" id="charts-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Charts <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="../graphs/class.html">
<i class="icon-list-alt"></i>&#160;Class hierarchy diagram
</a>
</li>
</ul>
</li>
<li class="dropdown" id="reports-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Reports <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="../reports/errors.html">
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">70</span>
</a>
</li>
<li>
<a href="../reports/markers.html">
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">0</span>
</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<!--<div class="go_to_top">-->
<!--<a href="#___" style="color: inherit">Back to top&#160;&#160;<i class="icon-upload icon-white"></i></a>-->
<!--</div>-->
</div>
 
<div id="___" class="container-fluid">
<section class="row-fluid">
<div class="span2 sidebar">
<div class="accordion" style="margin-bottom: 0">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle " data-toggle="collapse" data-target="#namespace-642997245"></a>
<a href="../namespaces/default.html" style="margin-left: 30px; padding-left: 0">\</a>
</div>
<div id="namespace-642997245" class="accordion-body collapse in">
<div class="accordion-inner">
 
<ul>
<li class="class"><a href="../classes/Url.html">Url</a></li>
<li class="class"><a href="../classes/Debug.html">Debug</a></li>
<li class="class"><a href="../classes/Chronometre.html">Chronometre</a></li>
<li class="class"><a href="../classes/SquelettePhp.html">SquelettePhp</a></li>
<li class="class"><a href="../classes/Controleur.html">Controleur</a></li>
<li class="class"><a href="../classes/GestionnaireException.html">GestionnaireException</a></li>
<li class="class"><a href="../classes/Modele.html">Modele</a></li>
<li class="class"><a href="../classes/Registre.html">Registre</a></li>
<li class="class"><a href="../classes/I18n.html">I18n</a></li>
<li class="class"><a href="../classes/Config.html">Config</a></li>
<li class="class"><a href="../classes/Application.html">Application</a></li>
<li class="class"><a href="../classes/Log.html">Log</a></li>
</ul>
</div>
</div>
</div>
</div>
 
</div>
</section>
<section class="row-fluid">
<div class="span10 offset2">
<div class="row-fluid">
<div class="span8 content class">
<nav>
<a href="../namespaces/default.html">\</a> <i class="icon-level-up"></i>
</nav>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal"><i class="icon-code"></i></a>
 
<h1><small>\</small>I18n</h1>
<p><em>I18n permet de traduire une application à partir de données stockées dans des fichiers ini.</em></p>
<p>Si vous souhaitez utiliser le fonctionnement par défaut vous devrez :</p>
<ul>
<li>déposer les fichiers ini dans le dossier définit par la variable de config "chemin_i18n".</li>
<li>nommer les fichiers selon la forme "locale.ini" (Ex.: fr.ini ou fr_CH.ini ).</li>
</ul>
<p>Elle offre l'accès en lecture seule aux paramètres de des fichiers ini.
C'est une Singleton. Une seule classe de traduction peut être instanciée par Application.</p>
 
<section id="summary">
<h2>Summary</h2>
<section class="row-fluid heading">
<section class="span4">
<a href="#methods">Methods</a>
</section>
<section class="span4">
<a href="#properties">Properties</a>
</section>
<section class="span4">
<a href="#constants">Constants</a>
</section>
</section>
<section class="row-fluid public">
<section class="span4">
<a href="../classes/I18n.html#method_get" class="">get()</a><br />
<a href="../classes/I18n.html#method_charger" class="">charger()</a><br />
<a href="../classes/I18n.html#method_setLangue" class="">setLangue()</a><br />
</section>
<section class="span4">
<em>No public properties found</em>
</section>
<section class="span4">
<a href="../classes/I18n.html#constant_FORMAT_INI" class="">FORMAT_INI</a><br />
</section>
</section>
<section class="row-fluid protected">
<section class="span4">
<em>No protected methods found</em>
</section>
<section class="span4">
<em>No protected properties found</em>
</section>
<section class="span4">
<em>N/A</em>
</section>
</section>
<section class="row-fluid private">
<section class="span4">
<a href="../classes/I18n.html#method___construct" class="">__construct()</a><br />
<a href="../classes/I18n.html#method_getValeur" class="">getValeur()</a><br />
<a href="../classes/I18n.html#method_chargerFichierIni" class="">chargerFichierIni()</a><br />
<a href="../classes/I18n.html#method_analyserTableauIni" class="">analyserTableauIni()</a><br />
<a href="../classes/I18n.html#method_evaluerCle" class="">evaluerCle()</a><br />
<a href="../classes/I18n.html#method_trouverLangue" class="">trouverLangue()</a><br />
<a href="../classes/I18n.html#method_verifierCreationInstance" class="">verifierCreationInstance()</a><br />
<a href="../classes/I18n.html#method_verifierParametresConfig" class="">verifierParametresConfig()</a><br />
<a href="../classes/I18n.html#method_ajouterErreur" class="">ajouterErreur()</a><br />
</section>
<section class="span4">
<a href="../classes/I18n.html#property_instance" class="">$instance</a><br />
<a href="../classes/I18n.html#property_traductions" class="">$traductions</a><br />
<a href="../classes/I18n.html#property_langue" class="">$langue</a><br />
</section>
<section class="span4">
<em>N/A</em>
</section>
</section>
</section>
</div>
<aside class="span4 detailsbar">
<dl>
<dt>File</dt>
<dd><a href="../files/I18n.php.html"><div class="path-wrapper">I18n.php</div></a></dd>
<dt>Package</dt>
<dd><div class="namespace-wrapper">\Framework</div></dd>
<dt>Class hierarchy</dt>
<dd class="hierarchy">
<div class="namespace-wrapper">\I18n</div>
</dd>
 
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr>
<th>
category
</th>
<td>
<p>PHP 5.2</p>
</td>
</tr>
<tr>
<th>
author
</th>
<td>
<p>Jean-Pascal MILCENT <a href="mailto:jpm@tela-botanica.org">jpm@tela-botanica.org</a></p>
</td>
</tr>
<tr>
<th>
copyright
</th>
<td>
<p>Copyright (c) 2010, Tela Botanica (accueil@tela-botanica.org)</p>
</td>
</tr>
<tr>
<th>
license
</th>
<td>
<p>GNU-GPL-v3 <a href="http://www.gnu.org/licenses/gpl.html">http://www.gnu.org/licenses/gpl.html</a></p>
<p>CECILL-v2 <a href="http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt">http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt</a></p>
</td>
</tr>
<tr>
<th>
todo
</th>
<td>
</td>
</tr>
</table>
</aside>
</div>
 
<a id="constants" name="constants"></a>
<div class="row-fluid">
<div class="span8 content class">
<h2>Constants</h2>
</div>
<aside class="span4 detailsbar"></aside>
</div>
 
<div class="row-fluid">
<div class="span8 content class">
<a id="constant_FORMAT_INI" name="constant_FORMAT_INI" class="anchor"></a>
<article id="constant_FORMAT_INI" class="constant">
<h3 class="">FORMAT_INI</h3>
<pre class="signature">FORMAT_INI</pre>
<p><em>Format de traduction utilisant les fichier .ini</em></p>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr>
<th>
todo
</th>
<td>
</td>
</tr>
</table>
</aside>
</div>
 
<a id="properties" name="properties"></a>
<div class="row-fluid">
<div class="span8 content class">
<h2>Properties</h2>
</div>
<aside class="span4 detailsbar"></aside>
</div>
 
<div class="row-fluid">
<div class="span8 content class">
<a id="property_instance" name="property_instance" class="anchor"></a>
<article class="property">
<h3 class="private ">$instance</h3>
<pre class="signature">$instance</pre>
<p><em>Instance de la classe pointant sur elle même (pour le pattern singleton)</em></p>
 
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr>
<th>
todo
</th>
<td>
</td>
</tr>
</table>
</aside>
</div>
 
<div class="row-fluid">
<div class="span8 content class">
<a id="property_traductions" name="property_traductions" class="anchor"></a>
<article class="property">
<h3 class="private ">$traductions</h3>
<pre class="signature">$traductions</pre>
<p><em>Fichiers de traduction disponibles.</em></p>
 
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr>
<th>
todo
</th>
<td>
</td>
</tr>
</table>
</aside>
</div>
 
<div class="row-fluid">
<div class="span8 content class">
<a id="property_langue" name="property_langue" class="anchor"></a>
<article class="property">
<h3 class="private ">$langue</h3>
<pre class="signature">$langue</pre>
<p><em>Langue courrante utilisée par l&#039;application.</em></p>
 
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr>
<th>
todo
</th>
<td>
</td>
</tr>
</table>
</aside>
</div>
 
<a id="methods" name="methods"></a>
<div class="row-fluid">
<div class="span8 content class"><h2>Methods</h2></div>
<aside class="span4 detailsbar"></aside>
</div>
 
<div class="row-fluid">
<div class="span8 content class">
<a id="method_get" name="method_get" class="anchor"></a>
<article class="method">
<h3 class="public ">get()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">get( <span class="argument">$identifiant</span>, <span class="argument">$langue</span>) : string</pre>
<p><em>Accesseur pour la valeur d&#039;une traduction</em></p>
 
<h4>Parameters</h4>
<table class="table table-condensed table-hover">
<tr>
<td></td>
<td>$identifiant</td>
<td></td>
</tr>
<tr>
<td></td>
<td>$langue</td>
<td></td>
</tr>
</table>
<h4>Returns</h4>
string
&mdash; <p>la valeur du paramètre</p>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<span class="label label-info">static</span>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr>
<th>
todo
</th>
<td>
</td>
</tr>
</table>
</aside>
</div>
 
<div class="row-fluid">
<div class="span8 content class">
<a id="method_charger" name="method_charger" class="anchor"></a>
<article class="method">
<h3 class="public ">charger()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">charger( <span class="argument">$langue</span>, <span class="argument">$fichier</span>, <span class="argument">$format</span>) : boolean</pre>
<p><em>Charge un fichier ini dans le tableau des paramètres de l&#039;appli</em></p>
 
<h4>Parameters</h4>
<table class="table table-condensed table-hover">
<tr>
<td></td>
<td>$langue</td>
<td></td>
</tr>
<tr>
<td></td>
<td>$fichier</td>
<td></td>
</tr>
<tr>
<td></td>
<td>$format</td>
<td></td>
</tr>
</table>
<h4>Returns</h4>
boolean
&mdash; <p>true, si le fichier a été trouvé et correctement chargé, sinon false.</p>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<span class="label label-info">static</span>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr>
<th>
todo
</th>
<td>
</td>
</tr>
</table>
</aside>
</div>
 
<div class="row-fluid">
<div class="span8 content class">
<a id="method_setLangue" name="method_setLangue" class="anchor"></a>
<article class="method">
<h3 class="public ">setLangue()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">setLangue( <span class="argument">$langue</span>) : array</pre>
<p><em>Définit la langue utiliser pour rechercher une traduction.</em></p>
 
<h4>Parameters</h4>
<table class="table table-condensed table-hover">
<tr>
<td></td>
<td>$langue</td>
<td></td>
</tr>
</table>
<h4>Returns</h4>
array
&mdash; <p>le fichier ini parsé</p>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<span class="label label-info">static</span>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr>
<th>
todo
</th>
<td>
</td>
</tr>
</table>
</aside>
</div>
 
<div class="row-fluid">
<div class="span8 content class">
<a id="method___construct" name="method___construct" class="anchor"></a>
<article class="method">
<h3 class="private ">__construct()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">__construct()</pre>
<p><em></em></p>
 
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr>
<th>
todo
</th>
<td>
</td>
</tr>
</table>
</aside>
</div>
 
<div class="row-fluid">
<div class="span8 content class">
<a id="method_getValeur" name="method_getValeur" class="anchor"></a>
<article class="method">
<h3 class="private ">getValeur()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">getValeur(string <span class="argument">$param</span>, array <span class="argument">$i18n</span>) : mixed</pre>
<p><em>Renvoie la valeur demandé grâce une chaine de paramètres</em></p>
 
<h4>Parameters</h4>
<table class="table table-condensed table-hover">
<tr>
<td>string</td>
<td>$param</td>
<td><p>la chaine identifiante</p></td>
</tr>
<tr>
<td>array</td>
<td>$i18n</td>
<td><p>le tableau de traductions</p></td>
</tr>
</table>
<h4>Returns</h4>
mixed
&mdash; <p>la valeur correspondante à la chaine identifiante si elle est trouvée, sinon false.</p>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<span class="label label-info">static</span>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr>
<th>
todo
</th>
<td>
</td>
</tr>
</table>
</aside>
</div>
 
<div class="row-fluid">
<div class="span8 content class">
<a id="method_chargerFichierIni" name="method_chargerFichierIni" class="anchor"></a>
<article class="method">
<h3 class="private ">chargerFichierIni()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">chargerFichierIni(string <span class="argument">$fichier_ini</span>, string <span class="argument">$langue</span>) : boolean</pre>
<p><em>Parse le fichier ini donné en paramètre</em></p>
 
<h4>Parameters</h4>
<table class="table table-condensed table-hover">
<tr>
<td>string</td>
<td>$fichier_ini</td>
<td><p>nom du fichier ini à parser</p></td>
</tr>
<tr>
<td>string</td>
<td>$langue</td>
<td><p>la langue correspondant au fichier</p></td>
</tr>
</table>
<h4>Returns</h4>
boolean
&mdash; <p>true si le chargement c'est bien passé, sinon false.</p>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<span class="label label-info">static</span>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr>
<th>
todo
</th>
<td>
</td>
</tr>
</table>
</aside>
</div>
 
<div class="row-fluid">
<div class="span8 content class">
<a id="method_analyserTableauIni" name="method_analyserTableauIni" class="anchor"></a>
<article class="method">
<h3 class="private ">analyserTableauIni()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">analyserTableauIni(array <span class="argument">$i18n</span>) : array</pre>
<p><em>Analyse un tableau de traductions pour évaluer les clés.</em></p>
 
<h4>Parameters</h4>
<table class="table table-condensed table-hover">
<tr>
<td>array</td>
<td>$i18n</td>
<td><p>le tableau de traductions</p></td>
</tr>
</table>
<h4>Returns</h4>
array
&mdash; <p>le tableau analysé et modifié si nécessaire.</p>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<span class="label label-info">static</span>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr>
<th>
todo
</th>
<td>
</td>
</tr>
</table>
</aside>
</div>
 
<div class="row-fluid">
<div class="span8 content class">
<a id="method_evaluerCle" name="method_evaluerCle" class="anchor"></a>
<article class="method">
<h3 class="private ">evaluerCle()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">evaluerCle(array <span class="argument">$i18n</span>, string <span class="argument">$cle</span>, string <span class="argument">$valeur</span>)</pre>
<p><em>Dans le cas des chaines de traduction à sous clé (ex.: cle.souscle), cette méthode
évalue les valeurs correspondantes et créée les sous tableaux associés.</em></p>
 
<h4>Parameters</h4>
<table class="table table-condensed table-hover">
<tr>
<td>array</td>
<td>$i18n</td>
<td><p>tableau de traductions (par référence)</p></td>
</tr>
<tr>
<td>string</td>
<td>$cle</td>
<td><p>la cle dans le tableau</p></td>
</tr>
<tr>
<td>string</td>
<td>$valeur</td>
<td><p>la valeur à affecter</p></td>
</tr>
</table>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<span class="label label-info">static</span>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr>
<th>
todo
</th>
<td>
</td>
</tr>
</table>
</aside>
</div>
 
<div class="row-fluid">
<div class="span8 content class">
<a id="method_trouverLangue" name="method_trouverLangue" class="anchor"></a>
<article class="method">
<h3 class="private ">trouverLangue()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">trouverLangue()</pre>
<p><em>Cherche l&#039;information sur la langue demandée par l&#039;application</em></p>
 
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<span class="label label-info">static</span>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr>
<th>
todo
</th>
<td>
</td>
</tr>
</table>
</aside>
</div>
 
<div class="row-fluid">
<div class="span8 content class">
<a id="method_verifierCreationInstance" name="method_verifierCreationInstance" class="anchor"></a>
<article class="method">
<h3 class="private ">verifierCreationInstance()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">verifierCreationInstance()</pre>
<p><em>Vérifie si l&#039;instance de classe à été crée, si non la crée</em></p>
 
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<span class="label label-info">static</span>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr>
<th>
todo
</th>
<td>
</td>
</tr>
</table>
</aside>
</div>
 
<div class="row-fluid">
<div class="span8 content class">
<a id="method_verifierParametresConfig" name="method_verifierParametresConfig" class="anchor"></a>
<article class="method">
<h3 class="private ">verifierParametresConfig()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">verifierParametresConfig()</pre>
<p><em>Vérifie que tous les paramêtres de config nécessaires au fonctionnement de cette classe existe dans les fichiers
de configurations.</em></p>
 
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<span class="label label-info">static</span>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr>
<th>
todo
</th>
<td>
</td>
</tr>
</table>
</aside>
</div>
 
<div class="row-fluid">
<div class="span8 content class">
<a id="method_ajouterErreur" name="method_ajouterErreur" class="anchor"></a>
<article class="method">
<h3 class="private ">ajouterErreur()</h3>
<a href="#source-view" role="button" class="pull-right btn" data-toggle="modal" style="font-size: 1.1em; padding: 9px 14px"><i class="icon-code"></i></a>
<pre class="signature" style="margin-right: 54px;">ajouterErreur( <span class="argument">$m</span>, <span class="argument">$e</span>)</pre>
<p><em>Ajouter une message d&#039;erreur</em></p>
 
<h4>Parameters</h4>
<table class="table table-condensed table-hover">
<tr>
<td></td>
<td>$m</td>
<td></td>
</tr>
<tr>
<td></td>
<td>$e</td>
<td></td>
</tr>
</table>
</article>
</div>
<aside class="span4 detailsbar">
<h1><i class="icon-arrow-down"></i></h1>
<span class="label label-info">static</span>
<dl>
</dl>
<h2>Tags</h2>
<table class="table table-condensed">
<tr>
<th>
todo
</th>
<td>
</td>
</tr>
</table>
</aside>
</div>
 
</div>
</section>
 
<div id="source-view" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="source-view-label" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="source-view-label">I18n.php</h3>
</div>
<div class="modal-body">
<pre data-src="../files/I18n.php.txt" class="language-php line-numbers"></pre>
</div>
</div>
 
<footer class="row-fluid">
<section class="span10 offset2">
<section class="row-fluid">
<section class="span10 offset1">
<section class="row-fluid footer-sections">
<section class="span4">
<h1><i class="icon-code"></i></h1>
<div>
<ul>
</ul>
</div>
</section>
<section class="span4">
<h1><i class="icon-bar-chart"></i></h1>
<div>
<ul>
<li><a href="../graphs/class.html">Class Hierarchy Diagram</a></li>
</ul>
</div>
</section>
<section class="span4">
<h1><i class="icon-pushpin"></i></h1>
<div>
<ul>
<li><a href="../reports/errors.html">Errors</a></li>
<li><a href="../reports/markers.html">Markers</a></li>
</ul>
</div>
</section>
</section>
</section>
</section>
<section class="row-fluid">
<section class="span10 offset1">
<hr />
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
on March 18th, 2014 at 19:19.
</section>
</section>
</section>
</footer>
</div>
 
</body>
</html>
/branches/v0.2-buhl/doc/PhpDoc/reports/deprecated.html
66,12 → 66,12
<ul class="dropdown-menu">
<li>
<a href="../reports/errors.html">
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">54</span>
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">70</span>
</a>
</li>
<li>
<a href="../reports/markers.html">
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">0</span>
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">0</span>
</a>
</li>
</ul>
101,25 → 101,7
</ul>
 
<div id="marker-accordion">
<a name="" id=""></a>
<h3>
<i class="icon-file"></i>
<small style="float: right;padding-right: 10px;">1</small>
</h3>
<div>
<table class="table markers table-bordered">
<tr>
<th>Type</th>
<th>Line</th>
<th>Description</th>
</tr>
<tr>
<td>deprecated</td>
<td></td>
<td></td>
</tr>
</table>
</div>
<div class="alert alert-info">No deprecated elements have been found in this project.</div>
</div>
</div>
</div>
160,7 → 142,7
<section class="span10 offset1">
<hr />
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
on March 12th, 2014 at 16:55.
on March 18th, 2014 at 19:19.
</section>
</section>
</section>
/branches/v0.2-buhl/doc/PhpDoc/reports/markers.html
66,12 → 66,12
<ul class="dropdown-menu">
<li>
<a href="../reports/errors.html">
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">54</span>
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">70</span>
</a>
</li>
<li>
<a href="../reports/markers.html">
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">0</span>
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">0</span>
</a>
</li>
</ul>
90,7 → 90,7
<div class="span2 sidebar">
<ul class="side-nav nav nav-list">
<li class="nav-header">Navigation</li>
</ul>
</ul>
</div>
 
<div class="span10 offset2">
103,7 → 103,7
<div class="alert alert-info">No markers have been found in this project.</div>
<div id="marker-accordion">
</div>
</div>
</div>
</section>
 
143,7 → 143,7
<section class="span10 offset1">
<hr />
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
on March 12th, 2014 at 16:55.
on March 18th, 2014 at 19:19.
</section>
</section>
</section>
/branches/v0.2-buhl/doc/PhpDoc/reports/errors.html
66,12 → 66,12
<ul class="dropdown-menu">
<li>
<a href="../reports/errors.html">
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">54</span>
<i class="icon-list-alt"></i>&#160;Errors <span class="label label-info pull-right">70</span>
</a>
</li>
<li>
<a href="../reports/markers.html">
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">0</span>
<i class="icon-list-alt"></i>&#160;Markers <span class="label label-info pull-right">0</span>
</a>
</li>
</ul>
100,6 → 100,7
<li><a href="#GestionnaireException.php"><i class="icon-file"></i> GestionnaireException.php</a></li>
<li><a href="#Modele.php"><i class="icon-file"></i> Modele.php</a></li>
<li><a href="#Registre.php"><i class="icon-file"></i> Registre.php</a></li>
<li><a href="#I18n.php"><i class="icon-file"></i> I18n.php</a></li>
<li><a href="#Config.php"><i class="icon-file"></i> Config.php</a></li>
<li><a href="#Application.php"><i class="icon-file"></i> Application.php</a></li>
<li><a href="#Log.php"><i class="icon-file"></i> Log.php</a></li>
137,102 → 138,102
</tr>
<tr>
<td>error</td>
<td>66</td>
<td>61</td>
<td>No summary for property $schema</td>
</tr>
<tr>
<td>error</td>
<td>71</td>
<td>66</td>
<td>No summary for property $infoUtilisateur</td>
</tr>
<tr>
<td>error</td>
<td>76</td>
<td>71</td>
<td>No summary for property $hote</td>
</tr>
<tr>
<td>error</td>
<td>81</td>
<td>76</td>
<td>No summary for property $port</td>
</tr>
<tr>
<td>error</td>
<td>86</td>
<td>81</td>
<td>No summary for property $chemin</td>
</tr>
<tr>
<td>error</td>
<td>91</td>
<td>86</td>
<td>No summary for property $requete</td>
</tr>
<tr>
<td>error</td>
<td>96</td>
<td>91</td>
<td>No summary for property $fragment</td>
</tr>
<tr>
<td>error</td>
<td>102</td>
<td>97</td>
<td>No summary for method __construct()</td>
</tr>
<tr>
<td>error</td>
<td>153</td>
<td>148</td>
<td>No summary for method setSchema()</td>
</tr>
<tr>
<td>error</td>
<td>219</td>
<td>214</td>
<td>No summary for method setHote()</td>
</tr>
<tr>
<td>error</td>
<td>238</td>
<td>233</td>
<td>No summary for method setPort()</td>
</tr>
<tr>
<td>error</td>
<td>273</td>
<td>268</td>
<td>No summary for method setAutorite()</td>
</tr>
<tr>
<td>error</td>
<td>304</td>
<td>299</td>
<td>No summary for method setChemin()</td>
</tr>
<tr>
<td>error</td>
<td>325</td>
<td>320</td>
<td>No summary for method setRequete()</td>
</tr>
<tr>
<td>error</td>
<td>343</td>
<td>338</td>
<td>No summary for method setFragment()</td>
</tr>
<tr>
<td>error</td>
<td>408</td>
<td>403</td>
<td>No summary for method setVariablesRequete()</td>
</tr>
<tr>
<td>error</td>
<td>440</td>
<td>435</td>
<td>No summary for method setVariableRequete()</td>
</tr>
<tr>
<td>error</td>
<td>451</td>
<td>446</td>
<td>No summary for method unsetVariableRequete()</td>
</tr>
<tr>
<td>error</td>
<td>462</td>
<td>457</td>
<td>No summary for method unsetVariablesRequete()</td>
</tr>
<tr>
<td>error</td>
<td>769</td>
<td>764</td>
<td>No summary for method __toString()</td>
</tr>
</tbody>
258,22 → 259,22
<tbody>
<tr>
<td>error</td>
<td>31</td>
<td>26</td>
<td>Argument $nom_classe_fw is missing from the Docblock of \autoloadFw()</td>
</tr>
<tr>
<td>error</td>
<td>31</td>
<td>26</td>
<td>No summary for function \autoloadFw()</td>
</tr>
<tr>
<td>error</td>
<td>44</td>
<td>39</td>
<td>Argument $nom_classe is missing from the Docblock of \autoloadAppliDefaut()</td>
</tr>
<tr>
<td>error</td>
<td>44</td>
<td>39</td>
<td>No summary for function \autoloadAppliDefaut()</td>
</tr>
</tbody>
311,7 → 312,7
<h3>
<i class="icon-file"></i>
Chronometre.php
<small style="float: right;padding-right: 10px;">2</small>
<small style="float: right;padding-right: 10px;">5</small>
</h3>
<div>
<table class="table markers table-bordered">
330,9 → 331,24
</tr>
<tr>
<td>error</td>
<td>25</td>
<td>No summary for property $_temps</td>
<td>17</td>
<td>No summary for property $instance</td>
</tr>
<tr>
<td>error</td>
<td>18</td>
<td>No summary for property $temps</td>
</tr>
<tr>
<td>error</td>
<td>47</td>
<td>Argument $cle is missing from the Docblock of setTemps()</td>
</tr>
<tr>
<td>error</td>
<td>59</td>
<td>Argument $cle is missing from the Docblock of chrono()</td>
</tr>
</tbody>
</table>
</div>
368,7 → 384,7
<h3>
<i class="icon-file"></i>
Controleur.php
<small style="float: right;padding-right: 10px;">1</small>
<small style="float: right;padding-right: 10px;">3</small>
</h3>
<div>
<table class="table markers table-bordered">
385,6 → 401,16
<td>0</td>
<td>No summary was found for this file</td>
</tr>
<tr>
<td>error</td>
<td>126</td>
<td>Argument $value is missing from the Docblock of \stripslashes_deep()</td>
</tr>
<tr>
<td>error</td>
<td>126</td>
<td>No summary for function \stripslashes_deep()</td>
</tr>
</tbody>
</table>
</div>
394,7 → 420,7
<h3>
<i class="icon-file"></i>
GestionnaireException.php
<small style="float: right;padding-right: 10px;">2</small>
<small style="float: right;padding-right: 10px;">3</small>
</h3>
<div>
<table class="table markers table-bordered">
413,9 → 439,14
</tr>
<tr>
<td>error</td>
<td>78</td>
<td>62</td>
<td>Argument $contexte is missing from the Docblock of setContexte()</td>
</tr>
<tr>
<td>error</td>
<td>149</td>
<td>No summary for method __destruct()</td>
</tr>
</tbody>
</table>
</div>
444,42 → 475,42
</tr>
<tr>
<td>error</td>
<td>151</td>
<td>146</td>
<td>Argument $requete is missing from the Docblock of requete()</td>
</tr>
<tr>
<td>error</td>
<td>177</td>
<td>172</td>
<td>Argument $requete is missing from the Docblock of requeteUn()</td>
</tr>
<tr>
<td>error</td>
<td>177</td>
<td>172</td>
<td>Argument $mode is missing from the Docblock of requeteUn()</td>
</tr>
<tr>
<td>error</td>
<td>177</td>
<td>172</td>
<td>No summary for method requeteUn()</td>
</tr>
<tr>
<td>error</td>
<td>213</td>
<td>208</td>
<td>Argument $requete is missing from the Docblock of requeteTous()</td>
</tr>
<tr>
<td>error</td>
<td>213</td>
<td>208</td>
<td>Argument $mode is missing from the Docblock of requeteTous()</td>
</tr>
<tr>
<td>error</td>
<td>213</td>
<td>208</td>
<td>No summary for method requeteTous()</td>
</tr>
<tr>
<td>error</td>
<td>273</td>
<td>268</td>
<td>Argument $chaine is missing from the Docblock of proteger()</td>
</tr>
</tbody>
510,27 → 541,27
</tr>
<tr>
<td>error</td>
<td>53</td>
<td>48</td>
<td>Argument $intitule is missing from the Docblock of set()</td>
</tr>
<tr>
<td>error</td>
<td>53</td>
<td>48</td>
<td>Argument $objet is missing from the Docblock of set()</td>
</tr>
<tr>
<td>error</td>
<td>67</td>
<td>62</td>
<td>Argument $intitule is missing from the Docblock of get()</td>
</tr>
<tr>
<td>error</td>
<td>77</td>
<td>72</td>
<td>Argument $intitule is missing from the Docblock of detruire()</td>
</tr>
<tr>
<td>error</td>
<td>87</td>
<td>82</td>
<td>Argument $intitule is missing from the Docblock of existe()</td>
</tr>
</tbody>
538,6 → 569,77
</div>
</div>
<div class="package-contents">
<a name="I18n.php" id="I18n.php"></a>
<h3>
<i class="icon-file"></i>
I18n.php
<small style="float: right;padding-right: 10px;">10</small>
</h3>
<div>
<table class="table markers table-bordered">
<thead>
<tr>
<th>Type</th>
<th>Line</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>error</td>
<td>0</td>
<td>No summary was found for this file</td>
</tr>
<tr>
<td>error</td>
<td>33</td>
<td>No summary for method __construct()</td>
</tr>
<tr>
<td>error</td>
<td>43</td>
<td>Argument $identifiant is missing from the Docblock of get()</td>
</tr>
<tr>
<td>error</td>
<td>43</td>
<td>Argument $langue is missing from the Docblock of get()</td>
</tr>
<tr>
<td>error</td>
<td>82</td>
<td>Argument $langue is missing from the Docblock of charger()</td>
</tr>
<tr>
<td>error</td>
<td>82</td>
<td>Argument $fichier is missing from the Docblock of charger()</td>
</tr>
<tr>
<td>error</td>
<td>82</td>
<td>Argument $format is missing from the Docblock of charger()</td>
</tr>
<tr>
<td>error</td>
<td>107</td>
<td>Argument $langue is missing from the Docblock of setLangue()</td>
</tr>
<tr>
<td>error</td>
<td>243</td>
<td>Argument $m is missing from the Docblock of ajouterErreur()</td>
</tr>
<tr>
<td>error</td>
<td>243</td>
<td>Argument $e is missing from the Docblock of ajouterErreur()</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="package-contents">
<a name="Config.php" id="Config.php"></a>
<h3>
<i class="icon-file"></i>
561,7 → 663,7
</tr>
<tr>
<td>error</td>
<td>147</td>
<td>144</td>
<td>Argument $config is missing from the Docblock of existeValeur()</td>
</tr>
</tbody>
618,17 → 720,17
</tr>
<tr>
<td>error</td>
<td>87</td>
<td>86</td>
<td>Argument $entree is missing from the Docblock of ajouterEntree()</td>
</tr>
<tr>
<td>error</td>
<td>87</td>
<td>86</td>
<td>Argument $mode is missing from the Docblock of ajouterEntree()</td>
</tr>
<tr>
<td>error</td>
<td>118</td>
<td>117</td>
<td>Argument $mode is missing from the Docblock of verifierOuvrirFichier()</td>
</tr>
</tbody>
674,7 → 776,7
<section class="span10 offset1">
<hr />
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and authored
on March 12th, 2014 at 16:55.
on March 18th, 2014 at 19:19.
</section>
</section>
</section>
/branches/v0.2-buhl/doc/ApiGen/source-class-Application.html
8,7 → 8,7
<title>File Application.php | TBFramework - v0.2</title>
 
<script type="text/javascript" src="resources/combined.js?4205936287"></script>
<script type="text/javascript" src="elementlist.js?117657638"></script>
<script type="text/javascript" src="elementlist.js?1835392179"></script>
<link rel="stylesheet" type="text/css" media="all" href="resources/style.css?3505392360">
 
</head>
41,6 → 41,7
<li><a href="class-Controleur.html">Controleur</a></li>
<li><a href="class-Debug.html">Debug</a></li>
<li><a href="class-GestionnaireException.html">GestionnaireException</a></li>
<li><a href="class-I18n.html">I18n</a></li>
<li><a href="class-Log.html">Log</a></li>
<li><a href="class-Modele.html">Modele</a></li>
<li><a href="class-Registre.html">Registre</a></li>
104,97 → 105,92
</span><span id="3" class="l"><a class="l" href="#3"> 3: </a><span class="php-comment">/**
</span></span><span id="4" class="l"><a class="l" href="#4"> 4: </a><span class="php-comment"> * Classe fournissant des informations au Framework sur l'application.
</span></span><span id="5" class="l"><a class="l" href="#5"> 5: </a><span class="php-comment"> *
</span></span><span id="6" class="l"><a class="l" href="#6"> 6: </a><span class="php-comment"> * PHP version 5
</span></span><span id="7" class="l"><a class="l" href="#7"> 7: </a><span class="php-comment"> *
</span></span><span id="8" class="l"><a class="l" href="#8"> 8: </a><span class="php-comment"> * @category Debogage
</span></span><span id="9" class="l"><a class="l" href="#9"> 9: </a><span class="php-comment"> * @package Framework
</span></span><span id="10" class="l"><a class="l" href="#10">10: </a><span class="php-comment"> // Auteur principal :
</span></span><span id="11" class="l"><a class="l" href="#11">11: </a><span class="php-comment"> * @author Jean-Pascal MILCENT &lt;jpm@tela-botanica.org&gt;
</span></span><span id="12" class="l"><a class="l" href="#12">12: </a><span class="php-comment"> // Autres auteurs :
</span></span><span id="13" class="l"><a class="l" href="#13">13: </a><span class="php-comment"> * @license GPL v3 &lt;http://www.gnu.org/licenses/gpl.txt&gt;
</span></span><span id="14" class="l"><a class="l" href="#14">14: </a><span class="php-comment"> * @license CECILL v2 &lt;http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt&gt;
</span></span><span id="15" class="l"><a class="l" href="#15">15: </a><span class="php-comment"> * @version $Id: Application.php 456 2014-02-06 11:07:43Z jpm $
</span></span><span id="16" class="l"><a class="l" href="#16">16: </a><span class="php-comment"> * @copyright 1999-2009 Tela Botanica (accueil@tela-botanica.org)
</span></span><span id="17" class="l"><a class="l" href="#17">17: </a><span class="php-comment"> */</span>
</span><span id="18" class="l"><a class="l" href="#18">18: </a><span class="php-keyword1">class</span> <a id="Application" href="#Application">Application</a> {
</span><span id="19" class="l"><a class="l" href="#19">19: </a>
</span><span id="20" class="l"><a class="l" href="#20">20: </a> <span class="php-comment">/**
</span></span><span id="21" class="l"><a class="l" href="#21">21: </a><span class="php-comment"> * Tableau d'informations sur l'application
</span></span><span id="22" class="l"><a class="l" href="#22">22: </a><span class="php-comment"> */</span>
</span><span id="23" class="l"><a class="l" href="#23">23: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-var"><a id="$info" href="#$info">$info</a></span> = <span class="php-keyword1">null</span>;
</span></span><span id="6" class="l"><a class="l" href="#6"> 6: </a><span class="php-comment"> * @category PHP 5.2
</span></span><span id="7" class="l"><a class="l" href="#7"> 7: </a><span class="php-comment"> * @package Framework
</span></span><span id="8" class="l"><a class="l" href="#8"> 8: </a><span class="php-comment"> * @author Jean-Pascal MILCENT &lt;jpm@tela-botanica.org&gt;
</span></span><span id="9" class="l"><a class="l" href="#9"> 9: </a><span class="php-comment"> * @copyright Copyright (c) 2009, Tela Botanica (accueil@tela-botanica.org)
</span></span><span id="10" class="l"><a class="l" href="#10">10: </a><span class="php-comment"> * @license GNU-GPL-v3 &lt;http://www.gnu.org/licenses/gpl.html&gt;
</span></span><span id="11" class="l"><a class="l" href="#11">11: </a><span class="php-comment"> * @license CECILL-v2 &lt;http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt&gt;
</span></span><span id="12" class="l"><a class="l" href="#12">12: </a><span class="php-comment"> */</span>
</span><span id="13" class="l"><a class="l" href="#13">13: </a><span class="php-keyword1">class</span> <a id="Application" href="#Application">Application</a> {
</span><span id="14" class="l"><a class="l" href="#14">14: </a>
</span><span id="15" class="l"><a class="l" href="#15">15: </a> <span class="php-comment">/**
</span></span><span id="16" class="l"><a class="l" href="#16">16: </a><span class="php-comment"> * Tableau d'informations sur l'application
</span></span><span id="17" class="l"><a class="l" href="#17">17: </a><span class="php-comment"> */</span>
</span><span id="18" class="l"><a class="l" href="#18">18: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-var"><a id="$info" href="#$info">$info</a></span> = <span class="php-keyword1">null</span>;
</span><span id="19" class="l"><a class="l" href="#19">19: </a> <span class="php-comment">/**
</span></span><span id="20" class="l"><a class="l" href="#20">20: </a><span class="php-comment"> * Chemin de base de l'application
</span></span><span id="21" class="l"><a class="l" href="#21">21: </a><span class="php-comment"> */</span>
</span><span id="22" class="l"><a class="l" href="#22">22: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-var"><a id="$chemin" href="#$chemin">$chemin</a></span> = <span class="php-keyword1">null</span>;
</span><span id="23" class="l"><a class="l" href="#23">23: </a>
</span><span id="24" class="l"><a class="l" href="#24">24: </a> <span class="php-comment">/**
</span></span><span id="25" class="l"><a class="l" href="#25">25: </a><span class="php-comment"> * Chemin de base de l'application
</span></span><span id="26" class="l"><a class="l" href="#26">26: </a><span class="php-comment"> */</span>
</span><span id="27" class="l"><a class="l" href="#27">27: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-var"><a id="$chemin" href="#$chemin">$chemin</a></span> = <span class="php-keyword1">null</span>;
</span><span id="28" class="l"><a class="l" href="#28">28: </a>
</span><span id="29" class="l"><a class="l" href="#29">29: </a> <span class="php-comment">/**
</span></span><span id="30" class="l"><a class="l" href="#30">30: </a><span class="php-comment"> * Initialise différentes classes du Framework nécessaires pour le fonctionnement de l'application.
</span></span><span id="31" class="l"><a class="l" href="#31">31: </a><span class="php-comment"> * Ces classes sont ensuites controlées via les fichiers de config.ini.
</span></span><span id="32" class="l"><a class="l" href="#32">32: </a><span class="php-comment"> * Elle est appelée automatiquement suite à la définition du chemin de l'application via Application::setChemin().
</span></span><span id="33" class="l"><a class="l" href="#33">33: </a><span class="php-comment"> */</span>
</span><span id="34" class="l"><a class="l" href="#34">34: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_initialiser" href="#_initialiser">initialiser</a>() {
</span><span id="35" class="l"><a class="l" href="#35">35: </a> <span class="php-comment">// Configuration du gestionnaire d'exception</span>
</span><span id="36" class="l"><a class="l" href="#36">36: </a> GestionnaireException::configurer();
</span><span id="37" class="l"><a class="l" href="#37">37: </a> <span class="php-comment">// Configuration du gestionnaire de logs</span>
</span><span id="38" class="l"><a class="l" href="#38">38: </a> <span class="php-comment">//Log::configurer();</span>
</span><span id="39" class="l"><a class="l" href="#39">39: </a> }
</span><span id="40" class="l"><a class="l" href="#40">40: </a>
</span><span id="41" class="l"><a class="l" href="#41">41: </a> <span class="php-comment">/**
</span></span><span id="42" class="l"><a class="l" href="#42">42: </a><span class="php-comment"> * Permet d'indiquer le chemin de base de l'Application.
</span></span><span id="43" class="l"><a class="l" href="#43">43: </a><span class="php-comment"> * Cette méthode doit obligatoirement être utilisée par l'application pour que le Framework fonctionne correctement.
</span></span><span id="44" class="l"><a class="l" href="#44">44: </a><span class="php-comment"> * @param string $chemin_fichier_principal chemin de base
</span></span><span id="45" class="l"><a class="l" href="#45">45: </a><span class="php-comment"> */</span>
</span><span id="46" class="l"><a class="l" href="#46">46: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_setChemin" href="#_setChemin">setChemin</a>(<span class="php-var">$chemin_fichier_principal</span>) {
</span><span id="47" class="l"><a class="l" href="#47">47: </a> <span class="php-keyword1">if</span> (self::<span class="php-var">$chemin</span> === <span class="php-keyword1">null</span>) {
</span><span id="48" class="l"><a class="l" href="#48">48: </a> <span class="php-keyword1">if</span> (!<span class="php-keyword2">file_exists</span>(<span class="php-var">$chemin_fichier_principal</span>)) {
</span><span id="49" class="l"><a class="l" href="#49">49: </a> <span class="php-keyword2">trigger_error</span>(<span class="php-quote">&quot;Le fichier indiqué n'existe pas. Utilisez __FILE__ dans la méthode set().&quot;</span>, E_USER_ERROR);
</span><span id="50" class="l"><a class="l" href="#50">50: </a> } <span class="php-keyword1">else</span> {
</span><span id="51" class="l"><a class="l" href="#51">51: </a> self::<span class="php-var">$chemin</span> = <span class="php-keyword2">dirname</span>(<span class="php-var">$chemin_fichier_principal</span>).DS;
</span><span id="52" class="l"><a class="l" href="#52">52: </a> self::initialiser();
</span><span id="53" class="l"><a class="l" href="#53">53: </a> }
</span><span id="54" class="l"><a class="l" href="#54">54: </a> } <span class="php-keyword1">else</span> {
</span><span id="55" class="l"><a class="l" href="#55">55: </a> <span class="php-keyword2">trigger_error</span>(<span class="php-quote">&quot;Le chemin de l'application a déjà été enregistré auprès du Framework&quot;</span>, E_USER_WARNING);
</span><span id="56" class="l"><a class="l" href="#56">56: </a> }
</span><span id="57" class="l"><a class="l" href="#57">57: </a> }
</span><span id="58" class="l"><a class="l" href="#58">58: </a>
</span><span id="59" class="l"><a class="l" href="#59">59: </a> <span class="php-comment">/**
</span></span><span id="60" class="l"><a class="l" href="#60">60: </a><span class="php-comment"> * accesseur pour le chemin
</span></span><span id="61" class="l"><a class="l" href="#61">61: </a><span class="php-comment"> * @return string le chemin
</span></span><span id="62" class="l"><a class="l" href="#62">62: </a><span class="php-comment"> */</span>
</span><span id="63" class="l"><a class="l" href="#63">63: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_getChemin" href="#_getChemin">getChemin</a>() {
</span><span id="64" class="l"><a class="l" href="#64">64: </a> <span class="php-keyword1">return</span> self::<span class="php-var">$chemin</span>;
</span><span id="65" class="l"><a class="l" href="#65">65: </a> }
</span><span id="66" class="l"><a class="l" href="#66">66: </a>
</span><span id="67" class="l"><a class="l" href="#67">67: </a> <span class="php-comment">/** Le tableau des informations sur l'application possède les clés suivantes :
</span></span><span id="68" class="l"><a class="l" href="#68">68: </a><span class="php-comment"> * - nom : nom de l'application
</span></span><span id="69" class="l"><a class="l" href="#69">69: </a><span class="php-comment"> * - abr : abréviation de l'application
</span></span><span id="70" class="l"><a class="l" href="#70">70: </a><span class="php-comment"> * - encodage : encodage de l'application (ISO-8859-15, UTF-8...)
</span></span><span id="71" class="l"><a class="l" href="#71">71: </a><span class="php-comment"> *
</span></span><span id="72" class="l"><a class="l" href="#72">72: </a><span class="php-comment"> * @param array $info tableau fournissant des informations sur l'application
</span></span><span id="73" class="l"><a class="l" href="#73">73: </a><span class="php-comment"> * @return void
</span></span><span id="74" class="l"><a class="l" href="#74">74: </a><span class="php-comment"> */</span>
</span><span id="75" class="l"><a class="l" href="#75">75: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_setInfo" href="#_setInfo">setInfo</a>(<span class="php-var">$info</span>) {
</span><span id="76" class="l"><a class="l" href="#76">76: </a> <span class="php-keyword1">if</span> (self::<span class="php-var">$info</span> === <span class="php-keyword1">null</span>) {
</span><span id="77" class="l"><a class="l" href="#77">77: </a> self::<span class="php-var">$info</span> = <span class="php-var">$info</span>;
</span><span id="78" class="l"><a class="l" href="#78">78: </a> } <span class="php-keyword1">else</span> {
</span><span id="79" class="l"><a class="l" href="#79">79: </a> <span class="php-keyword2">trigger_error</span>(<span class="php-quote">&quot;Le informations de l'application ont déjà été enregistrées auprès du Framework&quot;</span>, E_USER_WARNING);
</span><span id="80" class="l"><a class="l" href="#80">80: </a> }
</span><span id="81" class="l"><a class="l" href="#81">81: </a> }
</span><span id="82" class="l"><a class="l" href="#82">82: </a>
</span><span id="83" class="l"><a class="l" href="#83">83: </a> <span class="php-comment">/**
</span></span><span id="84" class="l"><a class="l" href="#84">84: </a><span class="php-comment"> * accesseur pour le tableau d'infos
</span></span><span id="85" class="l"><a class="l" href="#85">85: </a><span class="php-comment"> * @param string $cle la clé à laquelle on veut accéder
</span></span><span id="86" class="l"><a class="l" href="#86">86: </a><span class="php-comment"> */</span>
</span><span id="87" class="l"><a class="l" href="#87">87: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_getInfo" href="#_getInfo">getInfo</a>(<span class="php-var">$cle</span> = <span class="php-keyword1">null</span>) {
</span><span id="88" class="l"><a class="l" href="#88">88: </a> <span class="php-keyword1">if</span> (<span class="php-var">$cle</span> !== <span class="php-keyword1">null</span>) {
</span><span id="89" class="l"><a class="l" href="#89">89: </a> <span class="php-keyword1">if</span> (<span class="php-keyword1">isset</span>(self::<span class="php-var">$info</span>[<span class="php-var">$cle</span>])) {
</span><span id="90" class="l"><a class="l" href="#90">90: </a> <span class="php-keyword1">return</span> self::<span class="php-var">$info</span>[<span class="php-var">$cle</span>];
</span><span id="91" class="l"><a class="l" href="#91">91: </a> }
</span><span id="92" class="l"><a class="l" href="#92">92: </a> } <span class="php-keyword1">else</span> {
</span><span id="93" class="l"><a class="l" href="#93">93: </a> <span class="php-keyword1">return</span> self::<span class="php-var">$info</span>;
</span><span id="94" class="l"><a class="l" href="#94">94: </a> }
</span><span id="95" class="l"><a class="l" href="#95">95: </a> }
</span><span id="96" class="l"><a class="l" href="#96">96: </a></span>}</code></pre>
</span></span><span id="25" class="l"><a class="l" href="#25">25: </a><span class="php-comment"> * Initialise différentes classes du Framework nécessaires pour le fonctionnement de l'application.
</span></span><span id="26" class="l"><a class="l" href="#26">26: </a><span class="php-comment"> * Ces classes sont ensuites controlées via les fichiers de config.ini.
</span></span><span id="27" class="l"><a class="l" href="#27">27: </a><span class="php-comment"> * Elle est appelée automatiquement suite à la définition du chemin de l'application via Application::setChemin().
</span></span><span id="28" class="l"><a class="l" href="#28">28: </a><span class="php-comment"> */</span>
</span><span id="29" class="l"><a class="l" href="#29">29: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_initialiser" href="#_initialiser">initialiser</a>() {
</span><span id="30" class="l"><a class="l" href="#30">30: </a> <span class="php-comment">// Configuration du gestionnaire d'exception</span>
</span><span id="31" class="l"><a class="l" href="#31">31: </a> GestionnaireException::configurer();
</span><span id="32" class="l"><a class="l" href="#32">32: </a> <span class="php-comment">// Configuration du gestionnaire de logs</span>
</span><span id="33" class="l"><a class="l" href="#33">33: </a> <span class="php-comment">//Log::configurer();</span>
</span><span id="34" class="l"><a class="l" href="#34">34: </a> }
</span><span id="35" class="l"><a class="l" href="#35">35: </a>
</span><span id="36" class="l"><a class="l" href="#36">36: </a> <span class="php-comment">/**
</span></span><span id="37" class="l"><a class="l" href="#37">37: </a><span class="php-comment"> * Permet d'indiquer le chemin de base de l'Application.
</span></span><span id="38" class="l"><a class="l" href="#38">38: </a><span class="php-comment"> * Cette méthode doit obligatoirement être utilisée par l'application pour que le Framework fonctionne correctement.
</span></span><span id="39" class="l"><a class="l" href="#39">39: </a><span class="php-comment"> * @param string $chemin_fichier_principal chemin de base
</span></span><span id="40" class="l"><a class="l" href="#40">40: </a><span class="php-comment"> */</span>
</span><span id="41" class="l"><a class="l" href="#41">41: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_setChemin" href="#_setChemin">setChemin</a>(<span class="php-var">$chemin_fichier_principal</span>) {
</span><span id="42" class="l"><a class="l" href="#42">42: </a> <span class="php-keyword1">if</span> (self::<span class="php-var">$chemin</span> === <span class="php-keyword1">null</span>) {
</span><span id="43" class="l"><a class="l" href="#43">43: </a> <span class="php-keyword1">if</span> (!<span class="php-keyword2">file_exists</span>(<span class="php-var">$chemin_fichier_principal</span>)) {
</span><span id="44" class="l"><a class="l" href="#44">44: </a> <span class="php-keyword2">trigger_error</span>(<span class="php-quote">&quot;Le fichier indiqué n'existe pas. Utilisez __FILE__ dans la méthode set().&quot;</span>, E_USER_ERROR);
</span><span id="45" class="l"><a class="l" href="#45">45: </a> } <span class="php-keyword1">else</span> {
</span><span id="46" class="l"><a class="l" href="#46">46: </a> self::<span class="php-var">$chemin</span> = <span class="php-keyword2">dirname</span>(<span class="php-var">$chemin_fichier_principal</span>).DS;
</span><span id="47" class="l"><a class="l" href="#47">47: </a> self::initialiser();
</span><span id="48" class="l"><a class="l" href="#48">48: </a> }
</span><span id="49" class="l"><a class="l" href="#49">49: </a> } <span class="php-keyword1">else</span> {
</span><span id="50" class="l"><a class="l" href="#50">50: </a> <span class="php-keyword2">trigger_error</span>(<span class="php-quote">&quot;Le chemin de l'application a déjà été enregistré auprès du Framework&quot;</span>, E_USER_WARNING);
</span><span id="51" class="l"><a class="l" href="#51">51: </a> }
</span><span id="52" class="l"><a class="l" href="#52">52: </a> }
</span><span id="53" class="l"><a class="l" href="#53">53: </a>
</span><span id="54" class="l"><a class="l" href="#54">54: </a> <span class="php-comment">/**
</span></span><span id="55" class="l"><a class="l" href="#55">55: </a><span class="php-comment"> * accesseur pour le chemin
</span></span><span id="56" class="l"><a class="l" href="#56">56: </a><span class="php-comment"> * @return string le chemin
</span></span><span id="57" class="l"><a class="l" href="#57">57: </a><span class="php-comment"> */</span>
</span><span id="58" class="l"><a class="l" href="#58">58: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_getChemin" href="#_getChemin">getChemin</a>() {
</span><span id="59" class="l"><a class="l" href="#59">59: </a> <span class="php-keyword1">return</span> self::<span class="php-var">$chemin</span>;
</span><span id="60" class="l"><a class="l" href="#60">60: </a> }
</span><span id="61" class="l"><a class="l" href="#61">61: </a>
</span><span id="62" class="l"><a class="l" href="#62">62: </a> <span class="php-comment">/** Le tableau des informations sur l'application possède les clés suivantes :
</span></span><span id="63" class="l"><a class="l" href="#63">63: </a><span class="php-comment"> * - nom : nom de l'application
</span></span><span id="64" class="l"><a class="l" href="#64">64: </a><span class="php-comment"> * - abr : abréviation de l'application
</span></span><span id="65" class="l"><a class="l" href="#65">65: </a><span class="php-comment"> * - encodage : encodage de l'application (ISO-8859-15, UTF-8...)
</span></span><span id="66" class="l"><a class="l" href="#66">66: </a><span class="php-comment"> *
</span></span><span id="67" class="l"><a class="l" href="#67">67: </a><span class="php-comment"> * @param array $info tableau fournissant des informations sur l'application
</span></span><span id="68" class="l"><a class="l" href="#68">68: </a><span class="php-comment"> * @return void
</span></span><span id="69" class="l"><a class="l" href="#69">69: </a><span class="php-comment"> */</span>
</span><span id="70" class="l"><a class="l" href="#70">70: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_setInfo" href="#_setInfo">setInfo</a>(<span class="php-var">$info</span>) {
</span><span id="71" class="l"><a class="l" href="#71">71: </a> <span class="php-keyword1">if</span> (self::<span class="php-var">$info</span> === <span class="php-keyword1">null</span>) {
</span><span id="72" class="l"><a class="l" href="#72">72: </a> self::<span class="php-var">$info</span> = <span class="php-var">$info</span>;
</span><span id="73" class="l"><a class="l" href="#73">73: </a> } <span class="php-keyword1">else</span> {
</span><span id="74" class="l"><a class="l" href="#74">74: </a> <span class="php-keyword2">trigger_error</span>(<span class="php-quote">&quot;Le informations de l'application ont déjà été enregistrées auprès du Framework&quot;</span>, E_USER_WARNING);
</span><span id="75" class="l"><a class="l" href="#75">75: </a> }
</span><span id="76" class="l"><a class="l" href="#76">76: </a> }
</span><span id="77" class="l"><a class="l" href="#77">77: </a>
</span><span id="78" class="l"><a class="l" href="#78">78: </a> <span class="php-comment">/**
</span></span><span id="79" class="l"><a class="l" href="#79">79: </a><span class="php-comment"> * accesseur pour le tableau d'infos
</span></span><span id="80" class="l"><a class="l" href="#80">80: </a><span class="php-comment"> * @param string $cle la clé à laquelle on veut accéder
</span></span><span id="81" class="l"><a class="l" href="#81">81: </a><span class="php-comment"> */</span>
</span><span id="82" class="l"><a class="l" href="#82">82: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_getInfo" href="#_getInfo">getInfo</a>(<span class="php-var">$cle</span> = <span class="php-keyword1">null</span>) {
</span><span id="83" class="l"><a class="l" href="#83">83: </a> <span class="php-keyword1">if</span> (<span class="php-var">$cle</span> !== <span class="php-keyword1">null</span>) {
</span><span id="84" class="l"><a class="l" href="#84">84: </a> <span class="php-keyword1">if</span> (<span class="php-keyword1">isset</span>(self::<span class="php-var">$info</span>[<span class="php-var">$cle</span>])) {
</span><span id="85" class="l"><a class="l" href="#85">85: </a> <span class="php-keyword1">return</span> self::<span class="php-var">$info</span>[<span class="php-var">$cle</span>];
</span><span id="86" class="l"><a class="l" href="#86">86: </a> }
</span><span id="87" class="l"><a class="l" href="#87">87: </a> } <span class="php-keyword1">else</span> {
</span><span id="88" class="l"><a class="l" href="#88">88: </a> <span class="php-keyword1">return</span> self::<span class="php-var">$info</span>;
</span><span id="89" class="l"><a class="l" href="#89">89: </a> }
</span><span id="90" class="l"><a class="l" href="#90">90: </a> }
</span><span id="91" class="l"><a class="l" href="#91">91: </a></span>}</code></pre>
 
<div id="footer">
TBFramework - v0.2 API documentation generated by <a href="http://apigen.org">ApiGen 2.8.0</a>
/branches/v0.2-buhl/doc/ApiGen/class-Application.html
7,7 → 7,7
<title>Class Application | TBFramework - v0.2</title>
 
<script type="text/javascript" src="resources/combined.js?4205936287"></script>
<script type="text/javascript" src="elementlist.js?117657638"></script>
<script type="text/javascript" src="elementlist.js?1835392179"></script>
<link rel="stylesheet" type="text/css" media="all" href="resources/style.css?3505392360">
 
</head>
40,6 → 40,7
<li><a href="class-Controleur.html">Controleur</a></li>
<li><a href="class-Debug.html">Debug</a></li>
<li><a href="class-GestionnaireException.html">GestionnaireException</a></li>
<li><a href="class-I18n.html">I18n</a></li>
<li><a href="class-Log.html">Log</a></li>
<li><a href="class-Modele.html">Modele</a></li>
<li><a href="class-Registre.html">Registre</a></li>
105,8 → 106,6
<p>Classe fournissant des informations au Framework sur l'application.</p>
 
<p>PHP version 5</p>
 
</div>
 
 
124,21 → 123,18
<b>Package:</b> <a href="package-Framework.html">Framework</a><br>
 
<b>Category:</b>
Debogage<br>
PHP 5.2<br>
<b>Copyright:</b>
1999-2009 Tela Botanica (<a
Copyright (c) 2009, Tela Botanica (<a
href="mailto:accueil&#64;tela-botanica.org">accueil&#64;<!-- -->tela-botanica.org</a>)<br>
<b>License:</b>
<a href="GPL">v3 &lt;http://www.gnu.org/licenses/gpl.txt&gt;</a><br>
<a href="GNU-GPL-v3">&lt;http://www.gnu.org/licenses/gpl.html&gt;</a><br>
<b>License:</b>
<a href="CECILL">v2 &lt;http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt&gt;</a><br>
<a href="CECILL-v2">&lt;http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt&gt;</a><br>
<b>Author:</b>
Jean-Pascal MILCENT &lt;<a
href="mailto:jpm&#64;tela-botanica.org">jpm&#64;<!-- -->tela-botanica.org</a>&gt;
// Autres auteurs :<br>
<b>Version:</b>
$Id: Application.php 456 2014-02-06 11:07:43Z jpm $<br>
<b>Located at</b> <a href="source-class-Application.html#3-96" title="Go to source code">Application.php</a><br>
href="mailto:jpm&#64;tela-botanica.org">jpm&#64;<!-- -->tela-botanica.org</a>&gt;<br>
<b>Located at</b> <a href="source-class-Application.html#3-91" title="Go to source code">Application.php</a><br>
</div>
 
 
156,7 → 152,7
 
<td class="name"><div>
<a class="anchor" href="#_setChemin">#</a>
<code><a href="source-class-Application.html#41-57" title="Go to source code">setChemin</a>( <span>string <var>$chemin_fichier_principal</var></span> )</code>
<code><a href="source-class-Application.html#36-52" title="Go to source code">setChemin</a>( <span>string <var>$chemin_fichier_principal</var></span> )</code>
 
<div class="description short">
198,7 → 194,7
 
<td class="name"><div>
<a class="anchor" href="#_getChemin">#</a>
<code><a href="source-class-Application.html#59-65" title="Go to source code">getChemin</a>( )</code>
<code><a href="source-class-Application.html#54-60" title="Go to source code">getChemin</a>( )</code>
 
<div class="description short">
235,7 → 231,7
 
<td class="name"><div>
<a class="anchor" href="#_setInfo">#</a>
<code><a href="source-class-Application.html#67-81" title="Go to source code">setInfo</a>( <span>array <var>$info</var></span> )</code>
<code><a href="source-class-Application.html#62-76" title="Go to source code">setInfo</a>( <span>array <var>$info</var></span> )</code>
 
<div class="description short">
291,7 → 287,7
 
<td class="name"><div>
<a class="anchor" href="#_getInfo">#</a>
<code><a href="source-class-Application.html#83-95" title="Go to source code">getInfo</a>( <span>string <var>$cle</var> = <span class="php-keyword1">null</span></span> )</code>
<code><a href="source-class-Application.html#78-90" title="Go to source code">getInfo</a>( <span>string <var>$cle</var> = <span class="php-keyword1">null</span></span> )</code>
 
<div class="description short">
/branches/v0.2-buhl/doc/ApiGen/source-class-Config.html
8,7 → 8,7
<title>File Config.php | TBFramework - v0.2</title>
 
<script type="text/javascript" src="resources/combined.js?4205936287"></script>
<script type="text/javascript" src="elementlist.js?117657638"></script>
<script type="text/javascript" src="elementlist.js?1835392179"></script>
<link rel="stylesheet" type="text/css" media="all" href="resources/style.css?3505392360">
 
</head>
41,6 → 41,7
<li><a href="class-Controleur.html">Controleur</a></li>
<li><a href="class-Debug.html">Debug</a></li>
<li><a href="class-GestionnaireException.html">GestionnaireException</a></li>
<li><a href="class-I18n.html">I18n</a></li>
<li><a href="class-Log.html">Log</a></li>
<li><a href="class-Modele.html">Modele</a></li>
<li><a href="class-Registre.html">Registre</a></li>
106,264 → 107,261
</span></span><span id="5" class="l"><a class="l" href="#5"> 5: </a><span class="php-comment"> * Elle offre l'accès en lecture seule aux paramètres de config.
</span></span><span id="6" class="l"><a class="l" href="#6"> 6: </a><span class="php-comment"> * C'est une Singleton.
</span></span><span id="7" class="l"><a class="l" href="#7"> 7: </a><span class="php-comment"> *
</span></span><span id="8" class="l"><a class="l" href="#8"> 8: </a><span class="php-comment"> * PHP Version 5
</span></span><span id="9" class="l"><a class="l" href="#9"> 9: </a><span class="php-comment"> *
</span></span><span id="10" class="l"><a class="l" href="#10"> 10: </a><span class="php-comment"> * @category PHP
</span></span><span id="11" class="l"><a class="l" href="#11"> 11: </a><span class="php-comment"> * @package Framework
</span></span><span id="12" class="l"><a class="l" href="#12"> 12: </a><span class="php-comment"> * @author Jean-Pascal MILCENT &lt;jpm@tela-botanica.org&gt;
</span></span><span id="13" class="l"><a class="l" href="#13"> 13: </a><span class="php-comment"> * @copyright 2009 Tela-Botanica
</span></span><span id="14" class="l"><a class="l" href="#14"> 14: </a><span class="php-comment"> * @license GPL-v3 et CECILL-v2
</span></span><span id="15" class="l"><a class="l" href="#15"> 15: </a><span class="php-comment"> * @version SVN: &lt;svn_id&gt;
</span></span><span id="16" class="l"><a class="l" href="#16"> 16: </a><span class="php-comment"> * @link /doc/framework/
</span></span><span id="17" class="l"><a class="l" href="#17"> 17: </a><span class="php-comment"> */</span>
</span><span id="18" class="l"><a class="l" href="#18"> 18: </a>
</span><span id="19" class="l"><a class="l" href="#19"> 19: </a><span class="php-keyword1">class</span> <a id="Config" href="#Config">Config</a> {
</span><span id="20" class="l"><a class="l" href="#20"> 20: </a>
</span><span id="21" class="l"><a class="l" href="#21"> 21: </a> <span class="php-comment">/**
</span></span><span id="22" class="l"><a class="l" href="#22"> 22: </a><span class="php-comment"> * instance de la classe pointant sur elle même (pour le pattern singleton)
</span></span><span id="23" class="l"><a class="l" href="#23"> 23: </a><span class="php-comment"> */</span>
</span><span id="24" class="l"><a class="l" href="#24"> 24: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-var"><a id="$instance" href="#$instance">$instance</a></span> = <span class="php-keyword1">null</span>;
</span><span id="25" class="l"><a class="l" href="#25"> 25: </a>
</span><span id="26" class="l"><a class="l" href="#26"> 26: </a> <span class="php-comment">/**
</span></span><span id="27" class="l"><a class="l" href="#27"> 27: </a><span class="php-comment"> * paramètres de configuration
</span></span><span id="28" class="l"><a class="l" href="#28"> 28: </a><span class="php-comment"> */</span>
</span><span id="29" class="l"><a class="l" href="#29"> 29: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-var"><a id="$parametres" href="#$parametres">$parametres</a></span> = <span class="php-keyword1">array</span>();
</span><span id="30" class="l"><a class="l" href="#30"> 30: </a>
</span><span id="31" class="l"><a class="l" href="#31"> 31: </a> <span class="php-comment">/**
</span></span><span id="32" class="l"><a class="l" href="#32"> 32: </a><span class="php-comment"> * Constructeur vide
</span></span><span id="33" class="l"><a class="l" href="#33"> 33: </a><span class="php-comment"> */</span>
</span><span id="34" class="l"><a class="l" href="#34"> 34: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">function</span> <a id="___construct" href="#___construct">__construct</a>() {
</span><span id="35" class="l"><a class="l" href="#35"> 35: </a> <span class="php-comment">// Définition de paramètres avant chargement du config.ini</span>
</span><span id="36" class="l"><a class="l" href="#36"> 36: </a> self::<span class="php-var">$parametres</span> = <span class="php-keyword1">array</span>(
</span><span id="37" class="l"><a class="l" href="#37"> 37: </a> <span class="php-quote">'fw_fichier_config'</span> =&gt; <span class="php-quote">'config%s.ini'</span>,
</span><span id="38" class="l"><a class="l" href="#38"> 38: </a> <span class="php-quote">'fw_chemin'</span> =&gt; <span class="php-keyword2">dirname</span>(__FILE__).DS
</span><span id="39" class="l"><a class="l" href="#39"> 39: </a> );
</span><span id="40" class="l"><a class="l" href="#40"> 40: </a>
</span><span id="41" class="l"><a class="l" href="#41"> 41: </a> <span class="php-comment">// Chargement du fichier config.ini du Framework</span>
</span><span id="42" class="l"><a class="l" href="#42"> 42: </a> <span class="php-var">$existe</span> = self::parserFichierIni(self::<span class="php-var">$parametres</span>[<span class="php-quote">'fw_chemin'</span>].<span class="php-keyword2">sprintf</span>(self::<span class="php-var">$parametres</span>[<span class="php-quote">'fw_fichier_config'</span>], <span class="php-quote">''</span>));
</span><span id="43" class="l"><a class="l" href="#43"> 43: </a> <span class="php-keyword1">if</span> (<span class="php-var">$existe</span> === <span class="php-keyword1">false</span>) {
</span><span id="44" class="l"><a class="l" href="#44"> 44: </a> <span class="php-keyword2">trigger_error</span>(<span class="php-quote">&quot;Veuillez configurer le Framework en renommant le fichier config.defaut.ini en config.ini.&quot;</span>, E_USER_ERROR);
</span><span id="45" class="l"><a class="l" href="#45"> 45: </a> }
</span><span id="46" class="l"><a class="l" href="#46"> 46: </a>
</span><span id="47" class="l"><a class="l" href="#47"> 47: </a> <span class="php-comment">// Chargement du fichier config.ini par défaut de l'application</span>
</span><span id="48" class="l"><a class="l" href="#48"> 48: </a> <span class="php-var">$chemin_config_defaut_appli</span> = self::<span class="php-var">$parametres</span>[<span class="php-quote">'chemin_configurations'</span>].<span class="php-keyword2">sprintf</span>(self::<span class="php-var">$parametres</span>[<span class="php-quote">'fw_fichier_config'</span>], <span class="php-quote">''</span>);
</span><span id="49" class="l"><a class="l" href="#49"> 49: </a> self::parserFichierIni(<span class="php-var">$chemin_config_defaut_appli</span>);
</span><span id="50" class="l"><a class="l" href="#50"> 50: </a>
</span><span id="51" class="l"><a class="l" href="#51"> 51: </a> <span class="php-comment">// Chargement des fichiers config.ini contextuels</span>
</span><span id="52" class="l"><a class="l" href="#52"> 52: </a> <span class="php-keyword1">if</span> (PHP_SAPI == <span class="php-quote">'cli'</span>) {<span class="php-comment">// mode console</span>
</span><span id="53" class="l"><a class="l" href="#53"> 53: </a> <span class="php-keyword1">foreach</span> (<span class="php-var">$_SERVER</span>[<span class="php-quote">'argv'</span>] <span class="php-keyword1">as</span> <span class="php-var">$cle</span> =&gt; <span class="php-var">$valeur</span>) {
</span><span id="54" class="l"><a class="l" href="#54"> 54: </a> <span class="php-keyword1">if</span> (<span class="php-var">$valeur</span> == <span class="php-quote">'-contexte'</span>) {
</span><span id="55" class="l"><a class="l" href="#55"> 55: </a> chargerFichierContexte(<span class="php-var">$_SERVER</span>[<span class="php-quote">'argv'</span>][(<span class="php-var">$cle</span>+<span class="php-num">1</span>)]);
</span><span id="56" class="l"><a class="l" href="#56"> 56: </a> <span class="php-keyword1">break</span>;
</span><span id="57" class="l"><a class="l" href="#57"> 57: </a> }
</span><span id="58" class="l"><a class="l" href="#58"> 58: </a> }
</span><span id="59" class="l"><a class="l" href="#59"> 59: </a> } <span class="php-keyword1">else</span> {<span class="php-comment">// mode web</span>
</span><span id="60" class="l"><a class="l" href="#60"> 60: </a> <span class="php-comment">// Pour Papyrus</span>
</span><span id="61" class="l"><a class="l" href="#61"> 61: </a> <span class="php-keyword1">if</span> (<span class="php-keyword2">defined</span>(<span class="php-quote">'PAP_VERSION'</span>)) {
</span><span id="62" class="l"><a class="l" href="#62"> 62: </a> self::chargerFichierContexte(<span class="php-quote">'papyrus'</span>);
</span><span id="63" class="l"><a class="l" href="#63"> 63: </a> }
</span><span id="64" class="l"><a class="l" href="#64"> 64: </a> <span class="php-comment">// Via le fichie .ini par défaut de l'appli</span>
</span><span id="65" class="l"><a class="l" href="#65"> 65: </a> <span class="php-keyword1">if</span> (Config::existeValeur(<span class="php-quote">'info.contexte'</span>, self::<span class="php-var">$parametres</span>)) {
</span><span id="66" class="l"><a class="l" href="#66"> 66: </a> self::chargerFichierContexte(Config::get(<span class="php-quote">'info.contexte'</span>));
</span><span id="67" class="l"><a class="l" href="#67"> 67: </a> }
</span><span id="68" class="l"><a class="l" href="#68"> 68: </a>
</span><span id="69" class="l"><a class="l" href="#69"> 69: </a> <span class="php-comment">// Chargement du contexte présent dans le GET</span>
</span><span id="70" class="l"><a class="l" href="#70"> 70: </a> <span class="php-keyword1">if</span> (<span class="php-keyword1">isset</span>(<span class="php-var">$_GET</span>[<span class="php-quote">'contexte'</span>])) {
</span><span id="71" class="l"><a class="l" href="#71"> 71: </a> self::chargerFichierContexte(<span class="php-var">$_GET</span>[<span class="php-quote">'contexte'</span>]);
</span><span id="72" class="l"><a class="l" href="#72"> 72: </a> }
</span><span id="73" class="l"><a class="l" href="#73"> 73: </a>
</span><span id="74" class="l"><a class="l" href="#74"> 74: </a> <span class="php-comment">// Chargement du contexte présent dans le POST</span>
</span><span id="75" class="l"><a class="l" href="#75"> 75: </a> <span class="php-keyword1">if</span> (<span class="php-keyword1">isset</span>(<span class="php-var">$_POST</span>[<span class="php-quote">'contexte'</span>])) {
</span><span id="76" class="l"><a class="l" href="#76"> 76: </a> self::chargerFichierContexte(<span class="php-var">$_POST</span>[<span class="php-quote">'contexte'</span>]);
</span><span id="77" class="l"><a class="l" href="#77"> 77: </a> }
</span><span id="78" class="l"><a class="l" href="#78"> 78: </a> }
</span><span id="79" class="l"><a class="l" href="#79"> 79: </a> }
</span><span id="80" class="l"><a class="l" href="#80"> 80: </a>
</span><span id="81" class="l"><a class="l" href="#81"> 81: </a> <span class="php-comment">/**
</span></span><span id="82" class="l"><a class="l" href="#82"> 82: </a><span class="php-comment"> * Charge le fichier de config correspondant au contexte
</span></span><span id="83" class="l"><a class="l" href="#83"> 83: </a><span class="php-comment"> * @param string $contexte le contexte
</span></span><span id="84" class="l"><a class="l" href="#84"> 84: </a><span class="php-comment"> */</span>
</span><span id="85" class="l"><a class="l" href="#85"> 85: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_chargerFichierContexte" href="#_chargerFichierContexte">chargerFichierContexte</a>(<span class="php-var">$contexte</span>) {
</span><span id="86" class="l"><a class="l" href="#86"> 86: </a> <span class="php-var">$chemin_config_appli_contextuel</span> = self::<span class="php-var">$parametres</span>[<span class="php-quote">'chemin_configurations'</span>];
</span><span id="87" class="l"><a class="l" href="#87"> 87: </a> <span class="php-var">$chemin_config_appli_contextuel</span> .= <span class="php-keyword2">sprintf</span>(self::<span class="php-var">$parametres</span>[<span class="php-quote">'fw_fichier_config'</span>], <span class="php-quote">'_'</span>.<span class="php-var">$contexte</span>);
</span><span id="88" class="l"><a class="l" href="#88"> 88: </a> self::parserFichierIni(<span class="php-var">$chemin_config_appli_contextuel</span>);
</span><span id="89" class="l"><a class="l" href="#89"> 89: </a> }
</span><span id="90" class="l"><a class="l" href="#90"> 90: </a>
</span><span id="91" class="l"><a class="l" href="#91"> 91: </a> <span class="php-comment">/**
</span></span><span id="92" class="l"><a class="l" href="#92"> 92: </a><span class="php-comment"> * Parse le fichier ini donné en paramètre
</span></span><span id="93" class="l"><a class="l" href="#93"> 93: </a><span class="php-comment"> * @param string $fichier_ini nom du fichier ini à parser
</span></span><span id="94" class="l"><a class="l" href="#94"> 94: </a><span class="php-comment"> * @return array tableau contenant les paramètres du fichier ini
</span></span><span id="95" class="l"><a class="l" href="#95"> 95: </a><span class="php-comment"> */</span>
</span><span id="96" class="l"><a class="l" href="#96"> 96: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_parserFichierIni" href="#_parserFichierIni">parserFichierIni</a>(<span class="php-var">$fichier_ini</span>) {
</span><span id="97" class="l"><a class="l" href="#97"> 97: </a> <span class="php-var">$retour</span> = <span class="php-keyword1">false</span>;
</span><span id="98" class="l"><a class="l" href="#98"> 98: </a> <span class="php-keyword1">if</span> (<span class="php-keyword2">file_exists</span>(<span class="php-var">$fichier_ini</span>)) {
</span><span id="99" class="l"><a class="l" href="#99"> 99: </a> <span class="php-var">$ini</span> = <span class="php-keyword2">parse_ini_file</span>(<span class="php-var">$fichier_ini</span>, <span class="php-keyword1">true</span>);
</span><span id="100" class="l"><a class="l" href="#100">100: </a> <span class="php-var">$ini</span> = self::analyserTableauIni(<span class="php-var">$ini</span>);
</span><span id="101" class="l"><a class="l" href="#101">101: </a> self::fusionner(<span class="php-var">$ini</span>);
</span><span id="102" class="l"><a class="l" href="#102">102: </a> <span class="php-var">$retour</span> = <span class="php-keyword1">true</span>;
</span><span id="103" class="l"><a class="l" href="#103">103: </a> }
</span><span id="104" class="l"><a class="l" href="#104">104: </a> <span class="php-keyword1">return</span> <span class="php-var">$retour</span>;
</span><span id="105" class="l"><a class="l" href="#105">105: </a> }
</span><span id="106" class="l"><a class="l" href="#106">106: </a>
</span><span id="107" class="l"><a class="l" href="#107">107: </a> <span class="php-comment">/**
</span></span><span id="108" class="l"><a class="l" href="#108">108: </a><span class="php-comment"> * fusionne un tableau de paramètres avec le tableau de paramètres global
</span></span><span id="109" class="l"><a class="l" href="#109">109: </a><span class="php-comment"> * @param array $ini le tableau à fusionner
</span></span><span id="110" class="l"><a class="l" href="#110">110: </a><span class="php-comment"> */</span>
</span><span id="111" class="l"><a class="l" href="#111">111: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_fusionner" href="#_fusionner">fusionner</a>(<span class="php-keyword1">array</span> <span class="php-var">$ini</span>) {
</span><span id="112" class="l"><a class="l" href="#112">112: </a> self::<span class="php-var">$parametres</span> = <span class="php-keyword2">array_merge</span>(self::<span class="php-var">$parametres</span>, <span class="php-var">$ini</span>);
</span><span id="113" class="l"><a class="l" href="#113">113: </a> }
</span><span id="114" class="l"><a class="l" href="#114">114: </a>
</span><span id="115" class="l"><a class="l" href="#115">115: </a> <span class="php-comment">/**
</span></span><span id="116" class="l"><a class="l" href="#116">116: </a><span class="php-comment"> * renvoie la valeur demandé grâce une chaine de paramètres
</span></span><span id="117" class="l"><a class="l" href="#117">117: </a><span class="php-comment"> * @param string $param la chaine de paramètres
</span></span><span id="118" class="l"><a class="l" href="#118">118: </a><span class="php-comment"> * @param array $config le tableau de paramètre
</span></span><span id="119" class="l"><a class="l" href="#119">119: </a><span class="php-comment"> * @return string la valeur de la chaine demandée
</span></span><span id="120" class="l"><a class="l" href="#120">120: </a><span class="php-comment"> */</span>
</span><span id="121" class="l"><a class="l" href="#121">121: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_getValeur" href="#_getValeur">getValeur</a>(<span class="php-var">$param</span>, <span class="php-var">$config</span>) {
</span><span id="122" class="l"><a class="l" href="#122">122: </a> <span class="php-keyword1">if</span> (<span class="php-var">$param</span> === <span class="php-keyword1">null</span>) {
</span><span id="123" class="l"><a class="l" href="#123">123: </a> <span class="php-keyword1">return</span> <span class="php-keyword1">null</span>;
</span><span id="124" class="l"><a class="l" href="#124">124: </a> } <span class="php-keyword1">else</span> {
</span><span id="125" class="l"><a class="l" href="#125">125: </a> <span class="php-keyword1">if</span> (<span class="php-keyword1">isset</span>(<span class="php-var">$config</span>[<span class="php-var">$param</span>])) {
</span><span id="126" class="l"><a class="l" href="#126">126: </a> <span class="php-keyword1">return</span> <span class="php-var">$config</span>[<span class="php-var">$param</span>];
</span><span id="127" class="l"><a class="l" href="#127">127: </a> } <span class="php-keyword1">else</span> <span class="php-keyword1">if</span> (<span class="php-keyword2">strpos</span>(<span class="php-var">$param</span>, <span class="php-quote">'.'</span>) !== <span class="php-keyword1">false</span>) {
</span><span id="128" class="l"><a class="l" href="#128">128: </a> <span class="php-var">$pieces</span> = <span class="php-keyword2">explode</span>(<span class="php-quote">'.'</span>, <span class="php-var">$param</span>, <span class="php-num">2</span>);
</span><span id="129" class="l"><a class="l" href="#129">129: </a> <span class="php-keyword1">if</span> (<span class="php-keyword2">strlen</span>(<span class="php-var">$pieces</span>[<span class="php-num">0</span>]) &amp;&amp; <span class="php-keyword2">strlen</span>(<span class="php-var">$pieces</span>[<span class="php-num">1</span>])) {
</span><span id="130" class="l"><a class="l" href="#130">130: </a> <span class="php-keyword1">if</span> (<span class="php-keyword1">isset</span>(<span class="php-var">$config</span>[<span class="php-var">$pieces</span>[<span class="php-num">0</span>]])) {
</span><span id="131" class="l"><a class="l" href="#131">131: </a> <span class="php-keyword1">if</span> (<span class="php-keyword2">is_array</span>(<span class="php-var">$config</span>[<span class="php-var">$pieces</span>[<span class="php-num">0</span>]])) {
</span><span id="132" class="l"><a class="l" href="#132">132: </a> <span class="php-keyword1">return</span> self::getValeur(<span class="php-var">$pieces</span>[<span class="php-num">1</span>], <span class="php-var">$config</span>[<span class="php-var">$pieces</span>[<span class="php-num">0</span>]]);
</span><span id="133" class="l"><a class="l" href="#133">133: </a> }
</span><span id="134" class="l"><a class="l" href="#134">134: </a> }
</span><span id="135" class="l"><a class="l" href="#135">135: </a> }
</span><span id="136" class="l"><a class="l" href="#136">136: </a> } <span class="php-keyword1">else</span> {
</span><span id="137" class="l"><a class="l" href="#137">137: </a> <span class="php-keyword1">return</span> <span class="php-keyword1">null</span>;
</span><span id="138" class="l"><a class="l" href="#138">138: </a> }
</span><span id="139" class="l"><a class="l" href="#139">139: </a> }
</span><span id="140" class="l"><a class="l" href="#140">140: </a> }
</span><span id="141" class="l"><a class="l" href="#141">141: </a>
</span><span id="142" class="l"><a class="l" href="#142">142: </a> <span class="php-comment">/**
</span></span><span id="143" class="l"><a class="l" href="#143">143: </a><span class="php-comment"> * Teste si param existe dans le tableau config
</span></span><span id="144" class="l"><a class="l" href="#144">144: </a><span class="php-comment"> * @param string $param nom du paramètre
</span></span><span id="145" class="l"><a class="l" href="#145">145: </a><span class="php-comment"> * @param array tableau de configuration
</span></span><span id="146" class="l"><a class="l" href="#146">146: </a><span class="php-comment"> */</span>
</span><span id="147" class="l"><a class="l" href="#147">147: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_existeValeur" href="#_existeValeur">existeValeur</a>(<span class="php-var">$param</span>, <span class="php-var">$config</span>) {
</span><span id="148" class="l"><a class="l" href="#148">148: </a> <span class="php-var">$retour</span> = <span class="php-keyword1">false</span>;
</span><span id="149" class="l"><a class="l" href="#149">149: </a> <span class="php-keyword1">if</span> (self::getValeur(<span class="php-var">$param</span>, <span class="php-var">$config</span>) !== <span class="php-keyword1">null</span>) {
</span><span id="150" class="l"><a class="l" href="#150">150: </a> <span class="php-var">$retour</span> = <span class="php-keyword1">true</span>;
</span><span id="151" class="l"><a class="l" href="#151">151: </a> }
</span><span id="152" class="l"><a class="l" href="#152">152: </a> <span class="php-keyword1">return</span> <span class="php-var">$retour</span>;
</span><span id="153" class="l"><a class="l" href="#153">153: </a> }
</span><span id="154" class="l"><a class="l" href="#154">154: </a>
</span><span id="155" class="l"><a class="l" href="#155">155: </a> <span class="php-comment">/**
</span></span><span id="156" class="l"><a class="l" href="#156">156: </a><span class="php-comment"> * Vérifie si l'instance de classe à été crée, si non la crée
</span></span><span id="157" class="l"><a class="l" href="#157">157: </a><span class="php-comment"> */</span>
</span><span id="158" class="l"><a class="l" href="#158">158: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_verifierCreationInstance" href="#_verifierCreationInstance">verifierCreationInstance</a>() {
</span><span id="159" class="l"><a class="l" href="#159">159: </a> <span class="php-keyword1">if</span> (<span class="php-keyword1">empty</span>(self::<span class="php-var">$instance</span>)) {
</span><span id="160" class="l"><a class="l" href="#160">160: </a> self::<span class="php-var">$instance</span> = <span class="php-keyword1">new</span> Config();
</span><span id="161" class="l"><a class="l" href="#161">161: </a> }
</span><span id="162" class="l"><a class="l" href="#162">162: </a> }
</span><span id="163" class="l"><a class="l" href="#163">163: </a>
</span><span id="164" class="l"><a class="l" href="#164">164: </a> <span class="php-comment">/**
</span></span><span id="165" class="l"><a class="l" href="#165">165: </a><span class="php-comment"> * analyse un tableau de paramètres
</span></span><span id="166" class="l"><a class="l" href="#166">166: </a><span class="php-comment"> * @param array $config le tableau de paramètres
</span></span><span id="167" class="l"><a class="l" href="#167">167: </a><span class="php-comment"> * @return array le tableau analysé
</span></span><span id="168" class="l"><a class="l" href="#168">168: </a><span class="php-comment"> */</span>
</span><span id="169" class="l"><a class="l" href="#169">169: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_analyserTableauIni" href="#_analyserTableauIni">analyserTableauIni</a>(<span class="php-var">$config</span> = <span class="php-keyword1">array</span>()) {
</span><span id="170" class="l"><a class="l" href="#170">170: </a> <span class="php-keyword1">foreach</span> (<span class="php-var">$config</span> <span class="php-keyword1">as</span> <span class="php-var">$cle</span> =&gt; &amp;<span class="php-var">$valeur</span>) {
</span><span id="171" class="l"><a class="l" href="#171">171: </a> <span class="php-keyword1">if</span> (<span class="php-keyword2">is_array</span>(<span class="php-var">$valeur</span>)) {
</span><span id="172" class="l"><a class="l" href="#172">172: </a> <span class="php-var">$config</span>[<span class="php-var">$cle</span>] = self::analyserTableauIni(<span class="php-var">$valeur</span>);
</span><span id="173" class="l"><a class="l" href="#173">173: </a> } <span class="php-keyword1">else</span> {
</span><span id="174" class="l"><a class="l" href="#174">174: </a> self::evaluerReferences(<span class="php-var">$config</span>, <span class="php-var">$cle</span>);
</span><span id="175" class="l"><a class="l" href="#175">175: </a> self::evaluerPhp(<span class="php-var">$config</span>, <span class="php-var">$cle</span>);
</span><span id="176" class="l"><a class="l" href="#176">176: </a> self::evaluerCle(<span class="php-var">$config</span>, <span class="php-var">$cle</span>, <span class="php-var">$config</span>[<span class="php-var">$cle</span>]);
</span><span id="177" class="l"><a class="l" href="#177">177: </a> }
</span><span id="178" class="l"><a class="l" href="#178">178: </a> }
</span><span id="179" class="l"><a class="l" href="#179">179: </a> <span class="php-keyword1">return</span> <span class="php-var">$config</span>;
</span><span id="180" class="l"><a class="l" href="#180">180: </a> }
</span><span id="181" class="l"><a class="l" href="#181">181: </a>
</span><span id="182" class="l"><a class="l" href="#182">182: </a> <span class="php-comment">/**
</span></span><span id="183" class="l"><a class="l" href="#183">183: </a><span class="php-comment"> * dans le cas des chaine de configuration à sous clé (ex.: cle.souscle)
</span></span><span id="184" class="l"><a class="l" href="#184">184: </a><span class="php-comment"> * evalue les valeurs correspondantes et crée les sous tableaux associés
</span></span><span id="185" class="l"><a class="l" href="#185">185: </a><span class="php-comment"> * @param array $config tableau de configuration (par référence)
</span></span><span id="186" class="l"><a class="l" href="#186">186: </a><span class="php-comment"> * @param string $cle la cle dans le tableau
</span></span><span id="187" class="l"><a class="l" href="#187">187: </a><span class="php-comment"> * @param string $valeur la valeur à affecter
</span></span><span id="188" class="l"><a class="l" href="#188">188: </a><span class="php-comment"> */</span>
</span><span id="189" class="l"><a class="l" href="#189">189: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_evaluerCle" href="#_evaluerCle">evaluerCle</a>(&amp;<span class="php-var">$config</span>, <span class="php-var">$cle</span>, <span class="php-var">$valeur</span>) {
</span><span id="190" class="l"><a class="l" href="#190">190: </a> <span class="php-keyword1">if</span> (<span class="php-keyword2">strpos</span>(<span class="php-var">$cle</span>, <span class="php-quote">'.'</span>) !== <span class="php-keyword1">false</span>) {
</span><span id="191" class="l"><a class="l" href="#191">191: </a> <span class="php-keyword1">unset</span>(<span class="php-var">$config</span>[<span class="php-var">$cle</span>]);
</span><span id="192" class="l"><a class="l" href="#192">192: </a> <span class="php-var">$pieces</span> = <span class="php-keyword2">explode</span>(<span class="php-quote">'.'</span>, <span class="php-var">$cle</span>, <span class="php-num">2</span>);
</span><span id="193" class="l"><a class="l" href="#193">193: </a> <span class="php-keyword1">if</span> (<span class="php-keyword2">strlen</span>(<span class="php-var">$pieces</span>[<span class="php-num">0</span>]) &amp;&amp; <span class="php-keyword2">strlen</span>(<span class="php-var">$pieces</span>[<span class="php-num">1</span>])) {
</span><span id="194" class="l"><a class="l" href="#194">194: </a> <span class="php-keyword1">if</span> (<span class="php-keyword1">isset</span>(<span class="php-var">$config</span>[<span class="php-var">$pieces</span>[<span class="php-num">0</span>]]) &amp;&amp; !<span class="php-keyword2">is_array</span>(<span class="php-var">$config</span>[<span class="php-var">$pieces</span>[<span class="php-num">0</span>]])) {
</span><span id="195" class="l"><a class="l" href="#195">195: </a> <span class="php-var">$m</span> = <span class="php-quote">&quot;Ne peut pas créer de sous-clé pour '</span><span class="php-var">{$pieces[0]}</span><span class="php-quote">' car la clé existe déjà&quot;</span>;
</span><span id="196" class="l"><a class="l" href="#196">196: </a> <span class="php-keyword2">trigger_error</span>(<span class="php-var">$m</span>, E_USER_WARNING);
</span><span id="197" class="l"><a class="l" href="#197">197: </a> } <span class="php-keyword1">else</span> {
</span><span id="198" class="l"><a class="l" href="#198">198: </a> <span class="php-var">$config</span>[<span class="php-var">$pieces</span>[<span class="php-num">0</span>]][<span class="php-var">$pieces</span>[<span class="php-num">1</span>]] = <span class="php-var">$valeur</span>;
</span><span id="199" class="l"><a class="l" href="#199">199: </a> <span class="php-var">$config</span>[<span class="php-var">$pieces</span>[<span class="php-num">0</span>]] = self::evaluerCle(<span class="php-var">$config</span>[<span class="php-var">$pieces</span>[<span class="php-num">0</span>]], <span class="php-var">$pieces</span>[<span class="php-num">1</span>], <span class="php-var">$valeur</span>);
</span><span id="200" class="l"><a class="l" href="#200">200: </a> }
</span><span id="201" class="l"><a class="l" href="#201">201: </a> } <span class="php-keyword1">else</span> {
</span><span id="202" class="l"><a class="l" href="#202">202: </a> <span class="php-var">$m</span> = <span class="php-quote">&quot;Clé invalide '</span><span class="php-var">$cle</span><span class="php-quote">'&quot;</span>;
</span><span id="203" class="l"><a class="l" href="#203">203: </a> <span class="php-keyword2">trigger_error</span>(<span class="php-var">$m</span>, E_USER_WARNING);
</span><span id="204" class="l"><a class="l" href="#204">204: </a> }
</span><span id="205" class="l"><a class="l" href="#205">205: </a> } <span class="php-keyword1">else</span> {
</span><span id="206" class="l"><a class="l" href="#206">206: </a> <span class="php-var">$config</span>[<span class="php-var">$cle</span>] = <span class="php-var">$valeur</span>;
</span><span id="207" class="l"><a class="l" href="#207">207: </a> }
</span><span id="208" class="l"><a class="l" href="#208">208: </a> <span class="php-keyword1">return</span> <span class="php-var">$config</span>;
</span><span id="209" class="l"><a class="l" href="#209">209: </a> }
</span><span id="210" class="l"><a class="l" href="#210">210: </a>
</span><span id="211" class="l"><a class="l" href="#211">211: </a> <span class="php-comment">/**
</span></span><span id="212" class="l"><a class="l" href="#212">212: </a><span class="php-comment"> * Evalue les valeurs de références à une clé dans le tableau config (cas du ref:cle)
</span></span><span id="213" class="l"><a class="l" href="#213">213: </a><span class="php-comment"> * @param array $config tableau de configuration
</span></span><span id="214" class="l"><a class="l" href="#214">214: </a><span class="php-comment"> * @param string $cle la clé dont il faut évaluer les références
</span></span><span id="215" class="l"><a class="l" href="#215">215: </a><span class="php-comment"> */</span>
</span><span id="216" class="l"><a class="l" href="#216">216: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_evaluerReferences" href="#_evaluerReferences">evaluerReferences</a>(&amp;<span class="php-var">$config</span>, <span class="php-var">$cle</span>) {
</span><span id="217" class="l"><a class="l" href="#217">217: </a> <span class="php-keyword1">if</span> (<span class="php-keyword2">preg_match_all</span>(<span class="php-quote">'/{ref:([A-Za-z0-9_.-]+)}/'</span>, <span class="php-var">$config</span>[<span class="php-var">$cle</span>], <span class="php-var">$correspondances</span>, PREG_SET_ORDER)) {
</span><span id="218" class="l"><a class="l" href="#218">218: </a> <span class="php-keyword1">foreach</span> (<span class="php-var">$correspondances</span> <span class="php-keyword1">as</span> <span class="php-var">$ref</span>) {
</span><span id="219" class="l"><a class="l" href="#219">219: </a> <span class="php-var">$config</span>[<span class="php-var">$cle</span>] = <span class="php-keyword2">str_replace</span>(<span class="php-var">$ref</span>[<span class="php-num">0</span>], self::getValeur(<span class="php-var">$ref</span>[<span class="php-num">1</span>], <span class="php-var">$config</span>), <span class="php-var">$config</span>[<span class="php-var">$cle</span>]);
</span><span id="220" class="l"><a class="l" href="#220">220: </a> }
</span><span id="221" class="l"><a class="l" href="#221">221: </a> }
</span><span id="222" class="l"><a class="l" href="#222">222: </a> }
</span><span id="223" class="l"><a class="l" href="#223">223: </a>
</span><span id="224" class="l"><a class="l" href="#224">224: </a> <span class="php-comment">/**
</span></span><span id="225" class="l"><a class="l" href="#225">225: </a><span class="php-comment"> * Evalue le code php contenu dans un clé tu tableau config
</span></span><span id="226" class="l"><a class="l" href="#226">226: </a><span class="php-comment"> * @param array $config tableau de configuration (par référence)
</span></span><span id="227" class="l"><a class="l" href="#227">227: </a><span class="php-comment"> * @param string $cle le clé du tableau dont il faut évaluer la valeur
</span></span><span id="228" class="l"><a class="l" href="#228">228: </a><span class="php-comment"> */</span>
</span><span id="229" class="l"><a class="l" href="#229">229: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_evaluerPhp" href="#_evaluerPhp">evaluerPhp</a>(&amp;<span class="php-var">$config</span>, <span class="php-var">$cle</span>) {
</span><span id="230" class="l"><a class="l" href="#230">230: </a> <span class="php-keyword1">if</span> (<span class="php-keyword2">preg_match</span>(<span class="php-quote">'/^php:(.+)$/'</span>, <span class="php-var">$config</span>[<span class="php-var">$cle</span>], <span class="php-var">$correspondances</span>)) {
</span><span id="231" class="l"><a class="l" href="#231">231: </a> <span class="php-keyword2">eval</span>(<span class="php-quote">'$config[&quot;'</span>.<span class="php-var">$cle</span>.<span class="php-quote">'&quot;] = '</span>.<span class="php-var">$correspondances</span>[<span class="php-num">1</span>].<span class="php-quote">';'</span>);
</span><span id="232" class="l"><a class="l" href="#232">232: </a> }
</span><span id="233" class="l"><a class="l" href="#233">233: </a> }
</span><span id="234" class="l"><a class="l" href="#234">234: </a>
</span><span id="235" class="l"><a class="l" href="#235">235: </a> <span class="php-comment">/**
</span></span><span id="236" class="l"><a class="l" href="#236">236: </a><span class="php-comment"> * Charge un fichier ini dans le tableau des paramètres de l'appli
</span></span><span id="237" class="l"><a class="l" href="#237">237: </a><span class="php-comment"> * @param string $fichier_ini le nom du fichier à charger
</span></span><span id="238" class="l"><a class="l" href="#238">238: </a><span class="php-comment"> * @return array le fichier ini parsé
</span></span><span id="239" class="l"><a class="l" href="#239">239: </a><span class="php-comment"> */</span>
</span><span id="240" class="l"><a class="l" href="#240">240: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_charger" href="#_charger">charger</a>(<span class="php-var">$fichier_ini</span>) {
</span><span id="241" class="l"><a class="l" href="#241">241: </a> self::verifierCreationInstance();
</span><span id="242" class="l"><a class="l" href="#242">242: </a> <span class="php-keyword1">return</span> self::parserFichierIni(<span class="php-var">$fichier_ini</span>);
</span><span id="243" class="l"><a class="l" href="#243">243: </a> }
</span><span id="244" class="l"><a class="l" href="#244">244: </a>
</span><span id="245" class="l"><a class="l" href="#245">245: </a> <span class="php-comment">/**
</span></span><span id="246" class="l"><a class="l" href="#246">246: </a><span class="php-comment"> * Acesseur pour la valeur d'un paramètre
</span></span><span id="247" class="l"><a class="l" href="#247">247: </a><span class="php-comment"> * @param string $param le nom du paramètre
</span></span><span id="248" class="l"><a class="l" href="#248">248: </a><span class="php-comment"> * @return string la valeur du paramètre
</span></span><span id="249" class="l"><a class="l" href="#249">249: </a><span class="php-comment"> */</span>
</span><span id="250" class="l"><a class="l" href="#250">250: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_get" href="#_get">get</a>(<span class="php-var">$param</span> = <span class="php-keyword1">null</span>) {
</span><span id="251" class="l"><a class="l" href="#251">251: </a> self::verifierCreationInstance();
</span><span id="252" class="l"><a class="l" href="#252">252: </a> <span class="php-keyword1">return</span> self::getValeur(<span class="php-var">$param</span>, self::<span class="php-var">$parametres</span>);
</span><span id="253" class="l"><a class="l" href="#253">253: </a> }
</span><span id="254" class="l"><a class="l" href="#254">254: </a>
</span><span id="255" class="l"><a class="l" href="#255">255: </a> <span class="php-comment">/**
</span></span><span id="256" class="l"><a class="l" href="#256">256: </a><span class="php-comment"> * Vérifie si la valeur d'un paramètre existe
</span></span><span id="257" class="l"><a class="l" href="#257">257: </a><span class="php-comment"> * @param string $param le nom du paramètre
</span></span><span id="258" class="l"><a class="l" href="#258">258: </a><span class="php-comment"> * @return boolean vrai si le paramètre existe, false sinon
</span></span><span id="259" class="l"><a class="l" href="#259">259: </a><span class="php-comment"> */</span>
</span><span id="260" class="l"><a class="l" href="#260">260: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_existe" href="#_existe">existe</a>(<span class="php-var">$param</span>) {
</span><span id="261" class="l"><a class="l" href="#261">261: </a> self::verifierCreationInstance();
</span><span id="262" class="l"><a class="l" href="#262">262: </a> <span class="php-keyword1">return</span> self::existeValeur(<span class="php-var">$param</span>, self::<span class="php-var">$parametres</span>);
</span><span id="263" class="l"><a class="l" href="#263">263: </a> }
</span><span id="264" class="l"><a class="l" href="#264">264: </a>}
</span><span id="265" class="l"><a class="l" href="#265">265: </a></span><span class="xlang">?&gt;</span></code></pre>
</span></span><span id="8" class="l"><a class="l" href="#8"> 8: </a><span class="php-comment"> * @category PHP 5.2
</span></span><span id="9" class="l"><a class="l" href="#9"> 9: </a><span class="php-comment"> * @package Framework
</span></span><span id="10" class="l"><a class="l" href="#10"> 10: </a><span class="php-comment"> * @author Jean-Pascal MILCENT &lt;jpm@tela-botanica.org&gt;
</span></span><span id="11" class="l"><a class="l" href="#11"> 11: </a><span class="php-comment"> * @copyright Copyright (c) 2009, Tela Botanica (accueil@tela-botanica.org)
</span></span><span id="12" class="l"><a class="l" href="#12"> 12: </a><span class="php-comment"> * @license GNU-GPL-v3 &lt;http://www.gnu.org/licenses/gpl.html&gt;
</span></span><span id="13" class="l"><a class="l" href="#13"> 13: </a><span class="php-comment"> * @license CECILL-v2 &lt;http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt&gt;
</span></span><span id="14" class="l"><a class="l" href="#14"> 14: </a><span class="php-comment"> */</span>
</span><span id="15" class="l"><a class="l" href="#15"> 15: </a>
</span><span id="16" class="l"><a class="l" href="#16"> 16: </a><span class="php-keyword1">class</span> <a id="Config" href="#Config">Config</a> {
</span><span id="17" class="l"><a class="l" href="#17"> 17: </a>
</span><span id="18" class="l"><a class="l" href="#18"> 18: </a> <span class="php-comment">/**
</span></span><span id="19" class="l"><a class="l" href="#19"> 19: </a><span class="php-comment"> * instance de la classe pointant sur elle même (pour le pattern singleton)
</span></span><span id="20" class="l"><a class="l" href="#20"> 20: </a><span class="php-comment"> */</span>
</span><span id="21" class="l"><a class="l" href="#21"> 21: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-var"><a id="$instance" href="#$instance">$instance</a></span> = <span class="php-keyword1">null</span>;
</span><span id="22" class="l"><a class="l" href="#22"> 22: </a>
</span><span id="23" class="l"><a class="l" href="#23"> 23: </a> <span class="php-comment">/**
</span></span><span id="24" class="l"><a class="l" href="#24"> 24: </a><span class="php-comment"> * paramètres de configuration
</span></span><span id="25" class="l"><a class="l" href="#25"> 25: </a><span class="php-comment"> */</span>
</span><span id="26" class="l"><a class="l" href="#26"> 26: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-var"><a id="$parametres" href="#$parametres">$parametres</a></span> = <span class="php-keyword1">array</span>();
</span><span id="27" class="l"><a class="l" href="#27"> 27: </a>
</span><span id="28" class="l"><a class="l" href="#28"> 28: </a> <span class="php-comment">/**
</span></span><span id="29" class="l"><a class="l" href="#29"> 29: </a><span class="php-comment"> * Constructeur vide
</span></span><span id="30" class="l"><a class="l" href="#30"> 30: </a><span class="php-comment"> */</span>
</span><span id="31" class="l"><a class="l" href="#31"> 31: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">function</span> <a id="___construct" href="#___construct">__construct</a>() {
</span><span id="32" class="l"><a class="l" href="#32"> 32: </a> <span class="php-comment">// Définition de paramètres avant chargement du config.ini</span>
</span><span id="33" class="l"><a class="l" href="#33"> 33: </a> self::<span class="php-var">$parametres</span> = <span class="php-keyword1">array</span>(
</span><span id="34" class="l"><a class="l" href="#34"> 34: </a> <span class="php-quote">'fw_fichier_config'</span> =&gt; <span class="php-quote">'config%s.ini'</span>,
</span><span id="35" class="l"><a class="l" href="#35"> 35: </a> <span class="php-quote">'fw_chemin'</span> =&gt; <span class="php-keyword2">dirname</span>(__FILE__).DS
</span><span id="36" class="l"><a class="l" href="#36"> 36: </a> );
</span><span id="37" class="l"><a class="l" href="#37"> 37: </a>
</span><span id="38" class="l"><a class="l" href="#38"> 38: </a> <span class="php-comment">// Chargement du fichier config.ini du Framework</span>
</span><span id="39" class="l"><a class="l" href="#39"> 39: </a> <span class="php-var">$existe</span> = self::parserFichierIni(self::<span class="php-var">$parametres</span>[<span class="php-quote">'fw_chemin'</span>].<span class="php-keyword2">sprintf</span>(self::<span class="php-var">$parametres</span>[<span class="php-quote">'fw_fichier_config'</span>], <span class="php-quote">''</span>));
</span><span id="40" class="l"><a class="l" href="#40"> 40: </a> <span class="php-keyword1">if</span> (<span class="php-var">$existe</span> === <span class="php-keyword1">false</span>) {
</span><span id="41" class="l"><a class="l" href="#41"> 41: </a> <span class="php-keyword2">trigger_error</span>(<span class="php-quote">&quot;Veuillez configurer le Framework en renommant le fichier config.defaut.ini en config.ini.&quot;</span>, E_USER_ERROR);
</span><span id="42" class="l"><a class="l" href="#42"> 42: </a> }
</span><span id="43" class="l"><a class="l" href="#43"> 43: </a>
</span><span id="44" class="l"><a class="l" href="#44"> 44: </a> <span class="php-comment">// Chargement du fichier config.ini par défaut de l'application</span>
</span><span id="45" class="l"><a class="l" href="#45"> 45: </a> <span class="php-var">$chemin_config_defaut_appli</span> = self::<span class="php-var">$parametres</span>[<span class="php-quote">'chemin_configurations'</span>].<span class="php-keyword2">sprintf</span>(self::<span class="php-var">$parametres</span>[<span class="php-quote">'fw_fichier_config'</span>], <span class="php-quote">''</span>);
</span><span id="46" class="l"><a class="l" href="#46"> 46: </a> self::parserFichierIni(<span class="php-var">$chemin_config_defaut_appli</span>);
</span><span id="47" class="l"><a class="l" href="#47"> 47: </a>
</span><span id="48" class="l"><a class="l" href="#48"> 48: </a> <span class="php-comment">// Chargement des fichiers config.ini contextuels</span>
</span><span id="49" class="l"><a class="l" href="#49"> 49: </a> <span class="php-keyword1">if</span> (PHP_SAPI == <span class="php-quote">'cli'</span>) {<span class="php-comment">// mode console</span>
</span><span id="50" class="l"><a class="l" href="#50"> 50: </a> <span class="php-keyword1">foreach</span> (<span class="php-var">$_SERVER</span>[<span class="php-quote">'argv'</span>] <span class="php-keyword1">as</span> <span class="php-var">$cle</span> =&gt; <span class="php-var">$valeur</span>) {
</span><span id="51" class="l"><a class="l" href="#51"> 51: </a> <span class="php-keyword1">if</span> (<span class="php-var">$valeur</span> == <span class="php-quote">'-contexte'</span>) {
</span><span id="52" class="l"><a class="l" href="#52"> 52: </a> chargerFichierContexte(<span class="php-var">$_SERVER</span>[<span class="php-quote">'argv'</span>][(<span class="php-var">$cle</span>+<span class="php-num">1</span>)]);
</span><span id="53" class="l"><a class="l" href="#53"> 53: </a> <span class="php-keyword1">break</span>;
</span><span id="54" class="l"><a class="l" href="#54"> 54: </a> }
</span><span id="55" class="l"><a class="l" href="#55"> 55: </a> }
</span><span id="56" class="l"><a class="l" href="#56"> 56: </a> } <span class="php-keyword1">else</span> {<span class="php-comment">// mode web</span>
</span><span id="57" class="l"><a class="l" href="#57"> 57: </a> <span class="php-comment">// Pour Papyrus</span>
</span><span id="58" class="l"><a class="l" href="#58"> 58: </a> <span class="php-keyword1">if</span> (<span class="php-keyword2">defined</span>(<span class="php-quote">'PAP_VERSION'</span>)) {
</span><span id="59" class="l"><a class="l" href="#59"> 59: </a> self::chargerFichierContexte(<span class="php-quote">'papyrus'</span>);
</span><span id="60" class="l"><a class="l" href="#60"> 60: </a> }
</span><span id="61" class="l"><a class="l" href="#61"> 61: </a> <span class="php-comment">// Via le fichie .ini par défaut de l'appli</span>
</span><span id="62" class="l"><a class="l" href="#62"> 62: </a> <span class="php-keyword1">if</span> (Config::existeValeur(<span class="php-quote">'info.contexte'</span>, self::<span class="php-var">$parametres</span>)) {
</span><span id="63" class="l"><a class="l" href="#63"> 63: </a> self::chargerFichierContexte(Config::get(<span class="php-quote">'info.contexte'</span>));
</span><span id="64" class="l"><a class="l" href="#64"> 64: </a> }
</span><span id="65" class="l"><a class="l" href="#65"> 65: </a>
</span><span id="66" class="l"><a class="l" href="#66"> 66: </a> <span class="php-comment">// Chargement du contexte présent dans le GET</span>
</span><span id="67" class="l"><a class="l" href="#67"> 67: </a> <span class="php-keyword1">if</span> (<span class="php-keyword1">isset</span>(<span class="php-var">$_GET</span>[<span class="php-quote">'contexte'</span>])) {
</span><span id="68" class="l"><a class="l" href="#68"> 68: </a> self::chargerFichierContexte(<span class="php-var">$_GET</span>[<span class="php-quote">'contexte'</span>]);
</span><span id="69" class="l"><a class="l" href="#69"> 69: </a> }
</span><span id="70" class="l"><a class="l" href="#70"> 70: </a>
</span><span id="71" class="l"><a class="l" href="#71"> 71: </a> <span class="php-comment">// Chargement du contexte présent dans le POST</span>
</span><span id="72" class="l"><a class="l" href="#72"> 72: </a> <span class="php-keyword1">if</span> (<span class="php-keyword1">isset</span>(<span class="php-var">$_POST</span>[<span class="php-quote">'contexte'</span>])) {
</span><span id="73" class="l"><a class="l" href="#73"> 73: </a> self::chargerFichierContexte(<span class="php-var">$_POST</span>[<span class="php-quote">'contexte'</span>]);
</span><span id="74" class="l"><a class="l" href="#74"> 74: </a> }
</span><span id="75" class="l"><a class="l" href="#75"> 75: </a> }
</span><span id="76" class="l"><a class="l" href="#76"> 76: </a> }
</span><span id="77" class="l"><a class="l" href="#77"> 77: </a>
</span><span id="78" class="l"><a class="l" href="#78"> 78: </a> <span class="php-comment">/**
</span></span><span id="79" class="l"><a class="l" href="#79"> 79: </a><span class="php-comment"> * Charge le fichier de config correspondant au contexte
</span></span><span id="80" class="l"><a class="l" href="#80"> 80: </a><span class="php-comment"> * @param string $contexte le contexte
</span></span><span id="81" class="l"><a class="l" href="#81"> 81: </a><span class="php-comment"> */</span>
</span><span id="82" class="l"><a class="l" href="#82"> 82: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_chargerFichierContexte" href="#_chargerFichierContexte">chargerFichierContexte</a>(<span class="php-var">$contexte</span>) {
</span><span id="83" class="l"><a class="l" href="#83"> 83: </a> <span class="php-var">$chemin_config_appli_contextuel</span> = self::<span class="php-var">$parametres</span>[<span class="php-quote">'chemin_configurations'</span>];
</span><span id="84" class="l"><a class="l" href="#84"> 84: </a> <span class="php-var">$chemin_config_appli_contextuel</span> .= <span class="php-keyword2">sprintf</span>(self::<span class="php-var">$parametres</span>[<span class="php-quote">'fw_fichier_config'</span>], <span class="php-quote">'_'</span>.<span class="php-var">$contexte</span>);
</span><span id="85" class="l"><a class="l" href="#85"> 85: </a> self::parserFichierIni(<span class="php-var">$chemin_config_appli_contextuel</span>);
</span><span id="86" class="l"><a class="l" href="#86"> 86: </a> }
</span><span id="87" class="l"><a class="l" href="#87"> 87: </a>
</span><span id="88" class="l"><a class="l" href="#88"> 88: </a> <span class="php-comment">/**
</span></span><span id="89" class="l"><a class="l" href="#89"> 89: </a><span class="php-comment"> * Parse le fichier ini donné en paramètre
</span></span><span id="90" class="l"><a class="l" href="#90"> 90: </a><span class="php-comment"> * @param string $fichier_ini nom du fichier ini à parser
</span></span><span id="91" class="l"><a class="l" href="#91"> 91: </a><span class="php-comment"> * @return array tableau contenant les paramètres du fichier ini
</span></span><span id="92" class="l"><a class="l" href="#92"> 92: </a><span class="php-comment"> */</span>
</span><span id="93" class="l"><a class="l" href="#93"> 93: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_parserFichierIni" href="#_parserFichierIni">parserFichierIni</a>(<span class="php-var">$fichier_ini</span>) {
</span><span id="94" class="l"><a class="l" href="#94"> 94: </a> <span class="php-var">$retour</span> = <span class="php-keyword1">false</span>;
</span><span id="95" class="l"><a class="l" href="#95"> 95: </a> <span class="php-keyword1">if</span> (<span class="php-keyword2">file_exists</span>(<span class="php-var">$fichier_ini</span>)) {
</span><span id="96" class="l"><a class="l" href="#96"> 96: </a> <span class="php-var">$ini</span> = <span class="php-keyword2">parse_ini_file</span>(<span class="php-var">$fichier_ini</span>, <span class="php-keyword1">true</span>);
</span><span id="97" class="l"><a class="l" href="#97"> 97: </a> <span class="php-var">$ini</span> = self::analyserTableauIni(<span class="php-var">$ini</span>);
</span><span id="98" class="l"><a class="l" href="#98"> 98: </a> self::fusionner(<span class="php-var">$ini</span>);
</span><span id="99" class="l"><a class="l" href="#99"> 99: </a> <span class="php-var">$retour</span> = <span class="php-keyword1">true</span>;
</span><span id="100" class="l"><a class="l" href="#100">100: </a> }
</span><span id="101" class="l"><a class="l" href="#101">101: </a> <span class="php-keyword1">return</span> <span class="php-var">$retour</span>;
</span><span id="102" class="l"><a class="l" href="#102">102: </a> }
</span><span id="103" class="l"><a class="l" href="#103">103: </a>
</span><span id="104" class="l"><a class="l" href="#104">104: </a> <span class="php-comment">/**
</span></span><span id="105" class="l"><a class="l" href="#105">105: </a><span class="php-comment"> * fusionne un tableau de paramètres avec le tableau de paramètres global
</span></span><span id="106" class="l"><a class="l" href="#106">106: </a><span class="php-comment"> * @param array $ini le tableau à fusionner
</span></span><span id="107" class="l"><a class="l" href="#107">107: </a><span class="php-comment"> */</span>
</span><span id="108" class="l"><a class="l" href="#108">108: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_fusionner" href="#_fusionner">fusionner</a>(<span class="php-keyword1">array</span> <span class="php-var">$ini</span>) {
</span><span id="109" class="l"><a class="l" href="#109">109: </a> self::<span class="php-var">$parametres</span> = <span class="php-keyword2">array_merge</span>(self::<span class="php-var">$parametres</span>, <span class="php-var">$ini</span>);
</span><span id="110" class="l"><a class="l" href="#110">110: </a> }
</span><span id="111" class="l"><a class="l" href="#111">111: </a>
</span><span id="112" class="l"><a class="l" href="#112">112: </a> <span class="php-comment">/**
</span></span><span id="113" class="l"><a class="l" href="#113">113: </a><span class="php-comment"> * renvoie la valeur demandé grâce une chaine de paramètres
</span></span><span id="114" class="l"><a class="l" href="#114">114: </a><span class="php-comment"> * @param string $param la chaine de paramètres
</span></span><span id="115" class="l"><a class="l" href="#115">115: </a><span class="php-comment"> * @param array $config le tableau de paramètre
</span></span><span id="116" class="l"><a class="l" href="#116">116: </a><span class="php-comment"> * @return string la valeur de la chaine demandée
</span></span><span id="117" class="l"><a class="l" href="#117">117: </a><span class="php-comment"> */</span>
</span><span id="118" class="l"><a class="l" href="#118">118: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_getValeur" href="#_getValeur">getValeur</a>(<span class="php-var">$param</span>, <span class="php-var">$config</span>) {
</span><span id="119" class="l"><a class="l" href="#119">119: </a> <span class="php-keyword1">if</span> (<span class="php-var">$param</span> === <span class="php-keyword1">null</span>) {
</span><span id="120" class="l"><a class="l" href="#120">120: </a> <span class="php-keyword1">return</span> <span class="php-keyword1">null</span>;
</span><span id="121" class="l"><a class="l" href="#121">121: </a> } <span class="php-keyword1">else</span> {
</span><span id="122" class="l"><a class="l" href="#122">122: </a> <span class="php-keyword1">if</span> (<span class="php-keyword1">isset</span>(<span class="php-var">$config</span>[<span class="php-var">$param</span>])) {
</span><span id="123" class="l"><a class="l" href="#123">123: </a> <span class="php-keyword1">return</span> <span class="php-var">$config</span>[<span class="php-var">$param</span>];
</span><span id="124" class="l"><a class="l" href="#124">124: </a> } <span class="php-keyword1">else</span> <span class="php-keyword1">if</span> (<span class="php-keyword2">strpos</span>(<span class="php-var">$param</span>, <span class="php-quote">'.'</span>) !== <span class="php-keyword1">false</span>) {
</span><span id="125" class="l"><a class="l" href="#125">125: </a> <span class="php-var">$pieces</span> = <span class="php-keyword2">explode</span>(<span class="php-quote">'.'</span>, <span class="php-var">$param</span>, <span class="php-num">2</span>);
</span><span id="126" class="l"><a class="l" href="#126">126: </a> <span class="php-keyword1">if</span> (<span class="php-keyword2">strlen</span>(<span class="php-var">$pieces</span>[<span class="php-num">0</span>]) &amp;&amp; <span class="php-keyword2">strlen</span>(<span class="php-var">$pieces</span>[<span class="php-num">1</span>])) {
</span><span id="127" class="l"><a class="l" href="#127">127: </a> <span class="php-keyword1">if</span> (<span class="php-keyword1">isset</span>(<span class="php-var">$config</span>[<span class="php-var">$pieces</span>[<span class="php-num">0</span>]])) {
</span><span id="128" class="l"><a class="l" href="#128">128: </a> <span class="php-keyword1">if</span> (<span class="php-keyword2">is_array</span>(<span class="php-var">$config</span>[<span class="php-var">$pieces</span>[<span class="php-num">0</span>]])) {
</span><span id="129" class="l"><a class="l" href="#129">129: </a> <span class="php-keyword1">return</span> self::getValeur(<span class="php-var">$pieces</span>[<span class="php-num">1</span>], <span class="php-var">$config</span>[<span class="php-var">$pieces</span>[<span class="php-num">0</span>]]);
</span><span id="130" class="l"><a class="l" href="#130">130: </a> }
</span><span id="131" class="l"><a class="l" href="#131">131: </a> }
</span><span id="132" class="l"><a class="l" href="#132">132: </a> }
</span><span id="133" class="l"><a class="l" href="#133">133: </a> } <span class="php-keyword1">else</span> {
</span><span id="134" class="l"><a class="l" href="#134">134: </a> <span class="php-keyword1">return</span> <span class="php-keyword1">null</span>;
</span><span id="135" class="l"><a class="l" href="#135">135: </a> }
</span><span id="136" class="l"><a class="l" href="#136">136: </a> }
</span><span id="137" class="l"><a class="l" href="#137">137: </a> }
</span><span id="138" class="l"><a class="l" href="#138">138: </a>
</span><span id="139" class="l"><a class="l" href="#139">139: </a> <span class="php-comment">/**
</span></span><span id="140" class="l"><a class="l" href="#140">140: </a><span class="php-comment"> * Teste si param existe dans le tableau config
</span></span><span id="141" class="l"><a class="l" href="#141">141: </a><span class="php-comment"> * @param string $param nom du paramètre
</span></span><span id="142" class="l"><a class="l" href="#142">142: </a><span class="php-comment"> * @param array tableau de configuration
</span></span><span id="143" class="l"><a class="l" href="#143">143: </a><span class="php-comment"> */</span>
</span><span id="144" class="l"><a class="l" href="#144">144: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_existeValeur" href="#_existeValeur">existeValeur</a>(<span class="php-var">$param</span>, <span class="php-var">$config</span>) {
</span><span id="145" class="l"><a class="l" href="#145">145: </a> <span class="php-var">$retour</span> = <span class="php-keyword1">false</span>;
</span><span id="146" class="l"><a class="l" href="#146">146: </a> <span class="php-keyword1">if</span> (self::getValeur(<span class="php-var">$param</span>, <span class="php-var">$config</span>) !== <span class="php-keyword1">null</span>) {
</span><span id="147" class="l"><a class="l" href="#147">147: </a> <span class="php-var">$retour</span> = <span class="php-keyword1">true</span>;
</span><span id="148" class="l"><a class="l" href="#148">148: </a> }
</span><span id="149" class="l"><a class="l" href="#149">149: </a> <span class="php-keyword1">return</span> <span class="php-var">$retour</span>;
</span><span id="150" class="l"><a class="l" href="#150">150: </a> }
</span><span id="151" class="l"><a class="l" href="#151">151: </a>
</span><span id="152" class="l"><a class="l" href="#152">152: </a> <span class="php-comment">/**
</span></span><span id="153" class="l"><a class="l" href="#153">153: </a><span class="php-comment"> * Vérifie si l'instance de classe à été crée, si non la crée
</span></span><span id="154" class="l"><a class="l" href="#154">154: </a><span class="php-comment"> */</span>
</span><span id="155" class="l"><a class="l" href="#155">155: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_verifierCreationInstance" href="#_verifierCreationInstance">verifierCreationInstance</a>() {
</span><span id="156" class="l"><a class="l" href="#156">156: </a> <span class="php-keyword1">if</span> (<span class="php-keyword1">empty</span>(self::<span class="php-var">$instance</span>)) {
</span><span id="157" class="l"><a class="l" href="#157">157: </a> self::<span class="php-var">$instance</span> = <span class="php-keyword1">new</span> Config();
</span><span id="158" class="l"><a class="l" href="#158">158: </a> }
</span><span id="159" class="l"><a class="l" href="#159">159: </a> }
</span><span id="160" class="l"><a class="l" href="#160">160: </a>
</span><span id="161" class="l"><a class="l" href="#161">161: </a> <span class="php-comment">/**
</span></span><span id="162" class="l"><a class="l" href="#162">162: </a><span class="php-comment"> * analyse un tableau de paramètres
</span></span><span id="163" class="l"><a class="l" href="#163">163: </a><span class="php-comment"> * @param array $config le tableau de paramètres
</span></span><span id="164" class="l"><a class="l" href="#164">164: </a><span class="php-comment"> * @return array le tableau analysé
</span></span><span id="165" class="l"><a class="l" href="#165">165: </a><span class="php-comment"> */</span>
</span><span id="166" class="l"><a class="l" href="#166">166: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_analyserTableauIni" href="#_analyserTableauIni">analyserTableauIni</a>(<span class="php-var">$config</span> = <span class="php-keyword1">array</span>()) {
</span><span id="167" class="l"><a class="l" href="#167">167: </a> <span class="php-keyword1">foreach</span> (<span class="php-var">$config</span> <span class="php-keyword1">as</span> <span class="php-var">$cle</span> =&gt; &amp;<span class="php-var">$valeur</span>) {
</span><span id="168" class="l"><a class="l" href="#168">168: </a> <span class="php-keyword1">if</span> (<span class="php-keyword2">is_array</span>(<span class="php-var">$valeur</span>)) {
</span><span id="169" class="l"><a class="l" href="#169">169: </a> <span class="php-var">$config</span>[<span class="php-var">$cle</span>] = self::analyserTableauIni(<span class="php-var">$valeur</span>);
</span><span id="170" class="l"><a class="l" href="#170">170: </a> } <span class="php-keyword1">else</span> {
</span><span id="171" class="l"><a class="l" href="#171">171: </a> self::evaluerReferences(<span class="php-var">$config</span>, <span class="php-var">$cle</span>);
</span><span id="172" class="l"><a class="l" href="#172">172: </a> self::evaluerPhp(<span class="php-var">$config</span>, <span class="php-var">$cle</span>);
</span><span id="173" class="l"><a class="l" href="#173">173: </a> self::evaluerCle(<span class="php-var">$config</span>, <span class="php-var">$cle</span>, <span class="php-var">$config</span>[<span class="php-var">$cle</span>]);
</span><span id="174" class="l"><a class="l" href="#174">174: </a> }
</span><span id="175" class="l"><a class="l" href="#175">175: </a> }
</span><span id="176" class="l"><a class="l" href="#176">176: </a> <span class="php-keyword1">return</span> <span class="php-var">$config</span>;
</span><span id="177" class="l"><a class="l" href="#177">177: </a> }
</span><span id="178" class="l"><a class="l" href="#178">178: </a>
</span><span id="179" class="l"><a class="l" href="#179">179: </a> <span class="php-comment">/**
</span></span><span id="180" class="l"><a class="l" href="#180">180: </a><span class="php-comment"> * dans le cas des chaine de configuration à sous clé (ex.: cle.souscle)
</span></span><span id="181" class="l"><a class="l" href="#181">181: </a><span class="php-comment"> * evalue les valeurs correspondantes et crée les sous tableaux associés
</span></span><span id="182" class="l"><a class="l" href="#182">182: </a><span class="php-comment"> * @param array $config tableau de configuration (par référence)
</span></span><span id="183" class="l"><a class="l" href="#183">183: </a><span class="php-comment"> * @param string $cle la cle dans le tableau
</span></span><span id="184" class="l"><a class="l" href="#184">184: </a><span class="php-comment"> * @param string $valeur la valeur à affecter
</span></span><span id="185" class="l"><a class="l" href="#185">185: </a><span class="php-comment"> */</span>
</span><span id="186" class="l"><a class="l" href="#186">186: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_evaluerCle" href="#_evaluerCle">evaluerCle</a>(&amp;<span class="php-var">$config</span>, <span class="php-var">$cle</span>, <span class="php-var">$valeur</span>) {
</span><span id="187" class="l"><a class="l" href="#187">187: </a> <span class="php-keyword1">if</span> (<span class="php-keyword2">strpos</span>(<span class="php-var">$cle</span>, <span class="php-quote">'.'</span>) !== <span class="php-keyword1">false</span>) {
</span><span id="188" class="l"><a class="l" href="#188">188: </a> <span class="php-keyword1">unset</span>(<span class="php-var">$config</span>[<span class="php-var">$cle</span>]);
</span><span id="189" class="l"><a class="l" href="#189">189: </a> <span class="php-var">$pieces</span> = <span class="php-keyword2">explode</span>(<span class="php-quote">'.'</span>, <span class="php-var">$cle</span>, <span class="php-num">2</span>);
</span><span id="190" class="l"><a class="l" href="#190">190: </a> <span class="php-keyword1">if</span> (<span class="php-keyword2">strlen</span>(<span class="php-var">$pieces</span>[<span class="php-num">0</span>]) &amp;&amp; <span class="php-keyword2">strlen</span>(<span class="php-var">$pieces</span>[<span class="php-num">1</span>])) {
</span><span id="191" class="l"><a class="l" href="#191">191: </a> <span class="php-keyword1">if</span> (<span class="php-keyword1">isset</span>(<span class="php-var">$config</span>[<span class="php-var">$pieces</span>[<span class="php-num">0</span>]]) &amp;&amp; !<span class="php-keyword2">is_array</span>(<span class="php-var">$config</span>[<span class="php-var">$pieces</span>[<span class="php-num">0</span>]])) {
</span><span id="192" class="l"><a class="l" href="#192">192: </a> <span class="php-var">$m</span> = <span class="php-quote">&quot;Ne peut pas créer de sous-clé pour '</span><span class="php-var">{$pieces[0]}</span><span class="php-quote">' car la clé existe déjà&quot;</span>;
</span><span id="193" class="l"><a class="l" href="#193">193: </a> <span class="php-keyword2">trigger_error</span>(<span class="php-var">$m</span>, E_USER_WARNING);
</span><span id="194" class="l"><a class="l" href="#194">194: </a> } <span class="php-keyword1">else</span> {
</span><span id="195" class="l"><a class="l" href="#195">195: </a> <span class="php-var">$config</span>[<span class="php-var">$pieces</span>[<span class="php-num">0</span>]][<span class="php-var">$pieces</span>[<span class="php-num">1</span>]] = <span class="php-var">$valeur</span>;
</span><span id="196" class="l"><a class="l" href="#196">196: </a> <span class="php-var">$config</span>[<span class="php-var">$pieces</span>[<span class="php-num">0</span>]] = self::evaluerCle(<span class="php-var">$config</span>[<span class="php-var">$pieces</span>[<span class="php-num">0</span>]], <span class="php-var">$pieces</span>[<span class="php-num">1</span>], <span class="php-var">$valeur</span>);
</span><span id="197" class="l"><a class="l" href="#197">197: </a> }
</span><span id="198" class="l"><a class="l" href="#198">198: </a> } <span class="php-keyword1">else</span> {
</span><span id="199" class="l"><a class="l" href="#199">199: </a> <span class="php-var">$m</span> = <span class="php-quote">&quot;Clé invalide '</span><span class="php-var">$cle</span><span class="php-quote">'&quot;</span>;
</span><span id="200" class="l"><a class="l" href="#200">200: </a> <span class="php-keyword2">trigger_error</span>(<span class="php-var">$m</span>, E_USER_WARNING);
</span><span id="201" class="l"><a class="l" href="#201">201: </a> }
</span><span id="202" class="l"><a class="l" href="#202">202: </a> } <span class="php-keyword1">else</span> {
</span><span id="203" class="l"><a class="l" href="#203">203: </a> <span class="php-var">$config</span>[<span class="php-var">$cle</span>] = <span class="php-var">$valeur</span>;
</span><span id="204" class="l"><a class="l" href="#204">204: </a> }
</span><span id="205" class="l"><a class="l" href="#205">205: </a> <span class="php-keyword1">return</span> <span class="php-var">$config</span>;
</span><span id="206" class="l"><a class="l" href="#206">206: </a> }
</span><span id="207" class="l"><a class="l" href="#207">207: </a>
</span><span id="208" class="l"><a class="l" href="#208">208: </a> <span class="php-comment">/**
</span></span><span id="209" class="l"><a class="l" href="#209">209: </a><span class="php-comment"> * Evalue les valeurs de références à une clé dans le tableau config (cas du ref:cle)
</span></span><span id="210" class="l"><a class="l" href="#210">210: </a><span class="php-comment"> * @param array $config tableau de configuration
</span></span><span id="211" class="l"><a class="l" href="#211">211: </a><span class="php-comment"> * @param string $cle la clé dont il faut évaluer les références
</span></span><span id="212" class="l"><a class="l" href="#212">212: </a><span class="php-comment"> */</span>
</span><span id="213" class="l"><a class="l" href="#213">213: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_evaluerReferences" href="#_evaluerReferences">evaluerReferences</a>(&amp;<span class="php-var">$config</span>, <span class="php-var">$cle</span>) {
</span><span id="214" class="l"><a class="l" href="#214">214: </a> <span class="php-keyword1">if</span> (<span class="php-keyword2">preg_match_all</span>(<span class="php-quote">'/{ref:([A-Za-z0-9_.-]+)}/'</span>, <span class="php-var">$config</span>[<span class="php-var">$cle</span>], <span class="php-var">$correspondances</span>, PREG_SET_ORDER)) {
</span><span id="215" class="l"><a class="l" href="#215">215: </a> <span class="php-keyword1">foreach</span> (<span class="php-var">$correspondances</span> <span class="php-keyword1">as</span> <span class="php-var">$ref</span>) {
</span><span id="216" class="l"><a class="l" href="#216">216: </a> <span class="php-var">$config</span>[<span class="php-var">$cle</span>] = <span class="php-keyword2">str_replace</span>(<span class="php-var">$ref</span>[<span class="php-num">0</span>], self::getValeur(<span class="php-var">$ref</span>[<span class="php-num">1</span>], <span class="php-var">$config</span>), <span class="php-var">$config</span>[<span class="php-var">$cle</span>]);
</span><span id="217" class="l"><a class="l" href="#217">217: </a> }
</span><span id="218" class="l"><a class="l" href="#218">218: </a> }
</span><span id="219" class="l"><a class="l" href="#219">219: </a> }
</span><span id="220" class="l"><a class="l" href="#220">220: </a>
</span><span id="221" class="l"><a class="l" href="#221">221: </a> <span class="php-comment">/**
</span></span><span id="222" class="l"><a class="l" href="#222">222: </a><span class="php-comment"> * Evalue le code php contenu dans un clé tu tableau config
</span></span><span id="223" class="l"><a class="l" href="#223">223: </a><span class="php-comment"> * @param array $config tableau de configuration (par référence)
</span></span><span id="224" class="l"><a class="l" href="#224">224: </a><span class="php-comment"> * @param string $cle le clé du tableau dont il faut évaluer la valeur
</span></span><span id="225" class="l"><a class="l" href="#225">225: </a><span class="php-comment"> */</span>
</span><span id="226" class="l"><a class="l" href="#226">226: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_evaluerPhp" href="#_evaluerPhp">evaluerPhp</a>(&amp;<span class="php-var">$config</span>, <span class="php-var">$cle</span>) {
</span><span id="227" class="l"><a class="l" href="#227">227: </a> <span class="php-keyword1">if</span> (<span class="php-keyword2">preg_match</span>(<span class="php-quote">'/^php:(.+)$/'</span>, <span class="php-var">$config</span>[<span class="php-var">$cle</span>], <span class="php-var">$correspondances</span>)) {
</span><span id="228" class="l"><a class="l" href="#228">228: </a> <span class="php-keyword2">eval</span>(<span class="php-quote">'$config[&quot;'</span>.<span class="php-var">$cle</span>.<span class="php-quote">'&quot;] = '</span>.<span class="php-var">$correspondances</span>[<span class="php-num">1</span>].<span class="php-quote">';'</span>);
</span><span id="229" class="l"><a class="l" href="#229">229: </a> }
</span><span id="230" class="l"><a class="l" href="#230">230: </a> }
</span><span id="231" class="l"><a class="l" href="#231">231: </a>
</span><span id="232" class="l"><a class="l" href="#232">232: </a> <span class="php-comment">/**
</span></span><span id="233" class="l"><a class="l" href="#233">233: </a><span class="php-comment"> * Charge un fichier ini dans le tableau des paramètres de l'appli
</span></span><span id="234" class="l"><a class="l" href="#234">234: </a><span class="php-comment"> * @param string $fichier_ini le nom du fichier à charger
</span></span><span id="235" class="l"><a class="l" href="#235">235: </a><span class="php-comment"> * @return array le fichier ini parsé
</span></span><span id="236" class="l"><a class="l" href="#236">236: </a><span class="php-comment"> */</span>
</span><span id="237" class="l"><a class="l" href="#237">237: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_charger" href="#_charger">charger</a>(<span class="php-var">$fichier_ini</span>) {
</span><span id="238" class="l"><a class="l" href="#238">238: </a> self::verifierCreationInstance();
</span><span id="239" class="l"><a class="l" href="#239">239: </a> <span class="php-keyword1">return</span> self::parserFichierIni(<span class="php-var">$fichier_ini</span>);
</span><span id="240" class="l"><a class="l" href="#240">240: </a> }
</span><span id="241" class="l"><a class="l" href="#241">241: </a>
</span><span id="242" class="l"><a class="l" href="#242">242: </a> <span class="php-comment">/**
</span></span><span id="243" class="l"><a class="l" href="#243">243: </a><span class="php-comment"> * Acesseur pour la valeur d'un paramètre
</span></span><span id="244" class="l"><a class="l" href="#244">244: </a><span class="php-comment"> * @param string $param le nom du paramètre
</span></span><span id="245" class="l"><a class="l" href="#245">245: </a><span class="php-comment"> * @return string la valeur du paramètre
</span></span><span id="246" class="l"><a class="l" href="#246">246: </a><span class="php-comment"> */</span>
</span><span id="247" class="l"><a class="l" href="#247">247: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_get" href="#_get">get</a>(<span class="php-var">$param</span> = <span class="php-keyword1">null</span>) {
</span><span id="248" class="l"><a class="l" href="#248">248: </a> self::verifierCreationInstance();
</span><span id="249" class="l"><a class="l" href="#249">249: </a> <span class="php-keyword1">return</span> self::getValeur(<span class="php-var">$param</span>, self::<span class="php-var">$parametres</span>);
</span><span id="250" class="l"><a class="l" href="#250">250: </a> }
</span><span id="251" class="l"><a class="l" href="#251">251: </a>
</span><span id="252" class="l"><a class="l" href="#252">252: </a> <span class="php-comment">/**
</span></span><span id="253" class="l"><a class="l" href="#253">253: </a><span class="php-comment"> * Vérifie si la valeur d'un paramètre existe
</span></span><span id="254" class="l"><a class="l" href="#254">254: </a><span class="php-comment"> * @param string $param le nom du paramètre
</span></span><span id="255" class="l"><a class="l" href="#255">255: </a><span class="php-comment"> * @return boolean vrai si le paramètre existe, false sinon
</span></span><span id="256" class="l"><a class="l" href="#256">256: </a><span class="php-comment"> */</span>
</span><span id="257" class="l"><a class="l" href="#257">257: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_existe" href="#_existe">existe</a>(<span class="php-var">$param</span>) {
</span><span id="258" class="l"><a class="l" href="#258">258: </a> self::verifierCreationInstance();
</span><span id="259" class="l"><a class="l" href="#259">259: </a> <span class="php-keyword1">return</span> self::existeValeur(<span class="php-var">$param</span>, self::<span class="php-var">$parametres</span>);
</span><span id="260" class="l"><a class="l" href="#260">260: </a> }
</span><span id="261" class="l"><a class="l" href="#261">261: </a>}
</span><span id="262" class="l"><a class="l" href="#262">262: </a></span><span class="xlang">?&gt;</span></code></pre>
 
<div id="footer">
TBFramework - v0.2 API documentation generated by <a href="http://apigen.org">ApiGen 2.8.0</a>
/branches/v0.2-buhl/doc/ApiGen/404.html
8,7 → 8,7
<title>Page not found | TBFramework - v0.2</title>
 
<script type="text/javascript" src="resources/combined.js?4205936287"></script>
<script type="text/javascript" src="elementlist.js?117657638"></script>
<script type="text/javascript" src="elementlist.js?1835392179"></script>
<link rel="stylesheet" type="text/css" media="all" href="resources/style.css?3505392360">
 
</head>
41,6 → 41,7
<li><a href="class-Controleur.html">Controleur</a></li>
<li><a href="class-Debug.html">Debug</a></li>
<li><a href="class-GestionnaireException.html">GestionnaireException</a></li>
<li><a href="class-I18n.html">I18n</a></li>
<li><a href="class-Log.html">Log</a></li>
<li><a href="class-Modele.html">Modele</a></li>
<li><a href="class-PDOStatement.html">PDOStatement</a></li>
/branches/v0.2-buhl/doc/ApiGen/source-class-GestionnaireException.html
8,7 → 8,7
<title>File GestionnaireException.php | TBFramework - v0.2</title>
 
<script type="text/javascript" src="resources/combined.js?4205936287"></script>
<script type="text/javascript" src="elementlist.js?117657638"></script>
<script type="text/javascript" src="elementlist.js?1835392179"></script>
<link rel="stylesheet" type="text/css" media="all" href="resources/style.css?3505392360">
 
</head>
41,6 → 41,7
<li><a href="class-Controleur.html">Controleur</a></li>
<li><a href="class-Debug.html">Debug</a></li>
<li class="active"><a href="class-GestionnaireException.html">GestionnaireException</a></li>
<li><a href="class-I18n.html">I18n</a></li>
<li><a href="class-Log.html">Log</a></li>
<li><a href="class-Modele.html">Modele</a></li>
<li><a href="class-Registre.html">Registre</a></li>
106,227 → 107,156
</span></span><span id="5" class="l"><a class="l" href="#5"> 5: </a><span class="php-comment"> * C'est un Singleton.
</span></span><span id="6" class="l"><a class="l" href="#6"> 6: </a><span class="php-comment"> *
</span></span><span id="7" class="l"><a class="l" href="#7"> 7: </a><span class="php-comment"> * @category PHP 5.2
</span></span><span id="8" class="l"><a class="l" href="#8"> 8: </a><span class="php-comment"> * @package Framework
</span></span><span id="8" class="l"><a class="l" href="#8"> 8: </a><span class="php-comment"> * @package Framework
</span></span><span id="9" class="l"><a class="l" href="#9"> 9: </a><span class="php-comment"> * @author Aurélien PERONNET &lt;aurelien@tela-botanica.org&gt;
</span></span><span id="10" class="l"><a class="l" href="#10"> 10: </a><span class="php-comment"> * @author Jean-Pascal MILCENT &lt;jmp@tela-botanica.org&gt;
</span></span><span id="11" class="l"><a class="l" href="#11"> 11: </a><span class="php-comment"> * @copyright Copyright (c) 2009, Tela Botanica (accueil@tela-botanica.org)
</span></span><span id="12" class="l"><a class="l" href="#12"> 12: </a><span class="php-comment"> * @license http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
</span></span><span id="13" class="l"><a class="l" href="#13"> 13: </a><span class="php-comment"> * @license http://www.gnu.org/licenses/gpl.html Licence GNU-GPL
</span></span><span id="14" class="l"><a class="l" href="#14"> 14: </a><span class="php-comment"> * @version $Id: GestionnaireException.php 342 2011-06-06 13:58:53Z jpm $$
</span></span><span id="15" class="l"><a class="l" href="#15"> 15: </a><span class="php-comment"> * @link /doc/framework/
</span></span><span id="16" class="l"><a class="l" href="#16"> 16: </a><span class="php-comment"> *
</span></span><span id="17" class="l"><a class="l" href="#17"> 17: </a><span class="php-comment"> */</span>
</span><span id="18" class="l"><a class="l" href="#18"> 18: </a><span class="php-keyword1">class</span> <a id="GestionnaireException" href="#GestionnaireException">GestionnaireException</a> {
</span><span id="19" class="l"><a class="l" href="#19"> 19: </a>
</span><span id="20" class="l"><a class="l" href="#20"> 20: </a> <span class="php-keyword1">const</span> <a id="MODE_CLI" href="#MODE_CLI">MODE_CLI</a> = <span class="php-quote">'cli'</span>;
</span><span id="21" class="l"><a class="l" href="#21"> 21: </a>
</span><span id="22" class="l"><a class="l" href="#22"> 22: </a> <span class="php-comment">/** Liste des exceptions enregistrées */</span>
</span><span id="23" class="l"><a class="l" href="#23"> 23: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-var"><a id="$exceptions" href="#$exceptions">$exceptions</a></span> = <span class="php-keyword1">array</span>();
</span></span><span id="12" class="l"><a class="l" href="#12"> 12: </a><span class="php-comment"> * @license GNU-GPL-v3 &lt;http://www.gnu.org/licenses/gpl.html&gt;
</span></span><span id="13" class="l"><a class="l" href="#13"> 13: </a><span class="php-comment"> * @license CECILL-v2 &lt;http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt&gt;
</span></span><span id="14" class="l"><a class="l" href="#14"> 14: </a><span class="php-comment"> */</span>
</span><span id="15" class="l"><a class="l" href="#15"> 15: </a><span class="php-keyword1">class</span> <a id="GestionnaireException" href="#GestionnaireException">GestionnaireException</a> {
</span><span id="16" class="l"><a class="l" href="#16"> 16: </a>
</span><span id="17" class="l"><a class="l" href="#17"> 17: </a> <span class="php-keyword1">const</span> <a id="MODE_CLI" href="#MODE_CLI">MODE_CLI</a> = <span class="php-quote">'cli'</span>;
</span><span id="18" class="l"><a class="l" href="#18"> 18: </a>
</span><span id="19" class="l"><a class="l" href="#19"> 19: </a> <span class="php-comment">/** Liste des exceptions enregistrées */</span>
</span><span id="20" class="l"><a class="l" href="#20"> 20: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-var"><a id="$exceptions" href="#$exceptions">$exceptions</a></span> = <span class="php-keyword1">array</span>();
</span><span id="21" class="l"><a class="l" href="#21"> 21: </a>
</span><span id="22" class="l"><a class="l" href="#22"> 22: </a> <span class="php-comment">/** Détermine si l'on affiche ou non le contexte */</span>
</span><span id="23" class="l"><a class="l" href="#23"> 23: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-var"><a id="$contexte" href="#$contexte">$contexte</a></span> = <span class="php-keyword1">false</span>;
</span><span id="24" class="l"><a class="l" href="#24"> 24: </a>
</span><span id="25" class="l"><a class="l" href="#25"> 25: </a> <span class="php-comment">/** Détermine si l'on affiche ou non le contexte */</span>
</span><span id="26" class="l"><a class="l" href="#26"> 26: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-var"><a id="$contexte" href="#$contexte">$contexte</a></span> = <span class="php-keyword1">false</span>;
</span><span id="25" class="l"><a class="l" href="#25"> 25: </a> <span class="php-comment">/** Détermine si l'on loggue ou non les erreurs */</span>
</span><span id="26" class="l"><a class="l" href="#26"> 26: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-var"><a id="$logger" href="#$logger">$logger</a></span> = <span class="php-keyword1">false</span>;
</span><span id="27" class="l"><a class="l" href="#27"> 27: </a>
</span><span id="28" class="l"><a class="l" href="#28"> 28: </a> <span class="php-comment">/** Détermine si l'on loggue ou non les erreurs */</span>
</span><span id="29" class="l"><a class="l" href="#29"> 29: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-var"><a id="$logger" href="#$logger">$logger</a></span> = <span class="php-keyword1">false</span>;
</span><span id="28" class="l"><a class="l" href="#28"> 28: </a> <span class="php-comment">/** Détermine si l'affichage des erreurs est forcé (true) ou pas (false) à la destruction de la classe */</span>
</span><span id="29" class="l"><a class="l" href="#29"> 29: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-var"><a id="$afficher" href="#$afficher">$afficher</a></span> = <span class="php-keyword1">false</span>;
</span><span id="30" class="l"><a class="l" href="#30"> 30: </a>
</span><span id="31" class="l"><a class="l" href="#31"> 31: </a> <span class="php-comment">/** Détermine si l'affichage des erreurs est forcé (true) ou pas (false) à la destruction de la classe */</span>
</span><span id="32" class="l"><a class="l" href="#32"> 32: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-var"><a id="$afficher" href="#$afficher">$afficher</a></span> = <span class="php-keyword1">false</span>;
</span><span id="31" class="l"><a class="l" href="#31"> 31: </a> <span class="php-comment">/** Definit si php est lancé en ligne de commande ou en mode serveur */</span>
</span><span id="32" class="l"><a class="l" href="#32"> 32: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-var"><a id="$mode" href="#$mode">$mode</a></span> = <span class="php-keyword1">null</span> ;
</span><span id="33" class="l"><a class="l" href="#33"> 33: </a>
</span><span id="34" class="l"><a class="l" href="#34"> 34: </a> <span class="php-comment">/** Definit si php est lancé en ligne de commande ou en mode serveur */</span>
</span><span id="35" class="l"><a class="l" href="#35"> 35: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-var"><a id="$mode" href="#$mode">$mode</a></span> = <span class="php-keyword1">null</span> ;
</span><span id="36" class="l"><a class="l" href="#36"> 36: </a>
</span><span id="37" class="l"><a class="l" href="#37"> 37: </a> <span class="php-comment">/** Initialise le Gestionnaire d'exceptions et d'erreur sans tenir comptes des paramêtres de config. */</span>
</span><span id="38" class="l"><a class="l" href="#38"> 38: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_initialiser" href="#_initialiser">initialiser</a>() {
</span><span id="39" class="l"><a class="l" href="#39"> 39: </a> self::<span class="php-var">$mode</span> = <span class="php-keyword2">php_sapi_name</span>();
</span><span id="40" class="l"><a class="l" href="#40"> 40: </a> <span class="php-comment">// Désactivation des balises HTML dans les messages d'erreur de PHP en mode ligne de commande</span>
</span><span id="41" class="l"><a class="l" href="#41"> 41: </a> <span class="php-keyword1">if</span> (self::<span class="php-var">$mode</span> == self::MODE_CLI) {
</span><span id="42" class="l"><a class="l" href="#42"> 42: </a> <span class="php-keyword2">ini_set</span>(<span class="php-quote">'html_errors'</span>, <span class="php-num">0</span>);
</span><span id="43" class="l"><a class="l" href="#43"> 43: </a> }
</span><span id="44" class="l"><a class="l" href="#44"> 44: </a>
</span><span id="45" class="l"><a class="l" href="#45"> 45: </a> <span class="php-keyword2">set_exception_handler</span>(<span class="php-keyword1">array</span>(<span class="php-keyword2">get_class</span>(),<span class="php-quote">'gererException'</span>));
</span><span id="46" class="l"><a class="l" href="#46"> 46: </a> <span class="php-keyword2">set_error_handler</span>(<span class="php-keyword1">array</span>(<span class="php-keyword2">get_class</span>(),<span class="php-quote">'gererErreur'</span>));
</span><span id="47" class="l"><a class="l" href="#47"> 47: </a> }
</span><span id="48" class="l"><a class="l" href="#48"> 48: </a>
</span><span id="49" class="l"><a class="l" href="#49"> 49: </a> <span class="php-comment">/** Configure le Gestionnaire d'exceptions et d'erreur à partir des paramêtres de config. */</span>
</span><span id="50" class="l"><a class="l" href="#50"> 50: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_configurer" href="#_configurer">configurer</a>() {
</span><span id="51" class="l"><a class="l" href="#51"> 51: </a> self::<span class="php-var">$contexte</span> = Config::get(<span class="php-quote">'fw_debogage_contexte'</span>);
</span><span id="52" class="l"><a class="l" href="#52"> 52: </a> self::<span class="php-var">$logger</span> = Config::get(<span class="php-quote">'fw_log_debogage'</span>);
</span><span id="53" class="l"><a class="l" href="#53"> 53: </a> self::<span class="php-var">$afficher</span> = Config::get(<span class="php-quote">'fw_debogage'</span>);
</span><span id="54" class="l"><a class="l" href="#54"> 54: </a> }
</span><span id="55" class="l"><a class="l" href="#55"> 55: </a>
</span><span id="56" class="l"><a class="l" href="#56"> 56: </a> <span class="php-comment">/**
</span></span><span id="57" class="l"><a class="l" href="#57"> 57: </a><span class="php-comment"> * Renvoie le nombre d'exceptions et d'erreurs levées.
</span></span><span id="58" class="l"><a class="l" href="#58"> 58: </a><span class="php-comment"> * @see getExceptions() pour obtenir les exceptions formatées.
</span></span><span id="59" class="l"><a class="l" href="#59"> 59: </a><span class="php-comment"> * @since 0.3
</span></span><span id="60" class="l"><a class="l" href="#60"> 60: </a><span class="php-comment"> * @return int le nombre d'exception actuellement levées
</span><span id="34" class="l"><a class="l" href="#34"> 34: </a> <span class="php-comment">/** Initialise le Gestionnaire d'exceptions et d'erreur sans tenir comptes des paramêtres de config. */</span>
</span><span id="35" class="l"><a class="l" href="#35"> 35: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_initialiser" href="#_initialiser">initialiser</a>() {
</span><span id="36" class="l"><a class="l" href="#36"> 36: </a> self::<span class="php-var">$mode</span> = <span class="php-keyword2">php_sapi_name</span>();
</span><span id="37" class="l"><a class="l" href="#37"> 37: </a> <span class="php-comment">// Désactivation des balises HTML dans les messages d'erreur de PHP en mode ligne de commande</span>
</span><span id="38" class="l"><a class="l" href="#38"> 38: </a> <span class="php-keyword1">if</span> (self::<span class="php-var">$mode</span> == self::MODE_CLI) {
</span><span id="39" class="l"><a class="l" href="#39"> 39: </a> <span class="php-keyword2">ini_set</span>(<span class="php-quote">'html_errors'</span>, <span class="php-num">0</span>);
</span><span id="40" class="l"><a class="l" href="#40"> 40: </a> }
</span><span id="41" class="l"><a class="l" href="#41"> 41: </a>
</span><span id="42" class="l"><a class="l" href="#42"> 42: </a> <span class="php-keyword2">set_exception_handler</span>(<span class="php-keyword1">array</span>(<span class="php-keyword2">get_class</span>(),<span class="php-quote">'gererException'</span>));
</span><span id="43" class="l"><a class="l" href="#43"> 43: </a> <span class="php-keyword2">set_error_handler</span>(<span class="php-keyword1">array</span>(<span class="php-keyword2">get_class</span>(),<span class="php-quote">'gererErreur'</span>));
</span><span id="44" class="l"><a class="l" href="#44"> 44: </a> }
</span><span id="45" class="l"><a class="l" href="#45"> 45: </a>
</span><span id="46" class="l"><a class="l" href="#46"> 46: </a> <span class="php-comment">/** Configure le Gestionnaire d'exceptions et d'erreur à partir des paramêtres de config. */</span>
</span><span id="47" class="l"><a class="l" href="#47"> 47: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_configurer" href="#_configurer">configurer</a>() {
</span><span id="48" class="l"><a class="l" href="#48"> 48: </a> self::<span class="php-var">$contexte</span> = Config::get(<span class="php-quote">'fw_debogage_contexte'</span>);
</span><span id="49" class="l"><a class="l" href="#49"> 49: </a> self::<span class="php-var">$logger</span> = Config::get(<span class="php-quote">'fw_log_debogage'</span>);
</span><span id="50" class="l"><a class="l" href="#50"> 50: </a> self::<span class="php-var">$afficher</span> = Config::get(<span class="php-quote">'fw_debogage'</span>);
</span><span id="51" class="l"><a class="l" href="#51"> 51: </a> }
</span><span id="52" class="l"><a class="l" href="#52"> 52: </a>
</span><span id="53" class="l"><a class="l" href="#53"> 53: </a> <span class="php-comment">/** Renvoie le booleen définissant si l'on affiche le contexte ou non */</span>
</span><span id="54" class="l"><a class="l" href="#54"> 54: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_getContexte" href="#_getContexte">getContexte</a>() {
</span><span id="55" class="l"><a class="l" href="#55"> 55: </a> <span class="php-keyword1">return</span> self::<span class="php-var">$contexte</span>;
</span><span id="56" class="l"><a class="l" href="#56"> 56: </a> }
</span><span id="57" class="l"><a class="l" href="#57"> 57: </a>
</span><span id="58" class="l"><a class="l" href="#58"> 58: </a> <span class="php-comment">/**
</span></span><span id="59" class="l"><a class="l" href="#59"> 59: </a><span class="php-comment"> * Definit si l'on veut afficher le contexte ou non
</span></span><span id="60" class="l"><a class="l" href="#60"> 60: </a><span class="php-comment"> * @param bool true si on veut afficher le contexte, false sinon, par défaut vaut false
</span></span><span id="61" class="l"><a class="l" href="#61"> 61: </a><span class="php-comment"> */</span>
</span><span id="62" class="l"><a class="l" href="#62"> 62: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_getExceptionsNbre" href="#_getExceptionsNbre">getExceptionsNbre</a>() {
</span><span id="63" class="l"><a class="l" href="#63"> 63: </a> <span class="php-keyword1">return</span> <span class="php-keyword2">count</span>(self::<span class="php-var">$exceptions</span>);
</span><span id="62" class="l"><a class="l" href="#62"> 62: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_setContexte" href="#_setContexte">setContexte</a>(<span class="php-var">$contexte</span>) {
</span><span id="63" class="l"><a class="l" href="#63"> 63: </a> self::<span class="php-var">$contexte</span> = <span class="php-var">$contexte</span>;
</span><span id="64" class="l"><a class="l" href="#64"> 64: </a> }
</span><span id="65" class="l"><a class="l" href="#65"> 65: </a>
</span><span id="66" class="l"><a class="l" href="#66"> 66: </a> <span class="php-comment">/**
</span></span><span id="67" class="l"><a class="l" href="#67"> 67: </a><span class="php-comment"> * Renvoie le booleen définissant si l'on affiche le contexte ou non
</span></span><span id="68" class="l"><a class="l" href="#68"> 68: </a><span class="php-comment"> * @return bool true si on affiche le contexte sinon false.
</span><span id="65" class="l"><a class="l" href="#65"> 65: </a>
</span><span id="66" class="l"><a class="l" href="#66"> 66: </a> <span class="php-comment">/**
</span></span><span id="67" class="l"><a class="l" href="#67"> 67: </a><span class="php-comment"> * Fonction de gestion des exceptions, remplace le handler par défaut
</span></span><span id="68" class="l"><a class="l" href="#68"> 68: </a><span class="php-comment"> * @param Exception $e l'exception à traiter
</span></span><span id="69" class="l"><a class="l" href="#69"> 69: </a><span class="php-comment"> */</span>
</span><span id="70" class="l"><a class="l" href="#70"> 70: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_getContexte" href="#_getContexte">getContexte</a>() {
</span><span id="71" class="l"><a class="l" href="#71"> 71: </a> <span class="php-keyword1">return</span> self::<span class="php-var">$contexte</span>;
</span><span id="72" class="l"><a class="l" href="#72"> 72: </a> }
</span><span id="73" class="l"><a class="l" href="#73"> 73: </a>
</span><span id="74" class="l"><a class="l" href="#74"> 74: </a> <span class="php-comment">/**
</span></span><span id="75" class="l"><a class="l" href="#75"> 75: </a><span class="php-comment"> * Definit si l'on veut afficher le contexte ou non
</span></span><span id="76" class="l"><a class="l" href="#76"> 76: </a><span class="php-comment"> * @param bool true si on veut afficher le contexte, false sinon, par défaut vaut false
</span></span><span id="77" class="l"><a class="l" href="#77"> 77: </a><span class="php-comment"> */</span>
</span><span id="78" class="l"><a class="l" href="#78"> 78: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_setContexte" href="#_setContexte">setContexte</a>(<span class="php-var">$contexte</span>) {
</span><span id="79" class="l"><a class="l" href="#79"> 79: </a> self::<span class="php-var">$contexte</span> = <span class="php-var">$contexte</span>;
</span><span id="80" class="l"><a class="l" href="#80"> 80: </a> }
</span><span id="81" class="l"><a class="l" href="#81"> 81: </a>
</span><span id="82" class="l"><a class="l" href="#82"> 82: </a> <span class="php-comment">/**
</span></span><span id="83" class="l"><a class="l" href="#83"> 83: </a><span class="php-comment"> * Fonction de gestion des exceptions, remplace le handler par défaut.
</span></span><span id="84" class="l"><a class="l" href="#84"> 84: </a><span class="php-comment"> * Si une boucle génère de multiple exception (ou erreur) identique une seule sera stockée.
</span></span><span id="85" class="l"><a class="l" href="#85"> 85: </a><span class="php-comment"> * @param Exception $e l'exception à traiter
</span></span><span id="86" class="l"><a class="l" href="#86"> 86: </a><span class="php-comment"> */</span>
</span><span id="87" class="l"><a class="l" href="#87"> 87: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_gererException" href="#_gererException">gererException</a>(Exception <span class="php-var">$e</span>) {
</span><span id="88" class="l"><a class="l" href="#88"> 88: </a> <span class="php-var">$cle</span> = <span class="php-keyword2">hash</span>(<span class="php-quote">'md5'</span>, <span class="php-var">$e</span>-&gt;getMessage().<span class="php-quote">'-'</span>.<span class="php-var">$e</span>-&gt;getFile().<span class="php-quote">'-'</span>.<span class="php-var">$e</span>-&gt;getLine());
</span><span id="89" class="l"><a class="l" href="#89"> 89: </a> <span class="php-keyword1">if</span> (!<span class="php-keyword1">isset</span>(self::<span class="php-var">$exceptions</span>[<span class="php-var">$cle</span>])) {
</span><span id="90" class="l"><a class="l" href="#90"> 90: </a> self::<span class="php-var">$exceptions</span>[<span class="php-var">$cle</span>] = <span class="php-var">$e</span>;
</span><span id="91" class="l"><a class="l" href="#91"> 91: </a> self::loggerException(<span class="php-var">$e</span>);
</span><span id="92" class="l"><a class="l" href="#92"> 92: </a> }
</span><span id="93" class="l"><a class="l" href="#93"> 93: </a> }
</span><span id="94" class="l"><a class="l" href="#94"> 94: </a>
</span><span id="95" class="l"><a class="l" href="#95"> 95: </a> <span class="php-comment">/**
</span></span><span id="96" class="l"><a class="l" href="#96"> 96: </a><span class="php-comment"> * Gère les erreurs en les convertissant en exceptions (remplace la fonction gestion d'erreurs native de php)
</span></span><span id="97" class="l"><a class="l" href="#97"> 97: </a><span class="php-comment"> * @param int $niveau le niveau de l'erreur
</span></span><span id="98" class="l"><a class="l" href="#98"> 98: </a><span class="php-comment"> * @param string $message le message associé à l'erreur
</span></span><span id="99" class="l"><a class="l" href="#99"> 99: </a><span class="php-comment"> * @param string $fichier le nom du fichier où l'erreur s'est produite
</span></span><span id="100" class="l"><a class="l" href="#100">100: </a><span class="php-comment"> * @param int $ligne la ligne où l'erreur s'est produite
</span></span><span id="101" class="l"><a class="l" href="#101">101: </a><span class="php-comment"> * @param string $contexte le contexte associé à l'erreur
</span></span><span id="102" class="l"><a class="l" href="#102">102: </a><span class="php-comment"> */</span>
</span><span id="103" class="l"><a class="l" href="#103">103: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_gererErreur" href="#_gererErreur">gererErreur</a>(<span class="php-var">$niveau</span>, <span class="php-var">$message</span>, <span class="php-var">$fichier</span>, <span class="php-var">$ligne</span>, <span class="php-var">$contexte</span>){
</span><span id="104" class="l"><a class="l" href="#104">104: </a> <span class="php-comment">// Si un rapport d'erreur existe, création d'une exception</span>
</span><span id="105" class="l"><a class="l" href="#105">105: </a> <span class="php-keyword1">if</span> (<span class="php-keyword2">error_reporting</span>() != <span class="php-num">0</span>) {
</span><span id="106" class="l"><a class="l" href="#106">106: </a> <span class="php-var">$e</span> = <span class="php-keyword1">new</span> ErrorException(<span class="php-var">$message</span>, <span class="php-num">0</span>, <span class="php-var">$niveau</span>, <span class="php-var">$fichier</span>, <span class="php-var">$ligne</span>);
</span><span id="107" class="l"><a class="l" href="#107">107: </a> self::gererException(<span class="php-var">$e</span>);
</span><span id="108" class="l"><a class="l" href="#108">108: </a> }
</span><span id="109" class="l"><a class="l" href="#109">109: </a> <span class="php-keyword1">return</span> <span class="php-keyword1">null</span>;
</span><span id="110" class="l"><a class="l" href="#110">110: </a> }
</span><span id="111" class="l"><a class="l" href="#111">111: </a>
</span><span id="112" class="l"><a class="l" href="#112">112: </a> <span class="php-comment">/**
</span></span><span id="113" class="l"><a class="l" href="#113">113: </a><span class="php-comment"> * Renvoie les exceptions au format (X)HTML ou bien au format texte suivant le mode d'utilisation de PHP.
</span></span><span id="114" class="l"><a class="l" href="#114">114: </a><span class="php-comment"> * @since 0.3
</span></span><span id="115" class="l"><a class="l" href="#115">115: </a><span class="php-comment"> * @deprecated
</span></span><span id="116" class="l"><a class="l" href="#116">116: </a><span class="php-comment"> * @see getExceptionsFormatees()
</span></span><span id="117" class="l"><a class="l" href="#117">117: </a><span class="php-comment"> * @return string les exceptions formatées en texte ou (X)HTML.
</span></span><span id="118" class="l"><a class="l" href="#118">118: </a><span class="php-comment"> */</span>
</span><span id="119" class="l"><a class="l" href="#119">119: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_getExceptions" href="#_getExceptions">getExceptions</a>() {
</span><span id="120" class="l"><a class="l" href="#120">120: </a> <span class="php-keyword1">return</span> self::getExceptionsFormatees();
</span><span id="121" class="l"><a class="l" href="#121">121: </a> }
</span><span id="122" class="l"><a class="l" href="#122">122: </a>
</span><span id="123" class="l"><a class="l" href="#123">123: </a> <span class="php-comment">/**
</span></span><span id="124" class="l"><a class="l" href="#124">124: </a><span class="php-comment"> * Renvoie les exceptions au format (X)HTML ou bien au format texte suivant le mode d'utilisation de PHP.
</span></span><span id="125" class="l"><a class="l" href="#125">125: </a><span class="php-comment"> * @since 0.3
</span></span><span id="126" class="l"><a class="l" href="#126">126: </a><span class="php-comment"> * @return string les exceptions formatées en texte ou (X)HTML.
</span></span><span id="127" class="l"><a class="l" href="#127">127: </a><span class="php-comment"> */</span>
</span><span id="128" class="l"><a class="l" href="#128">128: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_getExceptionsFormatees" href="#_getExceptionsFormatees">getExceptionsFormatees</a>() {
</span><span id="129" class="l"><a class="l" href="#129">129: </a> <span class="php-var">$retour</span> = <span class="php-quote">''</span>;
</span><span id="130" class="l"><a class="l" href="#130">130: </a> <span class="php-keyword1">if</span> (self::getExceptionsNbre() &gt; <span class="php-num">0</span>) {
</span><span id="131" class="l"><a class="l" href="#131">131: </a> <span class="php-keyword1">foreach</span> (self::<span class="php-var">$exceptions</span> <span class="php-keyword1">as</span> <span class="php-var">$cle</span> =&gt; <span class="php-var">$e</span>) {
</span><span id="132" class="l"><a class="l" href="#132">132: </a> <span class="php-keyword1">switch</span> (self::<span class="php-var">$mode</span>) {
</span><span id="133" class="l"><a class="l" href="#133">133: </a> <span class="php-keyword1">case</span> self::MODE_CLI :
</span><span id="134" class="l"><a class="l" href="#134">134: </a> <span class="php-var">$retour</span> .= self::formaterExceptionTxt(<span class="php-var">$e</span>);
</span><span id="135" class="l"><a class="l" href="#135">135: </a> <span class="php-keyword1">break</span>;
</span><span id="136" class="l"><a class="l" href="#136">136: </a> <span class="php-keyword1">default</span>:
</span><span id="137" class="l"><a class="l" href="#137">137: </a> <span class="php-var">$retour</span> .= self::formaterExceptionXhtml(<span class="php-var">$e</span>);
</span><span id="138" class="l"><a class="l" href="#138">138: </a> }
</span><span id="139" class="l"><a class="l" href="#139">139: </a> <span class="php-comment">// Nous vidons le tableau des exceptions au fur et à mesure pour éviter le réaffichage avec le destructeur.</span>
</span><span id="140" class="l"><a class="l" href="#140">140: </a> <span class="php-keyword1">unset</span>(self::<span class="php-var">$exceptions</span>[<span class="php-var">$cle</span>]);
</span><span id="141" class="l"><a class="l" href="#141">141: </a> }
</span><span id="142" class="l"><a class="l" href="#142">142: </a> }
</span><span id="143" class="l"><a class="l" href="#143">143: </a> <span class="php-keyword1">return</span> <span class="php-var">$retour</span>;
</span><span id="144" class="l"><a class="l" href="#144">144: </a> }
</span><span id="145" class="l"><a class="l" href="#145">145: </a>
</span><span id="146" class="l"><a class="l" href="#146">146: </a> <span class="php-comment">/**
</span></span><span id="147" class="l"><a class="l" href="#147">147: </a><span class="php-comment"> * Renvoie le tableau d'objets Exception générées par le script PHP triées du niveau de sévérité le plus élevé au moins élevé.
</span></span><span id="148" class="l"><a class="l" href="#148">148: </a><span class="php-comment"> * Format du tableau :
</span></span><span id="149" class="l"><a class="l" href="#149">149: </a><span class="php-comment"> * array{sévérité_1 = array{Exception1, Exception2, Exception3,...}, sévérité_1 = array{Exception1, Exception2, ...}, ...};
</span></span><span id="150" class="l"><a class="l" href="#150">150: </a><span class="php-comment"> * ATTENTION : si vous utilisez cette méthode, c'est à vous de gérer l'affichage des Exceptions. Le gestionnaire d'exception
</span></span><span id="151" class="l"><a class="l" href="#151">151: </a><span class="php-comment"> * n'enverra plus rien au navigateur ou à la console.
</span></span><span id="152" class="l"><a class="l" href="#152">152: </a><span class="php-comment"> * @since 0.3
</span></span><span id="153" class="l"><a class="l" href="#153">153: </a><span class="php-comment"> * @return array le tableau trié d'objet Exception.
</span></span><span id="154" class="l"><a class="l" href="#154">154: </a><span class="php-comment"> */</span>
</span><span id="155" class="l"><a class="l" href="#155">155: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_getExceptionsTriees" href="#_getExceptionsTriees">getExceptionsTriees</a>() {
</span><span id="156" class="l"><a class="l" href="#156">156: </a> <span class="php-var">$retour</span> = <span class="php-keyword1">array</span>();
</span><span id="157" class="l"><a class="l" href="#157">157: </a> <span class="php-keyword1">if</span> (self::getExceptionsNbre() &gt; <span class="php-num">0</span>) {
</span><span id="158" class="l"><a class="l" href="#158">158: </a> <span class="php-keyword1">foreach</span> (self::<span class="php-var">$exceptions</span> <span class="php-keyword1">as</span> <span class="php-var">$cle</span> =&gt; <span class="php-var">$e</span>) {
</span><span id="159" class="l"><a class="l" href="#159">159: </a> <span class="php-var">$retour</span>[<span class="php-var">$e</span>-&gt;getSeverity()][] = <span class="php-var">$e</span>;
</span><span id="160" class="l"><a class="l" href="#160">160: </a> <span class="php-comment">// Nous vidons le tableau des exceptions au fur et à mesure pour éviter le réaffichage avec le destructeur.</span>
</span><span id="161" class="l"><a class="l" href="#161">161: </a> <span class="php-keyword1">unset</span>(self::<span class="php-var">$exceptions</span>[<span class="php-var">$cle</span>]);
</span><span id="162" class="l"><a class="l" href="#162">162: </a> }
</span><span id="163" class="l"><a class="l" href="#163">163: </a> <span class="php-keyword2">ksort</span>(<span class="php-var">$retour</span>);
</span><span id="164" class="l"><a class="l" href="#164">164: </a> }
</span><span id="165" class="l"><a class="l" href="#165">165: </a> <span class="php-keyword1">return</span> <span class="php-var">$retour</span>;
</span><span id="166" class="l"><a class="l" href="#166">166: </a> }
</span><span id="167" class="l"><a class="l" href="#167">167: </a>
</span><span id="168" class="l"><a class="l" href="#168">168: </a> <span class="php-comment">/**
</span></span><span id="169" class="l"><a class="l" href="#169">169: </a><span class="php-comment"> * Logue une exception donnée sous une forme lisible si self::logger vaut true.
</span></span><span id="170" class="l"><a class="l" href="#170">170: </a><span class="php-comment"> * @param Exception $e l'exception à logger
</span></span><span id="171" class="l"><a class="l" href="#171">171: </a><span class="php-comment"> */</span>
</span><span id="172" class="l"><a class="l" href="#172">172: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_loggerException" href="#_loggerException">loggerException</a>(Exception <span class="php-var">$e</span>) {
</span><span id="173" class="l"><a class="l" href="#173">173: </a> <span class="php-keyword1">if</span> (self::<span class="php-var">$logger</span>) {
</span><span id="174" class="l"><a class="l" href="#174">174: </a> <span class="php-var">$message</span> = self::formaterExceptionTxt(<span class="php-var">$e</span>);
</span><span id="175" class="l"><a class="l" href="#175">175: </a> <span class="php-keyword2">Log</span>::ajouterEntree(<span class="php-quote">'erreurs'</span>, <span class="php-var">$message</span>);
</span><span id="176" class="l"><a class="l" href="#176">176: </a> }
</span><span id="177" class="l"><a class="l" href="#177">177: </a> }
</span><span id="178" class="l"><a class="l" href="#178">178: </a>
</span><span id="179" class="l"><a class="l" href="#179">179: </a> <span class="php-comment">/**
</span></span><span id="180" class="l"><a class="l" href="#180">180: </a><span class="php-comment"> * Formate en texte une exception passée en paramètre.
</span></span><span id="181" class="l"><a class="l" href="#181">181: </a><span class="php-comment"> * @since 0.3
</span></span><span id="182" class="l"><a class="l" href="#182">182: </a><span class="php-comment"> * @param Exception l'exception à formater.
</span></span><span id="183" class="l"><a class="l" href="#183">183: </a><span class="php-comment"> */</span>
</span><span id="184" class="l"><a class="l" href="#184">184: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_formaterExceptionTxt" href="#_formaterExceptionTxt">formaterExceptionTxt</a>(Exception <span class="php-var">$e</span>) {
</span><span id="185" class="l"><a class="l" href="#185">185: </a> <span class="php-var">$message</span> = <span class="php-quote">''</span>;
</span><span id="186" class="l"><a class="l" href="#186">186: </a> <span class="php-var">$message</span> .= <span class="php-var">$e</span>-&gt;getMessage().<span class="php-quote">&quot;\n&quot;</span>;
</span><span id="187" class="l"><a class="l" href="#187">187: </a> <span class="php-var">$message</span> .= <span class="php-quote">'Fichier : '</span>.<span class="php-var">$e</span>-&gt;getFile().<span class="php-quote">&quot;\n&quot;</span>;
</span><span id="188" class="l"><a class="l" href="#188">188: </a> <span class="php-var">$message</span> .= <span class="php-quote">'Ligne : '</span>.<span class="php-var">$e</span>-&gt;getLine().<span class="php-quote">&quot;\n&quot;</span>;
</span><span id="189" class="l"><a class="l" href="#189">189: </a> <span class="php-keyword1">if</span> (self::getContexte()) {
</span><span id="190" class="l"><a class="l" href="#190">190: </a> <span class="php-var">$message</span> .= <span class="php-quote">'Contexte : '</span>.<span class="php-quote">&quot;\n&quot;</span>.<span class="php-keyword2">print_r</span>(<span class="php-var">$e</span>-&gt;getTraceAsString(), <span class="php-keyword1">true</span>).<span class="php-quote">&quot;\n&quot;</span>;
</span><span id="191" class="l"><a class="l" href="#191">191: </a> }
</span><span id="192" class="l"><a class="l" href="#192">192: </a> <span class="php-var">$message</span> .= <span class="php-quote">&quot;\n&quot;</span>;
</span><span id="193" class="l"><a class="l" href="#193">193: </a> <span class="php-keyword1">return</span> <span class="php-var">$message</span>;
</span><span id="194" class="l"><a class="l" href="#194">194: </a> }
</span><span id="195" class="l"><a class="l" href="#195">195: </a>
</span><span id="196" class="l"><a class="l" href="#196">196: </a> <span class="php-comment">/**
</span></span><span id="197" class="l"><a class="l" href="#197">197: </a><span class="php-comment"> * Formate en (X)HTML une exception passée en paramètre.
</span></span><span id="198" class="l"><a class="l" href="#198">198: </a><span class="php-comment"> * @since 0.3
</span></span><span id="199" class="l"><a class="l" href="#199">199: </a><span class="php-comment"> * @param Exception l'exception à formater.
</span></span><span id="200" class="l"><a class="l" href="#200">200: </a><span class="php-comment"> */</span>
</span><span id="201" class="l"><a class="l" href="#201">201: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_formaterExceptionXhtml" href="#_formaterExceptionXhtml">formaterExceptionXhtml</a>(Exception <span class="php-var">$e</span>) {
</span><span id="202" class="l"><a class="l" href="#202">202: </a> <span class="php-var">$message</span> = <span class="php-quote">''</span>;
</span><span id="203" class="l"><a class="l" href="#203">203: </a> <span class="php-var">$message</span> .= <span class="php-quote">'&lt;div class=&quot;debogage&quot;&gt;'</span>.<span class="php-quote">&quot;\n&quot;</span>;
</span><span id="204" class="l"><a class="l" href="#204">204: </a> <span class="php-var">$message</span> .= <span class="php-var">$e</span>-&gt;getMessage().<span class="php-quote">&quot;\n&quot;</span>;
</span><span id="205" class="l"><a class="l" href="#205">205: </a> <span class="php-var">$message</span> .= <span class="php-quote">'&lt;span class=&quot;debogage_fichier&quot;&gt;'</span>.<span class="php-quote">'Fichier : '</span>.<span class="php-var">$e</span>-&gt;getFile().<span class="php-quote">'&lt;/span&gt;'</span>.<span class="php-quote">&quot;\n&quot;</span>;
</span><span id="206" class="l"><a class="l" href="#206">206: </a> <span class="php-var">$message</span> .= <span class="php-quote">'&lt;span class=&quot;debogage_ligne&quot;&gt;'</span>.<span class="php-quote">'Ligne : '</span>.<span class="php-var">$e</span>-&gt;getLine().<span class="php-quote">'&lt;/span&gt;'</span>.<span class="php-quote">&quot;\n&quot;</span>;
</span><span id="207" class="l"><a class="l" href="#207">207: </a> <span class="php-keyword1">if</span> (self::getContexte()) {
</span><span id="208" class="l"><a class="l" href="#208">208: </a> <span class="php-var">$message</span> .= <span class="php-quote">'&lt;pre&gt;'</span>.<span class="php-quote">&quot;\n&quot;</span>;
</span><span id="209" class="l"><a class="l" href="#209">209: </a> <span class="php-var">$message</span> .= <span class="php-quote">'&lt;strong&gt;Contexte : &lt;/strong&gt;'</span>.<span class="php-quote">&quot;\n&quot;</span>.<span class="php-keyword2">print_r</span>(<span class="php-var">$e</span>-&gt;getTraceAsString(), <span class="php-keyword1">true</span>).<span class="php-quote">&quot;\n&quot;</span>;
</span><span id="210" class="l"><a class="l" href="#210">210: </a> <span class="php-var">$message</span> .= <span class="php-quote">'&lt;/pre&gt;'</span>.<span class="php-quote">&quot;\n&quot;</span>;
</span><span id="211" class="l"><a class="l" href="#211">211: </a> }
</span><span id="212" class="l"><a class="l" href="#212">212: </a> <span class="php-var">$message</span> .= <span class="php-quote">'&lt;/div&gt;'</span>.<span class="php-quote">&quot;\n&quot;</span>;
</span><span id="213" class="l"><a class="l" href="#213">213: </a> <span class="php-keyword1">return</span> <span class="php-var">$message</span>;
</span><span id="214" class="l"><a class="l" href="#214">214: </a> }
</span><span id="215" class="l"><a class="l" href="#215">215: </a>
</span><span id="216" class="l"><a class="l" href="#216">216: </a> <span class="php-comment">/**
</span></span><span id="217" class="l"><a class="l" href="#217">217: </a><span class="php-comment"> * Lors de la destruction de la classe si des exceptions n'ont pas été affichées, et si le débogage est à true, elles sont
</span></span><span id="218" class="l"><a class="l" href="#218">218: </a><span class="php-comment"> * affichées.
</span></span><span id="219" class="l"><a class="l" href="#219">219: </a><span class="php-comment"> */</span>
</span><span id="220" class="l"><a class="l" href="#220">220: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="___destruct" href="#___destruct">__destruct</a>() {
</span><span id="221" class="l"><a class="l" href="#221">221: </a> <span class="php-comment">// Si des erreurs n'ont pas été affichée nous forçons leur affichage</span>
</span><span id="222" class="l"><a class="l" href="#222">222: </a> <span class="php-keyword1">if</span> (self::<span class="php-var">$afficher</span> &amp;&amp; self::getExceptionsNbre() &gt; <span class="php-num">0</span>) {
</span><span id="223" class="l"><a class="l" href="#223">223: </a> <span class="php-keyword1">echo</span> self::getExceptionsFormatees();
</span><span id="224" class="l"><a class="l" href="#224">224: </a> }
</span><span id="225" class="l"><a class="l" href="#225">225: </a> }
</span><span id="226" class="l"><a class="l" href="#226">226: </a>
</span><span id="227" class="l"><a class="l" href="#227">227: </a>}
</span><span id="228" class="l"><a class="l" href="#228">228: </a></span><span class="xlang">?&gt;</span></code></pre>
</span><span id="70" class="l"><a class="l" href="#70"> 70: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_gererException" href="#_gererException">gererException</a>(Exception <span class="php-var">$e</span>) {
</span><span id="71" class="l"><a class="l" href="#71"> 71: </a> <span class="php-comment">// pour le moment on se contente de l'ajouter au tableau et de les afficher</span>
</span><span id="72" class="l"><a class="l" href="#72"> 72: </a> self::<span class="php-var">$exceptions</span>[] = <span class="php-var">$e</span>;
</span><span id="73" class="l"><a class="l" href="#73"> 73: </a> <span class="php-comment">// Log si nécéssaire</span>
</span><span id="74" class="l"><a class="l" href="#74"> 74: </a> self::loggerException(<span class="php-var">$e</span>);
</span><span id="75" class="l"><a class="l" href="#75"> 75: </a> }
</span><span id="76" class="l"><a class="l" href="#76"> 76: </a>
</span><span id="77" class="l"><a class="l" href="#77"> 77: </a> <span class="php-comment">/**
</span></span><span id="78" class="l"><a class="l" href="#78"> 78: </a><span class="php-comment"> * Gère les erreurs en les convertissant en exceptions (remplace la fonction gestion d'erreurs native de php)
</span></span><span id="79" class="l"><a class="l" href="#79"> 79: </a><span class="php-comment"> * @param int $niveau le niveau de l'erreur
</span></span><span id="80" class="l"><a class="l" href="#80"> 80: </a><span class="php-comment"> * @param string $message le message associé à l'erreur
</span></span><span id="81" class="l"><a class="l" href="#81"> 81: </a><span class="php-comment"> * @param string $fichier le nom du fichier où l'erreur s'est produite
</span></span><span id="82" class="l"><a class="l" href="#82"> 82: </a><span class="php-comment"> * @param int $ligne la ligne où l'erreur s'est produite
</span></span><span id="83" class="l"><a class="l" href="#83"> 83: </a><span class="php-comment"> * @param string $contexte le contexte associé à l'erreur
</span></span><span id="84" class="l"><a class="l" href="#84"> 84: </a><span class="php-comment"> */</span>
</span><span id="85" class="l"><a class="l" href="#85"> 85: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_gererErreur" href="#_gererErreur">gererErreur</a>(<span class="php-var">$niveau</span>, <span class="php-var">$message</span>, <span class="php-var">$fichier</span>, <span class="php-var">$ligne</span>, <span class="php-var">$contexte</span>){
</span><span id="86" class="l"><a class="l" href="#86"> 86: </a> <span class="php-comment">// Si un rapport d'erreur existe, création d'une exception</span>
</span><span id="87" class="l"><a class="l" href="#87"> 87: </a> <span class="php-keyword1">if</span> (<span class="php-keyword2">error_reporting</span>() != <span class="php-num">0</span>) {
</span><span id="88" class="l"><a class="l" href="#88"> 88: </a> <span class="php-var">$e</span> = <span class="php-keyword1">new</span> ErrorException(<span class="php-var">$message</span>, <span class="php-num">0</span>, <span class="php-var">$niveau</span>, <span class="php-var">$fichier</span>, <span class="php-var">$ligne</span>);
</span><span id="89" class="l"><a class="l" href="#89"> 89: </a> <span class="php-comment">// que l'on donne au tableau d'exceptions</span>
</span><span id="90" class="l"><a class="l" href="#90"> 90: </a> self::<span class="php-var">$exceptions</span>[] = <span class="php-var">$e</span>;
</span><span id="91" class="l"><a class="l" href="#91"> 91: </a> <span class="php-comment">// Log si nécéssaire</span>
</span><span id="92" class="l"><a class="l" href="#92"> 92: </a> self::loggerException(<span class="php-var">$e</span>);
</span><span id="93" class="l"><a class="l" href="#93"> 93: </a> }
</span><span id="94" class="l"><a class="l" href="#94"> 94: </a> <span class="php-keyword1">return</span> <span class="php-keyword1">null</span>;
</span><span id="95" class="l"><a class="l" href="#95"> 95: </a> }
</span><span id="96" class="l"><a class="l" href="#96"> 96: </a>
</span><span id="97" class="l"><a class="l" href="#97"> 97: </a> <span class="php-comment">/**
</span></span><span id="98" class="l"><a class="l" href="#98"> 98: </a><span class="php-comment"> * Renvoie les exceptions au format (X)HTML
</span></span><span id="99" class="l"><a class="l" href="#99"> 99: </a><span class="php-comment"> * ou bien au format texte suivant le mode d'utilisation de PHP
</span></span><span id="100" class="l"><a class="l" href="#100">100: </a><span class="php-comment"> */</span>
</span><span id="101" class="l"><a class="l" href="#101">101: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_getExceptions" href="#_getExceptions">getExceptions</a>() {
</span><span id="102" class="l"><a class="l" href="#102">102: </a> <span class="php-var">$retour</span> = <span class="php-quote">''</span>;
</span><span id="103" class="l"><a class="l" href="#103">103: </a> <span class="php-keyword1">foreach</span> (self::<span class="php-var">$exceptions</span> <span class="php-keyword1">as</span> <span class="php-var">$cle</span> =&gt; <span class="php-var">$e</span>) {
</span><span id="104" class="l"><a class="l" href="#104">104: </a> <span class="php-keyword1">switch</span> (self::<span class="php-var">$mode</span>) {
</span><span id="105" class="l"><a class="l" href="#105">105: </a> <span class="php-keyword1">case</span> self::MODE_CLI :
</span><span id="106" class="l"><a class="l" href="#106">106: </a> <span class="php-var">$retour</span> .= <span class="php-var">$e</span>-&gt;getMessage().<span class="php-quote">&quot;\n&quot;</span>;
</span><span id="107" class="l"><a class="l" href="#107">107: </a> <span class="php-var">$retour</span> .= <span class="php-quote">'Fichier : '</span>.<span class="php-var">$e</span>-&gt;getFile().<span class="php-quote">&quot;\n&quot;</span>;
</span><span id="108" class="l"><a class="l" href="#108">108: </a> <span class="php-var">$retour</span> .= <span class="php-quote">'Ligne : '</span>.<span class="php-var">$e</span>-&gt;getLine().<span class="php-quote">&quot;\n&quot;</span>;
</span><span id="109" class="l"><a class="l" href="#109">109: </a> <span class="php-keyword1">if</span> (self::getContexte()) {
</span><span id="110" class="l"><a class="l" href="#110">110: </a> <span class="php-var">$retour</span> .= <span class="php-quote">'Contexte : '</span>.<span class="php-quote">&quot;\n&quot;</span>.<span class="php-keyword2">print_r</span>(<span class="php-var">$e</span>-&gt;getTraceAsString(), <span class="php-keyword1">true</span>).<span class="php-quote">&quot;\n&quot;</span>;
</span><span id="111" class="l"><a class="l" href="#111">111: </a> }
</span><span id="112" class="l"><a class="l" href="#112">112: </a> <span class="php-keyword1">break</span>;
</span><span id="113" class="l"><a class="l" href="#113">113: </a> <span class="php-keyword1">default</span>:
</span><span id="114" class="l"><a class="l" href="#114">114: </a> <span class="php-var">$retour</span> .= <span class="php-quote">'&lt;div class=&quot;debogage&quot;&gt;'</span>.<span class="php-quote">&quot;\n&quot;</span>;
</span><span id="115" class="l"><a class="l" href="#115">115: </a> <span class="php-var">$retour</span> .= <span class="php-var">$e</span>-&gt;getMessage().<span class="php-quote">&quot;\n&quot;</span>;
</span><span id="116" class="l"><a class="l" href="#116">116: </a> <span class="php-var">$retour</span> .= <span class="php-quote">'&lt;span class=&quot;debogage_fichier&quot;&gt;'</span>.<span class="php-quote">'Fichier : '</span>.<span class="php-var">$e</span>-&gt;getFile().<span class="php-quote">'&lt;/span&gt;'</span>.<span class="php-quote">&quot;\n&quot;</span>;
</span><span id="117" class="l"><a class="l" href="#117">117: </a> <span class="php-var">$retour</span> .= <span class="php-quote">'&lt;span class=&quot;debogage_ligne&quot;&gt;'</span>.<span class="php-quote">'Ligne : '</span>.<span class="php-var">$e</span>-&gt;getLine().<span class="php-quote">'&lt;/span&gt;'</span>.<span class="php-quote">&quot;\n&quot;</span>;
</span><span id="118" class="l"><a class="l" href="#118">118: </a> <span class="php-keyword1">if</span> (self::getContexte()) {
</span><span id="119" class="l"><a class="l" href="#119">119: </a> <span class="php-var">$retour</span> .= <span class="php-quote">'&lt;pre&gt;'</span>.<span class="php-quote">&quot;\n&quot;</span>;
</span><span id="120" class="l"><a class="l" href="#120">120: </a> <span class="php-var">$retour</span> .= <span class="php-quote">'&lt;strong&gt;Contexte : &lt;/strong&gt;'</span>.<span class="php-quote">&quot;\n&quot;</span>.<span class="php-keyword2">print_r</span>(<span class="php-var">$e</span>-&gt;getTraceAsString(), <span class="php-keyword1">true</span>).<span class="php-quote">&quot;\n&quot;</span>;
</span><span id="121" class="l"><a class="l" href="#121">121: </a> <span class="php-var">$retour</span> .= <span class="php-quote">'&lt;/pre&gt;'</span>.<span class="php-quote">&quot;\n&quot;</span>;
</span><span id="122" class="l"><a class="l" href="#122">122: </a> }
</span><span id="123" class="l"><a class="l" href="#123">123: </a> <span class="php-var">$retour</span> .= <span class="php-quote">'&lt;/div&gt;'</span>.<span class="php-quote">&quot;\n&quot;</span>;
</span><span id="124" class="l"><a class="l" href="#124">124: </a> }
</span><span id="125" class="l"><a class="l" href="#125">125: </a> <span class="php-comment">// Nous vidons le tableau des exceptions au fur et à mesure</span>
</span><span id="126" class="l"><a class="l" href="#126">126: </a> <span class="php-keyword1">unset</span>(self::<span class="php-var">$exceptions</span>[<span class="php-var">$cle</span>]);
</span><span id="127" class="l"><a class="l" href="#127">127: </a> }
</span><span id="128" class="l"><a class="l" href="#128">128: </a> <span class="php-keyword1">return</span> <span class="php-var">$retour</span>;
</span><span id="129" class="l"><a class="l" href="#129">129: </a> }
</span><span id="130" class="l"><a class="l" href="#130">130: </a>
</span><span id="131" class="l"><a class="l" href="#131">131: </a> <span class="php-comment">/**
</span></span><span id="132" class="l"><a class="l" href="#132">132: </a><span class="php-comment"> * Logue une exception donnée sous une forme lisible si self::logger vaut true.
</span></span><span id="133" class="l"><a class="l" href="#133">133: </a><span class="php-comment"> * @param Exception $e l'exception à logger
</span></span><span id="134" class="l"><a class="l" href="#134">134: </a><span class="php-comment"> */</span>
</span><span id="135" class="l"><a class="l" href="#135">135: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_loggerException" href="#_loggerException">loggerException</a>(<span class="php-var">$e</span>) {
</span><span id="136" class="l"><a class="l" href="#136">136: </a> <span class="php-keyword1">if</span> (self::<span class="php-var">$logger</span>) {
</span><span id="137" class="l"><a class="l" href="#137">137: </a> <span class="php-var">$erreur</span> = <span class="php-quote">''</span>;
</span><span id="138" class="l"><a class="l" href="#138">138: </a> <span class="php-var">$erreur</span> .= <span class="php-var">$e</span>-&gt;getMessage().<span class="php-quote">&quot;\n&quot;</span>;
</span><span id="139" class="l"><a class="l" href="#139">139: </a> <span class="php-var">$erreur</span> .= <span class="php-quote">'Fichier : '</span>.<span class="php-var">$e</span>-&gt;getFile().<span class="php-quote">&quot;\n&quot;</span>;
</span><span id="140" class="l"><a class="l" href="#140">140: </a> <span class="php-var">$erreur</span> .= <span class="php-quote">'Ligne : '</span>.<span class="php-var">$e</span>-&gt;getLine().<span class="php-quote">&quot;\n&quot;</span>;
</span><span id="141" class="l"><a class="l" href="#141">141: </a> <span class="php-keyword1">if</span> (self::getContexte()) {
</span><span id="142" class="l"><a class="l" href="#142">142: </a> <span class="php-var">$erreur</span> .= <span class="php-quote">'Contexte : '</span>.<span class="php-quote">&quot;\n&quot;</span>.<span class="php-keyword2">print_r</span>(<span class="php-var">$e</span>-&gt;getTraceAsString(), <span class="php-keyword1">true</span>).<span class="php-quote">&quot;\n&quot;</span>;
</span><span id="143" class="l"><a class="l" href="#143">143: </a> }
</span><span id="144" class="l"><a class="l" href="#144">144: </a> <span class="php-var">$erreur</span> .= <span class="php-quote">&quot;\n&quot;</span>;
</span><span id="145" class="l"><a class="l" href="#145">145: </a> <span class="php-keyword2">Log</span>::ajouterEntree(<span class="php-quote">'erreurs'</span>, <span class="php-var">$erreur</span>);
</span><span id="146" class="l"><a class="l" href="#146">146: </a> }
</span><span id="147" class="l"><a class="l" href="#147">147: </a> }
</span><span id="148" class="l"><a class="l" href="#148">148: </a>
</span><span id="149" class="l"><a class="l" href="#149">149: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="___destruct" href="#___destruct">__destruct</a>() {
</span><span id="150" class="l"><a class="l" href="#150">150: </a> <span class="php-comment">// Si des erreurs n'ont pas été affichée nous forçons leur affichage</span>
</span><span id="151" class="l"><a class="l" href="#151">151: </a> <span class="php-keyword1">if</span> (self::<span class="php-var">$afficher</span> &amp;&amp; <span class="php-keyword2">count</span>(self::<span class="php-var">$exceptions</span>) &gt; <span class="php-num">0</span>) {
</span><span id="152" class="l"><a class="l" href="#152">152: </a> <span class="php-keyword1">echo</span> self::getExceptions();
</span><span id="153" class="l"><a class="l" href="#153">153: </a> }
</span><span id="154" class="l"><a class="l" href="#154">154: </a> }
</span><span id="155" class="l"><a class="l" href="#155">155: </a>
</span><span id="156" class="l"><a class="l" href="#156">156: </a>}
</span><span id="157" class="l"><a class="l" href="#157">157: </a></span><span class="xlang">?&gt;</span></code></pre>
 
<div id="footer">
TBFramework - v0.2 API documentation generated by <a href="http://apigen.org">ApiGen 2.8.0</a>
/branches/v0.2-buhl/doc/ApiGen/source-function-autoloadAppliDefaut.html
8,7 → 8,7
<title>File autoload.inc.php | TBFramework - v0.2</title>
 
<script type="text/javascript" src="resources/combined.js?4205936287"></script>
<script type="text/javascript" src="elementlist.js?117657638"></script>
<script type="text/javascript" src="elementlist.js?1835392179"></script>
<link rel="stylesheet" type="text/css" media="all" href="resources/style.css?3505392360">
 
</head>
41,6 → 41,7
<li><a href="class-Controleur.html">Controleur</a></li>
<li><a href="class-Debug.html">Debug</a></li>
<li><a href="class-GestionnaireException.html">GestionnaireException</a></li>
<li><a href="class-I18n.html">I18n</a></li>
<li><a href="class-Log.html">Log</a></li>
<li><a href="class-Modele.html">Modele</a></li>
<li><a href="class-Registre.html">Registre</a></li>
105,63 → 106,58
</span></span><span id="4" class="l"><a class="l" href="#4"> 4: </a><span class="php-comment"> * Fichier contenant la fonction de chargement automatique de classes, il doit toujours rester à la racine
</span></span><span id="5" class="l"><a class="l" href="#5"> 5: </a><span class="php-comment"> * du framework car il initialise le chemin de l'application en se basant sur son propre emplacement.
</span></span><span id="6" class="l"><a class="l" href="#6"> 6: </a><span class="php-comment"> *
</span></span><span id="7" class="l"><a class="l" href="#7"> 7: </a><span class="php-comment"> * PHP Version 5.1.2
</span></span><span id="8" class="l"><a class="l" href="#8"> 8: </a><span class="php-comment"> *
</span></span><span id="9" class="l"><a class="l" href="#9"> 9: </a><span class="php-comment"> * @category Fichier_De_Fonctions
</span></span><span id="10" class="l"><a class="l" href="#10">10: </a><span class="php-comment"> * @package Framework
</span></span><span id="11" class="l"><a class="l" href="#11">11: </a><span class="php-comment"> // Auteur principal :
</span></span><span id="12" class="l"><a class="l" href="#12">12: </a><span class="php-comment"> * @author Aurelien PERONNET &lt;aurelien@tela-botanica.org&gt;
</span></span><span id="13" class="l"><a class="l" href="#13">13: </a><span class="php-comment"> // Autres auteurs :
</span></span><span id="14" class="l"><a class="l" href="#14">14: </a><span class="php-comment"> * @author Jean-Pascal MILCENT &lt;jpm@tela-botanica.org&gt;
</span></span><span id="15" class="l"><a class="l" href="#15">15: </a><span class="php-comment"> * @license GPL v3 &lt;http://www.gnu.org/licenses/gpl.txt&gt;
</span></span><span id="16" class="l"><a class="l" href="#16">16: </a><span class="php-comment"> * @license CECILL v2 &lt;http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt&gt;
</span></span><span id="17" class="l"><a class="l" href="#17">17: </a><span class="php-comment"> * @version $$Id: autoload.inc.php 188 2010-04-29 12:09:17Z jpm $$
</span></span><span id="18" class="l"><a class="l" href="#18">18: </a><span class="php-comment"> * @copyright 1999-2009 Tela Botanica (accueil@tela-botanica.org)
</span></span><span id="19" class="l"><a class="l" href="#19">19: </a><span class="php-comment"> */</span>
</span><span id="20" class="l"><a class="l" href="#20">20: </a>
</span><span id="21" class="l"><a class="l" href="#21">21: </a><span class="php-comment">// Redéfinition de la constante DIRECTORY_SEPARATOR</span>
</span><span id="22" class="l"><a class="l" href="#22">22: </a><span class="php-keyword1">if</span> (!<span class="php-keyword2">defined</span>(<span class="php-quote">'DS'</span>)) {
</span><span id="23" class="l"><a class="l" href="#23">23: </a> <span class="php-keyword2">define</span>(<span class="php-quote">'DS'</span>, DIRECTORY_SEPARATOR);
</span><span id="24" class="l"><a class="l" href="#24">24: </a>}
</span><span id="25" class="l"><a class="l" href="#25">25: </a><span class="php-comment">// Redéfinition de la constante PATH_SEPARATOR</span>
</span><span id="26" class="l"><a class="l" href="#26">26: </a><span class="php-keyword1">if</span> (!<span class="php-keyword2">defined</span>(<span class="php-quote">'PS'</span>)) {
</span><span id="27" class="l"><a class="l" href="#27">27: </a> <span class="php-keyword2">define</span>(<span class="php-quote">'PS'</span>, PATH_SEPARATOR);
</span><span id="28" class="l"><a class="l" href="#28">28: </a>}
</span><span id="29" class="l"><a class="l" href="#29">29: </a>
</span><span id="30" class="l"><a class="l" href="#30">30: </a><span class="php-comment">// Autoload pour le Framework</span>
</span><span id="31" class="l"><a class="l" href="#31">31: </a><span class="php-keyword1">function</span> <a id="_autoloadFw" href="#_autoloadFw">autoloadFw</a>(<span class="php-var">$nom_classe_fw</span>) {
</span><span id="32" class="l"><a class="l" href="#32">32: </a> <span class="php-var">$fichier_a_inclure</span> = <span class="php-keyword2">dirname</span>(__FILE__).DS.<span class="php-var">$nom_classe_fw</span>.<span class="php-quote">'.php'</span>;
</span><span id="33" class="l"><a class="l" href="#33">33: </a> <span class="php-keyword1">if</span> (<span class="php-keyword2">file_exists</span>(<span class="php-var">$fichier_a_inclure</span>)) {
</span><span id="34" class="l"><a class="l" href="#34">34: </a> <span class="php-keyword1">include_once</span> <span class="php-var">$fichier_a_inclure</span>;
</span><span id="35" class="l"><a class="l" href="#35">35: </a> <span class="php-keyword1">return</span> <span class="php-keyword1">null</span>;
</span><span id="36" class="l"><a class="l" href="#36">36: </a> }
</span><span id="37" class="l"><a class="l" href="#37">37: </a>}
</span><span id="38" class="l"><a class="l" href="#38">38: </a><span class="php-keyword2">spl_autoload_register</span>(<span class="php-quote">'autoloadFw'</span>);
</span><span id="39" class="l"><a class="l" href="#39">39: </a>
</span><span id="40" class="l"><a class="l" href="#40">40: </a><span class="php-comment">// Initialisation du gestionnaire d'erreur avant toute chose</span>
</span><span id="41" class="l"><a class="l" href="#41">41: </a>GestionnaireException::initialiser();
</span><span id="42" class="l"><a class="l" href="#42">42: </a>
</span><span id="43" class="l"><a class="l" href="#43">43: </a><span class="php-comment">// Autoload par défaut pour l'application</span>
</span><span id="44" class="l"><a class="l" href="#44">44: </a><span class="php-keyword1">function</span> <a id="_autoloadAppliDefaut" href="#_autoloadAppliDefaut">autoloadAppliDefaut</a>(<span class="php-var">$nom_classe</span>) {
</span><span id="45" class="l"><a class="l" href="#45">45: </a> <span class="php-var">$dossiers_classes</span> = <span class="php-keyword1">array</span>( Config::get(<span class="php-quote">'chemin_controleurs'</span>),
</span><span id="46" class="l"><a class="l" href="#46">46: </a> Config::get(<span class="php-quote">'chemin_modeles'</span>),
</span><span id="47" class="l"><a class="l" href="#47">47: </a> Config::get(<span class="php-quote">'chemin_bibliotheque'</span>));
</span><span id="48" class="l"><a class="l" href="#48">48: </a>
</span><span id="49" class="l"><a class="l" href="#49">49: </a> <span class="php-keyword1">foreach</span> (<span class="php-var">$dossiers_classes</span> <span class="php-keyword1">as</span> <span class="php-var">$chemin</span>) {
</span><span id="50" class="l"><a class="l" href="#50">50: </a> <span class="php-var">$fichier_a_tester</span> = <span class="php-var">$chemin</span>.<span class="php-var">$nom_classe</span>.<span class="php-quote">'.php'</span>;
</span><span id="51" class="l"><a class="l" href="#51">51: </a> <span class="php-keyword1">if</span> (<span class="php-keyword2">file_exists</span>(<span class="php-var">$fichier_a_tester</span>)) {
</span><span id="52" class="l"><a class="l" href="#52">52: </a> <span class="php-keyword1">include_once</span> <span class="php-var">$fichier_a_tester</span>;
</span><span id="53" class="l"><a class="l" href="#53">53: </a> <span class="php-keyword1">return</span> <span class="php-keyword1">null</span>;
</span><span id="54" class="l"><a class="l" href="#54">54: </a> }
</span><span id="55" class="l"><a class="l" href="#55">55: </a> }
</span><span id="56" class="l"><a class="l" href="#56">56: </a>}
</span><span id="57" class="l"><a class="l" href="#57">57: </a><span class="php-keyword2">spl_autoload_register</span>(<span class="php-quote">'autoloadAppliDefaut'</span>);
</span><span id="58" class="l"><a class="l" href="#58">58: </a>
</span><span id="59" class="l"><a class="l" href="#59">59: </a><span class="php-comment">// Autoload défini par l'application</span>
</span><span id="60" class="l"><a class="l" href="#60">60: </a><span class="php-keyword1">if</span> (<span class="php-keyword2">function_exists</span>(<span class="php-quote">'__autoload'</span>)) {
</span><span id="61" class="l"><a class="l" href="#61">61: </a> <span class="php-keyword2">spl_autoload_register</span>(<span class="php-quote">'__autoload'</span>);
</span><span id="62" class="l"><a class="l" href="#62">62: </a>}
</span><span id="63" class="l"><a class="l" href="#63">63: </a></span><span class="xlang">?&gt;</span></code></pre>
</span></span><span id="7" class="l"><a class="l" href="#7"> 7: </a><span class="php-comment"> * @category PHP 5.2
</span></span><span id="8" class="l"><a class="l" href="#8"> 8: </a><span class="php-comment"> * @package Framework
</span></span><span id="9" class="l"><a class="l" href="#9"> 9: </a><span class="php-comment"> * @author Aurelien PERONNET &lt;aurelien@tela-botanica.org&gt;
</span></span><span id="10" class="l"><a class="l" href="#10">10: </a><span class="php-comment"> * @author Jean-Pascal MILCENT &lt;jpm@tela-botanica.org&gt;
</span></span><span id="11" class="l"><a class="l" href="#11">11: </a><span class="php-comment"> * @copyright Copyright (c) 2009, Tela Botanica (accueil@tela-botanica.org)
</span></span><span id="12" class="l"><a class="l" href="#12">12: </a><span class="php-comment"> * @license GPL v3 &lt;http://www.gnu.org/licenses/gpl.txt&gt;
</span></span><span id="13" class="l"><a class="l" href="#13">13: </a><span class="php-comment"> * @license CECILL v2 &lt;http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt&gt;
</span></span><span id="14" class="l"><a class="l" href="#14">14: </a><span class="php-comment"> */</span>
</span><span id="15" class="l"><a class="l" href="#15">15: </a>
</span><span id="16" class="l"><a class="l" href="#16">16: </a><span class="php-comment">// Redéfinition de la constante DIRECTORY_SEPARATOR</span>
</span><span id="17" class="l"><a class="l" href="#17">17: </a><span class="php-keyword1">if</span> (!<span class="php-keyword2">defined</span>(<span class="php-quote">'DS'</span>)) {
</span><span id="18" class="l"><a class="l" href="#18">18: </a> <span class="php-keyword2">define</span>(<span class="php-quote">'DS'</span>, DIRECTORY_SEPARATOR);
</span><span id="19" class="l"><a class="l" href="#19">19: </a>}
</span><span id="20" class="l"><a class="l" href="#20">20: </a><span class="php-comment">// Redéfinition de la constante PATH_SEPARATOR</span>
</span><span id="21" class="l"><a class="l" href="#21">21: </a><span class="php-keyword1">if</span> (!<span class="php-keyword2">defined</span>(<span class="php-quote">'PS'</span>)) {
</span><span id="22" class="l"><a class="l" href="#22">22: </a> <span class="php-keyword2">define</span>(<span class="php-quote">'PS'</span>, PATH_SEPARATOR);
</span><span id="23" class="l"><a class="l" href="#23">23: </a>}
</span><span id="24" class="l"><a class="l" href="#24">24: </a>
</span><span id="25" class="l"><a class="l" href="#25">25: </a><span class="php-comment">// Autoload pour le Framework</span>
</span><span id="26" class="l"><a class="l" href="#26">26: </a><span class="php-keyword1">function</span> <a id="_autoloadFw" href="#_autoloadFw">autoloadFw</a>(<span class="php-var">$nom_classe_fw</span>) {
</span><span id="27" class="l"><a class="l" href="#27">27: </a> <span class="php-var">$fichier_a_inclure</span> = <span class="php-keyword2">dirname</span>(__FILE__).DS.<span class="php-var">$nom_classe_fw</span>.<span class="php-quote">'.php'</span>;
</span><span id="28" class="l"><a class="l" href="#28">28: </a> <span class="php-keyword1">if</span> (<span class="php-keyword2">file_exists</span>(<span class="php-var">$fichier_a_inclure</span>)) {
</span><span id="29" class="l"><a class="l" href="#29">29: </a> <span class="php-keyword1">include_once</span> <span class="php-var">$fichier_a_inclure</span>;
</span><span id="30" class="l"><a class="l" href="#30">30: </a> <span class="php-keyword1">return</span> <span class="php-keyword1">null</span>;
</span><span id="31" class="l"><a class="l" href="#31">31: </a> }
</span><span id="32" class="l"><a class="l" href="#32">32: </a>}
</span><span id="33" class="l"><a class="l" href="#33">33: </a><span class="php-keyword2">spl_autoload_register</span>(<span class="php-quote">'autoloadFw'</span>);
</span><span id="34" class="l"><a class="l" href="#34">34: </a>
</span><span id="35" class="l"><a class="l" href="#35">35: </a><span class="php-comment">// Initialisation du gestionnaire d'erreur avant toute chose</span>
</span><span id="36" class="l"><a class="l" href="#36">36: </a>GestionnaireException::initialiser();
</span><span id="37" class="l"><a class="l" href="#37">37: </a>
</span><span id="38" class="l"><a class="l" href="#38">38: </a><span class="php-comment">// Autoload par défaut pour l'application</span>
</span><span id="39" class="l"><a class="l" href="#39">39: </a><span class="php-keyword1">function</span> <a id="_autoloadAppliDefaut" href="#_autoloadAppliDefaut">autoloadAppliDefaut</a>(<span class="php-var">$nom_classe</span>) {
</span><span id="40" class="l"><a class="l" href="#40">40: </a> <span class="php-var">$dossiers_classes</span> = <span class="php-keyword1">array</span>( Config::get(<span class="php-quote">'chemin_controleurs'</span>),
</span><span id="41" class="l"><a class="l" href="#41">41: </a> Config::get(<span class="php-quote">'chemin_modeles'</span>),
</span><span id="42" class="l"><a class="l" href="#42">42: </a> Config::get(<span class="php-quote">'chemin_bibliotheque'</span>));
</span><span id="43" class="l"><a class="l" href="#43">43: </a>
</span><span id="44" class="l"><a class="l" href="#44">44: </a> <span class="php-keyword1">foreach</span> (<span class="php-var">$dossiers_classes</span> <span class="php-keyword1">as</span> <span class="php-var">$chemin</span>) {
</span><span id="45" class="l"><a class="l" href="#45">45: </a> <span class="php-var">$fichier_a_tester</span> = <span class="php-var">$chemin</span>.<span class="php-var">$nom_classe</span>.<span class="php-quote">'.php'</span>;
</span><span id="46" class="l"><a class="l" href="#46">46: </a> <span class="php-keyword1">if</span> (<span class="php-keyword2">file_exists</span>(<span class="php-var">$fichier_a_tester</span>)) {
</span><span id="47" class="l"><a class="l" href="#47">47: </a> <span class="php-keyword1">include_once</span> <span class="php-var">$fichier_a_tester</span>;
</span><span id="48" class="l"><a class="l" href="#48">48: </a> <span class="php-keyword1">return</span> <span class="php-keyword1">null</span>;
</span><span id="49" class="l"><a class="l" href="#49">49: </a> }
</span><span id="50" class="l"><a class="l" href="#50">50: </a> }
</span><span id="51" class="l"><a class="l" href="#51">51: </a>}
</span><span id="52" class="l"><a class="l" href="#52">52: </a><span class="php-keyword2">spl_autoload_register</span>(<span class="php-quote">'autoloadAppliDefaut'</span>);
</span><span id="53" class="l"><a class="l" href="#53">53: </a>
</span><span id="54" class="l"><a class="l" href="#54">54: </a><span class="php-comment">// Autoload défini par l'application</span>
</span><span id="55" class="l"><a class="l" href="#55">55: </a><span class="php-keyword1">if</span> (<span class="php-keyword2">function_exists</span>(<span class="php-quote">'__autoload'</span>)) {
</span><span id="56" class="l"><a class="l" href="#56">56: </a> <span class="php-keyword2">spl_autoload_register</span>(<span class="php-quote">'__autoload'</span>);
</span><span id="57" class="l"><a class="l" href="#57">57: </a>}
</span><span id="58" class="l"><a class="l" href="#58">58: </a></span><span class="xlang">?&gt;</span></code></pre>
 
<div id="footer">
TBFramework - v0.2 API documentation generated by <a href="http://apigen.org">ApiGen 2.8.0</a>
/branches/v0.2-buhl/doc/ApiGen/class-Config.html
7,7 → 7,7
<title>Class Config | TBFramework - v0.2</title>
 
<script type="text/javascript" src="resources/combined.js?4205936287"></script>
<script type="text/javascript" src="elementlist.js?117657638"></script>
<script type="text/javascript" src="elementlist.js?1835392179"></script>
<link rel="stylesheet" type="text/css" media="all" href="resources/style.css?3505392360">
 
</head>
40,6 → 40,7
<li><a href="class-Controleur.html">Controleur</a></li>
<li><a href="class-Debug.html">Debug</a></li>
<li><a href="class-GestionnaireException.html">GestionnaireException</a></li>
<li><a href="class-I18n.html">I18n</a></li>
<li><a href="class-Log.html">Log</a></li>
<li><a href="class-Modele.html">Modele</a></li>
<li><a href="class-Registre.html">Registre</a></li>
107,8 → 108,6
l'application. Elle offre l'accès en lecture seule aux paramètres de config.
C'est une Singleton.</p>
 
<p>PHP Version 5</p>
 
</div>
 
 
126,19 → 125,18
<b>Package:</b> <a href="package-Framework.html">Framework</a><br>
 
<b>Category:</b>
PHP<br>
PHP 5.2<br>
<b>Copyright:</b>
2009 Tela-Botanica<br>
Copyright (c) 2009, Tela Botanica (<a
href="mailto:accueil&#64;tela-botanica.org">accueil&#64;<!-- -->tela-botanica.org</a>)<br>
<b>License:</b>
<a href="GPL-v3">et CECILL-v2</a><br>
<a href="GNU-GPL-v3">&lt;http://www.gnu.org/licenses/gpl.html&gt;</a><br>
<b>License:</b>
<a href="CECILL-v2">&lt;http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt&gt;</a><br>
<b>Author:</b>
Jean-Pascal MILCENT &lt;<a
href="mailto:jpm&#64;tela-botanica.org">jpm&#64;<!-- -->tela-botanica.org</a>&gt;<br>
<b>Version:</b>
SVN: &lt;svn_id&gt;<br>
<b>Link:</b>
/doc/framework/<br>
<b>Located at</b> <a href="source-class-Config.html#4-264" title="Go to source code">Config.php</a><br>
<b>Located at</b> <a href="source-class-Config.html#4-261" title="Go to source code">Config.php</a><br>
</div>
 
 
145,6 → 143,48
 
<table class="summary" id="methods">
<caption>Methods summary</caption>
<tr data-order="parserFichierIni" id="_parserFichierIni">
 
<td class="attributes"><code>
public static
array
</code>
</td>
 
<td class="name"><div>
<a class="anchor" href="#_parserFichierIni">#</a>
<code><a href="source-class-Config.html#88-102" title="Go to source code">parserFichierIni</a>( <span>string <var>$fichier_ini</var></span> )</code>
 
<div class="description short">
<p>Parse le fichier ini donné en paramètre</p>
 
</div>
 
<div class="description detailed hidden">
<p>Parse le fichier ini donné en paramètre</p>
 
 
 
<h4>Parameters</h4>
<div class="list"><dl>
<dt><var>$fichier_ini</var></dt>
<dd><code>string</code><br>$fichier_ini nom du fichier ini à parser</dd>
</dl></div>
 
<h4>Returns</h4>
<div class="list">
<code>array</code><br>tableau contenant les paramètres du fichier ini<br>
</div>
 
 
 
 
</div>
</div></td>
</tr>
<tr data-order="charger" id="_charger">
 
<td class="attributes"><code>
156,7 → 196,7
 
<td class="name"><div>
<a class="anchor" href="#_charger">#</a>
<code><a href="source-class-Config.html#235-243" title="Go to source code">charger</a>( <span>string <var>$fichier_ini</var></span> )</code>
<code><a href="source-class-Config.html#232-240" title="Go to source code">charger</a>( <span>string <var>$fichier_ini</var></span> )</code>
 
<div class="description short">
198,7 → 238,7
 
<td class="name"><div>
<a class="anchor" href="#_get">#</a>
<code><a href="source-class-Config.html#245-253" title="Go to source code">get</a>( <span>string <var>$param</var> = <span class="php-keyword1">null</span></span> )</code>
<code><a href="source-class-Config.html#242-250" title="Go to source code">get</a>( <span>string <var>$param</var> = <span class="php-keyword1">null</span></span> )</code>
 
<div class="description short">
240,7 → 280,7
 
<td class="name"><div>
<a class="anchor" href="#_existe">#</a>
<code><a href="source-class-Config.html#255-263" title="Go to source code">existe</a>( <span>string <var>$param</var></span> )</code>
<code><a href="source-class-Config.html#252-260" title="Go to source code">existe</a>( <span>string <var>$param</var></span> )</code>
 
<div class="description short">
/branches/v0.2-buhl/doc/ApiGen/class-GestionnaireException.html
7,7 → 7,7
<title>Class GestionnaireException | TBFramework - v0.2</title>
 
<script type="text/javascript" src="resources/combined.js?4205936287"></script>
<script type="text/javascript" src="elementlist.js?117657638"></script>
<script type="text/javascript" src="elementlist.js?1835392179"></script>
<link rel="stylesheet" type="text/css" media="all" href="resources/style.css?3505392360">
 
</head>
40,6 → 40,7
<li><a href="class-Controleur.html">Controleur</a></li>
<li><a href="class-Debug.html">Debug</a></li>
<li class="active"><a href="class-GestionnaireException.html">GestionnaireException</a></li>
<li><a href="class-I18n.html">I18n</a></li>
<li><a href="class-Log.html">Log</a></li>
<li><a href="class-Modele.html">Modele</a></li>
<li><a href="class-Registre.html">Registre</a></li>
127,9 → 128,9
Copyright (c) 2009, Tela Botanica (<a
href="mailto:accueil&#64;tela-botanica.org">accueil&#64;<!-- -->tela-botanica.org</a>)<br>
<b>License:</b>
<a href="http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt">Licence CECILL</a><br>
<a href="GNU-GPL-v3">&lt;http://www.gnu.org/licenses/gpl.html&gt;</a><br>
<b>License:</b>
<a href="http://www.gnu.org/licenses/gpl.html">Licence GNU-GPL</a><br>
<a href="CECILL-v2">&lt;http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt&gt;</a><br>
<b>Author:</b>
Aurélien PERONNET &lt;<a
href="mailto:aurelien&#64;tela-botanica.org">aurelien&#64;<!-- -->tela-botanica.org</a>&gt;<br>
136,11 → 137,7
<b>Author:</b>
Jean-Pascal MILCENT &lt;<a
href="mailto:jmp&#64;tela-botanica.org">jmp&#64;<!-- -->tela-botanica.org</a>&gt;<br>
<b>Version:</b>
$Id: GestionnaireException.php 342 2011-06-06 13:58:53Z jpm $$<br>
<b>Link:</b>
/doc/framework/<br>
<b>Located at</b> <a href="source-class-GestionnaireException.html#3-227" title="Go to source code">GestionnaireException.php</a><br>
<b>Located at</b> <a href="source-class-GestionnaireException.html#3-156" title="Go to source code">GestionnaireException.php</a><br>
</div>
 
 
158,7 → 155,7
 
<td class="name"><div>
<a class="anchor" href="#_initialiser">#</a>
<code><a href="source-class-GestionnaireException.html#37-47" title="Go to source code">initialiser</a>( )</code>
<code><a href="source-class-GestionnaireException.html#34-44" title="Go to source code">initialiser</a>( )</code>
 
<div class="description short">
193,7 → 190,7
 
<td class="name"><div>
<a class="anchor" href="#_configurer">#</a>
<code><a href="source-class-GestionnaireException.html#49-54" title="Go to source code">configurer</a>( )</code>
<code><a href="source-class-GestionnaireException.html#46-51" title="Go to source code">configurer</a>( )</code>
 
<div class="description short">
217,63 → 214,18
</div>
</div></td>
</tr>
<tr data-order="getExceptionsNbre" id="_getExceptionsNbre">
<tr data-order="getContexte" id="_getContexte">
 
<td class="attributes"><code>
public static
integer
</code>
</td>
 
<td class="name"><div>
<a class="anchor" href="#_getExceptionsNbre">#</a>
<code><a href="source-class-GestionnaireException.html#56-64" title="Go to source code">getExceptionsNbre</a>( )</code>
 
<div class="description short">
<p>Renvoie le nombre d'exceptions et d'erreurs levées.</p>
 
</div>
 
<div class="description detailed hidden">
<p>Renvoie le nombre d'exceptions et d'erreurs levées.</p>
 
 
 
 
<h4>Returns</h4>
<div class="list">
<code>integer</code><br>le nombre d'exception actuellement levées<br>
</div>
 
 
<h4>Since</h4>
<div class="list">
0.3<br>
</div>
<h4>See</h4>
<div class="list">
getExceptions() pour obtenir les exceptions formatées.<br>
</div>
 
 
</div>
</div></td>
</tr>
<tr data-order="getContexte" id="_getContexte">
 
<td class="attributes"><code>
public static
boolean
</code>
</td>
 
<td class="name"><div>
<a class="anchor" href="#_getContexte">#</a>
<code><a href="source-class-GestionnaireException.html#66-72" title="Go to source code">getContexte</a>( )</code>
<code><a href="source-class-GestionnaireException.html#53-56" title="Go to source code">getContexte</a>( )</code>
 
<div class="description short">
288,10 → 240,6
 
 
 
<h4>Returns</h4>
<div class="list">
<code>boolean</code><br>true si on affiche le contexte sinon false.<br>
</div>
 
 
 
310,7 → 258,7
 
<td class="name"><div>
<a class="anchor" href="#_setContexte">#</a>
<code><a href="source-class-GestionnaireException.html#74-80" title="Go to source code">setContexte</a>( <span>boolean <var>$contexte</var></span> )</code>
<code><a href="source-class-GestionnaireException.html#58-64" title="Go to source code">setContexte</a>( <span>boolean <var>$contexte</var></span> )</code>
 
<div class="description short">
348,21 → 296,17
 
<td class="name"><div>
<a class="anchor" href="#_gererException">#</a>
<code><a href="source-class-GestionnaireException.html#82-93" title="Go to source code">gererException</a>( <span><code><a href="class-Exception.html">Exception</a></code> <var>$e</var></span> )</code>
<code><a href="source-class-GestionnaireException.html#66-75" title="Go to source code">gererException</a>( <span><code><a href="class-Exception.html">Exception</a></code> <var>$e</var></span> )</code>
 
<div class="description short">
<p>Fonction de gestion des exceptions, remplace le handler par défaut. Si une
boucle génère de multiple exception (ou erreur) identique une seule sera
stockée.</p>
<p>Fonction de gestion des exceptions, remplace le handler par défaut</p>
 
</div>
 
<div class="description detailed hidden">
<p>Fonction de gestion des exceptions, remplace le handler par défaut. Si une
boucle génère de multiple exception (ou erreur) identique une seule sera
stockée.</p>
<p>Fonction de gestion des exceptions, remplace le handler par défaut</p>
 
 
 
390,7 → 334,7
 
<td class="name"><div>
<a class="anchor" href="#_gererErreur">#</a>
<code><a href="source-class-GestionnaireException.html#95-110" title="Go to source code">gererErreur</a>( <span>integer <var>$niveau</var></span>, <span>string <var>$message</var></span>, <span>string <var>$fichier</var></span>, <span>integer <var>$ligne</var></span>, <span>string <var>$contexte</var></span> )</code>
<code><a href="source-class-GestionnaireException.html#77-95" title="Go to source code">gererErreur</a>( <span>integer <var>$niveau</var></span>, <span>string <var>$message</var></span>, <span>string <var>$fichier</var></span>, <span>integer <var>$ligne</var></span>, <span>string <var>$contexte</var></span> )</code>
 
<div class="description short">
431,19 → 375,19
 
<td class="attributes"><code>
public static
string
</code>
</td>
 
<td class="name"><div>
<a class="anchor" href="#_getExceptions">#</a>
<code><a href="source-class-GestionnaireException.html#112-121" title="Go to source code">getExceptions</a>( )</code>
<code><a href="source-class-GestionnaireException.html#97-129" title="Go to source code">getExceptions</a>( )</code>
 
<div class="description short">
<p>Renvoie les exceptions au format (X)HTML ou bien au format texte suivant le
mode d'utilisation de PHP.</p>
mode d'utilisation de PHP</p>
 
</div>
 
450,211 → 394,18
<div class="description detailed hidden">
<p>Renvoie les exceptions au format (X)HTML ou bien au format texte suivant le
mode d'utilisation de PHP.</p>
mode d'utilisation de PHP</p>
 
 
<h4>Deprecated</h4>
<div class="list">
</div>
 
 
<h4>Returns</h4>
<div class="list">
<code>string</code><br>les exceptions formatées en texte ou (X)HTML.<br>
</div>
 
 
<h4>Since</h4>
<div class="list">
0.3<br>
</div>
<h4>See</h4>
<div class="list">
<code><code><a href="class-GestionnaireException.html#_getExceptionsFormatees">GestionnaireException::getExceptionsFormatees()</a></code></code><br>
</div>
 
 
</div>
</div></td>
</tr>
<tr data-order="getExceptionsFormatees" id="_getExceptionsFormatees">
 
<td class="attributes"><code>
public static
string
</code>
</td>
 
<td class="name"><div>
<a class="anchor" href="#_getExceptionsFormatees">#</a>
<code><a href="source-class-GestionnaireException.html#123-144" title="Go to source code">getExceptionsFormatees</a>( )</code>
 
<div class="description short">
<p>Renvoie les exceptions au format (X)HTML ou bien au format texte suivant le
mode d'utilisation de PHP.</p>
 
</div>
 
<div class="description detailed hidden">
<p>Renvoie les exceptions au format (X)HTML ou bien au format texte suivant le
mode d'utilisation de PHP.</p>
 
 
 
 
<h4>Returns</h4>
<div class="list">
<code>string</code><br>les exceptions formatées en texte ou (X)HTML.<br>
</div>
 
 
<h4>Since</h4>
<div class="list">
0.3<br>
</div>
 
 
</div>
</div></td>
</tr>
<tr data-order="getExceptionsTriees" id="_getExceptionsTriees">
 
<td class="attributes"><code>
public static
array
</code>
</td>
 
<td class="name"><div>
<a class="anchor" href="#_getExceptionsTriees">#</a>
<code><a href="source-class-GestionnaireException.html#146-166" title="Go to source code">getExceptionsTriees</a>( )</code>
 
<div class="description short">
<p>Renvoie le tableau d'objets Exception générées par le script PHP triées
du niveau de sévérité le plus élevé au moins élevé. Format du tableau :
array{sévérité_1 = array{Exception1, Exception2, Exception3,...},
sévérité_1 = array{Exception1, Exception2, ...}, ...}; ATTENTION : si vous
utilisez cette méthode, c'est à vous de gérer l'affichage des Exceptions. Le
gestionnaire d'exception n'enverra plus rien au navigateur ou à la console.</p>
 
</div>
 
<div class="description detailed hidden">
<p>Renvoie le tableau d'objets Exception générées par le script PHP triées
du niveau de sévérité le plus élevé au moins élevé. Format du tableau :
array{sévérité_1 = array{Exception1, Exception2, Exception3,...},
sévérité_1 = array{Exception1, Exception2, ...}, ...}; ATTENTION : si vous
utilisez cette méthode, c'est à vous de gérer l'affichage des Exceptions. Le
gestionnaire d'exception n'enverra plus rien au navigateur ou à la console.</p>
 
 
 
 
<h4>Returns</h4>
<div class="list">
<code>array</code><br>le tableau trié d'objet Exception.<br>
</div>
 
 
<h4>Since</h4>
<div class="list">
0.3<br>
</div>
 
 
</div>
</div></td>
</tr>
<tr data-order="formaterExceptionTxt" id="_formaterExceptionTxt">
 
<td class="attributes"><code>
public static
</code>
</td>
 
<td class="name"><div>
<a class="anchor" href="#_formaterExceptionTxt">#</a>
<code><a href="source-class-GestionnaireException.html#179-194" title="Go to source code">formaterExceptionTxt</a>( <span><code><a href="class-Exception.html">Exception</a></code> <var>$e</var></span> )</code>
 
<div class="description short">
<p>Formate en texte une exception passée en paramètre.</p>
 
</div>
 
<div class="description detailed hidden">
<p>Formate en texte une exception passée en paramètre.</p>
 
 
 
<h4>Parameters</h4>
<div class="list"><dl>
<dt><var>$e</var></dt>
<dd><code><code><a href="class-Exception.html">Exception</a></code></code><br>l'exception à formater.</dd>
</dl></div>
 
 
 
<h4>Since</h4>
<div class="list">
0.3<br>
</div>
 
 
</div>
</div></td>
</tr>
<tr data-order="formaterExceptionXhtml" id="_formaterExceptionXhtml">
 
<td class="attributes"><code>
public static
</code>
</td>
 
<td class="name"><div>
<a class="anchor" href="#_formaterExceptionXhtml">#</a>
<code><a href="source-class-GestionnaireException.html#196-214" title="Go to source code">formaterExceptionXhtml</a>( <span><code><a href="class-Exception.html">Exception</a></code> <var>$e</var></span> )</code>
 
<div class="description short">
<p>Formate en (X)HTML une exception passée en paramètre.</p>
 
</div>
 
<div class="description detailed hidden">
<p>Formate en (X)HTML une exception passée en paramètre.</p>
 
 
 
<h4>Parameters</h4>
<div class="list"><dl>
<dt><var>$e</var></dt>
<dd><code><code><a href="class-Exception.html">Exception</a></code></code><br>l'exception à formater.</dd>
</dl></div>
 
 
 
<h4>Since</h4>
<div class="list">
0.3<br>
</div>
 
 
</div>
</div></td>
</tr>
<tr data-order="__destruct" id="___destruct">
 
<td class="attributes"><code>
666,19 → 417,14
 
<td class="name"><div>
<a class="anchor" href="#___destruct">#</a>
<code><a href="source-class-GestionnaireException.html#216-225" title="Go to source code">__destruct</a>( )</code>
<code><a href="source-class-GestionnaireException.html#149-154" title="Go to source code">__destruct</a>( )</code>
 
<div class="description short">
<p>Lors de la destruction de la classe si des exceptions n'ont pas été
affichées, et si le débogage est à true, elles sont affichées.</p>
 
</div>
 
<div class="description detailed hidden">
<p>Lors de la destruction de la classe si des exceptions n'ont pas été
affichées, et si le débogage est à true, elles sont affichées.</p>
 
 
 
686,7 → 432,6
 
 
 
 
</div>
</div></td>
</tr>
705,7 → 450,7
 
<td class="attributes"><code>string</code></td>
<td class="name"><code>
<a href="source-class-GestionnaireException.html#20" title="Go to source code"><b>MODE_CLI</b></a>
<a href="source-class-GestionnaireException.html#17" title="Go to source code"><b>MODE_CLI</b></a>
</code></td>
<td class="value"><code><span class="php-quote">'cli'</span></code></td>
<td class="description"><div>
/branches/v0.2-buhl/doc/ApiGen/function-autoloadAppliDefaut.html
7,7 → 7,7
<title>Function autoloadAppliDefaut | TBFramework - v0.2</title>
 
<script type="text/javascript" src="resources/combined.js?4205936287"></script>
<script type="text/javascript" src="elementlist.js?117657638"></script>
<script type="text/javascript" src="elementlist.js?1835392179"></script>
<link rel="stylesheet" type="text/css" media="all" href="resources/style.css?3505392360">
 
</head>
40,6 → 40,7
<li><a href="class-Controleur.html">Controleur</a></li>
<li><a href="class-Debug.html">Debug</a></li>
<li><a href="class-GestionnaireException.html">GestionnaireException</a></li>
<li><a href="class-I18n.html">I18n</a></li>
<li><a href="class-Log.html">Log</a></li>
<li><a href="class-Modele.html">Modele</a></li>
<li><a href="class-Registre.html">Registre</a></li>
106,7 → 107,7
<b>Package:</b> <a href="package-Framework.html">Framework</a><br>
<b>Copyright:</b>
1999-2009 Tela Botanica (<a
Copyright (c) 2009, Tela Botanica (<a
href="mailto:accueil&#64;tela-botanica.org">accueil&#64;<!-- -->tela-botanica.org</a>)<br>
<b>License:</b>
<a href="GPL">v3 &lt;http://www.gnu.org/licenses/gpl.txt&gt;</a><br>
114,12 → 115,11
<a href="CECILL">v2 &lt;http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt&gt;</a><br>
<b>Author:</b>
Aurelien PERONNET &lt;<a
href="mailto:aurelien&#64;tela-botanica.org">aurelien&#64;<!-- -->tela-botanica.org</a>&gt;
// Autres auteurs :<br>
href="mailto:aurelien&#64;tela-botanica.org">aurelien&#64;<!-- -->tela-botanica.org</a>&gt;<br>
<b>Author:</b>
Jean-Pascal MILCENT &lt;<a
href="mailto:jpm&#64;tela-botanica.org">jpm&#64;<!-- -->tela-botanica.org</a>&gt;<br>
<b>Located at</b> <a href="source-function-autoloadAppliDefaut.html#44-56" title="Go to source code">autoload.inc.php</a><br>
<b>Located at</b> <a href="source-function-autoloadAppliDefaut.html#39-51" title="Go to source code">autoload.inc.php</a><br>
</div>
 
 
/branches/v0.2-buhl/doc/ApiGen/class-PDOStatement.html
7,7 → 7,7
<title>Class PDOStatement | TBFramework - v0.2</title>
 
<script type="text/javascript" src="resources/combined.js?4205936287"></script>
<script type="text/javascript" src="elementlist.js?117657638"></script>
<script type="text/javascript" src="elementlist.js?1835392179"></script>
<link rel="stylesheet" type="text/css" media="all" href="resources/style.css?3505392360">
 
</head>
/branches/v0.2-buhl/doc/ApiGen/class-Traversable.html
7,7 → 7,7
<title>Interface Traversable | TBFramework - v0.2</title>
 
<script type="text/javascript" src="resources/combined.js?4205936287"></script>
<script type="text/javascript" src="elementlist.js?117657638"></script>
<script type="text/javascript" src="elementlist.js?1835392179"></script>
<link rel="stylesheet" type="text/css" media="all" href="resources/style.css?3505392360">
 
</head>
/branches/v0.2-buhl/doc/ApiGen/source-class-Log.html
8,7 → 8,7
<title>File Log.php | TBFramework - v0.2</title>
 
<script type="text/javascript" src="resources/combined.js?4205936287"></script>
<script type="text/javascript" src="elementlist.js?117657638"></script>
<script type="text/javascript" src="elementlist.js?1835392179"></script>
<link rel="stylesheet" type="text/css" media="all" href="resources/style.css?3505392360">
 
</head>
41,6 → 41,7
<li><a href="class-Controleur.html">Controleur</a></li>
<li><a href="class-Debug.html">Debug</a></li>
<li><a href="class-GestionnaireException.html">GestionnaireException</a></li>
<li><a href="class-I18n.html">I18n</a></li>
<li class="active"><a href="class-Log.html">Log</a></li>
<li><a href="class-Modele.html">Modele</a></li>
<li><a href="class-Registre.html">Registre</a></li>
106,177 → 107,176
</span></span><span id="5" class="l"><a class="l" href="#5"> 5: </a><span class="php-comment"> *
</span></span><span id="6" class="l"><a class="l" href="#6"> 6: </a><span class="php-comment"> * @category PHP 5.2
</span></span><span id="7" class="l"><a class="l" href="#7"> 7: </a><span class="php-comment"> * @package Framework
</span></span><span id="8" class="l"><a class="l" href="#8"> 8: </a><span class="php-comment"> * @author aurelien &lt;aurelien@tela-botanica.org&gt;
</span></span><span id="9" class="l"><a class="l" href="#9"> 9: </a><span class="php-comment"> * @copyright 2009 Tela-Botanica
</span></span><span id="10" class="l"><a class="l" href="#10"> 10: </a><span class="php-comment"> * @license http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
</span></span><span id="11" class="l"><a class="l" href="#11"> 11: </a><span class="php-comment"> * @version SVN: $Id: Log.php 255 2010-12-23 10:37:30Z jpm $
</span></span><span id="12" class="l"><a class="l" href="#12"> 12: </a><span class="php-comment"> * @link /doc/framework/
</span></span><span id="13" class="l"><a class="l" href="#13"> 13: </a><span class="php-comment"> */</span>
</span><span id="14" class="l"><a class="l" href="#14"> 14: </a>
</span><span id="15" class="l"><a class="l" href="#15"> 15: </a><span class="php-keyword1">class</span> <span class="php-keyword2">Log</span> {
</span><span id="16" class="l"><a class="l" href="#16"> 16: </a>
</span><span id="17" class="l"><a class="l" href="#17"> 17: </a> <span class="php-comment">/**
</span></span><span id="18" class="l"><a class="l" href="#18"> 18: </a><span class="php-comment"> * Boolean indiquant si l'on doit utiliser les logs ou pas
</span></span><span id="19" class="l"><a class="l" href="#19"> 19: </a><span class="php-comment"> */</span>
</span><span id="20" class="l"><a class="l" href="#20"> 20: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-var"><a id="$logger" href="#$logger">$logger</a></span> = <span class="php-keyword1">false</span>;
</span><span id="21" class="l"><a class="l" href="#21"> 21: </a>
</span><span id="22" class="l"><a class="l" href="#22"> 22: </a> <span class="php-comment">/**
</span></span><span id="23" class="l"><a class="l" href="#23"> 23: </a><span class="php-comment"> * Tableau associatif stockant les descripteurs de fichiers
</span></span><span id="24" class="l"><a class="l" href="#24"> 24: </a><span class="php-comment"> */</span>
</span><span id="25" class="l"><a class="l" href="#25"> 25: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-var"><a id="$fichiersLog" href="#$fichiersLog">$fichiersLog</a></span> = <span class="php-keyword1">array</span>();
</span><span id="26" class="l"><a class="l" href="#26"> 26: </a>
</span><span id="27" class="l"><a class="l" href="#27"> 27: </a> <span class="php-comment">/**
</span></span><span id="28" class="l"><a class="l" href="#28"> 28: </a><span class="php-comment"> * Chemin de base du dossier log de l'application
</span></span><span id="29" class="l"><a class="l" href="#29"> 29: </a><span class="php-comment"> */</span>
</span><span id="30" class="l"><a class="l" href="#30"> 30: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-var"><a id="$cheminLogs" href="#$cheminLogs">$cheminLogs</a></span> = <span class="php-quote">''</span>;
</span><span id="31" class="l"><a class="l" href="#31"> 31: </a>
</span><span id="32" class="l"><a class="l" href="#32"> 32: </a> <span class="php-comment">/**
</span></span><span id="33" class="l"><a class="l" href="#33"> 33: </a><span class="php-comment"> * Booleen indiquant si l'on peut correctement écrire dans les fichiers de logs
</span></span><span id="34" class="l"><a class="l" href="#34"> 34: </a><span class="php-comment"> */</span>
</span><span id="35" class="l"><a class="l" href="#35"> 35: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-var"><a id="$droitLogger" href="#$droitLogger">$droitLogger</a></span> = <span class="php-keyword1">true</span>;
</span><span id="36" class="l"><a class="l" href="#36"> 36: </a>
</span><span id="37" class="l"><a class="l" href="#37"> 37: </a> <span class="php-comment">/**
</span></span><span id="38" class="l"><a class="l" href="#38"> 38: </a><span class="php-comment"> * Zone horaire (pour éviter des avertissements dans les dates)
</span></span><span id="39" class="l"><a class="l" href="#39"> 39: </a><span class="php-comment"> */</span>
</span><span id="40" class="l"><a class="l" href="#40"> 40: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-var"><a id="$timeZone" href="#$timeZone">$timeZone</a></span> = <span class="php-quote">'Europe/Paris'</span>;
</span><span id="41" class="l"><a class="l" href="#41"> 41: </a>
</span><span id="42" class="l"><a class="l" href="#42"> 42: </a> <span class="php-comment">/**
</span></span><span id="43" class="l"><a class="l" href="#43"> 43: </a><span class="php-comment"> * Taille maximum d'un fichier de log avant que celui ne soit archivé (en octets)
</span></span><span id="44" class="l"><a class="l" href="#44"> 44: </a><span class="php-comment"> */</span>
</span><span id="45" class="l"><a class="l" href="#45"> 45: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-var"><a id="$tailleMax" href="#$tailleMax">$tailleMax</a></span> = <span class="php-num">10000</span>;
</span><span id="46" class="l"><a class="l" href="#46"> 46: </a>
</span><span id="47" class="l"><a class="l" href="#47"> 47: </a> <span class="php-comment">/**
</span></span><span id="48" class="l"><a class="l" href="#48"> 48: </a><span class="php-comment"> * séparateur de dossier dans un chemin
</span></span><span id="49" class="l"><a class="l" href="#49"> 49: </a><span class="php-comment"> */</span>
</span><span id="50" class="l"><a class="l" href="#50"> 50: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-var"><a id="$sd" href="#$sd">$sd</a></span> = DIRECTORY_SEPARATOR;
</span><span id="51" class="l"><a class="l" href="#51"> 51: </a>
</span><span id="52" class="l"><a class="l" href="#52"> 52: </a> <span class="php-comment">/**
</span></span><span id="53" class="l"><a class="l" href="#53"> 53: </a><span class="php-comment"> * Extension des fichiers de log
</span></span><span id="54" class="l"><a class="l" href="#54"> 54: </a><span class="php-comment"> */</span>
</span><span id="55" class="l"><a class="l" href="#55"> 55: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-var"><a id="$ext" href="#$ext">$ext</a></span> = <span class="php-quote">'.log'</span>;
</span><span id="56" class="l"><a class="l" href="#56"> 56: </a>
</span><span id="57" class="l"><a class="l" href="#57"> 57: </a> <span class="php-comment">/**
</span></span><span id="58" class="l"><a class="l" href="#58"> 58: </a><span class="php-comment"> * Initialiser les logs par défaut, sans tenir comptes des paramêtres de config.
</span></span><span id="59" class="l"><a class="l" href="#59"> 59: </a><span class="php-comment"> */</span>
</span><span id="60" class="l"><a class="l" href="#60"> 60: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_initialiser" href="#_initialiser">initialiser</a>() {
</span><span id="61" class="l"><a class="l" href="#61"> 61: </a> <span class="php-comment">// gestion de la timezone pour éviter des erreurs</span>
</span><span id="62" class="l"><a class="l" href="#62"> 62: </a> <span class="php-keyword1">if</span> (<span class="php-keyword2">function_exists</span>(<span class="php-quote">'date_default_timezone_set'</span>) &amp;&amp; <span class="php-keyword2">function_exists</span>(<span class="php-quote">'date_default_timezone_get'</span>)) {
</span><span id="63" class="l"><a class="l" href="#63"> 63: </a> <span class="php-keyword2">date_default_timezone_set</span>(self::<span class="php-var">$timeZone</span>);
</span><span id="64" class="l"><a class="l" href="#64"> 64: </a> }
</span><span id="65" class="l"><a class="l" href="#65"> 65: </a>
</span><span id="66" class="l"><a class="l" href="#66"> 66: </a> <span class="php-keyword1">if</span> (self::<span class="php-var">$logger</span> &amp;&amp; (!<span class="php-keyword2">is_dir</span>(self::<span class="php-var">$cheminLogs</span>) || !<span class="php-keyword2">is_writable</span>(self::<span class="php-var">$cheminLogs</span>))) {
</span><span id="67" class="l"><a class="l" href="#67"> 67: </a> self::desactiverEcriture();
</span><span id="68" class="l"><a class="l" href="#68"> 68: </a> }
</span><span id="69" class="l"><a class="l" href="#69"> 69: </a> }
</span><span id="70" class="l"><a class="l" href="#70"> 70: </a>
</span><span id="71" class="l"><a class="l" href="#71"> 71: </a> <span class="php-comment">/**
</span></span><span id="72" class="l"><a class="l" href="#72"> 72: </a><span class="php-comment"> * Configure le Log à partir des paramêtres de config.
</span></span><span id="73" class="l"><a class="l" href="#73"> 73: </a><span class="php-comment"> */</span>
</span><span id="74" class="l"><a class="l" href="#74"> 74: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_configurer" href="#_configurer">configurer</a>() {
</span><span id="75" class="l"><a class="l" href="#75"> 75: </a> self::<span class="php-var">$sd</span> = Config::get(<span class="php-quote">'ds'</span>);
</span><span id="76" class="l"><a class="l" href="#76"> 76: </a> self::<span class="php-var">$cheminLogs</span> = Config::get(<span class="php-quote">'chemin_logs'</span>);
</span><span id="77" class="l"><a class="l" href="#77"> 77: </a> self::<span class="php-var">$timeZone</span> = (Config::get(<span class="php-quote">'fw_timezone'</span>) != <span class="php-quote">''</span>) ? Config::get(<span class="php-quote">'fw_timezone'</span>) : self::<span class="php-var">$timeZone</span>;
</span><span id="78" class="l"><a class="l" href="#78"> 78: </a> self::<span class="php-var">$tailleMax</span> = (Config::get(<span class="php-quote">'fw_taille_max_logs'</span>) != <span class="php-quote">''</span>) ? Config::get(<span class="php-quote">'fw_taille_max_logs'</span>) : self::<span class="php-var">$tailleMax</span>;
</span><span id="79" class="l"><a class="l" href="#79"> 79: </a> self::<span class="php-var">$logger</span> = (Config::get(<span class="php-quote">'fw_log_debogage'</span>) != <span class="php-quote">''</span>) ? Config::get(<span class="php-quote">'fw_log_debogage'</span>) : self::<span class="php-var">$logger</span>;
</span><span id="80" class="l"><a class="l" href="#80"> 80: </a> self::initialiser();
</span><span id="81" class="l"><a class="l" href="#81"> 81: </a> }
</span><span id="82" class="l"><a class="l" href="#82"> 82: </a>
</span><span id="83" class="l"><a class="l" href="#83"> 83: </a> <span class="php-comment">/**
</span></span><span id="84" class="l"><a class="l" href="#84"> 84: </a><span class="php-comment"> * Ajoute une entrée au log spécifié par le paramètre $nomFichier
</span></span><span id="85" class="l"><a class="l" href="#85"> 85: </a><span class="php-comment"> * @param string $nomFichier le nom du fichier dans lequel écrire
</span></span><span id="86" class="l"><a class="l" href="#86"> 86: </a><span class="php-comment"> */</span>
</span><span id="87" class="l"><a class="l" href="#87"> 87: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_ajouterEntree" href="#_ajouterEntree">ajouterEntree</a>(<span class="php-var">$nomFichier</span>, <span class="php-var">$entree</span>, <span class="php-var">$mode</span> = <span class="php-quote">'a+'</span>) {
</span><span id="88" class="l"><a class="l" href="#88"> 88: </a> <span class="php-keyword1">if</span> (self::<span class="php-var">$droitLogger</span>) {
</span><span id="89" class="l"><a class="l" href="#89"> 89: </a> <span class="php-var">$date</span> = <span class="php-quote">&quot;\n&quot;</span>.<span class="php-quote">&quot;\n&quot;</span>.<span class="php-keyword2">date</span>(<span class="php-quote">'d m Y H:i'</span>).<span class="php-quote">&quot;\n&quot;</span> ;
</span><span id="90" class="l"><a class="l" href="#90"> 90: </a>
</span><span id="91" class="l"><a class="l" href="#91"> 91: </a> <span class="php-comment">// si le fichier est déjà dans le tableau et qu'on peut y écrire</span>
</span><span id="92" class="l"><a class="l" href="#92"> 92: </a> <span class="php-keyword1">if</span>(self::verifierOuvrirFichier(<span class="php-var">$nomFichier</span>,<span class="php-var">$mode</span>)) {
</span><span id="93" class="l"><a class="l" href="#93"> 93: </a> <span class="php-comment">// on y écrit le message de log</span>
</span><span id="94" class="l"><a class="l" href="#94"> 94: </a> <span class="php-keyword2">fwrite</span>(self::<span class="php-var">$fichiersLog</span>[<span class="php-var">$nomFichier</span>],<span class="php-var">$date</span>.<span class="php-var">$entree</span>);
</span><span id="95" class="l"><a class="l" href="#95"> 95: </a> <span class="php-comment">// on vérifie si le fichier ne dépasse pas la taille maximale</span>
</span><span id="96" class="l"><a class="l" href="#96"> 96: </a> self::verifierTailleFichierOuArchiver(<span class="php-var">$nomFichier</span>);
</span><span id="97" class="l"><a class="l" href="#97"> 97: </a> } <span class="php-keyword1">else</span> {
</span><span id="98" class="l"><a class="l" href="#98"> 98: </a> <span class="php-comment">// sinon on interdit l'écriture</span>
</span><span id="99" class="l"><a class="l" href="#99"> 99: </a> self::desactiverEcriture(<span class="php-var">$nomFichier</span>);
</span><span id="100" class="l"><a class="l" href="#100">100: </a> }
</span><span id="101" class="l"><a class="l" href="#101">101: </a> }
</span><span id="102" class="l"><a class="l" href="#102">102: </a> }
</span><span id="103" class="l"><a class="l" href="#103">103: </a>
</span><span id="104" class="l"><a class="l" href="#104">104: </a> <span class="php-comment">/**
</span></span><span id="105" class="l"><a class="l" href="#105">105: </a><span class="php-comment"> * Vide un fichier log indiqué
</span></span><span id="106" class="l"><a class="l" href="#106">106: </a><span class="php-comment"> * @param string $nomFichier le nom du fichier à vider
</span></span><span id="107" class="l"><a class="l" href="#107">107: </a><span class="php-comment"> */</span>
</span><span id="108" class="l"><a class="l" href="#108">108: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_viderLog" href="#_viderLog">viderLog</a>(<span class="php-var">$nomFichier</span>) {
</span><span id="109" class="l"><a class="l" href="#109">109: </a> self::ajouterEntree(<span class="php-var">$nomFichier</span>, <span class="php-quote">''</span>, <span class="php-quote">'w'</span>);
</span><span id="110" class="l"><a class="l" href="#110">110: </a> }
</span><span id="111" class="l"><a class="l" href="#111">111: </a>
</span><span id="112" class="l"><a class="l" href="#112">112: </a> <span class="php-comment">/**
</span></span><span id="113" class="l"><a class="l" href="#113">113: </a><span class="php-comment"> * Vérifie la présence d'un fichier dans le tableau, ses droits d'écriture, l'ouvre si nécessaire.
</span></span><span id="114" class="l"><a class="l" href="#114">114: </a><span class="php-comment"> *
</span></span><span id="115" class="l"><a class="l" href="#115">115: </a><span class="php-comment"> * @param string $nomFichier le nom du fichier dont on doit vérifier la présence
</span></span><span id="116" class="l"><a class="l" href="#116">116: </a><span class="php-comment"> * @return boolean true si le fichier est ouvert ou maintenant accessible, false sinon
</span></span><span id="117" class="l"><a class="l" href="#117">117: </a><span class="php-comment"> */</span>
</span><span id="118" class="l"><a class="l" href="#118">118: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_verifierOuvrirFichier" href="#_verifierOuvrirFichier">verifierOuvrirFichier</a>(<span class="php-var">$nomFichier</span>,<span class="php-var">$mode</span>) {
</span><span id="119" class="l"><a class="l" href="#119">119: </a> <span class="php-comment">// le fichier est il déjà ouvert ?</span>
</span><span id="120" class="l"><a class="l" href="#120">120: </a> <span class="php-keyword1">if</span> (<span class="php-keyword2">in_array</span>(<span class="php-var">$nomFichier</span>, self::<span class="php-var">$fichiersLog</span>)) {
</span><span id="121" class="l"><a class="l" href="#121">121: </a> <span class="php-comment">// si oui peut on y écrire ?</span>
</span><span id="122" class="l"><a class="l" href="#122">122: </a> <span class="php-keyword1">if</span> (<span class="php-keyword2">is_writable</span>(self::<span class="php-var">$cheminLogs</span>.<span class="php-var">$nomFichier</span>.self::<span class="php-var">$ext</span>)) {
</span><span id="123" class="l"><a class="l" href="#123">123: </a> <span class="php-comment">// si oui on renvoie le descripteur</span>
</span><span id="124" class="l"><a class="l" href="#124">124: </a> <span class="php-keyword1">return</span> <span class="php-keyword1">true</span>;
</span><span id="125" class="l"><a class="l" href="#125">125: </a> }
</span><span id="126" class="l"><a class="l" href="#126">126: </a> <span class="php-keyword1">return</span> <span class="php-keyword1">false</span>;
</span><span id="127" class="l"><a class="l" href="#127">127: </a> } <span class="php-keyword1">else</span> {
</span><span id="128" class="l"><a class="l" href="#128">128: </a> <span class="php-comment">// sinon on l'ouvre</span>
</span><span id="129" class="l"><a class="l" href="#129">129: </a> <span class="php-var">$fp</span> = @<span class="php-keyword2">fopen</span>(self::<span class="php-var">$cheminLogs</span>.<span class="php-var">$nomFichier</span>.self::<span class="php-var">$ext</span>,<span class="php-var">$mode</span>);
</span><span id="130" class="l"><a class="l" href="#130">130: </a> <span class="php-comment">// si l'ouverture a réussi et si le fichier a les droits d'écriture</span>
</span><span id="131" class="l"><a class="l" href="#131">131: </a> <span class="php-keyword1">if</span> (<span class="php-var">$fp</span> &amp;&amp; <span class="php-keyword2">is_writable</span>(self::<span class="php-var">$cheminLogs</span>.<span class="php-var">$nomFichier</span>.self::<span class="php-var">$ext</span>)) {
</span><span id="132" class="l"><a class="l" href="#132">132: </a> <span class="php-comment">// si oui on renvoie le descripteur qu'on ajoute au tableau</span>
</span><span id="133" class="l"><a class="l" href="#133">133: </a> self::<span class="php-var">$fichiersLog</span>[<span class="php-var">$nomFichier</span>] = <span class="php-var">$fp</span>;
</span><span id="134" class="l"><a class="l" href="#134">134: </a> <span class="php-keyword1">return</span> <span class="php-keyword1">true</span>;
</span><span id="135" class="l"><a class="l" href="#135">135: </a> }
</span><span id="136" class="l"><a class="l" href="#136">136: </a> <span class="php-keyword1">return</span> <span class="php-keyword1">false</span>;
</span><span id="137" class="l"><a class="l" href="#137">137: </a> }
</span><span id="138" class="l"><a class="l" href="#138">138: </a> }
</span><span id="139" class="l"><a class="l" href="#139">139: </a>
</span><span id="140" class="l"><a class="l" href="#140">140: </a> <span class="php-comment">/**
</span></span><span id="141" class="l"><a class="l" href="#141">141: </a><span class="php-comment"> * Vérifie la taille d'un fichier donné et si celle ci est trop importante
</span></span><span id="142" class="l"><a class="l" href="#142">142: </a><span class="php-comment"> * archive le fichier de log
</span></span><span id="143" class="l"><a class="l" href="#143">143: </a><span class="php-comment"> * @param string $nomFichier nom du fichier à vérifier
</span></span><span id="144" class="l"><a class="l" href="#144">144: </a><span class="php-comment"> */</span>
</span><span id="145" class="l"><a class="l" href="#145">145: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_verifierTailleFichierOuArchiver" href="#_verifierTailleFichierOuArchiver">verifierTailleFichierOuArchiver</a>(<span class="php-var">$nomFichier</span>) {
</span><span id="146" class="l"><a class="l" href="#146">146: </a> <span class="php-keyword1">if</span>(<span class="php-keyword2">filesize</span>(self::<span class="php-var">$cheminLogs</span>.<span class="php-var">$nomFichier</span>.self::<span class="php-var">$ext</span>) &gt; self::<span class="php-var">$tailleMax</span>) {
</span><span id="147" class="l"><a class="l" href="#147">147: </a> <span class="php-keyword2">rename</span>(self::<span class="php-var">$cheminLogs</span>.<span class="php-var">$nomFichier</span>.self::<span class="php-var">$ext</span>,self::<span class="php-var">$cheminLogs</span>.<span class="php-var">$nomFichier</span>.<span class="php-keyword2">date</span>(<span class="php-quote">'d_m_Y_H:i'</span>).self::<span class="php-var">$ext</span>);
</span><span id="148" class="l"><a class="l" href="#148">148: </a> self::ajouterEntree(<span class="php-var">$nomFichier</span>,<span class="php-quote">''</span>);
</span><span id="149" class="l"><a class="l" href="#149">149: </a> }
</span><span id="150" class="l"><a class="l" href="#150">150: </a> }
</span><span id="151" class="l"><a class="l" href="#151">151: </a>
</span><span id="152" class="l"><a class="l" href="#152">152: </a> <span class="php-comment">/**
</span></span><span id="153" class="l"><a class="l" href="#153">153: </a><span class="php-comment"> * Désactive l'écriture du log et envoie un message au gestionnaire d'erreurs
</span></span><span id="154" class="l"><a class="l" href="#154">154: </a><span class="php-comment"> * @param string $nomFichier le nom du fichier qui a causé l'erreur
</span></span><span id="155" class="l"><a class="l" href="#155">155: </a><span class="php-comment"> */</span>
</span><span id="156" class="l"><a class="l" href="#156">156: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_desactiverEcriture" href="#_desactiverEcriture">desactiverEcriture</a>(<span class="php-var">$nomFichier</span> = <span class="php-quote">''</span>) {
</span><span id="157" class="l"><a class="l" href="#157">157: </a> self::<span class="php-var">$droitLogger</span> = <span class="php-keyword1">false</span>;
</span><span id="158" class="l"><a class="l" href="#158">158: </a> <span class="php-keyword1">if</span> (<span class="php-var">$nomFichier</span> != <span class="php-quote">''</span>) {
</span><span id="159" class="l"><a class="l" href="#159">159: </a> <span class="php-var">$fichierDossier</span> = <span class="php-quote">'fichier '</span>.<span class="php-var">$nomFichier</span> ;
</span><span id="160" class="l"><a class="l" href="#160">160: </a> } <span class="php-keyword1">else</span> {
</span><span id="161" class="l"><a class="l" href="#161">161: </a> <span class="php-var">$fichierDossier</span> = <span class="php-quote">'dossier des logs'</span>;
</span><span id="162" class="l"><a class="l" href="#162">162: </a> }
</span><span id="163" class="l"><a class="l" href="#163">163: </a> <span class="php-var">$message</span> = <span class="php-quote">'Écriture impossible dans le '</span>.<span class="php-var">$fichierDossier</span>.<span class="php-quote">', Assurez-vous des droits du dossier et des fichiers'</span>;
</span><span id="164" class="l"><a class="l" href="#164">164: </a> <span class="php-var">$e</span> = <span class="php-keyword1">new</span> ErrorException(<span class="php-var">$message</span>, <span class="php-num">0</span>, E_USER_WARNING, __FILE__, __LINE__);
</span><span id="165" class="l"><a class="l" href="#165">165: </a> GestionnaireException::gererException(<span class="php-var">$e</span>);
</span><span id="166" class="l"><a class="l" href="#166">166: </a> }
</span><span id="167" class="l"><a class="l" href="#167">167: </a>
</span><span id="168" class="l"><a class="l" href="#168">168: </a> <span class="php-comment">/**
</span></span><span id="169" class="l"><a class="l" href="#169">169: </a><span class="php-comment"> * destructeur de classe, ferme les descripteurs ouverts
</span></span><span id="170" class="l"><a class="l" href="#170">170: </a><span class="php-comment"> */</span>
</span><span id="171" class="l"><a class="l" href="#171">171: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="___destruct" href="#___destruct">__destruct</a>() {
</span><span id="172" class="l"><a class="l" href="#172">172: </a> <span class="php-keyword1">foreach</span>(self::<span class="php-var">$fichiersLog</span> <span class="php-keyword1">as</span> <span class="php-var">$nomFichier</span> =&gt; <span class="php-var">$fp</span>) {
</span><span id="173" class="l"><a class="l" href="#173">173: </a> <span class="php-keyword2">fclose</span>(<span class="php-var">$fp</span>);
</span><span id="174" class="l"><a class="l" href="#174">174: </a> }
</span><span id="175" class="l"><a class="l" href="#175">175: </a> }
</span><span id="176" class="l"><a class="l" href="#176">176: </a>}
</span><span id="177" class="l"><a class="l" href="#177">177: </a><span class="xlang">?&gt;</span>
</span><span id="178" class="l"><a class="l" href="#178">178: </a></span></code></pre>
</span></span><span id="8" class="l"><a class="l" href="#8"> 8: </a><span class="php-comment"> * @author Aurélien PERONNET &lt;aurelien@tela-botanica.org&gt;
</span></span><span id="9" class="l"><a class="l" href="#9"> 9: </a><span class="php-comment"> * @copyright Copyright (c) 2009, Tela Botanica (accueil@tela-botanica.org)
</span></span><span id="10" class="l"><a class="l" href="#10"> 10: </a><span class="php-comment"> * @license GNU-GPL-v3 &lt;http://www.gnu.org/licenses/gpl.html&gt;
</span></span><span id="11" class="l"><a class="l" href="#11"> 11: </a><span class="php-comment"> * @license CECILL-v2 &lt;http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt&gt;
</span></span><span id="12" class="l"><a class="l" href="#12"> 12: </a><span class="php-comment"> */</span>
</span><span id="13" class="l"><a class="l" href="#13"> 13: </a>
</span><span id="14" class="l"><a class="l" href="#14"> 14: </a><span class="php-keyword1">class</span> <span class="php-keyword2">Log</span> {
</span><span id="15" class="l"><a class="l" href="#15"> 15: </a>
</span><span id="16" class="l"><a class="l" href="#16"> 16: </a> <span class="php-comment">/**
</span></span><span id="17" class="l"><a class="l" href="#17"> 17: </a><span class="php-comment"> * Boolean indiquant si l'on doit utiliser les logs ou pas
</span></span><span id="18" class="l"><a class="l" href="#18"> 18: </a><span class="php-comment"> */</span>
</span><span id="19" class="l"><a class="l" href="#19"> 19: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-var"><a id="$logger" href="#$logger">$logger</a></span> = <span class="php-keyword1">false</span>;
</span><span id="20" class="l"><a class="l" href="#20"> 20: </a>
</span><span id="21" class="l"><a class="l" href="#21"> 21: </a> <span class="php-comment">/**
</span></span><span id="22" class="l"><a class="l" href="#22"> 22: </a><span class="php-comment"> * Tableau associatif stockant les descripteurs de fichiers
</span></span><span id="23" class="l"><a class="l" href="#23"> 23: </a><span class="php-comment"> */</span>
</span><span id="24" class="l"><a class="l" href="#24"> 24: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-var"><a id="$fichiersLog" href="#$fichiersLog">$fichiersLog</a></span> = <span class="php-keyword1">array</span>();
</span><span id="25" class="l"><a class="l" href="#25"> 25: </a>
</span><span id="26" class="l"><a class="l" href="#26"> 26: </a> <span class="php-comment">/**
</span></span><span id="27" class="l"><a class="l" href="#27"> 27: </a><span class="php-comment"> * Chemin de base du dossier log de l'application
</span></span><span id="28" class="l"><a class="l" href="#28"> 28: </a><span class="php-comment"> */</span>
</span><span id="29" class="l"><a class="l" href="#29"> 29: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-var"><a id="$cheminLogs" href="#$cheminLogs">$cheminLogs</a></span> = <span class="php-quote">''</span>;
</span><span id="30" class="l"><a class="l" href="#30"> 30: </a>
</span><span id="31" class="l"><a class="l" href="#31"> 31: </a> <span class="php-comment">/**
</span></span><span id="32" class="l"><a class="l" href="#32"> 32: </a><span class="php-comment"> * Booleen indiquant si l'on peut correctement écrire dans les fichiers de logs
</span></span><span id="33" class="l"><a class="l" href="#33"> 33: </a><span class="php-comment"> */</span>
</span><span id="34" class="l"><a class="l" href="#34"> 34: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-var"><a id="$droitLogger" href="#$droitLogger">$droitLogger</a></span> = <span class="php-keyword1">true</span>;
</span><span id="35" class="l"><a class="l" href="#35"> 35: </a>
</span><span id="36" class="l"><a class="l" href="#36"> 36: </a> <span class="php-comment">/**
</span></span><span id="37" class="l"><a class="l" href="#37"> 37: </a><span class="php-comment"> * Zone horaire (pour éviter des avertissements dans les dates)
</span></span><span id="38" class="l"><a class="l" href="#38"> 38: </a><span class="php-comment"> */</span>
</span><span id="39" class="l"><a class="l" href="#39"> 39: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-var"><a id="$timeZone" href="#$timeZone">$timeZone</a></span> = <span class="php-quote">'Europe/Paris'</span>;
</span><span id="40" class="l"><a class="l" href="#40"> 40: </a>
</span><span id="41" class="l"><a class="l" href="#41"> 41: </a> <span class="php-comment">/**
</span></span><span id="42" class="l"><a class="l" href="#42"> 42: </a><span class="php-comment"> * Taille maximum d'un fichier de log avant que celui ne soit archivé (en octets)
</span></span><span id="43" class="l"><a class="l" href="#43"> 43: </a><span class="php-comment"> */</span>
</span><span id="44" class="l"><a class="l" href="#44"> 44: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-var"><a id="$tailleMax" href="#$tailleMax">$tailleMax</a></span> = <span class="php-num">10000</span>;
</span><span id="45" class="l"><a class="l" href="#45"> 45: </a>
</span><span id="46" class="l"><a class="l" href="#46"> 46: </a> <span class="php-comment">/**
</span></span><span id="47" class="l"><a class="l" href="#47"> 47: </a><span class="php-comment"> * séparateur de dossier dans un chemin
</span></span><span id="48" class="l"><a class="l" href="#48"> 48: </a><span class="php-comment"> */</span>
</span><span id="49" class="l"><a class="l" href="#49"> 49: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-var"><a id="$sd" href="#$sd">$sd</a></span> = DIRECTORY_SEPARATOR;
</span><span id="50" class="l"><a class="l" href="#50"> 50: </a>
</span><span id="51" class="l"><a class="l" href="#51"> 51: </a> <span class="php-comment">/**
</span></span><span id="52" class="l"><a class="l" href="#52"> 52: </a><span class="php-comment"> * Extension des fichiers de log
</span></span><span id="53" class="l"><a class="l" href="#53"> 53: </a><span class="php-comment"> */</span>
</span><span id="54" class="l"><a class="l" href="#54"> 54: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-var"><a id="$ext" href="#$ext">$ext</a></span> = <span class="php-quote">'.log'</span>;
</span><span id="55" class="l"><a class="l" href="#55"> 55: </a>
</span><span id="56" class="l"><a class="l" href="#56"> 56: </a> <span class="php-comment">/**
</span></span><span id="57" class="l"><a class="l" href="#57"> 57: </a><span class="php-comment"> * Initialiser les logs par défaut, sans tenir comptes des paramêtres de config.
</span></span><span id="58" class="l"><a class="l" href="#58"> 58: </a><span class="php-comment"> */</span>
</span><span id="59" class="l"><a class="l" href="#59"> 59: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_initialiser" href="#_initialiser">initialiser</a>() {
</span><span id="60" class="l"><a class="l" href="#60"> 60: </a> <span class="php-comment">// gestion de la timezone pour éviter des erreurs</span>
</span><span id="61" class="l"><a class="l" href="#61"> 61: </a> <span class="php-keyword1">if</span> (<span class="php-keyword2">function_exists</span>(<span class="php-quote">'date_default_timezone_set'</span>) &amp;&amp; <span class="php-keyword2">function_exists</span>(<span class="php-quote">'date_default_timezone_get'</span>)) {
</span><span id="62" class="l"><a class="l" href="#62"> 62: </a> <span class="php-keyword2">date_default_timezone_set</span>(self::<span class="php-var">$timeZone</span>);
</span><span id="63" class="l"><a class="l" href="#63"> 63: </a> }
</span><span id="64" class="l"><a class="l" href="#64"> 64: </a>
</span><span id="65" class="l"><a class="l" href="#65"> 65: </a> <span class="php-keyword1">if</span> (self::<span class="php-var">$logger</span> &amp;&amp; (!<span class="php-keyword2">is_dir</span>(self::<span class="php-var">$cheminLogs</span>) || !<span class="php-keyword2">is_writable</span>(self::<span class="php-var">$cheminLogs</span>))) {
</span><span id="66" class="l"><a class="l" href="#66"> 66: </a> self::desactiverEcriture();
</span><span id="67" class="l"><a class="l" href="#67"> 67: </a> }
</span><span id="68" class="l"><a class="l" href="#68"> 68: </a> }
</span><span id="69" class="l"><a class="l" href="#69"> 69: </a>
</span><span id="70" class="l"><a class="l" href="#70"> 70: </a> <span class="php-comment">/**
</span></span><span id="71" class="l"><a class="l" href="#71"> 71: </a><span class="php-comment"> * Configure le Log à partir des paramêtres de config.
</span></span><span id="72" class="l"><a class="l" href="#72"> 72: </a><span class="php-comment"> */</span>
</span><span id="73" class="l"><a class="l" href="#73"> 73: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_configurer" href="#_configurer">configurer</a>() {
</span><span id="74" class="l"><a class="l" href="#74"> 74: </a> self::<span class="php-var">$sd</span> = Config::get(<span class="php-quote">'ds'</span>);
</span><span id="75" class="l"><a class="l" href="#75"> 75: </a> self::<span class="php-var">$cheminLogs</span> = Config::get(<span class="php-quote">'chemin_logs'</span>);
</span><span id="76" class="l"><a class="l" href="#76"> 76: </a> self::<span class="php-var">$timeZone</span> = (Config::get(<span class="php-quote">'fw_timezone'</span>) != <span class="php-quote">''</span>) ? Config::get(<span class="php-quote">'fw_timezone'</span>) : self::<span class="php-var">$timeZone</span>;
</span><span id="77" class="l"><a class="l" href="#77"> 77: </a> self::<span class="php-var">$tailleMax</span> = (Config::get(<span class="php-quote">'fw_taille_max_logs'</span>) != <span class="php-quote">''</span>) ? Config::get(<span class="php-quote">'fw_taille_max_logs'</span>) : self::<span class="php-var">$tailleMax</span>;
</span><span id="78" class="l"><a class="l" href="#78"> 78: </a> self::<span class="php-var">$logger</span> = (Config::get(<span class="php-quote">'fw_log_debogage'</span>) != <span class="php-quote">''</span>) ? Config::get(<span class="php-quote">'fw_log_debogage'</span>) : self::<span class="php-var">$logger</span>;
</span><span id="79" class="l"><a class="l" href="#79"> 79: </a> self::initialiser();
</span><span id="80" class="l"><a class="l" href="#80"> 80: </a> }
</span><span id="81" class="l"><a class="l" href="#81"> 81: </a>
</span><span id="82" class="l"><a class="l" href="#82"> 82: </a> <span class="php-comment">/**
</span></span><span id="83" class="l"><a class="l" href="#83"> 83: </a><span class="php-comment"> * Ajoute une entrée au log spécifié par le paramètre $nomFichier
</span></span><span id="84" class="l"><a class="l" href="#84"> 84: </a><span class="php-comment"> * @param string $nomFichier le nom du fichier dans lequel écrire
</span></span><span id="85" class="l"><a class="l" href="#85"> 85: </a><span class="php-comment"> */</span>
</span><span id="86" class="l"><a class="l" href="#86"> 86: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_ajouterEntree" href="#_ajouterEntree">ajouterEntree</a>(<span class="php-var">$nomFichier</span>, <span class="php-var">$entree</span>, <span class="php-var">$mode</span> = <span class="php-quote">'a+'</span>) {
</span><span id="87" class="l"><a class="l" href="#87"> 87: </a> <span class="php-keyword1">if</span> (self::<span class="php-var">$droitLogger</span>) {
</span><span id="88" class="l"><a class="l" href="#88"> 88: </a> <span class="php-var">$date</span> = <span class="php-quote">&quot;\n&quot;</span>.<span class="php-quote">&quot;\n&quot;</span>.<span class="php-keyword2">date</span>(<span class="php-quote">'d m Y H:i'</span>).<span class="php-quote">&quot;\n&quot;</span> ;
</span><span id="89" class="l"><a class="l" href="#89"> 89: </a>
</span><span id="90" class="l"><a class="l" href="#90"> 90: </a> <span class="php-comment">// si le fichier est déjà dans le tableau et qu'on peut y écrire</span>
</span><span id="91" class="l"><a class="l" href="#91"> 91: </a> <span class="php-keyword1">if</span>(self::verifierOuvrirFichier(<span class="php-var">$nomFichier</span>,<span class="php-var">$mode</span>)) {
</span><span id="92" class="l"><a class="l" href="#92"> 92: </a> <span class="php-comment">// on y écrit le message de log</span>
</span><span id="93" class="l"><a class="l" href="#93"> 93: </a> <span class="php-keyword2">fwrite</span>(self::<span class="php-var">$fichiersLog</span>[<span class="php-var">$nomFichier</span>],<span class="php-var">$date</span>.<span class="php-var">$entree</span>);
</span><span id="94" class="l"><a class="l" href="#94"> 94: </a> <span class="php-comment">// on vérifie si le fichier ne dépasse pas la taille maximale</span>
</span><span id="95" class="l"><a class="l" href="#95"> 95: </a> self::verifierTailleFichierOuArchiver(<span class="php-var">$nomFichier</span>);
</span><span id="96" class="l"><a class="l" href="#96"> 96: </a> } <span class="php-keyword1">else</span> {
</span><span id="97" class="l"><a class="l" href="#97"> 97: </a> <span class="php-comment">// sinon on interdit l'écriture</span>
</span><span id="98" class="l"><a class="l" href="#98"> 98: </a> self::desactiverEcriture(<span class="php-var">$nomFichier</span>);
</span><span id="99" class="l"><a class="l" href="#99"> 99: </a> }
</span><span id="100" class="l"><a class="l" href="#100">100: </a> }
</span><span id="101" class="l"><a class="l" href="#101">101: </a> }
</span><span id="102" class="l"><a class="l" href="#102">102: </a>
</span><span id="103" class="l"><a class="l" href="#103">103: </a> <span class="php-comment">/**
</span></span><span id="104" class="l"><a class="l" href="#104">104: </a><span class="php-comment"> * Vide un fichier log indiqué
</span></span><span id="105" class="l"><a class="l" href="#105">105: </a><span class="php-comment"> * @param string $nomFichier le nom du fichier à vider
</span></span><span id="106" class="l"><a class="l" href="#106">106: </a><span class="php-comment"> */</span>
</span><span id="107" class="l"><a class="l" href="#107">107: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_viderLog" href="#_viderLog">viderLog</a>(<span class="php-var">$nomFichier</span>) {
</span><span id="108" class="l"><a class="l" href="#108">108: </a> self::ajouterEntree(<span class="php-var">$nomFichier</span>, <span class="php-quote">''</span>, <span class="php-quote">'w'</span>);
</span><span id="109" class="l"><a class="l" href="#109">109: </a> }
</span><span id="110" class="l"><a class="l" href="#110">110: </a>
</span><span id="111" class="l"><a class="l" href="#111">111: </a> <span class="php-comment">/**
</span></span><span id="112" class="l"><a class="l" href="#112">112: </a><span class="php-comment"> * Vérifie la présence d'un fichier dans le tableau, ses droits d'écriture, l'ouvre si nécessaire.
</span></span><span id="113" class="l"><a class="l" href="#113">113: </a><span class="php-comment"> *
</span></span><span id="114" class="l"><a class="l" href="#114">114: </a><span class="php-comment"> * @param string $nomFichier le nom du fichier dont on doit vérifier la présence
</span></span><span id="115" class="l"><a class="l" href="#115">115: </a><span class="php-comment"> * @return boolean true si le fichier est ouvert ou maintenant accessible, false sinon
</span></span><span id="116" class="l"><a class="l" href="#116">116: </a><span class="php-comment"> */</span>
</span><span id="117" class="l"><a class="l" href="#117">117: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_verifierOuvrirFichier" href="#_verifierOuvrirFichier">verifierOuvrirFichier</a>(<span class="php-var">$nomFichier</span>,<span class="php-var">$mode</span>) {
</span><span id="118" class="l"><a class="l" href="#118">118: </a> <span class="php-comment">// le fichier est il déjà ouvert ?</span>
</span><span id="119" class="l"><a class="l" href="#119">119: </a> <span class="php-keyword1">if</span> (<span class="php-keyword2">in_array</span>(<span class="php-var">$nomFichier</span>, self::<span class="php-var">$fichiersLog</span>)) {
</span><span id="120" class="l"><a class="l" href="#120">120: </a> <span class="php-comment">// si oui peut on y écrire ?</span>
</span><span id="121" class="l"><a class="l" href="#121">121: </a> <span class="php-keyword1">if</span> (<span class="php-keyword2">is_writable</span>(self::<span class="php-var">$cheminLogs</span>.<span class="php-var">$nomFichier</span>.self::<span class="php-var">$ext</span>)) {
</span><span id="122" class="l"><a class="l" href="#122">122: </a> <span class="php-comment">// si oui on renvoie le descripteur</span>
</span><span id="123" class="l"><a class="l" href="#123">123: </a> <span class="php-keyword1">return</span> <span class="php-keyword1">true</span>;
</span><span id="124" class="l"><a class="l" href="#124">124: </a> }
</span><span id="125" class="l"><a class="l" href="#125">125: </a> <span class="php-keyword1">return</span> <span class="php-keyword1">false</span>;
</span><span id="126" class="l"><a class="l" href="#126">126: </a> } <span class="php-keyword1">else</span> {
</span><span id="127" class="l"><a class="l" href="#127">127: </a> <span class="php-comment">// sinon on l'ouvre</span>
</span><span id="128" class="l"><a class="l" href="#128">128: </a> <span class="php-var">$fp</span> = @<span class="php-keyword2">fopen</span>(self::<span class="php-var">$cheminLogs</span>.<span class="php-var">$nomFichier</span>.self::<span class="php-var">$ext</span>,<span class="php-var">$mode</span>);
</span><span id="129" class="l"><a class="l" href="#129">129: </a> <span class="php-comment">// si l'ouverture a réussi et si le fichier a les droits d'écriture</span>
</span><span id="130" class="l"><a class="l" href="#130">130: </a> <span class="php-keyword1">if</span> (<span class="php-var">$fp</span> &amp;&amp; <span class="php-keyword2">is_writable</span>(self::<span class="php-var">$cheminLogs</span>.<span class="php-var">$nomFichier</span>.self::<span class="php-var">$ext</span>)) {
</span><span id="131" class="l"><a class="l" href="#131">131: </a> <span class="php-comment">// si oui on renvoie le descripteur qu'on ajoute au tableau</span>
</span><span id="132" class="l"><a class="l" href="#132">132: </a> self::<span class="php-var">$fichiersLog</span>[<span class="php-var">$nomFichier</span>] = <span class="php-var">$fp</span>;
</span><span id="133" class="l"><a class="l" href="#133">133: </a> <span class="php-keyword1">return</span> <span class="php-keyword1">true</span>;
</span><span id="134" class="l"><a class="l" href="#134">134: </a> }
</span><span id="135" class="l"><a class="l" href="#135">135: </a> <span class="php-keyword1">return</span> <span class="php-keyword1">false</span>;
</span><span id="136" class="l"><a class="l" href="#136">136: </a> }
</span><span id="137" class="l"><a class="l" href="#137">137: </a> }
</span><span id="138" class="l"><a class="l" href="#138">138: </a>
</span><span id="139" class="l"><a class="l" href="#139">139: </a> <span class="php-comment">/**
</span></span><span id="140" class="l"><a class="l" href="#140">140: </a><span class="php-comment"> * Vérifie la taille d'un fichier donné et si celle ci est trop importante
</span></span><span id="141" class="l"><a class="l" href="#141">141: </a><span class="php-comment"> * archive le fichier de log
</span></span><span id="142" class="l"><a class="l" href="#142">142: </a><span class="php-comment"> * @param string $nomFichier nom du fichier à vérifier
</span></span><span id="143" class="l"><a class="l" href="#143">143: </a><span class="php-comment"> */</span>
</span><span id="144" class="l"><a class="l" href="#144">144: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_verifierTailleFichierOuArchiver" href="#_verifierTailleFichierOuArchiver">verifierTailleFichierOuArchiver</a>(<span class="php-var">$nomFichier</span>) {
</span><span id="145" class="l"><a class="l" href="#145">145: </a> <span class="php-keyword1">if</span>(<span class="php-keyword2">filesize</span>(self::<span class="php-var">$cheminLogs</span>.<span class="php-var">$nomFichier</span>.self::<span class="php-var">$ext</span>) &gt; self::<span class="php-var">$tailleMax</span>) {
</span><span id="146" class="l"><a class="l" href="#146">146: </a> <span class="php-keyword2">rename</span>(self::<span class="php-var">$cheminLogs</span>.<span class="php-var">$nomFichier</span>.self::<span class="php-var">$ext</span>,self::<span class="php-var">$cheminLogs</span>.<span class="php-var">$nomFichier</span>.<span class="php-keyword2">date</span>(<span class="php-quote">'d_m_Y_H:i'</span>).self::<span class="php-var">$ext</span>);
</span><span id="147" class="l"><a class="l" href="#147">147: </a> self::ajouterEntree(<span class="php-var">$nomFichier</span>,<span class="php-quote">''</span>);
</span><span id="148" class="l"><a class="l" href="#148">148: </a> }
</span><span id="149" class="l"><a class="l" href="#149">149: </a> }
</span><span id="150" class="l"><a class="l" href="#150">150: </a>
</span><span id="151" class="l"><a class="l" href="#151">151: </a> <span class="php-comment">/**
</span></span><span id="152" class="l"><a class="l" href="#152">152: </a><span class="php-comment"> * Désactive l'écriture du log et envoie un message au gestionnaire d'erreurs
</span></span><span id="153" class="l"><a class="l" href="#153">153: </a><span class="php-comment"> * @param string $nomFichier le nom du fichier qui a causé l'erreur
</span></span><span id="154" class="l"><a class="l" href="#154">154: </a><span class="php-comment"> */</span>
</span><span id="155" class="l"><a class="l" href="#155">155: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_desactiverEcriture" href="#_desactiverEcriture">desactiverEcriture</a>(<span class="php-var">$nomFichier</span> = <span class="php-quote">''</span>) {
</span><span id="156" class="l"><a class="l" href="#156">156: </a> self::<span class="php-var">$droitLogger</span> = <span class="php-keyword1">false</span>;
</span><span id="157" class="l"><a class="l" href="#157">157: </a> <span class="php-keyword1">if</span> (<span class="php-var">$nomFichier</span> != <span class="php-quote">''</span>) {
</span><span id="158" class="l"><a class="l" href="#158">158: </a> <span class="php-var">$fichierDossier</span> = <span class="php-quote">'fichier '</span>.<span class="php-var">$nomFichier</span> ;
</span><span id="159" class="l"><a class="l" href="#159">159: </a> } <span class="php-keyword1">else</span> {
</span><span id="160" class="l"><a class="l" href="#160">160: </a> <span class="php-var">$fichierDossier</span> = <span class="php-quote">'dossier des logs'</span>;
</span><span id="161" class="l"><a class="l" href="#161">161: </a> }
</span><span id="162" class="l"><a class="l" href="#162">162: </a> <span class="php-var">$message</span> = <span class="php-quote">'Écriture impossible dans le '</span>.<span class="php-var">$fichierDossier</span>.<span class="php-quote">', Assurez-vous des droits du dossier et des fichiers'</span>;
</span><span id="163" class="l"><a class="l" href="#163">163: </a> <span class="php-var">$e</span> = <span class="php-keyword1">new</span> ErrorException(<span class="php-var">$message</span>, <span class="php-num">0</span>, E_USER_WARNING, __FILE__, __LINE__);
</span><span id="164" class="l"><a class="l" href="#164">164: </a> GestionnaireException::gererException(<span class="php-var">$e</span>);
</span><span id="165" class="l"><a class="l" href="#165">165: </a> }
</span><span id="166" class="l"><a class="l" href="#166">166: </a>
</span><span id="167" class="l"><a class="l" href="#167">167: </a> <span class="php-comment">/**
</span></span><span id="168" class="l"><a class="l" href="#168">168: </a><span class="php-comment"> * destructeur de classe, ferme les descripteurs ouverts
</span></span><span id="169" class="l"><a class="l" href="#169">169: </a><span class="php-comment"> */</span>
</span><span id="170" class="l"><a class="l" href="#170">170: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="___destruct" href="#___destruct">__destruct</a>() {
</span><span id="171" class="l"><a class="l" href="#171">171: </a> <span class="php-keyword1">foreach</span>(self::<span class="php-var">$fichiersLog</span> <span class="php-keyword1">as</span> <span class="php-var">$nomFichier</span> =&gt; <span class="php-var">$fp</span>) {
</span><span id="172" class="l"><a class="l" href="#172">172: </a> <span class="php-keyword2">fclose</span>(<span class="php-var">$fp</span>);
</span><span id="173" class="l"><a class="l" href="#173">173: </a> }
</span><span id="174" class="l"><a class="l" href="#174">174: </a> }
</span><span id="175" class="l"><a class="l" href="#175">175: </a>}
</span><span id="176" class="l"><a class="l" href="#176">176: </a><span class="xlang">?&gt;</span>
</span><span id="177" class="l"><a class="l" href="#177">177: </a></span></code></pre>
 
<div id="footer">
TBFramework - v0.2 API documentation generated by <a href="http://apigen.org">ApiGen 2.8.0</a>
/branches/v0.2-buhl/doc/ApiGen/class-Log.html
7,7 → 7,7
<title>Class Log | TBFramework - v0.2</title>
 
<script type="text/javascript" src="resources/combined.js?4205936287"></script>
<script type="text/javascript" src="elementlist.js?117657638"></script>
<script type="text/javascript" src="elementlist.js?1835392179"></script>
<link rel="stylesheet" type="text/css" media="all" href="resources/style.css?3505392360">
 
</head>
40,6 → 40,7
<li><a href="class-Controleur.html">Controleur</a></li>
<li><a href="class-Debug.html">Debug</a></li>
<li><a href="class-GestionnaireException.html">GestionnaireException</a></li>
<li><a href="class-I18n.html">I18n</a></li>
<li class="active"><a href="class-Log.html">Log</a></li>
<li><a href="class-Modele.html">Modele</a></li>
<li><a href="class-Registre.html">Registre</a></li>
125,17 → 126,16
<b>Category:</b>
PHP 5.2<br>
<b>Copyright:</b>
2009 Tela-Botanica<br>
Copyright (c) 2009, Tela Botanica (<a
href="mailto:accueil&#64;tela-botanica.org">accueil&#64;<!-- -->tela-botanica.org</a>)<br>
<b>License:</b>
<a href="http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt">Licence CECILL</a><br>
<a href="GNU-GPL-v3">&lt;http://www.gnu.org/licenses/gpl.html&gt;</a><br>
<b>License:</b>
<a href="CECILL-v2">&lt;http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt&gt;</a><br>
<b>Author:</b>
aurelien &lt;<a
Aurélien PERONNET &lt;<a
href="mailto:aurelien&#64;tela-botanica.org">aurelien&#64;<!-- -->tela-botanica.org</a>&gt;<br>
<b>Version:</b>
SVN: $Id: Log.php 255 2010-12-23 10:37:30Z jpm $<br>
<b>Link:</b>
/doc/framework/<br>
<b>Located at</b> <a href="source-class-Log.html#4-176" title="Go to source code">Log.php</a><br>
<b>Located at</b> <a href="source-class-Log.html#4-175" title="Go to source code">Log.php</a><br>
</div>
 
 
153,7 → 153,7
 
<td class="name"><div>
<a class="anchor" href="#_initialiser">#</a>
<code><a href="source-class-Log.html#57-69" title="Go to source code">initialiser</a>( )</code>
<code><a href="source-class-Log.html#56-68" title="Go to source code">initialiser</a>( )</code>
 
<div class="description short">
188,7 → 188,7
 
<td class="name"><div>
<a class="anchor" href="#_configurer">#</a>
<code><a href="source-class-Log.html#71-81" title="Go to source code">configurer</a>( )</code>
<code><a href="source-class-Log.html#70-80" title="Go to source code">configurer</a>( )</code>
 
<div class="description short">
221,7 → 221,7
 
<td class="name"><div>
<a class="anchor" href="#_ajouterEntree">#</a>
<code><a href="source-class-Log.html#83-102" title="Go to source code">ajouterEntree</a>( <span>string <var>$nomFichier</var></span>, <span>mixed <var>$entree</var></span>, <span>mixed <var>$mode</var> = <span class="php-quote">'a+'</span></span> )</code>
<code><a href="source-class-Log.html#82-101" title="Go to source code">ajouterEntree</a>( <span>string <var>$nomFichier</var></span>, <span>mixed <var>$entree</var></span>, <span>mixed <var>$mode</var> = <span class="php-quote">'a+'</span></span> )</code>
 
<div class="description short">
263,7 → 263,7
 
<td class="name"><div>
<a class="anchor" href="#_viderLog">#</a>
<code><a href="source-class-Log.html#104-110" title="Go to source code">viderLog</a>( <span>string <var>$nomFichier</var></span> )</code>
<code><a href="source-class-Log.html#103-109" title="Go to source code">viderLog</a>( <span>string <var>$nomFichier</var></span> )</code>
 
<div class="description short">
301,7 → 301,7
 
<td class="name"><div>
<a class="anchor" href="#_verifierOuvrirFichier">#</a>
<code><a href="source-class-Log.html#112-138" title="Go to source code">verifierOuvrirFichier</a>( <span>string <var>$nomFichier</var></span>, <span>mixed <var>$mode</var></span> )</code>
<code><a href="source-class-Log.html#111-137" title="Go to source code">verifierOuvrirFichier</a>( <span>string <var>$nomFichier</var></span>, <span>mixed <var>$mode</var></span> )</code>
 
<div class="description short">
347,7 → 347,7
 
<td class="name"><div>
<a class="anchor" href="#___destruct">#</a>
<code><a href="source-class-Log.html#168-175" title="Go to source code">__destruct</a>( )</code>
<code><a href="source-class-Log.html#167-174" title="Go to source code">__destruct</a>( )</code>
 
<div class="description short">
/branches/v0.2-buhl/doc/ApiGen/source-class-Registre.html
8,7 → 8,7
<title>File Registre.php | TBFramework - v0.2</title>
 
<script type="text/javascript" src="resources/combined.js?4205936287"></script>
<script type="text/javascript" src="elementlist.js?117657638"></script>
<script type="text/javascript" src="elementlist.js?1835392179"></script>
<link rel="stylesheet" type="text/css" media="all" href="resources/style.css?3505392360">
 
</head>
41,6 → 41,7
<li><a href="class-Controleur.html">Controleur</a></li>
<li><a href="class-Debug.html">Debug</a></li>
<li><a href="class-GestionnaireException.html">GestionnaireException</a></li>
<li><a href="class-I18n.html">I18n</a></li>
<li><a href="class-Log.html">Log</a></li>
<li><a href="class-Modele.html">Modele</a></li>
<li class="active"><a href="class-Registre.html">Registre</a></li>
105,94 → 106,89
</span></span><span id="4" class="l"><a class="l" href="#4"> 4: </a><span class="php-comment"> * Classe registre, qui permet un accès à différentes variables à travers les autres classes.
</span></span><span id="5" class="l"><a class="l" href="#5"> 5: </a><span class="php-comment"> * C'est un singleton
</span></span><span id="6" class="l"><a class="l" href="#6"> 6: </a><span class="php-comment"> *
</span></span><span id="7" class="l"><a class="l" href="#7"> 7: </a><span class="php-comment">* PHP Version 5
</span></span><span id="8" class="l"><a class="l" href="#8"> 8: </a><span class="php-comment">*
</span></span><span id="9" class="l"><a class="l" href="#9"> 9: </a><span class="php-comment">* @category Class
</span></span><span id="10" class="l"><a class="l" href="#10">10: </a><span class="php-comment">* @package Framework
</span></span><span id="11" class="l"><a class="l" href="#11">11: </a><span class="php-comment">* @author Jean-Pascal Milcent &lt;jmp@tela-botanica.org&gt;
</span></span><span id="12" class="l"><a class="l" href="#12">12: </a><span class="php-comment">* @copyright 2009 Tela-Botanica
</span></span><span id="13" class="l"><a class="l" href="#13">13: </a><span class="php-comment">* @license http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
</span></span><span id="14" class="l"><a class="l" href="#14">14: </a><span class="php-comment">* @license http://www.gnu.org/licenses/gpl.html Licence GNU-GPL
</span></span><span id="15" class="l"><a class="l" href="#15">15: </a><span class="php-comment">* @version SVN: $$Id: Registre.php 120 2009-09-01 12:21:14Z aurelien $$
</span></span><span id="16" class="l"><a class="l" href="#16">16: </a><span class="php-comment">* @link /doc/framework/
</span></span><span id="17" class="l"><a class="l" href="#17">17: </a><span class="php-comment">*
</span></span><span id="18" class="l"><a class="l" href="#18">18: </a><span class="php-comment">*/</span>
</span><span id="19" class="l"><a class="l" href="#19">19: </a><span class="php-keyword1">class</span> <a id="Registre" href="#Registre">Registre</a> {
</span><span id="20" class="l"><a class="l" href="#20">20: </a>
</span><span id="21" class="l"><a class="l" href="#21">21: </a> <span class="php-comment">/**
</span></span><span id="22" class="l"><a class="l" href="#22">22: </a><span class="php-comment"> * Tableau associatif stockant les variables
</span></span><span id="23" class="l"><a class="l" href="#23">23: </a><span class="php-comment"> */</span>
</span><span id="24" class="l"><a class="l" href="#24">24: </a> <span class="php-keyword1">private</span> <span class="php-var"><a id="$stockage" href="#$stockage">$stockage</a></span> = <span class="php-keyword1">array</span>();
</span></span><span id="7" class="l"><a class="l" href="#7"> 7: </a><span class="php-comment"> * @category PHP 5.2
</span></span><span id="8" class="l"><a class="l" href="#8"> 8: </a><span class="php-comment"> * @package Framework
</span></span><span id="9" class="l"><a class="l" href="#9"> 9: </a><span class="php-comment"> * @author Jean-Pascal MILCENT &lt;jpm@tela-botanica.org&gt;
</span></span><span id="10" class="l"><a class="l" href="#10">10: </a><span class="php-comment"> * @copyright Copyright (c) 2009, Tela Botanica (accueil@tela-botanica.org)
</span></span><span id="11" class="l"><a class="l" href="#11">11: </a><span class="php-comment"> * @license GNU-GPL-v3 &lt;http://www.gnu.org/licenses/gpl.html&gt;
</span></span><span id="12" class="l"><a class="l" href="#12">12: </a><span class="php-comment"> * @license CECILL-v2 &lt;http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt&gt;
</span></span><span id="13" class="l"><a class="l" href="#13">13: </a><span class="php-comment">*/</span>
</span><span id="14" class="l"><a class="l" href="#14">14: </a><span class="php-keyword1">class</span> <a id="Registre" href="#Registre">Registre</a> {
</span><span id="15" class="l"><a class="l" href="#15">15: </a>
</span><span id="16" class="l"><a class="l" href="#16">16: </a> <span class="php-comment">/**
</span></span><span id="17" class="l"><a class="l" href="#17">17: </a><span class="php-comment"> * Tableau associatif stockant les variables
</span></span><span id="18" class="l"><a class="l" href="#18">18: </a><span class="php-comment"> */</span>
</span><span id="19" class="l"><a class="l" href="#19">19: </a> <span class="php-keyword1">private</span> <span class="php-var"><a id="$stockage" href="#$stockage">$stockage</a></span> = <span class="php-keyword1">array</span>();
</span><span id="20" class="l"><a class="l" href="#20">20: </a> <span class="php-comment">/**
</span></span><span id="21" class="l"><a class="l" href="#21">21: </a><span class="php-comment"> * La classe registre se contient elle-même, (pour le pattern singleton)
</span></span><span id="22" class="l"><a class="l" href="#22">22: </a><span class="php-comment"> */</span>
</span><span id="23" class="l"><a class="l" href="#23">23: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-var"><a id="$registre" href="#$registre">$registre</a></span>;
</span><span id="24" class="l"><a class="l" href="#24">24: </a>
</span><span id="25" class="l"><a class="l" href="#25">25: </a> <span class="php-comment">/**
</span></span><span id="26" class="l"><a class="l" href="#26">26: </a><span class="php-comment"> * La classe registre se contient elle-même, (pour le pattern singleton)
</span></span><span id="26" class="l"><a class="l" href="#26">26: </a><span class="php-comment"> * Constructeur par défaut, privé, car on accède à la classe par le getInstance
</span></span><span id="27" class="l"><a class="l" href="#27">27: </a><span class="php-comment"> */</span>
</span><span id="28" class="l"><a class="l" href="#28">28: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-var"><a id="$registre" href="#$registre">$registre</a></span>;
</span><span id="29" class="l"><a class="l" href="#29">29: </a>
</span><span id="30" class="l"><a class="l" href="#30">30: </a> <span class="php-comment">/**
</span></span><span id="31" class="l"><a class="l" href="#31">31: </a><span class="php-comment"> * Constructeur par défaut, privé, car on accède à la classe par le getInstance
</span></span><span id="32" class="l"><a class="l" href="#32">32: </a><span class="php-comment"> */</span>
</span><span id="33" class="l"><a class="l" href="#33">33: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">function</span> <a id="___construct" href="#___construct">__construct</a>() {
</span><span id="34" class="l"><a class="l" href="#34">34: </a> }
</span><span id="35" class="l"><a class="l" href="#35">35: </a>
</span><span id="36" class="l"><a class="l" href="#36">36: </a> <span class="php-comment">/**
</span></span><span id="37" class="l"><a class="l" href="#37">37: </a><span class="php-comment"> * Fonction qui renvoie l'instance de classe en assurant son unicité, c'est l'unique méthode qui doit être
</span></span><span id="38" class="l"><a class="l" href="#38">38: </a><span class="php-comment"> * utilisée pour récupérer l'objet Registre
</span></span><span id="39" class="l"><a class="l" href="#39">39: </a><span class="php-comment"> */</span>
</span><span id="40" class="l"><a class="l" href="#40">40: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_getInstance" href="#_getInstance">getInstance</a>() {
</span><span id="41" class="l"><a class="l" href="#41">41: </a> <span class="php-keyword1">if</span> (self::<span class="php-var">$registre</span> <span class="php-keyword1">instanceof</span> Registre) {
</span><span id="42" class="l"><a class="l" href="#42">42: </a> <span class="php-keyword1">return</span> self::<span class="php-var">$registre</span>;
</span><span id="43" class="l"><a class="l" href="#43">43: </a> }
</span><span id="44" class="l"><a class="l" href="#44">44: </a> self::<span class="php-var">$registre</span> = <span class="php-keyword1">new</span> Registre;
</span><span id="45" class="l"><a class="l" href="#45">45: </a> <span class="php-keyword1">return</span> self::<span class="php-var">$registre</span>;
</span><span id="46" class="l"><a class="l" href="#46">46: </a> }
</span><span id="47" class="l"><a class="l" href="#47">47: </a>
</span><span id="48" class="l"><a class="l" href="#48">48: </a> <span class="php-comment">/**
</span></span><span id="49" class="l"><a class="l" href="#49">49: </a><span class="php-comment"> * Ajoute un objet au tableau selon un intitulé donné
</span></span><span id="50" class="l"><a class="l" href="#50">50: </a><span class="php-comment"> * @param string l'intitulé sous lequel l'objet sera conservé
</span></span><span id="51" class="l"><a class="l" href="#51">51: </a><span class="php-comment"> * @param mixed l'objet à conserver
</span></span><span id="52" class="l"><a class="l" href="#52">52: </a><span class="php-comment"> */</span>
</span><span id="53" class="l"><a class="l" href="#53">53: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="_set" href="#_set">set</a>(<span class="php-var">$intitule</span>, <span class="php-var">$objet</span>) {
</span><span id="54" class="l"><a class="l" href="#54">54: </a> <span class="php-keyword1">if</span> (<span class="php-keyword2">is_array</span>(<span class="php-var">$objet</span>) &amp;&amp; <span class="php-keyword1">isset</span>(<span class="php-var">$this</span>-&gt;stockage[<span class="php-var">$intitule</span>])) {
</span><span id="55" class="l"><a class="l" href="#55">55: </a> <span class="php-var">$this</span>-&gt;stockage[<span class="php-var">$intitule</span>] = <span class="php-keyword2">array_merge</span>((<span class="php-keyword1">array</span>) <span class="php-var">$this</span>-&gt;stockage[<span class="php-var">$intitule</span>], (<span class="php-keyword1">array</span>) <span class="php-var">$objet</span>);
</span><span id="56" class="l"><a class="l" href="#56">56: </a> <span class="php-var">$message</span> = <span class="php-quote">&quot;Le tableau </span><span class="php-var">$intitule</span><span class="php-quote"> présent dans le registre a été fusionné avec un nouveau tableau de même intitulé !&quot;</span>;
</span><span id="57" class="l"><a class="l" href="#57">57: </a> <span class="php-keyword2">trigger_error</span>(<span class="php-var">$message</span>, E_USER_WARNING);
</span><span id="58" class="l"><a class="l" href="#58">58: </a> } <span class="php-keyword1">else</span> {
</span><span id="59" class="l"><a class="l" href="#59">59: </a> <span class="php-var">$this</span>-&gt;stockage[<span class="php-var">$intitule</span>] = <span class="php-var">$objet</span>;
</span><span id="60" class="l"><a class="l" href="#60">60: </a> }
</span><span id="61" class="l"><a class="l" href="#61">61: </a> }
</span><span id="62" class="l"><a class="l" href="#62">62: </a>
</span><span id="63" class="l"><a class="l" href="#63">63: </a> <span class="php-comment">/**
</span></span><span id="64" class="l"><a class="l" href="#64">64: </a><span class="php-comment"> * Renvoie l'objet associé à l'intitulé donné en paramètre
</span></span><span id="65" class="l"><a class="l" href="#65">65: </a><span class="php-comment"> * @return mixed l'objet associé à l'intitulé ou null s'il n'est pas présent
</span></span><span id="66" class="l"><a class="l" href="#66">66: </a><span class="php-comment"> */</span>
</span><span id="67" class="l"><a class="l" href="#67">67: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="_get" href="#_get">get</a>(<span class="php-var">$intitule</span>) {
</span><span id="68" class="l"><a class="l" href="#68">68: </a> <span class="php-keyword1">if</span> (<span class="php-keyword1">isset</span>(<span class="php-var">$this</span>-&gt;stockage[<span class="php-var">$intitule</span>])) {
</span><span id="69" class="l"><a class="l" href="#69">69: </a> <span class="php-keyword1">return</span> <span class="php-var">$this</span>-&gt;stockage[<span class="php-var">$intitule</span>];
</span><span id="70" class="l"><a class="l" href="#70">70: </a> }
</span><span id="71" class="l"><a class="l" href="#71">71: </a> <span class="php-keyword1">return</span> <span class="php-keyword1">null</span>;
</span><span id="72" class="l"><a class="l" href="#72">72: </a> }
</span><span id="73" class="l"><a class="l" href="#73">73: </a>
</span><span id="74" class="l"><a class="l" href="#74">74: </a> <span class="php-comment">/**
</span></span><span id="75" class="l"><a class="l" href="#75">75: </a><span class="php-comment"> * Détruit l'objet associé à l'intitulé, n'a pas d'effet si il n'y a pas d'objet associé
</span></span><span id="76" class="l"><a class="l" href="#76">76: </a><span class="php-comment"> */</span>
</span><span id="77" class="l"><a class="l" href="#77">77: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="_detruire" href="#_detruire">detruire</a>(<span class="php-var">$intitule</span>) {
</span><span id="78" class="l"><a class="l" href="#78">78: </a> <span class="php-keyword1">if</span> (<span class="php-keyword1">isset</span>(<span class="php-var">$this</span>-&gt;stockage[<span class="php-var">$intitule</span>])) {
</span><span id="79" class="l"><a class="l" href="#79">79: </a> <span class="php-keyword1">unset</span>(<span class="php-var">$this</span>-&gt;stockage[<span class="php-var">$intitule</span>]);
</span><span id="80" class="l"><a class="l" href="#80">80: </a> }
</span><span id="81" class="l"><a class="l" href="#81">81: </a> }
</span><span id="82" class="l"><a class="l" href="#82">82: </a>
</span><span id="83" class="l"><a class="l" href="#83">83: </a> <span class="php-comment">/**
</span></span><span id="84" class="l"><a class="l" href="#84">84: </a><span class="php-comment"> * Teste si un objet est présent sous un intitulé donné
</span></span><span id="85" class="l"><a class="l" href="#85">85: </a><span class="php-comment"> * @return boolean true si un objet associé à cet intitulé est présent, false sinon
</span></span><span id="86" class="l"><a class="l" href="#86">86: </a><span class="php-comment"> */</span>
</span><span id="87" class="l"><a class="l" href="#87">87: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="_existe" href="#_existe">existe</a>(<span class="php-var">$intitule</span>) {
</span><span id="88" class="l"><a class="l" href="#88">88: </a> <span class="php-keyword1">if</span>(<span class="php-keyword1">isset</span>(<span class="php-var">$this</span>-&gt;stockage[<span class="php-var">$intitule</span>])){
</span><span id="89" class="l"><a class="l" href="#89">89: </a> <span class="php-keyword1">return</span> <span class="php-keyword1">true</span>;
</span><span id="90" class="l"><a class="l" href="#90">90: </a> }
</span><span id="91" class="l"><a class="l" href="#91">91: </a> <span class="php-keyword1">return</span> <span class="php-keyword1">false</span>;
</span><span id="92" class="l"><a class="l" href="#92">92: </a> }
</span><span id="93" class="l"><a class="l" href="#93">93: </a>}
</span><span id="94" class="l"><a class="l" href="#94">94: </a></span><span class="xlang">?&gt;</span></code></pre>
</span><span id="28" class="l"><a class="l" href="#28">28: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">function</span> <a id="___construct" href="#___construct">__construct</a>() {
</span><span id="29" class="l"><a class="l" href="#29">29: </a> }
</span><span id="30" class="l"><a class="l" href="#30">30: </a>
</span><span id="31" class="l"><a class="l" href="#31">31: </a> <span class="php-comment">/**
</span></span><span id="32" class="l"><a class="l" href="#32">32: </a><span class="php-comment"> * Fonction qui renvoie l'instance de classe en assurant son unicité, c'est l'unique méthode qui doit être
</span></span><span id="33" class="l"><a class="l" href="#33">33: </a><span class="php-comment"> * utilisée pour récupérer l'objet Registre
</span></span><span id="34" class="l"><a class="l" href="#34">34: </a><span class="php-comment"> */</span>
</span><span id="35" class="l"><a class="l" href="#35">35: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_getInstance" href="#_getInstance">getInstance</a>() {
</span><span id="36" class="l"><a class="l" href="#36">36: </a> <span class="php-keyword1">if</span> (self::<span class="php-var">$registre</span> <span class="php-keyword1">instanceof</span> Registre) {
</span><span id="37" class="l"><a class="l" href="#37">37: </a> <span class="php-keyword1">return</span> self::<span class="php-var">$registre</span>;
</span><span id="38" class="l"><a class="l" href="#38">38: </a> }
</span><span id="39" class="l"><a class="l" href="#39">39: </a> self::<span class="php-var">$registre</span> = <span class="php-keyword1">new</span> Registre;
</span><span id="40" class="l"><a class="l" href="#40">40: </a> <span class="php-keyword1">return</span> self::<span class="php-var">$registre</span>;
</span><span id="41" class="l"><a class="l" href="#41">41: </a> }
</span><span id="42" class="l"><a class="l" href="#42">42: </a>
</span><span id="43" class="l"><a class="l" href="#43">43: </a> <span class="php-comment">/**
</span></span><span id="44" class="l"><a class="l" href="#44">44: </a><span class="php-comment"> * Ajoute un objet au tableau selon un intitulé donné
</span></span><span id="45" class="l"><a class="l" href="#45">45: </a><span class="php-comment"> * @param string l'intitulé sous lequel l'objet sera conservé
</span></span><span id="46" class="l"><a class="l" href="#46">46: </a><span class="php-comment"> * @param mixed l'objet à conserver
</span></span><span id="47" class="l"><a class="l" href="#47">47: </a><span class="php-comment"> */</span>
</span><span id="48" class="l"><a class="l" href="#48">48: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="_set" href="#_set">set</a>(<span class="php-var">$intitule</span>, <span class="php-var">$objet</span>) {
</span><span id="49" class="l"><a class="l" href="#49">49: </a> <span class="php-keyword1">if</span> (<span class="php-keyword2">is_array</span>(<span class="php-var">$objet</span>) &amp;&amp; <span class="php-keyword1">isset</span>(<span class="php-var">$this</span>-&gt;stockage[<span class="php-var">$intitule</span>])) {
</span><span id="50" class="l"><a class="l" href="#50">50: </a> <span class="php-var">$this</span>-&gt;stockage[<span class="php-var">$intitule</span>] = <span class="php-keyword2">array_merge</span>((<span class="php-keyword1">array</span>) <span class="php-var">$this</span>-&gt;stockage[<span class="php-var">$intitule</span>], (<span class="php-keyword1">array</span>) <span class="php-var">$objet</span>);
</span><span id="51" class="l"><a class="l" href="#51">51: </a> <span class="php-var">$message</span> = <span class="php-quote">&quot;Le tableau </span><span class="php-var">$intitule</span><span class="php-quote"> présent dans le registre a été fusionné avec un nouveau tableau de même intitulé !&quot;</span>;
</span><span id="52" class="l"><a class="l" href="#52">52: </a> <span class="php-keyword2">trigger_error</span>(<span class="php-var">$message</span>, E_USER_WARNING);
</span><span id="53" class="l"><a class="l" href="#53">53: </a> } <span class="php-keyword1">else</span> {
</span><span id="54" class="l"><a class="l" href="#54">54: </a> <span class="php-var">$this</span>-&gt;stockage[<span class="php-var">$intitule</span>] = <span class="php-var">$objet</span>;
</span><span id="55" class="l"><a class="l" href="#55">55: </a> }
</span><span id="56" class="l"><a class="l" href="#56">56: </a> }
</span><span id="57" class="l"><a class="l" href="#57">57: </a>
</span><span id="58" class="l"><a class="l" href="#58">58: </a> <span class="php-comment">/**
</span></span><span id="59" class="l"><a class="l" href="#59">59: </a><span class="php-comment"> * Renvoie l'objet associé à l'intitulé donné en paramètre
</span></span><span id="60" class="l"><a class="l" href="#60">60: </a><span class="php-comment"> * @return mixed l'objet associé à l'intitulé ou null s'il n'est pas présent
</span></span><span id="61" class="l"><a class="l" href="#61">61: </a><span class="php-comment"> */</span>
</span><span id="62" class="l"><a class="l" href="#62">62: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="_get" href="#_get">get</a>(<span class="php-var">$intitule</span>) {
</span><span id="63" class="l"><a class="l" href="#63">63: </a> <span class="php-keyword1">if</span> (<span class="php-keyword1">isset</span>(<span class="php-var">$this</span>-&gt;stockage[<span class="php-var">$intitule</span>])) {
</span><span id="64" class="l"><a class="l" href="#64">64: </a> <span class="php-keyword1">return</span> <span class="php-var">$this</span>-&gt;stockage[<span class="php-var">$intitule</span>];
</span><span id="65" class="l"><a class="l" href="#65">65: </a> }
</span><span id="66" class="l"><a class="l" href="#66">66: </a> <span class="php-keyword1">return</span> <span class="php-keyword1">null</span>;
</span><span id="67" class="l"><a class="l" href="#67">67: </a> }
</span><span id="68" class="l"><a class="l" href="#68">68: </a>
</span><span id="69" class="l"><a class="l" href="#69">69: </a> <span class="php-comment">/**
</span></span><span id="70" class="l"><a class="l" href="#70">70: </a><span class="php-comment"> * Détruit l'objet associé à l'intitulé, n'a pas d'effet si il n'y a pas d'objet associé
</span></span><span id="71" class="l"><a class="l" href="#71">71: </a><span class="php-comment"> */</span>
</span><span id="72" class="l"><a class="l" href="#72">72: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="_detruire" href="#_detruire">detruire</a>(<span class="php-var">$intitule</span>) {
</span><span id="73" class="l"><a class="l" href="#73">73: </a> <span class="php-keyword1">if</span> (<span class="php-keyword1">isset</span>(<span class="php-var">$this</span>-&gt;stockage[<span class="php-var">$intitule</span>])) {
</span><span id="74" class="l"><a class="l" href="#74">74: </a> <span class="php-keyword1">unset</span>(<span class="php-var">$this</span>-&gt;stockage[<span class="php-var">$intitule</span>]);
</span><span id="75" class="l"><a class="l" href="#75">75: </a> }
</span><span id="76" class="l"><a class="l" href="#76">76: </a> }
</span><span id="77" class="l"><a class="l" href="#77">77: </a>
</span><span id="78" class="l"><a class="l" href="#78">78: </a> <span class="php-comment">/**
</span></span><span id="79" class="l"><a class="l" href="#79">79: </a><span class="php-comment"> * Teste si un objet est présent sous un intitulé donné
</span></span><span id="80" class="l"><a class="l" href="#80">80: </a><span class="php-comment"> * @return boolean true si un objet associé à cet intitulé est présent, false sinon
</span></span><span id="81" class="l"><a class="l" href="#81">81: </a><span class="php-comment"> */</span>
</span><span id="82" class="l"><a class="l" href="#82">82: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="_existe" href="#_existe">existe</a>(<span class="php-var">$intitule</span>) {
</span><span id="83" class="l"><a class="l" href="#83">83: </a> <span class="php-keyword1">if</span>(<span class="php-keyword1">isset</span>(<span class="php-var">$this</span>-&gt;stockage[<span class="php-var">$intitule</span>])){
</span><span id="84" class="l"><a class="l" href="#84">84: </a> <span class="php-keyword1">return</span> <span class="php-keyword1">true</span>;
</span><span id="85" class="l"><a class="l" href="#85">85: </a> }
</span><span id="86" class="l"><a class="l" href="#86">86: </a> <span class="php-keyword1">return</span> <span class="php-keyword1">false</span>;
</span><span id="87" class="l"><a class="l" href="#87">87: </a> }
</span><span id="88" class="l"><a class="l" href="#88">88: </a>}
</span><span id="89" class="l"><a class="l" href="#89">89: </a></span><span class="xlang">?&gt;</span></code></pre>
 
<div id="footer">
TBFramework - v0.2 API documentation generated by <a href="http://apigen.org">ApiGen 2.8.0</a>
/branches/v0.2-buhl/doc/ApiGen/source-function-autoloadFw.html
8,7 → 8,7
<title>File autoload.inc.php | TBFramework - v0.2</title>
 
<script type="text/javascript" src="resources/combined.js?4205936287"></script>
<script type="text/javascript" src="elementlist.js?117657638"></script>
<script type="text/javascript" src="elementlist.js?1835392179"></script>
<link rel="stylesheet" type="text/css" media="all" href="resources/style.css?3505392360">
 
</head>
41,6 → 41,7
<li><a href="class-Controleur.html">Controleur</a></li>
<li><a href="class-Debug.html">Debug</a></li>
<li><a href="class-GestionnaireException.html">GestionnaireException</a></li>
<li><a href="class-I18n.html">I18n</a></li>
<li><a href="class-Log.html">Log</a></li>
<li><a href="class-Modele.html">Modele</a></li>
<li><a href="class-Registre.html">Registre</a></li>
105,63 → 106,58
</span></span><span id="4" class="l"><a class="l" href="#4"> 4: </a><span class="php-comment"> * Fichier contenant la fonction de chargement automatique de classes, il doit toujours rester à la racine
</span></span><span id="5" class="l"><a class="l" href="#5"> 5: </a><span class="php-comment"> * du framework car il initialise le chemin de l'application en se basant sur son propre emplacement.
</span></span><span id="6" class="l"><a class="l" href="#6"> 6: </a><span class="php-comment"> *
</span></span><span id="7" class="l"><a class="l" href="#7"> 7: </a><span class="php-comment"> * PHP Version 5.1.2
</span></span><span id="8" class="l"><a class="l" href="#8"> 8: </a><span class="php-comment"> *
</span></span><span id="9" class="l"><a class="l" href="#9"> 9: </a><span class="php-comment"> * @category Fichier_De_Fonctions
</span></span><span id="10" class="l"><a class="l" href="#10">10: </a><span class="php-comment"> * @package Framework
</span></span><span id="11" class="l"><a class="l" href="#11">11: </a><span class="php-comment"> // Auteur principal :
</span></span><span id="12" class="l"><a class="l" href="#12">12: </a><span class="php-comment"> * @author Aurelien PERONNET &lt;aurelien@tela-botanica.org&gt;
</span></span><span id="13" class="l"><a class="l" href="#13">13: </a><span class="php-comment"> // Autres auteurs :
</span></span><span id="14" class="l"><a class="l" href="#14">14: </a><span class="php-comment"> * @author Jean-Pascal MILCENT &lt;jpm@tela-botanica.org&gt;
</span></span><span id="15" class="l"><a class="l" href="#15">15: </a><span class="php-comment"> * @license GPL v3 &lt;http://www.gnu.org/licenses/gpl.txt&gt;
</span></span><span id="16" class="l"><a class="l" href="#16">16: </a><span class="php-comment"> * @license CECILL v2 &lt;http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt&gt;
</span></span><span id="17" class="l"><a class="l" href="#17">17: </a><span class="php-comment"> * @version $$Id: autoload.inc.php 188 2010-04-29 12:09:17Z jpm $$
</span></span><span id="18" class="l"><a class="l" href="#18">18: </a><span class="php-comment"> * @copyright 1999-2009 Tela Botanica (accueil@tela-botanica.org)
</span></span><span id="19" class="l"><a class="l" href="#19">19: </a><span class="php-comment"> */</span>
</span><span id="20" class="l"><a class="l" href="#20">20: </a>
</span><span id="21" class="l"><a class="l" href="#21">21: </a><span class="php-comment">// Redéfinition de la constante DIRECTORY_SEPARATOR</span>
</span><span id="22" class="l"><a class="l" href="#22">22: </a><span class="php-keyword1">if</span> (!<span class="php-keyword2">defined</span>(<span class="php-quote">'DS'</span>)) {
</span><span id="23" class="l"><a class="l" href="#23">23: </a> <span class="php-keyword2">define</span>(<span class="php-quote">'DS'</span>, DIRECTORY_SEPARATOR);
</span><span id="24" class="l"><a class="l" href="#24">24: </a>}
</span><span id="25" class="l"><a class="l" href="#25">25: </a><span class="php-comment">// Redéfinition de la constante PATH_SEPARATOR</span>
</span><span id="26" class="l"><a class="l" href="#26">26: </a><span class="php-keyword1">if</span> (!<span class="php-keyword2">defined</span>(<span class="php-quote">'PS'</span>)) {
</span><span id="27" class="l"><a class="l" href="#27">27: </a> <span class="php-keyword2">define</span>(<span class="php-quote">'PS'</span>, PATH_SEPARATOR);
</span><span id="28" class="l"><a class="l" href="#28">28: </a>}
</span><span id="29" class="l"><a class="l" href="#29">29: </a>
</span><span id="30" class="l"><a class="l" href="#30">30: </a><span class="php-comment">// Autoload pour le Framework</span>
</span><span id="31" class="l"><a class="l" href="#31">31: </a><span class="php-keyword1">function</span> <a id="_autoloadFw" href="#_autoloadFw">autoloadFw</a>(<span class="php-var">$nom_classe_fw</span>) {
</span><span id="32" class="l"><a class="l" href="#32">32: </a> <span class="php-var">$fichier_a_inclure</span> = <span class="php-keyword2">dirname</span>(__FILE__).DS.<span class="php-var">$nom_classe_fw</span>.<span class="php-quote">'.php'</span>;
</span><span id="33" class="l"><a class="l" href="#33">33: </a> <span class="php-keyword1">if</span> (<span class="php-keyword2">file_exists</span>(<span class="php-var">$fichier_a_inclure</span>)) {
</span><span id="34" class="l"><a class="l" href="#34">34: </a> <span class="php-keyword1">include_once</span> <span class="php-var">$fichier_a_inclure</span>;
</span><span id="35" class="l"><a class="l" href="#35">35: </a> <span class="php-keyword1">return</span> <span class="php-keyword1">null</span>;
</span><span id="36" class="l"><a class="l" href="#36">36: </a> }
</span><span id="37" class="l"><a class="l" href="#37">37: </a>}
</span><span id="38" class="l"><a class="l" href="#38">38: </a><span class="php-keyword2">spl_autoload_register</span>(<span class="php-quote">'autoloadFw'</span>);
</span><span id="39" class="l"><a class="l" href="#39">39: </a>
</span><span id="40" class="l"><a class="l" href="#40">40: </a><span class="php-comment">// Initialisation du gestionnaire d'erreur avant toute chose</span>
</span><span id="41" class="l"><a class="l" href="#41">41: </a>GestionnaireException::initialiser();
</span><span id="42" class="l"><a class="l" href="#42">42: </a>
</span><span id="43" class="l"><a class="l" href="#43">43: </a><span class="php-comment">// Autoload par défaut pour l'application</span>
</span><span id="44" class="l"><a class="l" href="#44">44: </a><span class="php-keyword1">function</span> <a id="_autoloadAppliDefaut" href="#_autoloadAppliDefaut">autoloadAppliDefaut</a>(<span class="php-var">$nom_classe</span>) {
</span><span id="45" class="l"><a class="l" href="#45">45: </a> <span class="php-var">$dossiers_classes</span> = <span class="php-keyword1">array</span>( Config::get(<span class="php-quote">'chemin_controleurs'</span>),
</span><span id="46" class="l"><a class="l" href="#46">46: </a> Config::get(<span class="php-quote">'chemin_modeles'</span>),
</span><span id="47" class="l"><a class="l" href="#47">47: </a> Config::get(<span class="php-quote">'chemin_bibliotheque'</span>));
</span><span id="48" class="l"><a class="l" href="#48">48: </a>
</span><span id="49" class="l"><a class="l" href="#49">49: </a> <span class="php-keyword1">foreach</span> (<span class="php-var">$dossiers_classes</span> <span class="php-keyword1">as</span> <span class="php-var">$chemin</span>) {
</span><span id="50" class="l"><a class="l" href="#50">50: </a> <span class="php-var">$fichier_a_tester</span> = <span class="php-var">$chemin</span>.<span class="php-var">$nom_classe</span>.<span class="php-quote">'.php'</span>;
</span><span id="51" class="l"><a class="l" href="#51">51: </a> <span class="php-keyword1">if</span> (<span class="php-keyword2">file_exists</span>(<span class="php-var">$fichier_a_tester</span>)) {
</span><span id="52" class="l"><a class="l" href="#52">52: </a> <span class="php-keyword1">include_once</span> <span class="php-var">$fichier_a_tester</span>;
</span><span id="53" class="l"><a class="l" href="#53">53: </a> <span class="php-keyword1">return</span> <span class="php-keyword1">null</span>;
</span><span id="54" class="l"><a class="l" href="#54">54: </a> }
</span><span id="55" class="l"><a class="l" href="#55">55: </a> }
</span><span id="56" class="l"><a class="l" href="#56">56: </a>}
</span><span id="57" class="l"><a class="l" href="#57">57: </a><span class="php-keyword2">spl_autoload_register</span>(<span class="php-quote">'autoloadAppliDefaut'</span>);
</span><span id="58" class="l"><a class="l" href="#58">58: </a>
</span><span id="59" class="l"><a class="l" href="#59">59: </a><span class="php-comment">// Autoload défini par l'application</span>
</span><span id="60" class="l"><a class="l" href="#60">60: </a><span class="php-keyword1">if</span> (<span class="php-keyword2">function_exists</span>(<span class="php-quote">'__autoload'</span>)) {
</span><span id="61" class="l"><a class="l" href="#61">61: </a> <span class="php-keyword2">spl_autoload_register</span>(<span class="php-quote">'__autoload'</span>);
</span><span id="62" class="l"><a class="l" href="#62">62: </a>}
</span><span id="63" class="l"><a class="l" href="#63">63: </a></span><span class="xlang">?&gt;</span></code></pre>
</span></span><span id="7" class="l"><a class="l" href="#7"> 7: </a><span class="php-comment"> * @category PHP 5.2
</span></span><span id="8" class="l"><a class="l" href="#8"> 8: </a><span class="php-comment"> * @package Framework
</span></span><span id="9" class="l"><a class="l" href="#9"> 9: </a><span class="php-comment"> * @author Aurelien PERONNET &lt;aurelien@tela-botanica.org&gt;
</span></span><span id="10" class="l"><a class="l" href="#10">10: </a><span class="php-comment"> * @author Jean-Pascal MILCENT &lt;jpm@tela-botanica.org&gt;
</span></span><span id="11" class="l"><a class="l" href="#11">11: </a><span class="php-comment"> * @copyright Copyright (c) 2009, Tela Botanica (accueil@tela-botanica.org)
</span></span><span id="12" class="l"><a class="l" href="#12">12: </a><span class="php-comment"> * @license GPL v3 &lt;http://www.gnu.org/licenses/gpl.txt&gt;
</span></span><span id="13" class="l"><a class="l" href="#13">13: </a><span class="php-comment"> * @license CECILL v2 &lt;http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt&gt;
</span></span><span id="14" class="l"><a class="l" href="#14">14: </a><span class="php-comment"> */</span>
</span><span id="15" class="l"><a class="l" href="#15">15: </a>
</span><span id="16" class="l"><a class="l" href="#16">16: </a><span class="php-comment">// Redéfinition de la constante DIRECTORY_SEPARATOR</span>
</span><span id="17" class="l"><a class="l" href="#17">17: </a><span class="php-keyword1">if</span> (!<span class="php-keyword2">defined</span>(<span class="php-quote">'DS'</span>)) {
</span><span id="18" class="l"><a class="l" href="#18">18: </a> <span class="php-keyword2">define</span>(<span class="php-quote">'DS'</span>, DIRECTORY_SEPARATOR);
</span><span id="19" class="l"><a class="l" href="#19">19: </a>}
</span><span id="20" class="l"><a class="l" href="#20">20: </a><span class="php-comment">// Redéfinition de la constante PATH_SEPARATOR</span>
</span><span id="21" class="l"><a class="l" href="#21">21: </a><span class="php-keyword1">if</span> (!<span class="php-keyword2">defined</span>(<span class="php-quote">'PS'</span>)) {
</span><span id="22" class="l"><a class="l" href="#22">22: </a> <span class="php-keyword2">define</span>(<span class="php-quote">'PS'</span>, PATH_SEPARATOR);
</span><span id="23" class="l"><a class="l" href="#23">23: </a>}
</span><span id="24" class="l"><a class="l" href="#24">24: </a>
</span><span id="25" class="l"><a class="l" href="#25">25: </a><span class="php-comment">// Autoload pour le Framework</span>
</span><span id="26" class="l"><a class="l" href="#26">26: </a><span class="php-keyword1">function</span> <a id="_autoloadFw" href="#_autoloadFw">autoloadFw</a>(<span class="php-var">$nom_classe_fw</span>) {
</span><span id="27" class="l"><a class="l" href="#27">27: </a> <span class="php-var">$fichier_a_inclure</span> = <span class="php-keyword2">dirname</span>(__FILE__).DS.<span class="php-var">$nom_classe_fw</span>.<span class="php-quote">'.php'</span>;
</span><span id="28" class="l"><a class="l" href="#28">28: </a> <span class="php-keyword1">if</span> (<span class="php-keyword2">file_exists</span>(<span class="php-var">$fichier_a_inclure</span>)) {
</span><span id="29" class="l"><a class="l" href="#29">29: </a> <span class="php-keyword1">include_once</span> <span class="php-var">$fichier_a_inclure</span>;
</span><span id="30" class="l"><a class="l" href="#30">30: </a> <span class="php-keyword1">return</span> <span class="php-keyword1">null</span>;
</span><span id="31" class="l"><a class="l" href="#31">31: </a> }
</span><span id="32" class="l"><a class="l" href="#32">32: </a>}
</span><span id="33" class="l"><a class="l" href="#33">33: </a><span class="php-keyword2">spl_autoload_register</span>(<span class="php-quote">'autoloadFw'</span>);
</span><span id="34" class="l"><a class="l" href="#34">34: </a>
</span><span id="35" class="l"><a class="l" href="#35">35: </a><span class="php-comment">// Initialisation du gestionnaire d'erreur avant toute chose</span>
</span><span id="36" class="l"><a class="l" href="#36">36: </a>GestionnaireException::initialiser();
</span><span id="37" class="l"><a class="l" href="#37">37: </a>
</span><span id="38" class="l"><a class="l" href="#38">38: </a><span class="php-comment">// Autoload par défaut pour l'application</span>
</span><span id="39" class="l"><a class="l" href="#39">39: </a><span class="php-keyword1">function</span> <a id="_autoloadAppliDefaut" href="#_autoloadAppliDefaut">autoloadAppliDefaut</a>(<span class="php-var">$nom_classe</span>) {
</span><span id="40" class="l"><a class="l" href="#40">40: </a> <span class="php-var">$dossiers_classes</span> = <span class="php-keyword1">array</span>( Config::get(<span class="php-quote">'chemin_controleurs'</span>),
</span><span id="41" class="l"><a class="l" href="#41">41: </a> Config::get(<span class="php-quote">'chemin_modeles'</span>),
</span><span id="42" class="l"><a class="l" href="#42">42: </a> Config::get(<span class="php-quote">'chemin_bibliotheque'</span>));
</span><span id="43" class="l"><a class="l" href="#43">43: </a>
</span><span id="44" class="l"><a class="l" href="#44">44: </a> <span class="php-keyword1">foreach</span> (<span class="php-var">$dossiers_classes</span> <span class="php-keyword1">as</span> <span class="php-var">$chemin</span>) {
</span><span id="45" class="l"><a class="l" href="#45">45: </a> <span class="php-var">$fichier_a_tester</span> = <span class="php-var">$chemin</span>.<span class="php-var">$nom_classe</span>.<span class="php-quote">'.php'</span>;
</span><span id="46" class="l"><a class="l" href="#46">46: </a> <span class="php-keyword1">if</span> (<span class="php-keyword2">file_exists</span>(<span class="php-var">$fichier_a_tester</span>)) {
</span><span id="47" class="l"><a class="l" href="#47">47: </a> <span class="php-keyword1">include_once</span> <span class="php-var">$fichier_a_tester</span>;
</span><span id="48" class="l"><a class="l" href="#48">48: </a> <span class="php-keyword1">return</span> <span class="php-keyword1">null</span>;
</span><span id="49" class="l"><a class="l" href="#49">49: </a> }
</span><span id="50" class="l"><a class="l" href="#50">50: </a> }
</span><span id="51" class="l"><a class="l" href="#51">51: </a>}
</span><span id="52" class="l"><a class="l" href="#52">52: </a><span class="php-keyword2">spl_autoload_register</span>(<span class="php-quote">'autoloadAppliDefaut'</span>);
</span><span id="53" class="l"><a class="l" href="#53">53: </a>
</span><span id="54" class="l"><a class="l" href="#54">54: </a><span class="php-comment">// Autoload défini par l'application</span>
</span><span id="55" class="l"><a class="l" href="#55">55: </a><span class="php-keyword1">if</span> (<span class="php-keyword2">function_exists</span>(<span class="php-quote">'__autoload'</span>)) {
</span><span id="56" class="l"><a class="l" href="#56">56: </a> <span class="php-keyword2">spl_autoload_register</span>(<span class="php-quote">'__autoload'</span>);
</span><span id="57" class="l"><a class="l" href="#57">57: </a>}
</span><span id="58" class="l"><a class="l" href="#58">58: </a></span><span class="xlang">?&gt;</span></code></pre>
 
<div id="footer">
TBFramework - v0.2 API documentation generated by <a href="http://apigen.org">ApiGen 2.8.0</a>
/branches/v0.2-buhl/doc/ApiGen/source-class-Debug.html
8,7 → 8,7
<title>File Debug.php | TBFramework - v0.2</title>
 
<script type="text/javascript" src="resources/combined.js?4205936287"></script>
<script type="text/javascript" src="elementlist.js?117657638"></script>
<script type="text/javascript" src="elementlist.js?1835392179"></script>
<link rel="stylesheet" type="text/css" media="all" href="resources/style.css?3505392360">
 
</head>
41,6 → 41,7
<li><a href="class-Controleur.html">Controleur</a></li>
<li class="active"><a href="class-Debug.html">Debug</a></li>
<li><a href="class-GestionnaireException.html">GestionnaireException</a></li>
<li><a href="class-I18n.html">I18n</a></li>
<li><a href="class-Log.html">Log</a></li>
<li><a href="class-Modele.html">Modele</a></li>
<li><a href="class-Registre.html">Registre</a></li>
106,122 → 107,142
</span></span><span id="5" class="l"><a class="l" href="#5"> 5: </a><span class="php-comment"> * L'affichage et l'utilisation de ces fonctions sont améliorés via cette classe.
</span></span><span id="6" class="l"><a class="l" href="#6"> 6: </a><span class="php-comment"> * Cette classe est inspirée de la classe Zend_Debug.
</span></span><span id="7" class="l"><a class="l" href="#7"> 7: </a><span class="php-comment"> *
</span></span><span id="8" class="l"><a class="l" href="#8"> 8: </a><span class="php-comment"> * PHP version 5
</span></span><span id="9" class="l"><a class="l" href="#9"> 9: </a><span class="php-comment"> *
</span></span><span id="10" class="l"><a class="l" href="#10"> 10: </a><span class="php-comment"> * @category Debogage
</span></span><span id="11" class="l"><a class="l" href="#11"> 11: </a><span class="php-comment"> * @package Framework
</span></span><span id="12" class="l"><a class="l" href="#12"> 12: </a><span class="php-comment"> // Auteur principal :
</span></span><span id="13" class="l"><a class="l" href="#13"> 13: </a><span class="php-comment"> * @author Jean-Pascal MILCENT &lt;jpm@tela-botanica.org&gt;
</span></span><span id="14" class="l"><a class="l" href="#14"> 14: </a><span class="php-comment"> // Autres auteurs :
</span></span><span id="15" class="l"><a class="l" href="#15"> 15: </a><span class="php-comment"> * @license GPL v3 &lt;http://www.gnu.org/licenses/gpl.txt&gt;
</span></span><span id="16" class="l"><a class="l" href="#16"> 16: </a><span class="php-comment"> * @license CECILL v2 &lt;http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt&gt;
</span></span><span id="17" class="l"><a class="l" href="#17"> 17: </a><span class="php-comment"> * @version $$Id: Debug.php 167 2010-03-19 17:12:08Z jpm $$
</span></span><span id="18" class="l"><a class="l" href="#18"> 18: </a><span class="php-comment"> * @copyright 1999-2009 Tela Botanica (accueil@tela-botanica.org)
</span></span><span id="19" class="l"><a class="l" href="#19"> 19: </a><span class="php-comment"> */</span>
</span><span id="20" class="l"><a class="l" href="#20"> 20: </a><span class="php-keyword1">class</span> <a id="Debug" href="#Debug">Debug</a> {
</span><span id="21" class="l"><a class="l" href="#21"> 21: </a>
</span><span id="22" class="l"><a class="l" href="#22"> 22: </a> <span class="php-comment">/**
</span></span><span id="23" class="l"><a class="l" href="#23"> 23: </a><span class="php-comment"> * mode de php (cli ou sapi)
</span></span><span id="24" class="l"><a class="l" href="#24"> 24: </a><span class="php-comment"> */</span>
</span><span id="25" class="l"><a class="l" href="#25"> 25: </a> <span class="php-keyword1">protected</span> <span class="php-keyword1">static</span> <span class="php-var"><a id="$mode" href="#$mode">$mode</a></span> = <span class="php-keyword1">null</span>;
</span><span id="26" class="l"><a class="l" href="#26"> 26: </a>
</span><span id="27" class="l"><a class="l" href="#27"> 27: </a> <span class="php-comment">/**
</span></span><span id="28" class="l"><a class="l" href="#28"> 28: </a><span class="php-comment"> * Accesseur pour le mode
</span></span><span id="29" class="l"><a class="l" href="#29"> 29: </a><span class="php-comment"> * @return string le mode de php
</span></span><span id="30" class="l"><a class="l" href="#30"> 30: </a><span class="php-comment"> */</span>
</span><span id="31" class="l"><a class="l" href="#31"> 31: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_getMode" href="#_getMode">getMode</a>() {
</span><span id="32" class="l"><a class="l" href="#32"> 32: </a> <span class="php-keyword1">if</span> (self::<span class="php-var">$mode</span> === <span class="php-keyword1">null</span>) {
</span><span id="33" class="l"><a class="l" href="#33"> 33: </a> self::<span class="php-var">$mode</span> = PHP_SAPI;
</span><span id="34" class="l"><a class="l" href="#34"> 34: </a> }
</span><span id="35" class="l"><a class="l" href="#35"> 35: </a> <span class="php-keyword1">return</span> self::<span class="php-var">$mode</span>;
</span><span id="36" class="l"><a class="l" href="#36"> 36: </a> }
</span><span id="37" class="l"><a class="l" href="#37"> 37: </a>
</span><span id="38" class="l"><a class="l" href="#38"> 38: </a> <span class="php-comment">/**
</span></span><span id="39" class="l"><a class="l" href="#39"> 39: </a><span class="php-comment"> * Equivalent de var_dump
</span></span><span id="40" class="l"><a class="l" href="#40"> 40: </a><span class="php-comment"> * @param mixed $variable la variable à dumper
</span></span><span id="41" class="l"><a class="l" href="#41"> 41: </a><span class="php-comment"> * @param string $mot_cle le mot cle à associer à la variable
</span></span><span id="42" class="l"><a class="l" href="#42"> 42: </a><span class="php-comment"> * @param boolean $echo si true on affiche le résultat, si false on ne renvoie que la chaine sans l'afficher
</span></span><span id="43" class="l"><a class="l" href="#43"> 43: </a><span class="php-comment"> * @return string la chaine à afficher representant le dump ou null si echo
</span></span><span id="44" class="l"><a class="l" href="#44"> 44: </a><span class="php-comment"> */</span>
</span><span id="45" class="l"><a class="l" href="#45"> 45: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_dump" href="#_dump">dump</a>(<span class="php-var">$variable</span>, <span class="php-var">$mot_cle</span> = <span class="php-keyword1">null</span>, <span class="php-var">$echo</span> = <span class="php-keyword1">true</span>) {
</span><span id="46" class="l"><a class="l" href="#46"> 46: </a> <span class="php-comment">// var_dump de la variable dans un buffer et récupération de la sortie</span>
</span><span id="47" class="l"><a class="l" href="#47"> 47: </a> <span class="php-keyword2">ob_start</span>();
</span><span id="48" class="l"><a class="l" href="#48"> 48: </a> <span class="php-keyword2">var_dump</span>(<span class="php-var">$variable</span>);
</span><span id="49" class="l"><a class="l" href="#49"> 49: </a> <span class="php-var">$sortie</span> = <span class="php-keyword2">ob_get_clean</span>();
</span><span id="50" class="l"><a class="l" href="#50"> 50: </a>
</span><span id="51" class="l"><a class="l" href="#51"> 51: </a> <span class="php-comment">// Pré-traitement de la sortie</span>
</span><span id="52" class="l"><a class="l" href="#52"> 52: </a> <span class="php-var">$sortie</span> = <span class="php-keyword2">preg_replace</span>(<span class="php-quote">&quot;/\]\=\&gt;\n(\s+)/m&quot;</span>, <span class="php-quote">&quot;] =&gt; &quot;</span>, <span class="php-var">$sortie</span>);
</span><span id="53" class="l"><a class="l" href="#53"> 53: </a>
</span><span id="54" class="l"><a class="l" href="#54"> 54: </a> <span class="php-comment">// Traitement général du débogage</span>
</span><span id="55" class="l"><a class="l" href="#55"> 55: </a> <span class="php-keyword1">return</span> self::traiterDebogage(<span class="php-var">$mot_cle</span>, <span class="php-var">$sortie</span>, <span class="php-var">$echo</span>);
</span><span id="56" class="l"><a class="l" href="#56"> 56: </a> }
</span><span id="57" class="l"><a class="l" href="#57"> 57: </a>
</span><span id="58" class="l"><a class="l" href="#58"> 58: </a> <span class="php-comment">/**
</span></span><span id="59" class="l"><a class="l" href="#59"> 59: </a><span class="php-comment"> * Equivalent de print_r
</span></span><span id="60" class="l"><a class="l" href="#60"> 60: </a><span class="php-comment"> * @param mixed $variable la variable à afficher
</span></span><span id="61" class="l"><a class="l" href="#61"> 61: </a><span class="php-comment"> * @param string $mot_cle le mot cle à associer
</span></span><span id="62" class="l"><a class="l" href="#62"> 62: </a><span class="php-comment"> * @param boolean $echo faire un echo ou non
</span></span><span id="63" class="l"><a class="l" href="#63"> 63: </a><span class="php-comment"> * @return string la chaine contenant la variable printée ou null si echo
</span></span><span id="64" class="l"><a class="l" href="#64"> 64: </a><span class="php-comment"> */</span>
</span><span id="65" class="l"><a class="l" href="#65"> 65: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_printr" href="#_printr">printr</a>(<span class="php-var">$variable</span>, <span class="php-var">$mot_cle</span> = <span class="php-keyword1">null</span>, <span class="php-var">$echo</span> = <span class="php-keyword1">true</span>) {
</span><span id="66" class="l"><a class="l" href="#66"> 66: </a> <span class="php-comment">// Récupération de la sortie</span>
</span><span id="67" class="l"><a class="l" href="#67"> 67: </a> <span class="php-var">$sortie</span> = <span class="php-keyword2">print_r</span>(<span class="php-var">$variable</span>, <span class="php-keyword1">true</span>);
</span><span id="68" class="l"><a class="l" href="#68"> 68: </a>
</span><span id="69" class="l"><a class="l" href="#69"> 69: </a> <span class="php-comment">// Traitement général du débogage</span>
</span><span id="70" class="l"><a class="l" href="#70"> 70: </a> <span class="php-keyword1">return</span> self::traiterDebogage(<span class="php-var">$mot_cle</span>, <span class="php-var">$sortie</span>, <span class="php-var">$echo</span>);
</span><span id="71" class="l"><a class="l" href="#71"> 71: </a> }
</span><span id="72" class="l"><a class="l" href="#72"> 72: </a>
</span><span id="73" class="l"><a class="l" href="#73"> 73: </a> <span class="php-comment">/**
</span></span><span id="74" class="l"><a class="l" href="#74"> 74: </a><span class="php-comment"> * Traite une chaine de débogage et les mots clés associés
</span></span><span id="75" class="l"><a class="l" href="#75"> 75: </a><span class="php-comment"> * @param string $mot_cle le mot à associer à la chaine
</span></span><span id="76" class="l"><a class="l" href="#76"> 76: </a><span class="php-comment"> * @param string $sortie le chaine de debogage
</span></span><span id="77" class="l"><a class="l" href="#77"> 77: </a><span class="php-comment"> * @param boolean $echo faire un echo du resultat ou non
</span></span><span id="78" class="l"><a class="l" href="#78"> 78: </a><span class="php-comment"> * @return string la chaine de debogage formatée ou bien null si echo
</span></span><span id="79" class="l"><a class="l" href="#79"> 79: </a><span class="php-comment"> */</span>
</span><span id="80" class="l"><a class="l" href="#80"> 80: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_traiterDebogage" href="#_traiterDebogage">traiterDebogage</a>(<span class="php-var">$mot_cle</span>, <span class="php-var">$sortie</span>, <span class="php-var">$echo</span>) {
</span><span id="81" class="l"><a class="l" href="#81"> 81: </a> <span class="php-comment">// Formate le mot-clé</span>
</span><span id="82" class="l"><a class="l" href="#82"> 82: </a> <span class="php-var">$mot_cle</span> = self::formaterMotCle(<span class="php-var">$mot_cle</span>);
</span><span id="83" class="l"><a class="l" href="#83"> 83: </a>
</span><span id="84" class="l"><a class="l" href="#84"> 84: </a> <span class="php-comment">// Traitement de la sortie</span>
</span><span id="85" class="l"><a class="l" href="#85"> 85: </a> <span class="php-var">$sortie</span> = self::traiterSortieSuivantMode(<span class="php-var">$mot_cle</span>, <span class="php-var">$sortie</span>);
</span><span id="86" class="l"><a class="l" href="#86"> 86: </a>
</span><span id="87" class="l"><a class="l" href="#87"> 87: </a> <span class="php-comment">// Affichage et/ou retour</span>
</span><span id="88" class="l"><a class="l" href="#88"> 88: </a> <span class="php-keyword1">if</span> (Config::get(<span class="php-quote">'fw_debogage'</span>) == <span class="php-keyword1">true</span>) {
</span><span id="89" class="l"><a class="l" href="#89"> 89: </a> <span class="php-keyword1">if</span> (<span class="php-var">$echo</span>) {
</span><span id="90" class="l"><a class="l" href="#90"> 90: </a> <span class="php-keyword1">echo</span> <span class="php-var">$sortie</span>;
</span><span id="91" class="l"><a class="l" href="#91"> 91: </a> <span class="php-keyword1">return</span> <span class="php-keyword1">null</span>;
</span><span id="92" class="l"><a class="l" href="#92"> 92: </a> } <span class="php-keyword1">else</span> {
</span><span id="93" class="l"><a class="l" href="#93"> 93: </a> <span class="php-keyword1">return</span> <span class="php-var">$sortie</span>;
</span><span id="94" class="l"><a class="l" href="#94"> 94: </a> }
</span><span id="95" class="l"><a class="l" href="#95"> 95: </a> }
</span><span id="96" class="l"><a class="l" href="#96"> 96: </a> }
</span><span id="97" class="l"><a class="l" href="#97"> 97: </a>
</span><span id="98" class="l"><a class="l" href="#98"> 98: </a> <span class="php-comment">/**
</span></span><span id="99" class="l"><a class="l" href="#99"> 99: </a><span class="php-comment"> * formate un mot clé donné
</span></span><span id="100" class="l"><a class="l" href="#100">100: </a><span class="php-comment"> * @param string $mot_cle le mot clé à formaté
</span></span><span id="101" class="l"><a class="l" href="#101">101: </a><span class="php-comment"> * @return string le mot clé formaté ou bien un chaine vide le mot clé est null ou vide
</span></span><span id="102" class="l"><a class="l" href="#102">102: </a><span class="php-comment"> */</span>
</span><span id="103" class="l"><a class="l" href="#103">103: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_formaterMotCle" href="#_formaterMotCle">formaterMotCle</a>(<span class="php-var">$mot_cle</span>) {
</span><span id="104" class="l"><a class="l" href="#104">104: </a> <span class="php-keyword1">return</span> (<span class="php-var">$mot_cle</span> === <span class="php-keyword1">null</span>) ? <span class="php-quote">''</span> : <span class="php-keyword2">rtrim</span>(<span class="php-var">$mot_cle</span>).<span class="php-quote">' '</span>;
</span><span id="105" class="l"><a class="l" href="#105">105: </a> }
</span><span id="106" class="l"><a class="l" href="#106">106: </a>
</span><span id="107" class="l"><a class="l" href="#107">107: </a> <span class="php-comment">/**
</span></span><span id="108" class="l"><a class="l" href="#108">108: </a><span class="php-comment"> * traite la sortie de la chaine de débogage suivant le mode de php
</span></span><span id="109" class="l"><a class="l" href="#109">109: </a><span class="php-comment"> * @param string $mot_cle le mot clé associé à la chaine
</span></span><span id="110" class="l"><a class="l" href="#110">110: </a><span class="php-comment"> * @param string $sortie la chaine de débogage
</span></span><span id="111" class="l"><a class="l" href="#111">111: </a><span class="php-comment"> * @return string la sortie formatée pour le mode en cours
</span></span><span id="112" class="l"><a class="l" href="#112">112: </a><span class="php-comment"> */</span>
</span><span id="113" class="l"><a class="l" href="#113">113: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_traiterSortieSuivantMode" href="#_traiterSortieSuivantMode">traiterSortieSuivantMode</a>(<span class="php-var">$mot_cle</span>, <span class="php-var">$sortie</span>) {
</span><span id="114" class="l"><a class="l" href="#114">114: </a> <span class="php-var">$corps</span> = <span class="php-var">$mot_cle</span>.PHP_EOL.<span class="php-var">$sortie</span>;
</span><span id="115" class="l"><a class="l" href="#115">115: </a> <span class="php-keyword1">if</span> (self::getMode() == <span class="php-quote">'cli'</span>) {
</span><span id="116" class="l"><a class="l" href="#116">116: </a> <span class="php-var">$sortie</span> = PHP_EOL.<span class="php-var">$corps</span>.PHP_EOL;
</span><span id="117" class="l"><a class="l" href="#117">117: </a> } <span class="php-keyword1">else</span> {
</span><span id="118" class="l"><a class="l" href="#118">118: </a> <span class="php-var">$sortie</span> = <span class="php-quote">'&lt;pre&gt;'</span>.<span class="php-var">$corps</span>.<span class="php-quote">'&lt;/pre&gt;'</span>;
</span><span id="119" class="l"><a class="l" href="#119">119: </a> }
</span><span id="120" class="l"><a class="l" href="#120">120: </a> <span class="php-keyword1">return</span> <span class="php-var">$sortie</span>;
</span><span id="121" class="l"><a class="l" href="#121">121: </a> }
</span><span id="122" class="l"><a class="l" href="#122">122: </a>}
</span><span id="123" class="l"><a class="l" href="#123">123: </a></span><span class="xlang">?&gt;</span></code></pre>
</span></span><span id="8" class="l"><a class="l" href="#8"> 8: </a><span class="php-comment"> * @category PHP 5.2
</span></span><span id="9" class="l"><a class="l" href="#9"> 9: </a><span class="php-comment"> * @package Framework
</span></span><span id="10" class="l"><a class="l" href="#10"> 10: </a><span class="php-comment"> * @author Jean-Pascal MILCENT &lt;jpm@tela-botanica.org&gt;
</span></span><span id="11" class="l"><a class="l" href="#11"> 11: </a><span class="php-comment"> * @copyright Copyright (c) 2009, Tela Botanica (accueil@tela-botanica.org)
</span></span><span id="12" class="l"><a class="l" href="#12"> 12: </a><span class="php-comment"> * @license GNU-GPL-v3 &lt;http://www.gnu.org/licenses/gpl.html&gt;
</span></span><span id="13" class="l"><a class="l" href="#13"> 13: </a><span class="php-comment"> * @license CECILL-v2 &lt;http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt&gt;
</span></span><span id="14" class="l"><a class="l" href="#14"> 14: </a><span class="php-comment"> */</span>
</span><span id="15" class="l"><a class="l" href="#15"> 15: </a><span class="php-keyword1">class</span> <a id="Debug" href="#Debug">Debug</a> {
</span><span id="16" class="l"><a class="l" href="#16"> 16: </a>
</span><span id="17" class="l"><a class="l" href="#17"> 17: </a> <span class="php-keyword1">const</span> <a id="MODE_ECHO" href="#MODE_ECHO">MODE_ECHO</a> = <span class="php-quote">'echo'</span>;
</span><span id="18" class="l"><a class="l" href="#18"> 18: </a> <span class="php-keyword1">const</span> <a id="MODE_NOTICE" href="#MODE_NOTICE">MODE_NOTICE</a> = <span class="php-quote">'e_user_notice'</span>;
</span><span id="19" class="l"><a class="l" href="#19"> 19: </a>
</span><span id="20" class="l"><a class="l" href="#20"> 20: </a> <span class="php-comment">/**
</span></span><span id="21" class="l"><a class="l" href="#21"> 21: </a><span class="php-comment"> * mode de php (cli ou sapi)
</span></span><span id="22" class="l"><a class="l" href="#22"> 22: </a><span class="php-comment"> */</span>
</span><span id="23" class="l"><a class="l" href="#23"> 23: </a> <span class="php-keyword1">protected</span> <span class="php-keyword1">static</span> <span class="php-var"><a id="$mode" href="#$mode">$mode</a></span> = <span class="php-keyword1">null</span>;
</span><span id="24" class="l"><a class="l" href="#24"> 24: </a>
</span><span id="25" class="l"><a class="l" href="#25"> 25: </a> <span class="php-comment">/**
</span></span><span id="26" class="l"><a class="l" href="#26"> 26: </a><span class="php-comment"> * Accesseur pour le mode
</span></span><span id="27" class="l"><a class="l" href="#27"> 27: </a><span class="php-comment"> * @return string le mode de php
</span></span><span id="28" class="l"><a class="l" href="#28"> 28: </a><span class="php-comment"> */</span>
</span><span id="29" class="l"><a class="l" href="#29"> 29: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_getMode" href="#_getMode">getMode</a>() {
</span><span id="30" class="l"><a class="l" href="#30"> 30: </a> <span class="php-keyword1">if</span> (self::<span class="php-var">$mode</span> === <span class="php-keyword1">null</span>) {
</span><span id="31" class="l"><a class="l" href="#31"> 31: </a> self::<span class="php-var">$mode</span> = PHP_SAPI;
</span><span id="32" class="l"><a class="l" href="#32"> 32: </a> }
</span><span id="33" class="l"><a class="l" href="#33"> 33: </a> <span class="php-keyword1">return</span> self::<span class="php-var">$mode</span>;
</span><span id="34" class="l"><a class="l" href="#34"> 34: </a> }
</span><span id="35" class="l"><a class="l" href="#35"> 35: </a>
</span><span id="36" class="l"><a class="l" href="#36"> 36: </a> <span class="php-comment">/**
</span></span><span id="37" class="l"><a class="l" href="#37"> 37: </a><span class="php-comment"> * Equivalent de var_dump
</span></span><span id="38" class="l"><a class="l" href="#38"> 38: </a><span class="php-comment"> * @param mixed $variable la variable à dumper
</span></span><span id="39" class="l"><a class="l" href="#39"> 39: </a><span class="php-comment"> * @param string $mot_cle le mot cle à associer à la variable
</span></span><span id="40" class="l"><a class="l" href="#40"> 40: </a><span class="php-comment"> * @param boolean $echo si true on affiche le résultat, si false on ne renvoie que la chaine sans l'afficher
</span></span><span id="41" class="l"><a class="l" href="#41"> 41: </a><span class="php-comment"> * @return string la chaine à afficher representant le dump ou null si echo
</span></span><span id="42" class="l"><a class="l" href="#42"> 42: </a><span class="php-comment"> */</span>
</span><span id="43" class="l"><a class="l" href="#43"> 43: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_dump" href="#_dump">dump</a>(<span class="php-var">$variable</span>, <span class="php-var">$mot_cle</span> = <span class="php-keyword1">null</span>, <span class="php-var">$echo</span> = <span class="php-keyword1">false</span>) {
</span><span id="44" class="l"><a class="l" href="#44"> 44: </a> <span class="php-comment">// var_dump de la variable dans un buffer et récupération de la sortie</span>
</span><span id="45" class="l"><a class="l" href="#45"> 45: </a> <span class="php-keyword2">ob_start</span>();
</span><span id="46" class="l"><a class="l" href="#46"> 46: </a> <span class="php-keyword2">var_dump</span>(<span class="php-var">$variable</span>);
</span><span id="47" class="l"><a class="l" href="#47"> 47: </a> <span class="php-var">$sortie</span> = <span class="php-keyword2">ob_get_clean</span>();
</span><span id="48" class="l"><a class="l" href="#48"> 48: </a>
</span><span id="49" class="l"><a class="l" href="#49"> 49: </a> <span class="php-comment">// Pré-traitement de la sortie</span>
</span><span id="50" class="l"><a class="l" href="#50"> 50: </a> <span class="php-var">$sortie</span> = <span class="php-keyword2">preg_replace</span>(<span class="php-quote">&quot;/\]\=\&gt;\n(\s+)/m&quot;</span>, <span class="php-quote">&quot;] =&gt; &quot;</span>, <span class="php-var">$sortie</span>);
</span><span id="51" class="l"><a class="l" href="#51"> 51: </a>
</span><span id="52" class="l"><a class="l" href="#52"> 52: </a> <span class="php-comment">// Traitement général du débogage</span>
</span><span id="53" class="l"><a class="l" href="#53"> 53: </a> <span class="php-keyword1">return</span> self::traiterDebogage(<span class="php-var">$mot_cle</span>, <span class="php-var">$sortie</span>, <span class="php-var">$echo</span>);
</span><span id="54" class="l"><a class="l" href="#54"> 54: </a> }
</span><span id="55" class="l"><a class="l" href="#55"> 55: </a>
</span><span id="56" class="l"><a class="l" href="#56"> 56: </a> <span class="php-comment">/**
</span></span><span id="57" class="l"><a class="l" href="#57"> 57: </a><span class="php-comment"> * Equivalent de print_r.
</span></span><span id="58" class="l"><a class="l" href="#58"> 58: </a><span class="php-comment"> * @param mixed $variable la variable à afficher
</span></span><span id="59" class="l"><a class="l" href="#59"> 59: </a><span class="php-comment"> * @param string $mot_cle le mot cle à associer
</span></span><span id="60" class="l"><a class="l" href="#60"> 60: </a><span class="php-comment"> * @param boolean $echo faire un echo ou non
</span></span><span id="61" class="l"><a class="l" href="#61"> 61: </a><span class="php-comment"> * @return string la chaine contenant la variable printée ou null si echo
</span></span><span id="62" class="l"><a class="l" href="#62"> 62: </a><span class="php-comment"> */</span>
</span><span id="63" class="l"><a class="l" href="#63"> 63: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_printr" href="#_printr">printr</a>(<span class="php-var">$variable</span>, <span class="php-var">$mot_cle</span> = <span class="php-keyword1">null</span>, <span class="php-var">$echo</span> = <span class="php-keyword1">false</span>) {
</span><span id="64" class="l"><a class="l" href="#64"> 64: </a> <span class="php-comment">// Récupération de la sortie</span>
</span><span id="65" class="l"><a class="l" href="#65"> 65: </a> <span class="php-var">$sortie</span> = <span class="php-keyword2">print_r</span>(<span class="php-var">$variable</span>, <span class="php-keyword1">true</span>);
</span><span id="66" class="l"><a class="l" href="#66"> 66: </a>
</span><span id="67" class="l"><a class="l" href="#67"> 67: </a> <span class="php-comment">// Traitement général du débogage</span>
</span><span id="68" class="l"><a class="l" href="#68"> 68: </a> <span class="php-keyword1">return</span> self::traiterDebogage(<span class="php-var">$mot_cle</span>, <span class="php-var">$sortie</span>, <span class="php-var">$echo</span>);
</span><span id="69" class="l"><a class="l" href="#69"> 69: </a> }
</span><span id="70" class="l"><a class="l" href="#70"> 70: </a>
</span><span id="71" class="l"><a class="l" href="#71"> 71: </a> <span class="php-comment">/**
</span></span><span id="72" class="l"><a class="l" href="#72"> 72: </a><span class="php-comment"> * Traite une chaine de débogage et les mots clés associés
</span></span><span id="73" class="l"><a class="l" href="#73"> 73: </a><span class="php-comment"> * @param string $mot_cle le mot à associer à la chaine
</span></span><span id="74" class="l"><a class="l" href="#74"> 74: </a><span class="php-comment"> * @param string $sortie le chaine de debogage
</span></span><span id="75" class="l"><a class="l" href="#75"> 75: </a><span class="php-comment"> * @param boolean $echo faire un echo du resultat ou non
</span></span><span id="76" class="l"><a class="l" href="#76"> 76: </a><span class="php-comment"> * @return string la chaine de debogage formatée ou bien null si echo
</span></span><span id="77" class="l"><a class="l" href="#77"> 77: </a><span class="php-comment"> */</span>
</span><span id="78" class="l"><a class="l" href="#78"> 78: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_traiterDebogage" href="#_traiterDebogage">traiterDebogage</a>(<span class="php-var">$mot_cle</span>, <span class="php-var">$sortie</span>, <span class="php-var">$echo</span>) {
</span><span id="79" class="l"><a class="l" href="#79"> 79: </a> <span class="php-comment">// Formate le mot-clé</span>
</span><span id="80" class="l"><a class="l" href="#80"> 80: </a> <span class="php-var">$mot_cle</span> = self::formaterMotCle(<span class="php-var">$mot_cle</span>);
</span><span id="81" class="l"><a class="l" href="#81"> 81: </a>
</span><span id="82" class="l"><a class="l" href="#82"> 82: </a> <span class="php-comment">// Traitement de la sortie</span>
</span><span id="83" class="l"><a class="l" href="#83"> 83: </a> <span class="php-var">$sortie</span> = self::traiterSortieSuivantMode(<span class="php-var">$mot_cle</span>, <span class="php-var">$sortie</span>);
</span><span id="84" class="l"><a class="l" href="#84"> 84: </a>
</span><span id="85" class="l"><a class="l" href="#85"> 85: </a> <span class="php-comment">// Affichage et/ou retour</span>
</span><span id="86" class="l"><a class="l" href="#86"> 86: </a> self::verifierParametresConfig();
</span><span id="87" class="l"><a class="l" href="#87"> 87: </a> <span class="php-keyword1">if</span> (Config::get(<span class="php-quote">'fw_debogage'</span>) == <span class="php-keyword1">true</span>) {
</span><span id="88" class="l"><a class="l" href="#88"> 88: </a> <span class="php-keyword1">if</span> (<span class="php-var">$echo</span> === <span class="php-keyword1">true</span> || Config::get(<span class="php-quote">'fw_debogage_mode'</span>) == self::MODE_ECHO) {
</span><span id="89" class="l"><a class="l" href="#89"> 89: </a> <span class="php-keyword1">echo</span> <span class="php-var">$sortie</span>;
</span><span id="90" class="l"><a class="l" href="#90"> 90: </a> <span class="php-keyword1">return</span> <span class="php-keyword1">null</span>;
</span><span id="91" class="l"><a class="l" href="#91"> 91: </a> } <span class="php-keyword1">else</span> <span class="php-keyword1">if</span> (Config::get(<span class="php-quote">'fw_debogage_mode'</span>) == self::MODE_NOTICE) {
</span><span id="92" class="l"><a class="l" href="#92"> 92: </a> <span class="php-keyword2">trigger_error</span>(<span class="php-var">$sortie</span>, E_USER_NOTICE);
</span><span id="93" class="l"><a class="l" href="#93"> 93: </a> <span class="php-keyword1">return</span> <span class="php-keyword1">null</span>;
</span><span id="94" class="l"><a class="l" href="#94"> 94: </a> } <span class="php-keyword1">else</span> {
</span><span id="95" class="l"><a class="l" href="#95"> 95: </a> <span class="php-keyword1">return</span> <span class="php-var">$sortie</span>;
</span><span id="96" class="l"><a class="l" href="#96"> 96: </a> }
</span><span id="97" class="l"><a class="l" href="#97"> 97: </a> }
</span><span id="98" class="l"><a class="l" href="#98"> 98: </a> }
</span><span id="99" class="l"><a class="l" href="#99"> 99: </a>
</span><span id="100" class="l"><a class="l" href="#100">100: </a> <span class="php-comment">/**
</span></span><span id="101" class="l"><a class="l" href="#101">101: </a><span class="php-comment"> * formate un mot clé donné
</span></span><span id="102" class="l"><a class="l" href="#102">102: </a><span class="php-comment"> * @param string $mot_cle le mot clé à formaté
</span></span><span id="103" class="l"><a class="l" href="#103">103: </a><span class="php-comment"> * @return string le mot clé formaté ou bien un chaine vide le mot clé est null ou vide
</span></span><span id="104" class="l"><a class="l" href="#104">104: </a><span class="php-comment"> */</span>
</span><span id="105" class="l"><a class="l" href="#105">105: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_formaterMotCle" href="#_formaterMotCle">formaterMotCle</a>(<span class="php-var">$mot_cle</span>) {
</span><span id="106" class="l"><a class="l" href="#106">106: </a> <span class="php-keyword1">return</span> (<span class="php-var">$mot_cle</span> === <span class="php-keyword1">null</span>) ? <span class="php-quote">''</span> : <span class="php-keyword2">rtrim</span>(<span class="php-var">$mot_cle</span>).<span class="php-quote">' '</span>;
</span><span id="107" class="l"><a class="l" href="#107">107: </a> }
</span><span id="108" class="l"><a class="l" href="#108">108: </a>
</span><span id="109" class="l"><a class="l" href="#109">109: </a> <span class="php-comment">/**
</span></span><span id="110" class="l"><a class="l" href="#110">110: </a><span class="php-comment"> * traite la sortie de la chaine de débogage suivant le mode de php
</span></span><span id="111" class="l"><a class="l" href="#111">111: </a><span class="php-comment"> * @param string $mot_cle le mot clé associé à la chaine
</span></span><span id="112" class="l"><a class="l" href="#112">112: </a><span class="php-comment"> * @param string $sortie la chaine de débogage
</span></span><span id="113" class="l"><a class="l" href="#113">113: </a><span class="php-comment"> * @return string la sortie formatée pour le mode en cours
</span></span><span id="114" class="l"><a class="l" href="#114">114: </a><span class="php-comment"> */</span>
</span><span id="115" class="l"><a class="l" href="#115">115: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_traiterSortieSuivantMode" href="#_traiterSortieSuivantMode">traiterSortieSuivantMode</a>(<span class="php-var">$mot_cle</span>, <span class="php-var">$sortie</span>) {
</span><span id="116" class="l"><a class="l" href="#116">116: </a> <span class="php-var">$corps</span> = <span class="php-var">$mot_cle</span>.PHP_EOL.<span class="php-var">$sortie</span>;
</span><span id="117" class="l"><a class="l" href="#117">117: </a> <span class="php-keyword1">if</span> (self::getMode() == <span class="php-quote">'cli'</span>) {
</span><span id="118" class="l"><a class="l" href="#118">118: </a> <span class="php-var">$sortie</span> = PHP_EOL.<span class="php-var">$corps</span>.PHP_EOL;
</span><span id="119" class="l"><a class="l" href="#119">119: </a> } <span class="php-keyword1">else</span> {
</span><span id="120" class="l"><a class="l" href="#120">120: </a> <span class="php-var">$sortie</span> = <span class="php-quote">'&lt;pre&gt;'</span>.<span class="php-var">$corps</span>.<span class="php-quote">'&lt;/pre&gt;'</span>;
</span><span id="121" class="l"><a class="l" href="#121">121: </a> }
</span><span id="122" class="l"><a class="l" href="#122">122: </a> <span class="php-keyword1">return</span> <span class="php-var">$sortie</span>;
</span><span id="123" class="l"><a class="l" href="#123">123: </a> }
</span><span id="124" class="l"><a class="l" href="#124">124: </a>
</span><span id="125" class="l"><a class="l" href="#125">125: </a> <span class="php-comment">/**
</span></span><span id="126" class="l"><a class="l" href="#126">126: </a><span class="php-comment"> * Vérifie que tous les paramêtres de config nécessaires au fonctionnement de cette classe existe dans les fichiers
</span></span><span id="127" class="l"><a class="l" href="#127">127: </a><span class="php-comment"> * de configurations.
</span></span><span id="128" class="l"><a class="l" href="#128">128: </a><span class="php-comment"> */</span>
</span><span id="129" class="l"><a class="l" href="#129">129: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_verifierParametresConfig" href="#_verifierParametresConfig">verifierParametresConfig</a>() {
</span><span id="130" class="l"><a class="l" href="#130">130: </a> <span class="php-var">$ok</span> = <span class="php-keyword1">true</span>;
</span><span id="131" class="l"><a class="l" href="#131">131: </a> <span class="php-var">$parametres</span> = <span class="php-keyword1">array</span>(<span class="php-quote">'fw_debogage'</span>, <span class="php-quote">'fw_debogage_mode'</span>);
</span><span id="132" class="l"><a class="l" href="#132">132: </a> <span class="php-keyword1">foreach</span> (<span class="php-var">$parametres</span> <span class="php-keyword1">as</span> <span class="php-var">$param</span>) {
</span><span id="133" class="l"><a class="l" href="#133">133: </a> <span class="php-keyword1">if</span> (<span class="php-keyword2">is_null</span>(Config::get(<span class="php-var">$param</span>))) {
</span><span id="134" class="l"><a class="l" href="#134">134: </a> <span class="php-var">$classe</span> = <span class="php-keyword2">get_class</span>();
</span><span id="135" class="l"><a class="l" href="#135">135: </a> <span class="php-var">$m</span> = <span class="php-quote">&quot;L'utilisation de la classe </span><span class="php-var">$classe</span><span class="php-quote"> nécessite de définir '</span><span class="php-var">$param</span><span class="php-quote">' dans un fichier de configuration.&quot;</span>;
</span><span id="136" class="l"><a class="l" href="#136">136: </a> <span class="php-keyword2">trigger_error</span>(<span class="php-var">$m</span>, E_USER_WARNING);
</span><span id="137" class="l"><a class="l" href="#137">137: </a> <span class="php-var">$ok</span> = <span class="php-keyword1">false</span>;
</span><span id="138" class="l"><a class="l" href="#138">138: </a> }
</span><span id="139" class="l"><a class="l" href="#139">139: </a> }
</span><span id="140" class="l"><a class="l" href="#140">140: </a> <span class="php-keyword1">return</span> <span class="php-var">$ok</span>;
</span><span id="141" class="l"><a class="l" href="#141">141: </a> }
</span><span id="142" class="l"><a class="l" href="#142">142: </a>}
</span><span id="143" class="l"><a class="l" href="#143">143: </a></span><span class="xlang">?&gt;</span></code></pre>
 
<div id="footer">
TBFramework - v0.2 API documentation generated by <a href="http://apigen.org">ApiGen 2.8.0</a>
/branches/v0.2-buhl/doc/ApiGen/class-Registre.html
7,7 → 7,7
<title>Class Registre | TBFramework - v0.2</title>
 
<script type="text/javascript" src="resources/combined.js?4205936287"></script>
<script type="text/javascript" src="elementlist.js?117657638"></script>
<script type="text/javascript" src="elementlist.js?1835392179"></script>
<link rel="stylesheet" type="text/css" media="all" href="resources/style.css?3505392360">
 
</head>
40,6 → 40,7
<li><a href="class-Controleur.html">Controleur</a></li>
<li><a href="class-Debug.html">Debug</a></li>
<li><a href="class-GestionnaireException.html">GestionnaireException</a></li>
<li><a href="class-I18n.html">I18n</a></li>
<li><a href="class-Log.html">Log</a></li>
<li><a href="class-Modele.html">Modele</a></li>
<li class="active"><a href="class-Registre.html">Registre</a></li>
106,8 → 107,6
<p>Classe registre, qui permet un accès à différentes variables à travers
les autres classes. C'est un singleton</p>
 
<p>PHP Version 5</p>
 
</div>
 
 
125,21 → 124,18
<b>Package:</b> <a href="package-Framework.html">Framework</a><br>
 
<b>Category:</b>
Class<br>
PHP 5.2<br>
<b>Copyright:</b>
2009 Tela-Botanica<br>
Copyright (c) 2009, Tela Botanica (<a
href="mailto:accueil&#64;tela-botanica.org">accueil&#64;<!-- -->tela-botanica.org</a>)<br>
<b>License:</b>
<a href="http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt">Licence CECILL</a><br>
<a href="GNU-GPL-v3">&lt;http://www.gnu.org/licenses/gpl.html&gt;</a><br>
<b>License:</b>
<a href="http://www.gnu.org/licenses/gpl.html">Licence GNU-GPL</a><br>
<a href="CECILL-v2">&lt;http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt&gt;</a><br>
<b>Author:</b>
Jean-Pascal Milcent &lt;<a
href="mailto:jmp&#64;tela-botanica.org">jmp&#64;<!-- -->tela-botanica.org</a>&gt;<br>
<b>Version:</b>
SVN: $$Id: Registre.php 120 2009-09-01 12:21:14Z aurelien $$<br>
<b>Link:</b>
/doc/framework/<br>
<b>Located at</b> <a href="source-class-Registre.html#3-93" title="Go to source code">Registre.php</a><br>
Jean-Pascal MILCENT &lt;<a
href="mailto:jpm&#64;tela-botanica.org">jpm&#64;<!-- -->tela-botanica.org</a>&gt;<br>
<b>Located at</b> <a href="source-class-Registre.html#3-88" title="Go to source code">Registre.php</a><br>
</div>
 
 
157,7 → 153,7
 
<td class="name"><div>
<a class="anchor" href="#_getInstance">#</a>
<code><a href="source-class-Registre.html#36-46" title="Go to source code">getInstance</a>( )</code>
<code><a href="source-class-Registre.html#31-41" title="Go to source code">getInstance</a>( )</code>
 
<div class="description short">
192,7 → 188,7
 
<td class="name"><div>
<a class="anchor" href="#_set">#</a>
<code><a href="source-class-Registre.html#48-61" title="Go to source code">set</a>( <span>string <var>$intitule</var></span>, <span>mixed <var>$objet</var></span> )</code>
<code><a href="source-class-Registre.html#43-56" title="Go to source code">set</a>( <span>string <var>$intitule</var></span>, <span>mixed <var>$objet</var></span> )</code>
 
<div class="description short">
232,7 → 228,7
 
<td class="name"><div>
<a class="anchor" href="#_get">#</a>
<code><a href="source-class-Registre.html#63-72" title="Go to source code">get</a>( <span>mixed <var>$intitule</var></span> )</code>
<code><a href="source-class-Registre.html#58-67" title="Go to source code">get</a>( <span>mixed <var>$intitule</var></span> )</code>
 
<div class="description short">
269,7 → 265,7
 
<td class="name"><div>
<a class="anchor" href="#_detruire">#</a>
<code><a href="source-class-Registre.html#74-81" title="Go to source code">detruire</a>( <span>mixed <var>$intitule</var></span> )</code>
<code><a href="source-class-Registre.html#69-76" title="Go to source code">detruire</a>( <span>mixed <var>$intitule</var></span> )</code>
 
<div class="description short">
304,7 → 300,7
 
<td class="name"><div>
<a class="anchor" href="#_existe">#</a>
<code><a href="source-class-Registre.html#83-92" title="Go to source code">existe</a>( <span>mixed <var>$intitule</var></span> )</code>
<code><a href="source-class-Registre.html#78-87" title="Go to source code">existe</a>( <span>mixed <var>$intitule</var></span> )</code>
 
<div class="description short">
/branches/v0.2-buhl/doc/ApiGen/function-autoloadFw.html
7,7 → 7,7
<title>Function autoloadFw | TBFramework - v0.2</title>
 
<script type="text/javascript" src="resources/combined.js?4205936287"></script>
<script type="text/javascript" src="elementlist.js?117657638"></script>
<script type="text/javascript" src="elementlist.js?1835392179"></script>
<link rel="stylesheet" type="text/css" media="all" href="resources/style.css?3505392360">
 
</head>
40,6 → 40,7
<li><a href="class-Controleur.html">Controleur</a></li>
<li><a href="class-Debug.html">Debug</a></li>
<li><a href="class-GestionnaireException.html">GestionnaireException</a></li>
<li><a href="class-I18n.html">I18n</a></li>
<li><a href="class-Log.html">Log</a></li>
<li><a href="class-Modele.html">Modele</a></li>
<li><a href="class-Registre.html">Registre</a></li>
106,7 → 107,7
<b>Package:</b> <a href="package-Framework.html">Framework</a><br>
<b>Copyright:</b>
1999-2009 Tela Botanica (<a
Copyright (c) 2009, Tela Botanica (<a
href="mailto:accueil&#64;tela-botanica.org">accueil&#64;<!-- -->tela-botanica.org</a>)<br>
<b>License:</b>
<a href="GPL">v3 &lt;http://www.gnu.org/licenses/gpl.txt&gt;</a><br>
114,12 → 115,11
<a href="CECILL">v2 &lt;http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt&gt;</a><br>
<b>Author:</b>
Aurelien PERONNET &lt;<a
href="mailto:aurelien&#64;tela-botanica.org">aurelien&#64;<!-- -->tela-botanica.org</a>&gt;
// Autres auteurs :<br>
href="mailto:aurelien&#64;tela-botanica.org">aurelien&#64;<!-- -->tela-botanica.org</a>&gt;<br>
<b>Author:</b>
Jean-Pascal MILCENT &lt;<a
href="mailto:jpm&#64;tela-botanica.org">jpm&#64;<!-- -->tela-botanica.org</a>&gt;<br>
<b>Located at</b> <a href="source-function-autoloadFw.html#31-37" title="Go to source code">autoload.inc.php</a><br>
<b>Located at</b> <a href="source-function-autoloadFw.html#26-32" title="Go to source code">autoload.inc.php</a><br>
</div>
 
 
/branches/v0.2-buhl/doc/ApiGen/class-Debug.html
7,7 → 7,7
<title>Class Debug | TBFramework - v0.2</title>
 
<script type="text/javascript" src="resources/combined.js?4205936287"></script>
<script type="text/javascript" src="elementlist.js?117657638"></script>
<script type="text/javascript" src="elementlist.js?1835392179"></script>
<link rel="stylesheet" type="text/css" media="all" href="resources/style.css?3505392360">
 
</head>
40,6 → 40,7
<li><a href="class-Controleur.html">Controleur</a></li>
<li class="active"><a href="class-Debug.html">Debug</a></li>
<li><a href="class-GestionnaireException.html">GestionnaireException</a></li>
<li><a href="class-I18n.html">I18n</a></li>
<li><a href="class-Log.html">Log</a></li>
<li><a href="class-Modele.html">Modele</a></li>
<li><a href="class-Registre.html">Registre</a></li>
107,8 → 108,6
print_r. L'affichage et l'utilisation de ces fonctions sont améliorés via
cette classe. Cette classe est inspirée de la classe Zend_Debug.</p>
 
<p>PHP version 5</p>
 
</div>
 
 
126,21 → 125,18
<b>Package:</b> <a href="package-Framework.html">Framework</a><br>
 
<b>Category:</b>
Debogage<br>
PHP 5.2<br>
<b>Copyright:</b>
1999-2009 Tela Botanica (<a
Copyright (c) 2009, Tela Botanica (<a
href="mailto:accueil&#64;tela-botanica.org">accueil&#64;<!-- -->tela-botanica.org</a>)<br>
<b>License:</b>
<a href="GPL">v3 &lt;http://www.gnu.org/licenses/gpl.txt&gt;</a><br>
<a href="GNU-GPL-v3">&lt;http://www.gnu.org/licenses/gpl.html&gt;</a><br>
<b>License:</b>
<a href="CECILL">v2 &lt;http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt&gt;</a><br>
<a href="CECILL-v2">&lt;http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt&gt;</a><br>
<b>Author:</b>
Jean-Pascal MILCENT &lt;<a
href="mailto:jpm&#64;tela-botanica.org">jpm&#64;<!-- -->tela-botanica.org</a>&gt;
// Autres auteurs :<br>
<b>Version:</b>
$$Id: Debug.php 167 2010-03-19 17:12:08Z jpm $$<br>
<b>Located at</b> <a href="source-class-Debug.html#3-122" title="Go to source code">Debug.php</a><br>
href="mailto:jpm&#64;tela-botanica.org">jpm&#64;<!-- -->tela-botanica.org</a>&gt;<br>
<b>Located at</b> <a href="source-class-Debug.html#3-142" title="Go to source code">Debug.php</a><br>
</div>
 
 
158,7 → 154,7
 
<td class="name"><div>
<a class="anchor" href="#_getMode">#</a>
<code><a href="source-class-Debug.html#27-36" title="Go to source code">getMode</a>( )</code>
<code><a href="source-class-Debug.html#25-34" title="Go to source code">getMode</a>( )</code>
 
<div class="description short">
195,7 → 191,7
 
<td class="name"><div>
<a class="anchor" href="#_dump">#</a>
<code><a href="source-class-Debug.html#38-56" title="Go to source code">dump</a>( <span>mixed <var>$variable</var></span>, <span>string <var>$mot_cle</var> = <span class="php-keyword1">null</span></span>, <span>boolean <var>$echo</var> = <span class="php-keyword1">true</span></span> )</code>
<code><a href="source-class-Debug.html#36-54" title="Go to source code">dump</a>( <span>mixed <var>$variable</var></span>, <span>string <var>$mot_cle</var> = <span class="php-keyword1">null</span></span>, <span>boolean <var>$echo</var> = <span class="php-keyword1">false</span></span> )</code>
 
<div class="description short">
242,17 → 238,17
 
<td class="name"><div>
<a class="anchor" href="#_printr">#</a>
<code><a href="source-class-Debug.html#58-71" title="Go to source code">printr</a>( <span>mixed <var>$variable</var></span>, <span>string <var>$mot_cle</var> = <span class="php-keyword1">null</span></span>, <span>boolean <var>$echo</var> = <span class="php-keyword1">true</span></span> )</code>
<code><a href="source-class-Debug.html#56-69" title="Go to source code">printr</a>( <span>mixed <var>$variable</var></span>, <span>string <var>$mot_cle</var> = <span class="php-keyword1">null</span></span>, <span>boolean <var>$echo</var> = <span class="php-keyword1">false</span></span> )</code>
 
<div class="description short">
<p>Equivalent de print_r</p>
<p>Equivalent de print_r.</p>
 
</div>
 
<div class="description detailed hidden">
<p>Equivalent de print_r</p>
<p>Equivalent de print_r.</p>
 
 
 
286,10 → 282,53
 
 
 
<table class="summary" id="constants">
<caption>Constants summary</caption>
<tr data-order="MODE_ECHO" id="MODE_ECHO">
 
<td class="attributes"><code>string</code></td>
<td class="name"><code>
<a href="source-class-Debug.html#17" title="Go to source code"><b>MODE_ECHO</b></a>
</code></td>
<td class="value"><code><span class="php-quote">'echo'</span></code></td>
<td class="description"><div>
<a href="#MODE_ECHO" class="anchor">#</a>
 
<div class="description short">
</div>
 
<div class="description detailed hidden">
 
</div>
</div></td>
</tr>
<tr data-order="MODE_NOTICE" id="MODE_NOTICE">
 
<td class="attributes"><code>string</code></td>
<td class="name"><code>
<a href="source-class-Debug.html#18" title="Go to source code"><b>MODE_NOTICE</b></a>
</code></td>
<td class="value"><code><span class="php-quote">'e_user_notice'</span></code></td>
<td class="description"><div>
<a href="#MODE_NOTICE" class="anchor">#</a>
 
<div class="description short">
</div>
 
<div class="description detailed hidden">
 
</div>
</div></td>
</tr>
</table>
 
 
 
 
<table class="summary" id="properties">
<caption>Properties summary</caption>
<tr data-order="mode" id="$mode">
299,7 → 338,7
</code></td>
 
<td class="name">
<a href="source-class-Debug.html#22-25" title="Go to source code"><var>$mode</var></a>
<a href="source-class-Debug.html#20-23" title="Go to source code"><var>$mode</var></a>
</td>
<td class="value"><code><span class="php-keyword1">null</span></code></td>
<td class="description"><div>
/branches/v0.2-buhl/doc/ApiGen/elementlist.js
1,3 → 1,3
 
var ApiGen = ApiGen || {};
ApiGen.elements = [["c","Application"],["f","autoloadAppliDefaut()"],["f","autoloadFw()"],["c","Chronometre"],["c","Config"],["c","Controleur"],["c","Debug"],["c","Exception"],["c","GestionnaireException"],["c","Log"],["c","Modele"],["c","PDOStatement"],["c","Registre"],["c","SquelettePhp"],["c","Traversable"],["c","Url"]];
ApiGen.elements = [["c","Application"],["f","autoloadAppliDefaut()"],["f","autoloadFw()"],["c","Chronometre"],["c","Config"],["c","Controleur"],["c","Debug"],["c","Exception"],["c","GestionnaireException"],["c","I18n"],["c","Log"],["c","Modele"],["c","PDOStatement"],["c","Registre"],["c","SquelettePhp"],["c","Traversable"],["c","Url"]];
/branches/v0.2-buhl/doc/ApiGen/class-Exception.html
7,7 → 7,7
<title>Class Exception | TBFramework - v0.2</title>
 
<script type="text/javascript" src="resources/combined.js?4205936287"></script>
<script type="text/javascript" src="elementlist.js?117657638"></script>
<script type="text/javascript" src="elementlist.js?1835392179"></script>
<link rel="stylesheet" type="text/css" media="all" href="resources/style.css?3505392360">
 
</head>
/branches/v0.2-buhl/doc/ApiGen/source-class-Url.html
8,7 → 8,7
<title>File Url.php | TBFramework - v0.2</title>
 
<script type="text/javascript" src="resources/combined.js?4205936287"></script>
<script type="text/javascript" src="elementlist.js?117657638"></script>
<script type="text/javascript" src="elementlist.js?1835392179"></script>
<link rel="stylesheet" type="text/css" media="all" href="resources/style.css?3505392360">
 
</head>
41,6 → 41,7
<li><a href="class-Controleur.html">Controleur</a></li>
<li><a href="class-Debug.html">Debug</a></li>
<li><a href="class-GestionnaireException.html">GestionnaireException</a></li>
<li><a href="class-I18n.html">I18n</a></li>
<li><a href="class-Log.html">Log</a></li>
<li><a href="class-Modele.html">Modele</a></li>
<li><a href="class-Registre.html">Registre</a></li>
102,776 → 103,771
<pre><code><span id="1" class="l"><a class="l" href="#1"> 1: </a><span class="xlang">&lt;?php</span>
</span><span id="2" class="l"><a class="l" href="#2"> 2: </a><span class="php-comment">// declare(encoding='UTF-8');</span>
</span><span id="3" class="l"><a class="l" href="#3"> 3: </a><span class="php-comment">/**
</span></span><span id="4" class="l"><a class="l" href="#4"> 4: </a><span class="php-comment">* classe Url, gérant le découpage des paramètres, leurs modification etc...
</span></span><span id="5" class="l"><a class="l" href="#5"> 5: </a><span class="php-comment">* Traduction et conversion d'une classe (NET_Url2) issue de Pear
</span></span><span id="6" class="l"><a class="l" href="#6"> 6: </a><span class="php-comment">*
</span></span><span id="7" class="l"><a class="l" href="#7"> 7: </a><span class="php-comment">* @category Php5
</span></span><span id="8" class="l"><a class="l" href="#8"> 8: </a><span class="php-comment">* @package Framework
</span></span><span id="9" class="l"><a class="l" href="#9"> 9: </a><span class="php-comment">// Auteur principal
</span></span><span id="10" class="l"><a class="l" href="#10"> 10: </a><span class="php-comment">* @author Christian Schmidt &lt;schmidt@php.net&gt;
</span></span><span id="11" class="l"><a class="l" href="#11"> 11: </a><span class="php-comment">// Autre auteurs
</span></span><span id="12" class="l"><a class="l" href="#12"> 12: </a><span class="php-comment">* @author Aurélien PERONNET &lt;aurelien@tela-botanica.org&gt;
</span></span><span id="13" class="l"><a class="l" href="#13"> 13: </a><span class="php-comment">* @author Jean-Pascal MILCENT &lt;jpm@tela-botanica.org&gt;
</span></span><span id="14" class="l"><a class="l" href="#14"> 14: </a><span class="php-comment">* @copyright 2009 Tela-Botanica
</span></span><span id="15" class="l"><a class="l" href="#15"> 15: </a><span class="php-comment">* @license http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
</span></span><span id="16" class="l"><a class="l" href="#16"> 16: </a><span class="php-comment">* @license http://www.gnu.org/licenses/gpl.html Licence GNU-GPL
</span></span><span id="17" class="l"><a class="l" href="#17"> 17: </a><span class="php-comment">* @version SVN: $Id: Url.php 171 2010-03-23 11:23:38Z jpm $
</span></span><span id="18" class="l"><a class="l" href="#18"> 18: </a><span class="php-comment">* @link /doc/framework/
</span></span><span id="19" class="l"><a class="l" href="#19"> 19: </a><span class="php-comment">*
</span></span><span id="20" class="l"><a class="l" href="#20"> 20: </a><span class="php-comment">*/</span>
</span><span id="21" class="l"><a class="l" href="#21"> 21: </a><span class="php-keyword1">class</span> <a id="Url" href="#Url">Url</a>
</span><span id="22" class="l"><a class="l" href="#22"> 22: </a>{
</span><span id="23" class="l"><a class="l" href="#23"> 23: </a> <span class="php-comment">/**
</span></span><span id="24" class="l"><a class="l" href="#24"> 24: </a><span class="php-comment"> * Parsing strict dans resoudre() (voir RFC 3986, section 5.2.2). Par défaut
</span></span><span id="25" class="l"><a class="l" href="#25"> 25: </a><span class="php-comment"> * à true.
</span></span><span id="4" class="l"><a class="l" href="#4"> 4: </a><span class="php-comment"> * classe Url, gérant le découpage des paramètres, leurs modification etc...
</span></span><span id="5" class="l"><a class="l" href="#5"> 5: </a><span class="php-comment"> * Traduction et conversion d'une classe (NET_Url2) issue de Pear
</span></span><span id="6" class="l"><a class="l" href="#6"> 6: </a><span class="php-comment"> *
</span></span><span id="7" class="l"><a class="l" href="#7"> 7: </a><span class="php-comment"> * @category PHP 5.2
</span></span><span id="8" class="l"><a class="l" href="#8"> 8: </a><span class="php-comment"> * @package Framework
</span></span><span id="9" class="l"><a class="l" href="#9"> 9: </a><span class="php-comment"> * @author Christian SCHMIDT&lt;schmidt@php.net&gt;
</span></span><span id="10" class="l"><a class="l" href="#10"> 10: </a><span class="php-comment"> * @author Aurélien PERONNET &lt;aurelien@tela-botanica.org&gt;
</span></span><span id="11" class="l"><a class="l" href="#11"> 11: </a><span class="php-comment"> * @author Jean-Pascal MILCENT &lt;jpm@tela-botanica.org&gt;
</span></span><span id="12" class="l"><a class="l" href="#12"> 12: </a><span class="php-comment"> * @copyright Copyright (c) 2009, Tela Botanica (accueil@tela-botanica.org)
</span></span><span id="13" class="l"><a class="l" href="#13"> 13: </a><span class="php-comment"> * @license GNU-GPL-v3 &lt;http://www.gnu.org/licenses/gpl.html&gt;
</span></span><span id="14" class="l"><a class="l" href="#14"> 14: </a><span class="php-comment"> * @license CECILL-v2 &lt;http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt&gt;
</span></span><span id="15" class="l"><a class="l" href="#15"> 15: </a><span class="php-comment"> */</span>
</span><span id="16" class="l"><a class="l" href="#16"> 16: </a><span class="php-keyword1">class</span> <a id="Url" href="#Url">Url</a>
</span><span id="17" class="l"><a class="l" href="#17"> 17: </a>{
</span><span id="18" class="l"><a class="l" href="#18"> 18: </a> <span class="php-comment">/**
</span></span><span id="19" class="l"><a class="l" href="#19"> 19: </a><span class="php-comment"> * Parsing strict dans resoudre() (voir RFC 3986, section 5.2.2). Par défaut
</span></span><span id="20" class="l"><a class="l" href="#20"> 20: </a><span class="php-comment"> * à true.
</span></span><span id="21" class="l"><a class="l" href="#21"> 21: </a><span class="php-comment"> */</span>
</span><span id="22" class="l"><a class="l" href="#22"> 22: </a> <span class="php-keyword1">const</span> <a id="OPTION_STRICTE" href="#OPTION_STRICTE">OPTION_STRICTE</a> = <span class="php-quote">'strict'</span>;
</span><span id="23" class="l"><a class="l" href="#23"> 23: </a>
</span><span id="24" class="l"><a class="l" href="#24"> 24: </a> <span class="php-comment">/**
</span></span><span id="25" class="l"><a class="l" href="#25"> 25: </a><span class="php-comment"> * Répresenter les tableaux dans les requêtes en utilisant la notation php []. Par défaut à true.
</span></span><span id="26" class="l"><a class="l" href="#26"> 26: </a><span class="php-comment"> */</span>
</span><span id="27" class="l"><a class="l" href="#27"> 27: </a> <span class="php-keyword1">const</span> <a id="OPTION_STRICTE" href="#OPTION_STRICTE">OPTION_STRICTE</a> = <span class="php-quote">'strict'</span>;
</span><span id="27" class="l"><a class="l" href="#27"> 27: </a> <span class="php-keyword1">const</span> <a id="OPTION_UTILISER_CROCHETS" href="#OPTION_UTILISER_CROCHETS">OPTION_UTILISER_CROCHETS</a> = <span class="php-quote">'use_brackets'</span>;
</span><span id="28" class="l"><a class="l" href="#28"> 28: </a>
</span><span id="29" class="l"><a class="l" href="#29"> 29: </a> <span class="php-comment">/**
</span></span><span id="30" class="l"><a class="l" href="#30"> 30: </a><span class="php-comment"> * Répresenter les tableaux dans les requêtes en utilisant la notation php []. Par défaut à true.
</span></span><span id="30" class="l"><a class="l" href="#30"> 30: </a><span class="php-comment"> * URL-encoder les clés des variables dans les requêtes. Par défaut à true.
</span></span><span id="31" class="l"><a class="l" href="#31"> 31: </a><span class="php-comment"> */</span>
</span><span id="32" class="l"><a class="l" href="#32"> 32: </a> <span class="php-keyword1">const</span> <a id="OPTION_UTILISER_CROCHETS" href="#OPTION_UTILISER_CROCHETS">OPTION_UTILISER_CROCHETS</a> = <span class="php-quote">'use_brackets'</span>;
</span><span id="32" class="l"><a class="l" href="#32"> 32: </a> <span class="php-keyword1">const</span> <a id="OPTION_ENCODER_CLES" href="#OPTION_ENCODER_CLES">OPTION_ENCODER_CLES</a> = <span class="php-quote">'encode_keys'</span>;
</span><span id="33" class="l"><a class="l" href="#33"> 33: </a>
</span><span id="34" class="l"><a class="l" href="#34"> 34: </a> <span class="php-comment">/**
</span></span><span id="35" class="l"><a class="l" href="#35"> 35: </a><span class="php-comment"> * URL-encoder les clés des variables dans les requêtes. Par défaut à true.
</span></span><span id="36" class="l"><a class="l" href="#36"> 36: </a><span class="php-comment"> */</span>
</span><span id="37" class="l"><a class="l" href="#37"> 37: </a> <span class="php-keyword1">const</span> <a id="OPTION_ENCODER_CLES" href="#OPTION_ENCODER_CLES">OPTION_ENCODER_CLES</a> = <span class="php-quote">'encode_keys'</span>;
</span><span id="38" class="l"><a class="l" href="#38"> 38: </a>
</span><span id="39" class="l"><a class="l" href="#39"> 39: </a> <span class="php-comment">/**
</span></span><span id="40" class="l"><a class="l" href="#40"> 40: </a><span class="php-comment"> * Séparateurs de variables lors du parsing de la requête. Chaque caractère
</span></span><span id="41" class="l"><a class="l" href="#41"> 41: </a><span class="php-comment"> * est considéré comme un séparateur. Par défaut, spécifié par le paramêtre
</span></span><span id="42" class="l"><a class="l" href="#42"> 42: </a><span class="php-comment"> * arg_separator.input dans php.ini (par défaut &quot;&amp;&quot;).
</span></span><span id="43" class="l"><a class="l" href="#43"> 43: </a><span class="php-comment"> */</span>
</span><span id="44" class="l"><a class="l" href="#44"> 44: </a> <span class="php-keyword1">const</span> <a id="OPTION_SEPARATEUR_ENTREE" href="#OPTION_SEPARATEUR_ENTREE">OPTION_SEPARATEUR_ENTREE</a> = <span class="php-quote">'input_separator'</span>;
</span><span id="45" class="l"><a class="l" href="#45"> 45: </a>
</span><span id="46" class="l"><a class="l" href="#46"> 46: </a> <span class="php-comment">/**
</span></span><span id="47" class="l"><a class="l" href="#47"> 47: </a><span class="php-comment"> * Séparateur de variables lors de la génération de la requête. Par défaut, spécifié
</span></span><span id="48" class="l"><a class="l" href="#48"> 48: </a><span class="php-comment"> * par le paramètre arg_separator.output dans php.ini (par défaut &quot;&amp;&quot;).
</span></span><span id="49" class="l"><a class="l" href="#49"> 49: </a><span class="php-comment"> */</span>
</span><span id="50" class="l"><a class="l" href="#50"> 50: </a> <span class="php-keyword1">const</span> <a id="OPTION_SEPARATEUR_SORTIE" href="#OPTION_SEPARATEUR_SORTIE">OPTION_SEPARATEUR_SORTIE</a> = <span class="php-quote">'output_separator'</span>;
</span><span id="51" class="l"><a class="l" href="#51"> 51: </a>
</span><span id="52" class="l"><a class="l" href="#52"> 52: </a> <span class="php-comment">/**
</span></span><span id="53" class="l"><a class="l" href="#53"> 53: </a><span class="php-comment"> * Options par défaut correspondant au comportement de php
</span></span><span id="54" class="l"><a class="l" href="#54"> 54: </a><span class="php-comment"> * vis à vis de $_GET
</span></span><span id="55" class="l"><a class="l" href="#55"> 55: </a><span class="php-comment"> */</span>
</span><span id="56" class="l"><a class="l" href="#56"> 56: </a> <span class="php-keyword1">private</span> <span class="php-var"><a id="$options" href="#$options">$options</a></span> = <span class="php-keyword1">array</span>(
</span><span id="57" class="l"><a class="l" href="#57"> 57: </a> self::OPTION_STRICTE =&gt; <span class="php-keyword1">true</span>,
</span><span id="58" class="l"><a class="l" href="#58"> 58: </a> self::OPTION_UTILISER_CROCHETS =&gt; <span class="php-keyword1">true</span>,
</span><span id="59" class="l"><a class="l" href="#59"> 59: </a> self::OPTION_ENCODER_CLES =&gt; <span class="php-keyword1">true</span>,
</span><span id="60" class="l"><a class="l" href="#60"> 60: </a> self::OPTION_SEPARATEUR_ENTREE =&gt; <span class="php-quote">'x&amp;'</span>,
</span><span id="61" class="l"><a class="l" href="#61"> 61: </a> self::OPTION_SEPARATEUR_SORTIE =&gt; <span class="php-quote">'x&amp;'</span>);
</span></span><span id="35" class="l"><a class="l" href="#35"> 35: </a><span class="php-comment"> * Séparateurs de variables lors du parsing de la requête. Chaque caractère
</span></span><span id="36" class="l"><a class="l" href="#36"> 36: </a><span class="php-comment"> * est considéré comme un séparateur. Par défaut, spécifié par le paramêtre
</span></span><span id="37" class="l"><a class="l" href="#37"> 37: </a><span class="php-comment"> * arg_separator.input dans php.ini (par défaut &quot;&amp;&quot;).
</span></span><span id="38" class="l"><a class="l" href="#38"> 38: </a><span class="php-comment"> */</span>
</span><span id="39" class="l"><a class="l" href="#39"> 39: </a> <span class="php-keyword1">const</span> <a id="OPTION_SEPARATEUR_ENTREE" href="#OPTION_SEPARATEUR_ENTREE">OPTION_SEPARATEUR_ENTREE</a> = <span class="php-quote">'input_separator'</span>;
</span><span id="40" class="l"><a class="l" href="#40"> 40: </a>
</span><span id="41" class="l"><a class="l" href="#41"> 41: </a> <span class="php-comment">/**
</span></span><span id="42" class="l"><a class="l" href="#42"> 42: </a><span class="php-comment"> * Séparateur de variables lors de la génération de la requête. Par défaut, spécifié
</span></span><span id="43" class="l"><a class="l" href="#43"> 43: </a><span class="php-comment"> * par le paramètre arg_separator.output dans php.ini (par défaut &quot;&amp;&quot;).
</span></span><span id="44" class="l"><a class="l" href="#44"> 44: </a><span class="php-comment"> */</span>
</span><span id="45" class="l"><a class="l" href="#45"> 45: </a> <span class="php-keyword1">const</span> <a id="OPTION_SEPARATEUR_SORTIE" href="#OPTION_SEPARATEUR_SORTIE">OPTION_SEPARATEUR_SORTIE</a> = <span class="php-quote">'output_separator'</span>;
</span><span id="46" class="l"><a class="l" href="#46"> 46: </a>
</span><span id="47" class="l"><a class="l" href="#47"> 47: </a> <span class="php-comment">/**
</span></span><span id="48" class="l"><a class="l" href="#48"> 48: </a><span class="php-comment"> * Options par défaut correspondant au comportement de php
</span></span><span id="49" class="l"><a class="l" href="#49"> 49: </a><span class="php-comment"> * vis à vis de $_GET
</span></span><span id="50" class="l"><a class="l" href="#50"> 50: </a><span class="php-comment"> */</span>
</span><span id="51" class="l"><a class="l" href="#51"> 51: </a> <span class="php-keyword1">private</span> <span class="php-var"><a id="$options" href="#$options">$options</a></span> = <span class="php-keyword1">array</span>(
</span><span id="52" class="l"><a class="l" href="#52"> 52: </a> self::OPTION_STRICTE =&gt; <span class="php-keyword1">true</span>,
</span><span id="53" class="l"><a class="l" href="#53"> 53: </a> self::OPTION_UTILISER_CROCHETS =&gt; <span class="php-keyword1">true</span>,
</span><span id="54" class="l"><a class="l" href="#54"> 54: </a> self::OPTION_ENCODER_CLES =&gt; <span class="php-keyword1">true</span>,
</span><span id="55" class="l"><a class="l" href="#55"> 55: </a> self::OPTION_SEPARATEUR_ENTREE =&gt; <span class="php-quote">'x&amp;'</span>,
</span><span id="56" class="l"><a class="l" href="#56"> 56: </a> self::OPTION_SEPARATEUR_SORTIE =&gt; <span class="php-quote">'x&amp;'</span>);
</span><span id="57" class="l"><a class="l" href="#57"> 57: </a>
</span><span id="58" class="l"><a class="l" href="#58"> 58: </a> <span class="php-comment">/**
</span></span><span id="59" class="l"><a class="l" href="#59"> 59: </a><span class="php-comment"> * @var string|bool
</span></span><span id="60" class="l"><a class="l" href="#60"> 60: </a><span class="php-comment"> */</span>
</span><span id="61" class="l"><a class="l" href="#61"> 61: </a> <span class="php-keyword1">private</span> <span class="php-var"><a id="$schema" href="#$schema">$schema</a></span> = <span class="php-keyword1">false</span>;
</span><span id="62" class="l"><a class="l" href="#62"> 62: </a>
</span><span id="63" class="l"><a class="l" href="#63"> 63: </a> <span class="php-comment">/**
</span></span><span id="64" class="l"><a class="l" href="#64"> 64: </a><span class="php-comment"> * @var string|bool
</span></span><span id="65" class="l"><a class="l" href="#65"> 65: </a><span class="php-comment"> */</span>
</span><span id="66" class="l"><a class="l" href="#66"> 66: </a> <span class="php-keyword1">private</span> <span class="php-var"><a id="$schema" href="#$schema">$schema</a></span> = <span class="php-keyword1">false</span>;
</span><span id="66" class="l"><a class="l" href="#66"> 66: </a> <span class="php-keyword1">private</span> <span class="php-var"><a id="$infoUtilisateur" href="#$infoUtilisateur">$infoUtilisateur</a></span> = <span class="php-keyword1">false</span>;
</span><span id="67" class="l"><a class="l" href="#67"> 67: </a>
</span><span id="68" class="l"><a class="l" href="#68"> 68: </a> <span class="php-comment">/**
</span></span><span id="69" class="l"><a class="l" href="#69"> 69: </a><span class="php-comment"> * @var string|bool
</span></span><span id="70" class="l"><a class="l" href="#70"> 70: </a><span class="php-comment"> */</span>
</span><span id="71" class="l"><a class="l" href="#71"> 71: </a> <span class="php-keyword1">private</span> <span class="php-var"><a id="$infoUtilisateur" href="#$infoUtilisateur">$infoUtilisateur</a></span> = <span class="php-keyword1">false</span>;
</span><span id="71" class="l"><a class="l" href="#71"> 71: </a> <span class="php-keyword1">private</span> <span class="php-var"><a id="$hote" href="#$hote">$hote</a></span> = <span class="php-keyword1">false</span>;
</span><span id="72" class="l"><a class="l" href="#72"> 72: </a>
</span><span id="73" class="l"><a class="l" href="#73"> 73: </a> <span class="php-comment">/**
</span></span><span id="74" class="l"><a class="l" href="#74"> 74: </a><span class="php-comment"> * @var string|bool
</span></span><span id="74" class="l"><a class="l" href="#74"> 74: </a><span class="php-comment"> * @var int|bool
</span></span><span id="75" class="l"><a class="l" href="#75"> 75: </a><span class="php-comment"> */</span>
</span><span id="76" class="l"><a class="l" href="#76"> 76: </a> <span class="php-keyword1">private</span> <span class="php-var"><a id="$hote" href="#$hote">$hote</a></span> = <span class="php-keyword1">false</span>;
</span><span id="76" class="l"><a class="l" href="#76"> 76: </a> <span class="php-keyword1">private</span> <span class="php-var"><a id="$port" href="#$port">$port</a></span> = <span class="php-keyword1">false</span>;
</span><span id="77" class="l"><a class="l" href="#77"> 77: </a>
</span><span id="78" class="l"><a class="l" href="#78"> 78: </a> <span class="php-comment">/**
</span></span><span id="79" class="l"><a class="l" href="#79"> 79: </a><span class="php-comment"> * @var int|bool
</span></span><span id="79" class="l"><a class="l" href="#79"> 79: </a><span class="php-comment"> * @var string
</span></span><span id="80" class="l"><a class="l" href="#80"> 80: </a><span class="php-comment"> */</span>
</span><span id="81" class="l"><a class="l" href="#81"> 81: </a> <span class="php-keyword1">private</span> <span class="php-var"><a id="$port" href="#$port">$port</a></span> = <span class="php-keyword1">false</span>;
</span><span id="81" class="l"><a class="l" href="#81"> 81: </a> <span class="php-keyword1">private</span> <span class="php-var"><a id="$chemin" href="#$chemin">$chemin</a></span> = <span class="php-quote">''</span>;
</span><span id="82" class="l"><a class="l" href="#82"> 82: </a>
</span><span id="83" class="l"><a class="l" href="#83"> 83: </a> <span class="php-comment">/**
</span></span><span id="84" class="l"><a class="l" href="#84"> 84: </a><span class="php-comment"> * @var string
</span></span><span id="84" class="l"><a class="l" href="#84"> 84: </a><span class="php-comment"> * @var string|bool
</span></span><span id="85" class="l"><a class="l" href="#85"> 85: </a><span class="php-comment"> */</span>
</span><span id="86" class="l"><a class="l" href="#86"> 86: </a> <span class="php-keyword1">private</span> <span class="php-var"><a id="$chemin" href="#$chemin">$chemin</a></span> = <span class="php-quote">''</span>;
</span><span id="86" class="l"><a class="l" href="#86"> 86: </a> <span class="php-keyword1">private</span> <span class="php-var"><a id="$requete" href="#$requete">$requete</a></span> = <span class="php-keyword1">false</span>;
</span><span id="87" class="l"><a class="l" href="#87"> 87: </a>
</span><span id="88" class="l"><a class="l" href="#88"> 88: </a> <span class="php-comment">/**
</span></span><span id="89" class="l"><a class="l" href="#89"> 89: </a><span class="php-comment"> * @var string|bool
</span></span><span id="90" class="l"><a class="l" href="#90"> 90: </a><span class="php-comment"> */</span>
</span><span id="91" class="l"><a class="l" href="#91"> 91: </a> <span class="php-keyword1">private</span> <span class="php-var"><a id="$requete" href="#$requete">$requete</a></span> = <span class="php-keyword1">false</span>;
</span><span id="91" class="l"><a class="l" href="#91"> 91: </a> <span class="php-keyword1">private</span> <span class="php-var"><a id="$fragment" href="#$fragment">$fragment</a></span> = <span class="php-keyword1">false</span>;
</span><span id="92" class="l"><a class="l" href="#92"> 92: </a>
</span><span id="93" class="l"><a class="l" href="#93"> 93: </a> <span class="php-comment">/**
</span></span><span id="94" class="l"><a class="l" href="#94"> 94: </a><span class="php-comment"> * @var string|bool
</span></span><span id="95" class="l"><a class="l" href="#95"> 95: </a><span class="php-comment"> */</span>
</span><span id="96" class="l"><a class="l" href="#96"> 96: </a> <span class="php-keyword1">private</span> <span class="php-var"><a id="$fragment" href="#$fragment">$fragment</a></span> = <span class="php-keyword1">false</span>;
</span><span id="97" class="l"><a class="l" href="#97"> 97: </a>
</span><span id="98" class="l"><a class="l" href="#98"> 98: </a> <span class="php-comment">/**
</span></span><span id="99" class="l"><a class="l" href="#99"> 99: </a><span class="php-comment"> * @param string $url une URL relative ou absolue
</span></span><span id="100" class="l"><a class="l" href="#100">100: </a><span class="php-comment"> * @param array $options
</span></span><span id="101" class="l"><a class="l" href="#101">101: </a><span class="php-comment"> */</span>
</span><span id="102" class="l"><a class="l" href="#102">102: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="___construct" href="#___construct">__construct</a>(<span class="php-var">$url</span>, <span class="php-var">$options</span> = <span class="php-keyword1">null</span>) {
</span><span id="103" class="l"><a class="l" href="#103">103: </a> <span class="php-var">$this</span>-&gt;setOption(self::OPTION_SEPARATEUR_ENTREE,
</span><span id="104" class="l"><a class="l" href="#104">104: </a> Config::get(<span class="php-quote">'fw_url_arg_separateur_entree'</span>));
</span><span id="105" class="l"><a class="l" href="#105">105: </a> <span class="php-var">$this</span>-&gt;setOption(self::OPTION_SEPARATEUR_SORTIE,
</span><span id="106" class="l"><a class="l" href="#106">106: </a> Config::get(<span class="php-quote">'fw_url_arg_separateur_sortie'</span>));
</span><span id="107" class="l"><a class="l" href="#107">107: </a> <span class="php-keyword1">if</span> (<span class="php-keyword2">is_array</span>(<span class="php-var">$options</span>)) {
</span><span id="108" class="l"><a class="l" href="#108">108: </a> <span class="php-keyword1">foreach</span> (<span class="php-var">$options</span> <span class="php-keyword1">as</span> <span class="php-var">$nomOption</span> =&gt; <span class="php-var">$valeur</span>) {
</span><span id="109" class="l"><a class="l" href="#109">109: </a> <span class="php-var">$this</span>-&gt;setOption(<span class="php-var">$nomOption</span>);
</span><span id="110" class="l"><a class="l" href="#110">110: </a> }
</span></span><span id="94" class="l"><a class="l" href="#94"> 94: </a><span class="php-comment"> * @param string $url une URL relative ou absolue
</span></span><span id="95" class="l"><a class="l" href="#95"> 95: </a><span class="php-comment"> * @param array $options
</span></span><span id="96" class="l"><a class="l" href="#96"> 96: </a><span class="php-comment"> */</span>
</span><span id="97" class="l"><a class="l" href="#97"> 97: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="___construct" href="#___construct">__construct</a>(<span class="php-var">$url</span>, <span class="php-var">$options</span> = <span class="php-keyword1">null</span>) {
</span><span id="98" class="l"><a class="l" href="#98"> 98: </a> <span class="php-var">$this</span>-&gt;setOption(self::OPTION_SEPARATEUR_ENTREE,
</span><span id="99" class="l"><a class="l" href="#99"> 99: </a> Config::get(<span class="php-quote">'fw_url_arg_separateur_entree'</span>));
</span><span id="100" class="l"><a class="l" href="#100">100: </a> <span class="php-var">$this</span>-&gt;setOption(self::OPTION_SEPARATEUR_SORTIE,
</span><span id="101" class="l"><a class="l" href="#101">101: </a> Config::get(<span class="php-quote">'fw_url_arg_separateur_sortie'</span>));
</span><span id="102" class="l"><a class="l" href="#102">102: </a> <span class="php-keyword1">if</span> (<span class="php-keyword2">is_array</span>(<span class="php-var">$options</span>)) {
</span><span id="103" class="l"><a class="l" href="#103">103: </a> <span class="php-keyword1">foreach</span> (<span class="php-var">$options</span> <span class="php-keyword1">as</span> <span class="php-var">$nomOption</span> =&gt; <span class="php-var">$valeur</span>) {
</span><span id="104" class="l"><a class="l" href="#104">104: </a> <span class="php-var">$this</span>-&gt;setOption(<span class="php-var">$nomOption</span>);
</span><span id="105" class="l"><a class="l" href="#105">105: </a> }
</span><span id="106" class="l"><a class="l" href="#106">106: </a> }
</span><span id="107" class="l"><a class="l" href="#107">107: </a>
</span><span id="108" class="l"><a class="l" href="#108">108: </a> <span class="php-keyword1">if</span> (<span class="php-keyword2">preg_match</span>(<span class="php-quote">'@^([a-z][a-z0-9.+-]*):@i'</span>, <span class="php-var">$url</span>, <span class="php-var">$reg</span>)) {
</span><span id="109" class="l"><a class="l" href="#109">109: </a> <span class="php-var">$this</span>-&gt;schema = <span class="php-var">$reg</span>[<span class="php-num">1</span>];
</span><span id="110" class="l"><a class="l" href="#110">110: </a> <span class="php-var">$url</span> = <span class="php-keyword2">substr</span>(<span class="php-var">$url</span>, <span class="php-keyword2">strlen</span>(<span class="php-var">$reg</span>[<span class="php-num">0</span>]));
</span><span id="111" class="l"><a class="l" href="#111">111: </a> }
</span><span id="112" class="l"><a class="l" href="#112">112: </a>
</span><span id="113" class="l"><a class="l" href="#113">113: </a> <span class="php-keyword1">if</span> (<span class="php-keyword2">preg_match</span>(<span class="php-quote">'@^([a-z][a-z0-9.+-]*):@i'</span>, <span class="php-var">$url</span>, <span class="php-var">$reg</span>)) {
</span><span id="114" class="l"><a class="l" href="#114">114: </a> <span class="php-var">$this</span>-&gt;schema = <span class="php-var">$reg</span>[<span class="php-num">1</span>];
</span><span id="113" class="l"><a class="l" href="#113">113: </a> <span class="php-keyword1">if</span> (<span class="php-keyword2">preg_match</span>(<span class="php-quote">'@^//([^/#?]+)@'</span>, <span class="php-var">$url</span>, <span class="php-var">$reg</span>)) {
</span><span id="114" class="l"><a class="l" href="#114">114: </a> <span class="php-var">$this</span>-&gt;setAutorite(<span class="php-var">$reg</span>[<span class="php-num">1</span>]);
</span><span id="115" class="l"><a class="l" href="#115">115: </a> <span class="php-var">$url</span> = <span class="php-keyword2">substr</span>(<span class="php-var">$url</span>, <span class="php-keyword2">strlen</span>(<span class="php-var">$reg</span>[<span class="php-num">0</span>]));
</span><span id="116" class="l"><a class="l" href="#116">116: </a> }
</span><span id="117" class="l"><a class="l" href="#117">117: </a>
</span><span id="118" class="l"><a class="l" href="#118">118: </a> <span class="php-keyword1">if</span> (<span class="php-keyword2">preg_match</span>(<span class="php-quote">'@^//([^/#?]+)@'</span>, <span class="php-var">$url</span>, <span class="php-var">$reg</span>)) {
</span><span id="119" class="l"><a class="l" href="#119">119: </a> <span class="php-var">$this</span>-&gt;setAutorite(<span class="php-var">$reg</span>[<span class="php-num">1</span>]);
</span><span id="120" class="l"><a class="l" href="#120">120: </a> <span class="php-var">$url</span> = <span class="php-keyword2">substr</span>(<span class="php-var">$url</span>, <span class="php-keyword2">strlen</span>(<span class="php-var">$reg</span>[<span class="php-num">0</span>]));
</span><span id="121" class="l"><a class="l" href="#121">121: </a> }
</span><span id="122" class="l"><a class="l" href="#122">122: </a>
</span><span id="123" class="l"><a class="l" href="#123">123: </a> <span class="php-var">$i</span> = <span class="php-keyword2">strcspn</span>(<span class="php-var">$url</span>, <span class="php-quote">'?#'</span>);
</span><span id="124" class="l"><a class="l" href="#124">124: </a> <span class="php-var">$this</span>-&gt;chemin = <span class="php-keyword2">substr</span>(<span class="php-var">$url</span>, <span class="php-num">0</span>, <span class="php-var">$i</span>);
</span><span id="125" class="l"><a class="l" href="#125">125: </a> <span class="php-var">$url</span> = <span class="php-keyword2">substr</span>(<span class="php-var">$url</span>, <span class="php-var">$i</span>);
</span><span id="118" class="l"><a class="l" href="#118">118: </a> <span class="php-var">$i</span> = <span class="php-keyword2">strcspn</span>(<span class="php-var">$url</span>, <span class="php-quote">'?#'</span>);
</span><span id="119" class="l"><a class="l" href="#119">119: </a> <span class="php-var">$this</span>-&gt;chemin = <span class="php-keyword2">substr</span>(<span class="php-var">$url</span>, <span class="php-num">0</span>, <span class="php-var">$i</span>);
</span><span id="120" class="l"><a class="l" href="#120">120: </a> <span class="php-var">$url</span> = <span class="php-keyword2">substr</span>(<span class="php-var">$url</span>, <span class="php-var">$i</span>);
</span><span id="121" class="l"><a class="l" href="#121">121: </a>
</span><span id="122" class="l"><a class="l" href="#122">122: </a> <span class="php-keyword1">if</span> (<span class="php-keyword2">preg_match</span>(<span class="php-quote">'@^\?([^#]*)@'</span>, <span class="php-var">$url</span>, <span class="php-var">$reg</span>)) {
</span><span id="123" class="l"><a class="l" href="#123">123: </a> <span class="php-var">$this</span>-&gt;requete = <span class="php-var">$reg</span>[<span class="php-num">1</span>];
</span><span id="124" class="l"><a class="l" href="#124">124: </a> <span class="php-var">$url</span> = <span class="php-keyword2">substr</span>(<span class="php-var">$url</span>, <span class="php-keyword2">strlen</span>(<span class="php-var">$reg</span>[<span class="php-num">0</span>]));
</span><span id="125" class="l"><a class="l" href="#125">125: </a> }
</span><span id="126" class="l"><a class="l" href="#126">126: </a>
</span><span id="127" class="l"><a class="l" href="#127">127: </a> <span class="php-keyword1">if</span> (<span class="php-keyword2">preg_match</span>(<span class="php-quote">'@^\?([^#]*)@'</span>, <span class="php-var">$url</span>, <span class="php-var">$reg</span>)) {
</span><span id="128" class="l"><a class="l" href="#128">128: </a> <span class="php-var">$this</span>-&gt;requete = <span class="php-var">$reg</span>[<span class="php-num">1</span>];
</span><span id="129" class="l"><a class="l" href="#129">129: </a> <span class="php-var">$url</span> = <span class="php-keyword2">substr</span>(<span class="php-var">$url</span>, <span class="php-keyword2">strlen</span>(<span class="php-var">$reg</span>[<span class="php-num">0</span>]));
</span><span id="130" class="l"><a class="l" href="#130">130: </a> }
</span><span id="127" class="l"><a class="l" href="#127">127: </a> <span class="php-keyword1">if</span> (<span class="php-var">$url</span>) {
</span><span id="128" class="l"><a class="l" href="#128">128: </a> <span class="php-var">$this</span>-&gt;fragment = <span class="php-keyword2">substr</span>(<span class="php-var">$url</span>, <span class="php-num">1</span>);
</span><span id="129" class="l"><a class="l" href="#129">129: </a> }
</span><span id="130" class="l"><a class="l" href="#130">130: </a> }
</span><span id="131" class="l"><a class="l" href="#131">131: </a>
</span><span id="132" class="l"><a class="l" href="#132">132: </a> <span class="php-keyword1">if</span> (<span class="php-var">$url</span>) {
</span><span id="133" class="l"><a class="l" href="#133">133: </a> <span class="php-var">$this</span>-&gt;fragment = <span class="php-keyword2">substr</span>(<span class="php-var">$url</span>, <span class="php-num">1</span>);
</span><span id="134" class="l"><a class="l" href="#134">134: </a> }
</span><span id="135" class="l"><a class="l" href="#135">135: </a> }
</span><span id="136" class="l"><a class="l" href="#136">136: </a>
</span><span id="137" class="l"><a class="l" href="#137">137: </a> <span class="php-comment">/**
</span></span><span id="138" class="l"><a class="l" href="#138">138: </a><span class="php-comment"> * Retourne le schéma, c.a.d. &quot;http&quot; ou &quot;urn&quot;, ou false si aucun schéma n'est
</span></span><span id="139" class="l"><a class="l" href="#139">139: </a><span class="php-comment"> * spécifié, i.e. l'url est une url relative
</span></span><span id="140" class="l"><a class="l" href="#140">140: </a><span class="php-comment"> *
</span></span><span id="141" class="l"><a class="l" href="#141">141: </a><span class="php-comment"> * @return string|bool
</span></span><span id="142" class="l"><a class="l" href="#142">142: </a><span class="php-comment"> */</span>
</span><span id="143" class="l"><a class="l" href="#143">143: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="_getSchema" href="#_getSchema">getSchema</a>() {
</span><span id="144" class="l"><a class="l" href="#144">144: </a> <span class="php-keyword1">return</span> <span class="php-var">$this</span>-&gt;schema;
</span><span id="145" class="l"><a class="l" href="#145">145: </a> }
</span><span id="146" class="l"><a class="l" href="#146">146: </a>
</span><span id="147" class="l"><a class="l" href="#147">147: </a> <span class="php-comment">/**
</span></span><span id="148" class="l"><a class="l" href="#148">148: </a><span class="php-comment"> * @param string|bool $schema
</span></span><span id="149" class="l"><a class="l" href="#149">149: </a><span class="php-comment"> *
</span></span><span id="150" class="l"><a class="l" href="#150">150: </a><span class="php-comment"> * @return void
</span></span><span id="151" class="l"><a class="l" href="#151">151: </a><span class="php-comment"> * @see getSchema()
</span></span><span id="152" class="l"><a class="l" href="#152">152: </a><span class="php-comment"> */</span>
</span><span id="153" class="l"><a class="l" href="#153">153: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="_setSchema" href="#_setSchema">setSchema</a>(<span class="php-var">$schema</span>) {
</span><span id="154" class="l"><a class="l" href="#154">154: </a> <span class="php-var">$this</span>-&gt;schema = <span class="php-var">$schema</span>;
</span><span id="155" class="l"><a class="l" href="#155">155: </a> }
</span><span id="156" class="l"><a class="l" href="#156">156: </a>
</span><span id="157" class="l"><a class="l" href="#157">157: </a> <span class="php-comment">/**
</span></span><span id="158" class="l"><a class="l" href="#158">158: </a><span class="php-comment"> * renvoie la partie user de la partie infoUtilisateur (partie précédant le premier
</span></span><span id="159" class="l"><a class="l" href="#159">159: </a><span class="php-comment"> * &quot;:&quot;), ou false si aucune partie infoUtilisateur n'est définie.
</span></span><span id="160" class="l"><a class="l" href="#160">160: </a><span class="php-comment"> *
</span></span><span id="161" class="l"><a class="l" href="#161">161: </a><span class="php-comment"> * @return string|bool
</span></span><span id="162" class="l"><a class="l" href="#162">162: </a><span class="php-comment"> */</span>
</span><span id="163" class="l"><a class="l" href="#163">163: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="_getUtilisateur" href="#_getUtilisateur">getUtilisateur</a>() {
</span><span id="164" class="l"><a class="l" href="#164">164: </a> <span class="php-keyword1">return</span> <span class="php-var">$this</span>-&gt;infoUtilisateur !== <span class="php-keyword1">false</span> ? <span class="php-keyword2">preg_replace</span>(<span class="php-quote">'@:.*$@'</span>, <span class="php-quote">''</span>, <span class="php-var">$this</span>-&gt;infoUtilisateur) : <span class="php-keyword1">false</span>;
</span><span id="165" class="l"><a class="l" href="#165">165: </a> }
</span><span id="166" class="l"><a class="l" href="#166">166: </a>
</span><span id="167" class="l"><a class="l" href="#167">167: </a> <span class="php-comment">/**
</span></span><span id="168" class="l"><a class="l" href="#168">168: </a><span class="php-comment"> * renvoie la partie mot de passe de la partie infoUtilisateur (partie après le premier
</span></span><span id="169" class="l"><a class="l" href="#169">169: </a><span class="php-comment"> * &quot;:&quot;), , ou false si aucune partie infoUtilisateur n'est définie (i.e. l'URL ne contient
</span></span><span id="170" class="l"><a class="l" href="#170">170: </a><span class="php-comment"> * pas de &quot;@&quot; en face du nom d'hôte) ou si la partie infoUtilisateur ne contient pas de &quot;:&quot;.
</span></span><span id="171" class="l"><a class="l" href="#171">171: </a><span class="php-comment"> *
</span></span><span id="172" class="l"><a class="l" href="#172">172: </a><span class="php-comment"> * @return string|bool
</span></span><span id="173" class="l"><a class="l" href="#173">173: </a><span class="php-comment"> */</span>
</span><span id="174" class="l"><a class="l" href="#174">174: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="_getMotDePasse" href="#_getMotDePasse">getMotDePasse</a>() {
</span><span id="175" class="l"><a class="l" href="#175">175: </a> <span class="php-keyword1">return</span> <span class="php-var">$this</span>-&gt;infoUtilisateur !== <span class="php-keyword1">false</span> ? <span class="php-keyword2">substr</span>(<span class="php-keyword2">strstr</span>(<span class="php-var">$this</span>-&gt;infoUtilisateur, <span class="php-quote">':'</span>), <span class="php-num">1</span>) : <span class="php-keyword1">false</span>;
</span><span id="176" class="l"><a class="l" href="#176">176: </a> }
</span><span id="177" class="l"><a class="l" href="#177">177: </a>
</span><span id="178" class="l"><a class="l" href="#178">178: </a> <span class="php-comment">/**
</span></span><span id="179" class="l"><a class="l" href="#179">179: </a><span class="php-comment"> * Renvoie la partie userinfio, ou false si celle-ci n'existe pas, i.e. si la partie
</span></span><span id="180" class="l"><a class="l" href="#180">180: </a><span class="php-comment"> * autorité ne contient pas de &quot;@&quot;
</span></span><span id="181" class="l"><a class="l" href="#181">181: </a><span class="php-comment"> *
</span></span><span id="182" class="l"><a class="l" href="#182">182: </a><span class="php-comment"> * @return string|bool
</span></span><span id="183" class="l"><a class="l" href="#183">183: </a><span class="php-comment"> */</span>
</span><span id="184" class="l"><a class="l" href="#184">184: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="_getInfoUtilisateur" href="#_getInfoUtilisateur">getInfoUtilisateur</a>() {
</span><span id="185" class="l"><a class="l" href="#185">185: </a> <span class="php-keyword1">return</span> <span class="php-var">$this</span>-&gt;infoUtilisateur;
</span><span id="186" class="l"><a class="l" href="#186">186: </a> }
</span><span id="187" class="l"><a class="l" href="#187">187: </a>
</span><span id="188" class="l"><a class="l" href="#188">188: </a> <span class="php-comment">/**
</span></span><span id="189" class="l"><a class="l" href="#189">189: </a><span class="php-comment"> * Setteur pour la partie infoUtilisateur. Si deux argument sont passé, ils sont combinés
</span></span><span id="190" class="l"><a class="l" href="#190">190: </a><span class="php-comment"> * dans la partie infoUtilisateur de cette manière username &quot;:&quot; password.
</span></span><span id="191" class="l"><a class="l" href="#191">191: </a><span class="php-comment"> *
</span></span><span id="192" class="l"><a class="l" href="#192">192: </a><span class="php-comment"> * @param string|bool $infoUtilisateur infoUtilisateur ou username
</span></span><span id="193" class="l"><a class="l" href="#193">193: </a><span class="php-comment"> * @param string|bool $motDePasse
</span></span><span id="194" class="l"><a class="l" href="#194">194: </a><span class="php-comment"> *
</span></span><span id="195" class="l"><a class="l" href="#195">195: </a><span class="php-comment"> * @return void
</span></span><span id="196" class="l"><a class="l" href="#196">196: </a><span class="php-comment"> */</span>
</span><span id="197" class="l"><a class="l" href="#197">197: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="_setInfoUtilisateur" href="#_setInfoUtilisateur">setInfoUtilisateur</a>(<span class="php-var">$infoUtilisateur</span>, <span class="php-var">$motDePasse</span> = <span class="php-keyword1">false</span>) {
</span><span id="198" class="l"><a class="l" href="#198">198: </a> <span class="php-var">$this</span>-&gt;infoUtilisateur = <span class="php-var">$infoUtilisateur</span>;
</span><span id="199" class="l"><a class="l" href="#199">199: </a> <span class="php-keyword1">if</span> (<span class="php-var">$motDePasse</span> !== <span class="php-keyword1">false</span>) {
</span><span id="200" class="l"><a class="l" href="#200">200: </a> <span class="php-var">$this</span>-&gt;infoUtilisateur .= <span class="php-quote">':'</span> . <span class="php-var">$motDePasse</span>;
</span><span id="201" class="l"><a class="l" href="#201">201: </a> }
</span><span id="202" class="l"><a class="l" href="#202">202: </a> }
</span><span id="203" class="l"><a class="l" href="#203">203: </a>
</span><span id="204" class="l"><a class="l" href="#204">204: </a> <span class="php-comment">/**
</span></span><span id="205" class="l"><a class="l" href="#205">205: </a><span class="php-comment"> * Renvoie la partie hôte, ou false s'il n'y a pas de partie autorité, c.a.d.
</span></span><span id="206" class="l"><a class="l" href="#206">206: </a><span class="php-comment"> * l'URL est relative.
</span></span><span id="207" class="l"><a class="l" href="#207">207: </a><span class="php-comment"> *
</span></span><span id="208" class="l"><a class="l" href="#208">208: </a><span class="php-comment"> * @return string|bool
</span></span><span id="209" class="l"><a class="l" href="#209">209: </a><span class="php-comment"> */</span>
</span><span id="210" class="l"><a class="l" href="#210">210: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="_getHote" href="#_getHote">getHote</a>() {
</span><span id="211" class="l"><a class="l" href="#211">211: </a> <span class="php-keyword1">return</span> <span class="php-var">$this</span>-&gt;hote;
</span><span id="212" class="l"><a class="l" href="#212">212: </a> }
</span><span id="213" class="l"><a class="l" href="#213">213: </a>
</span><span id="214" class="l"><a class="l" href="#214">214: </a> <span class="php-comment">/**
</span></span><span id="215" class="l"><a class="l" href="#215">215: </a><span class="php-comment"> * @param string|bool $hote
</span></span><span id="216" class="l"><a class="l" href="#216">216: </a><span class="php-comment"> *
</span></span><span id="217" class="l"><a class="l" href="#217">217: </a><span class="php-comment"> * @return void
</span></span><span id="218" class="l"><a class="l" href="#218">218: </a><span class="php-comment"> */</span>
</span><span id="219" class="l"><a class="l" href="#219">219: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="_setHote" href="#_setHote">setHote</a>(<span class="php-var">$hote</span>) {
</span><span id="220" class="l"><a class="l" href="#220">220: </a> <span class="php-var">$this</span>-&gt;hote = <span class="php-var">$hote</span>;
</span><span id="221" class="l"><a class="l" href="#221">221: </a> }
</span><span id="222" class="l"><a class="l" href="#222">222: </a>
</span><span id="223" class="l"><a class="l" href="#223">223: </a> <span class="php-comment">/**
</span></span><span id="224" class="l"><a class="l" href="#224">224: </a><span class="php-comment"> * Renvoie le numéro de port, ou false si aucun numéro de port n'est spécifié,
</span></span><span id="225" class="l"><a class="l" href="#225">225: </a><span class="php-comment"> * i.e. le port par défaut doit utilisé.
</span></span><span id="226" class="l"><a class="l" href="#226">226: </a><span class="php-comment"> *
</span></span><span id="227" class="l"><a class="l" href="#227">227: </a><span class="php-comment"> * @return int|bool
</span></span><span id="228" class="l"><a class="l" href="#228">228: </a><span class="php-comment"> */</span>
</span><span id="229" class="l"><a class="l" href="#229">229: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="_getPort" href="#_getPort">getPort</a>() {
</span><span id="230" class="l"><a class="l" href="#230">230: </a> <span class="php-keyword1">return</span> <span class="php-var">$this</span>-&gt;port;
</span><span id="231" class="l"><a class="l" href="#231">231: </a> }
</span><span id="232" class="l"><a class="l" href="#232">232: </a>
</span><span id="233" class="l"><a class="l" href="#233">233: </a> <span class="php-comment">/**
</span></span><span id="234" class="l"><a class="l" href="#234">234: </a><span class="php-comment"> * @param int|bool $port
</span></span><span id="235" class="l"><a class="l" href="#235">235: </a><span class="php-comment"> *
</span></span><span id="236" class="l"><a class="l" href="#236">236: </a><span class="php-comment"> * @return void
</span></span><span id="237" class="l"><a class="l" href="#237">237: </a><span class="php-comment"> */</span>
</span><span id="238" class="l"><a class="l" href="#238">238: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="_setPort" href="#_setPort">setPort</a>(<span class="php-var">$port</span>) {
</span><span id="239" class="l"><a class="l" href="#239">239: </a> <span class="php-var">$this</span>-&gt;port = <span class="php-keyword2">intval</span>(<span class="php-var">$port</span>);
</span><span id="240" class="l"><a class="l" href="#240">240: </a> }
</span><span id="241" class="l"><a class="l" href="#241">241: </a>
</span><span id="242" class="l"><a class="l" href="#242">242: </a> <span class="php-comment">/**
</span></span><span id="243" class="l"><a class="l" href="#243">243: </a><span class="php-comment"> * Renvoie la partie autorité, i.e. [ infoUtilisateur &quot;@&quot; ] hote [ &quot;:&quot; port ], ou
</span></span><span id="244" class="l"><a class="l" href="#244">244: </a><span class="php-comment"> * false si celle-ci est absente.
</span></span><span id="245" class="l"><a class="l" href="#245">245: </a><span class="php-comment"> *
</span></span><span id="246" class="l"><a class="l" href="#246">246: </a><span class="php-comment"> * @return string|bool
</span></span><span id="247" class="l"><a class="l" href="#247">247: </a><span class="php-comment"> */</span>
</span><span id="248" class="l"><a class="l" href="#248">248: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="_getAutorite" href="#_getAutorite">getAutorite</a>() {
</span><span id="249" class="l"><a class="l" href="#249">249: </a> <span class="php-keyword1">if</span> (!<span class="php-var">$this</span>-&gt;hote) {
</span><span id="250" class="l"><a class="l" href="#250">250: </a> <span class="php-keyword1">return</span> <span class="php-keyword1">false</span>;
</span><span id="251" class="l"><a class="l" href="#251">251: </a> }
</span><span id="252" class="l"><a class="l" href="#252">252: </a>
</span><span id="253" class="l"><a class="l" href="#253">253: </a> <span class="php-var">$autorite</span> = <span class="php-quote">''</span>;
</span><span id="254" class="l"><a class="l" href="#254">254: </a>
</span><span id="255" class="l"><a class="l" href="#255">255: </a> <span class="php-keyword1">if</span> (<span class="php-var">$this</span>-&gt;infoUtilisateur !== <span class="php-keyword1">false</span>) {
</span><span id="256" class="l"><a class="l" href="#256">256: </a> <span class="php-var">$autorite</span> .= <span class="php-var">$this</span>-&gt;infoUtilisateur . <span class="php-quote">'@'</span>;
</span><span id="257" class="l"><a class="l" href="#257">257: </a> }
</span><span id="258" class="l"><a class="l" href="#258">258: </a>
</span><span id="259" class="l"><a class="l" href="#259">259: </a> <span class="php-var">$autorite</span> .= <span class="php-var">$this</span>-&gt;hote;
</span><span id="260" class="l"><a class="l" href="#260">260: </a>
</span><span id="261" class="l"><a class="l" href="#261">261: </a> <span class="php-keyword1">if</span> (<span class="php-var">$this</span>-&gt;port !== <span class="php-keyword1">false</span>) {
</span><span id="262" class="l"><a class="l" href="#262">262: </a> <span class="php-var">$autorite</span> .= <span class="php-quote">':'</span> . <span class="php-var">$this</span>-&gt;port;
</span><span id="263" class="l"><a class="l" href="#263">263: </a> }
</span><span id="264" class="l"><a class="l" href="#264">264: </a>
</span><span id="265" class="l"><a class="l" href="#265">265: </a> <span class="php-keyword1">return</span> <span class="php-var">$autorite</span>;
</span><span id="266" class="l"><a class="l" href="#266">266: </a> }
</span><span id="267" class="l"><a class="l" href="#267">267: </a>
</span><span id="268" class="l"><a class="l" href="#268">268: </a> <span class="php-comment">/**
</span></span><span id="269" class="l"><a class="l" href="#269">269: </a><span class="php-comment"> * @param string|false $autorite
</span></span><span id="270" class="l"><a class="l" href="#270">270: </a><span class="php-comment"> *
</span></span><span id="271" class="l"><a class="l" href="#271">271: </a><span class="php-comment"> * @return void
</span></span><span id="272" class="l"><a class="l" href="#272">272: </a><span class="php-comment"> */</span>
</span><span id="273" class="l"><a class="l" href="#273">273: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="_setAutorite" href="#_setAutorite">setAutorite</a>(<span class="php-var">$autorite</span>) {
</span><span id="274" class="l"><a class="l" href="#274">274: </a> <span class="php-var">$this</span>-&gt;user = <span class="php-keyword1">false</span>;
</span><span id="275" class="l"><a class="l" href="#275">275: </a> <span class="php-var">$this</span>-&gt;pass = <span class="php-keyword1">false</span>;
</span><span id="276" class="l"><a class="l" href="#276">276: </a> <span class="php-var">$this</span>-&gt;hote = <span class="php-keyword1">false</span>;
</span><span id="277" class="l"><a class="l" href="#277">277: </a> <span class="php-var">$this</span>-&gt;port = <span class="php-keyword1">false</span>;
</span><span id="278" class="l"><a class="l" href="#278">278: </a> <span class="php-keyword1">if</span> (<span class="php-keyword2">preg_match</span>(<span class="php-quote">'@^(([^\@]+)\@)?([^:]+)(:(\d*))?$@'</span>, <span class="php-var">$autorite</span>, <span class="php-var">$reg</span>)) {
</span><span id="279" class="l"><a class="l" href="#279">279: </a> <span class="php-keyword1">if</span> (<span class="php-var">$reg</span>[<span class="php-num">1</span>]) {
</span><span id="280" class="l"><a class="l" href="#280">280: </a> <span class="php-var">$this</span>-&gt;infoUtilisateur = <span class="php-var">$reg</span>[<span class="php-num">2</span>];
</span><span id="132" class="l"><a class="l" href="#132">132: </a> <span class="php-comment">/**
</span></span><span id="133" class="l"><a class="l" href="#133">133: </a><span class="php-comment"> * Retourne le schéma, c.a.d. &quot;http&quot; ou &quot;urn&quot;, ou false si aucun schéma n'est
</span></span><span id="134" class="l"><a class="l" href="#134">134: </a><span class="php-comment"> * spécifié, i.e. l'url est une url relative
</span></span><span id="135" class="l"><a class="l" href="#135">135: </a><span class="php-comment"> *
</span></span><span id="136" class="l"><a class="l" href="#136">136: </a><span class="php-comment"> * @return string|bool
</span></span><span id="137" class="l"><a class="l" href="#137">137: </a><span class="php-comment"> */</span>
</span><span id="138" class="l"><a class="l" href="#138">138: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="_getSchema" href="#_getSchema">getSchema</a>() {
</span><span id="139" class="l"><a class="l" href="#139">139: </a> <span class="php-keyword1">return</span> <span class="php-var">$this</span>-&gt;schema;
</span><span id="140" class="l"><a class="l" href="#140">140: </a> }
</span><span id="141" class="l"><a class="l" href="#141">141: </a>
</span><span id="142" class="l"><a class="l" href="#142">142: </a> <span class="php-comment">/**
</span></span><span id="143" class="l"><a class="l" href="#143">143: </a><span class="php-comment"> * @param string|bool $schema
</span></span><span id="144" class="l"><a class="l" href="#144">144: </a><span class="php-comment"> *
</span></span><span id="145" class="l"><a class="l" href="#145">145: </a><span class="php-comment"> * @return void
</span></span><span id="146" class="l"><a class="l" href="#146">146: </a><span class="php-comment"> * @see getSchema()
</span></span><span id="147" class="l"><a class="l" href="#147">147: </a><span class="php-comment"> */</span>
</span><span id="148" class="l"><a class="l" href="#148">148: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="_setSchema" href="#_setSchema">setSchema</a>(<span class="php-var">$schema</span>) {
</span><span id="149" class="l"><a class="l" href="#149">149: </a> <span class="php-var">$this</span>-&gt;schema = <span class="php-var">$schema</span>;
</span><span id="150" class="l"><a class="l" href="#150">150: </a> }
</span><span id="151" class="l"><a class="l" href="#151">151: </a>
</span><span id="152" class="l"><a class="l" href="#152">152: </a> <span class="php-comment">/**
</span></span><span id="153" class="l"><a class="l" href="#153">153: </a><span class="php-comment"> * renvoie la partie user de la partie infoUtilisateur (partie précédant le premier
</span></span><span id="154" class="l"><a class="l" href="#154">154: </a><span class="php-comment"> * &quot;:&quot;), ou false si aucune partie infoUtilisateur n'est définie.
</span></span><span id="155" class="l"><a class="l" href="#155">155: </a><span class="php-comment"> *
</span></span><span id="156" class="l"><a class="l" href="#156">156: </a><span class="php-comment"> * @return string|bool
</span></span><span id="157" class="l"><a class="l" href="#157">157: </a><span class="php-comment"> */</span>
</span><span id="158" class="l"><a class="l" href="#158">158: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="_getUtilisateur" href="#_getUtilisateur">getUtilisateur</a>() {
</span><span id="159" class="l"><a class="l" href="#159">159: </a> <span class="php-keyword1">return</span> <span class="php-var">$this</span>-&gt;infoUtilisateur !== <span class="php-keyword1">false</span> ? <span class="php-keyword2">preg_replace</span>(<span class="php-quote">'@:.*$@'</span>, <span class="php-quote">''</span>, <span class="php-var">$this</span>-&gt;infoUtilisateur) : <span class="php-keyword1">false</span>;
</span><span id="160" class="l"><a class="l" href="#160">160: </a> }
</span><span id="161" class="l"><a class="l" href="#161">161: </a>
</span><span id="162" class="l"><a class="l" href="#162">162: </a> <span class="php-comment">/**
</span></span><span id="163" class="l"><a class="l" href="#163">163: </a><span class="php-comment"> * renvoie la partie mot de passe de la partie infoUtilisateur (partie après le premier
</span></span><span id="164" class="l"><a class="l" href="#164">164: </a><span class="php-comment"> * &quot;:&quot;), , ou false si aucune partie infoUtilisateur n'est définie (i.e. l'URL ne contient
</span></span><span id="165" class="l"><a class="l" href="#165">165: </a><span class="php-comment"> * pas de &quot;@&quot; en face du nom d'hôte) ou si la partie infoUtilisateur ne contient pas de &quot;:&quot;.
</span></span><span id="166" class="l"><a class="l" href="#166">166: </a><span class="php-comment"> *
</span></span><span id="167" class="l"><a class="l" href="#167">167: </a><span class="php-comment"> * @return string|bool
</span></span><span id="168" class="l"><a class="l" href="#168">168: </a><span class="php-comment"> */</span>
</span><span id="169" class="l"><a class="l" href="#169">169: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="_getMotDePasse" href="#_getMotDePasse">getMotDePasse</a>() {
</span><span id="170" class="l"><a class="l" href="#170">170: </a> <span class="php-keyword1">return</span> <span class="php-var">$this</span>-&gt;infoUtilisateur !== <span class="php-keyword1">false</span> ? <span class="php-keyword2">substr</span>(<span class="php-keyword2">strstr</span>(<span class="php-var">$this</span>-&gt;infoUtilisateur, <span class="php-quote">':'</span>), <span class="php-num">1</span>) : <span class="php-keyword1">false</span>;
</span><span id="171" class="l"><a class="l" href="#171">171: </a> }
</span><span id="172" class="l"><a class="l" href="#172">172: </a>
</span><span id="173" class="l"><a class="l" href="#173">173: </a> <span class="php-comment">/**
</span></span><span id="174" class="l"><a class="l" href="#174">174: </a><span class="php-comment"> * Renvoie la partie userinfio, ou false si celle-ci n'existe pas, i.e. si la partie
</span></span><span id="175" class="l"><a class="l" href="#175">175: </a><span class="php-comment"> * autorité ne contient pas de &quot;@&quot;
</span></span><span id="176" class="l"><a class="l" href="#176">176: </a><span class="php-comment"> *
</span></span><span id="177" class="l"><a class="l" href="#177">177: </a><span class="php-comment"> * @return string|bool
</span></span><span id="178" class="l"><a class="l" href="#178">178: </a><span class="php-comment"> */</span>
</span><span id="179" class="l"><a class="l" href="#179">179: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="_getInfoUtilisateur" href="#_getInfoUtilisateur">getInfoUtilisateur</a>() {
</span><span id="180" class="l"><a class="l" href="#180">180: </a> <span class="php-keyword1">return</span> <span class="php-var">$this</span>-&gt;infoUtilisateur;
</span><span id="181" class="l"><a class="l" href="#181">181: </a> }
</span><span id="182" class="l"><a class="l" href="#182">182: </a>
</span><span id="183" class="l"><a class="l" href="#183">183: </a> <span class="php-comment">/**
</span></span><span id="184" class="l"><a class="l" href="#184">184: </a><span class="php-comment"> * Setteur pour la partie infoUtilisateur. Si deux argument sont passé, ils sont combinés
</span></span><span id="185" class="l"><a class="l" href="#185">185: </a><span class="php-comment"> * dans la partie infoUtilisateur de cette manière username &quot;:&quot; password.
</span></span><span id="186" class="l"><a class="l" href="#186">186: </a><span class="php-comment"> *
</span></span><span id="187" class="l"><a class="l" href="#187">187: </a><span class="php-comment"> * @param string|bool $infoUtilisateur infoUtilisateur ou username
</span></span><span id="188" class="l"><a class="l" href="#188">188: </a><span class="php-comment"> * @param string|bool $motDePasse
</span></span><span id="189" class="l"><a class="l" href="#189">189: </a><span class="php-comment"> *
</span></span><span id="190" class="l"><a class="l" href="#190">190: </a><span class="php-comment"> * @return void
</span></span><span id="191" class="l"><a class="l" href="#191">191: </a><span class="php-comment"> */</span>
</span><span id="192" class="l"><a class="l" href="#192">192: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="_setInfoUtilisateur" href="#_setInfoUtilisateur">setInfoUtilisateur</a>(<span class="php-var">$infoUtilisateur</span>, <span class="php-var">$motDePasse</span> = <span class="php-keyword1">false</span>) {
</span><span id="193" class="l"><a class="l" href="#193">193: </a> <span class="php-var">$this</span>-&gt;infoUtilisateur = <span class="php-var">$infoUtilisateur</span>;
</span><span id="194" class="l"><a class="l" href="#194">194: </a> <span class="php-keyword1">if</span> (<span class="php-var">$motDePasse</span> !== <span class="php-keyword1">false</span>) {
</span><span id="195" class="l"><a class="l" href="#195">195: </a> <span class="php-var">$this</span>-&gt;infoUtilisateur .= <span class="php-quote">':'</span> . <span class="php-var">$motDePasse</span>;
</span><span id="196" class="l"><a class="l" href="#196">196: </a> }
</span><span id="197" class="l"><a class="l" href="#197">197: </a> }
</span><span id="198" class="l"><a class="l" href="#198">198: </a>
</span><span id="199" class="l"><a class="l" href="#199">199: </a> <span class="php-comment">/**
</span></span><span id="200" class="l"><a class="l" href="#200">200: </a><span class="php-comment"> * Renvoie la partie hôte, ou false s'il n'y a pas de partie autorité, c.a.d.
</span></span><span id="201" class="l"><a class="l" href="#201">201: </a><span class="php-comment"> * l'URL est relative.
</span></span><span id="202" class="l"><a class="l" href="#202">202: </a><span class="php-comment"> *
</span></span><span id="203" class="l"><a class="l" href="#203">203: </a><span class="php-comment"> * @return string|bool
</span></span><span id="204" class="l"><a class="l" href="#204">204: </a><span class="php-comment"> */</span>
</span><span id="205" class="l"><a class="l" href="#205">205: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="_getHote" href="#_getHote">getHote</a>() {
</span><span id="206" class="l"><a class="l" href="#206">206: </a> <span class="php-keyword1">return</span> <span class="php-var">$this</span>-&gt;hote;
</span><span id="207" class="l"><a class="l" href="#207">207: </a> }
</span><span id="208" class="l"><a class="l" href="#208">208: </a>
</span><span id="209" class="l"><a class="l" href="#209">209: </a> <span class="php-comment">/**
</span></span><span id="210" class="l"><a class="l" href="#210">210: </a><span class="php-comment"> * @param string|bool $hote
</span></span><span id="211" class="l"><a class="l" href="#211">211: </a><span class="php-comment"> *
</span></span><span id="212" class="l"><a class="l" href="#212">212: </a><span class="php-comment"> * @return void
</span></span><span id="213" class="l"><a class="l" href="#213">213: </a><span class="php-comment"> */</span>
</span><span id="214" class="l"><a class="l" href="#214">214: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="_setHote" href="#_setHote">setHote</a>(<span class="php-var">$hote</span>) {
</span><span id="215" class="l"><a class="l" href="#215">215: </a> <span class="php-var">$this</span>-&gt;hote = <span class="php-var">$hote</span>;
</span><span id="216" class="l"><a class="l" href="#216">216: </a> }
</span><span id="217" class="l"><a class="l" href="#217">217: </a>
</span><span id="218" class="l"><a class="l" href="#218">218: </a> <span class="php-comment">/**
</span></span><span id="219" class="l"><a class="l" href="#219">219: </a><span class="php-comment"> * Renvoie le numéro de port, ou false si aucun numéro de port n'est spécifié,
</span></span><span id="220" class="l"><a class="l" href="#220">220: </a><span class="php-comment"> * i.e. le port par défaut doit utilisé.
</span></span><span id="221" class="l"><a class="l" href="#221">221: </a><span class="php-comment"> *
</span></span><span id="222" class="l"><a class="l" href="#222">222: </a><span class="php-comment"> * @return int|bool
</span></span><span id="223" class="l"><a class="l" href="#223">223: </a><span class="php-comment"> */</span>
</span><span id="224" class="l"><a class="l" href="#224">224: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="_getPort" href="#_getPort">getPort</a>() {
</span><span id="225" class="l"><a class="l" href="#225">225: </a> <span class="php-keyword1">return</span> <span class="php-var">$this</span>-&gt;port;
</span><span id="226" class="l"><a class="l" href="#226">226: </a> }
</span><span id="227" class="l"><a class="l" href="#227">227: </a>
</span><span id="228" class="l"><a class="l" href="#228">228: </a> <span class="php-comment">/**
</span></span><span id="229" class="l"><a class="l" href="#229">229: </a><span class="php-comment"> * @param int|bool $port
</span></span><span id="230" class="l"><a class="l" href="#230">230: </a><span class="php-comment"> *
</span></span><span id="231" class="l"><a class="l" href="#231">231: </a><span class="php-comment"> * @return void
</span></span><span id="232" class="l"><a class="l" href="#232">232: </a><span class="php-comment"> */</span>
</span><span id="233" class="l"><a class="l" href="#233">233: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="_setPort" href="#_setPort">setPort</a>(<span class="php-var">$port</span>) {
</span><span id="234" class="l"><a class="l" href="#234">234: </a> <span class="php-var">$this</span>-&gt;port = <span class="php-keyword2">intval</span>(<span class="php-var">$port</span>);
</span><span id="235" class="l"><a class="l" href="#235">235: </a> }
</span><span id="236" class="l"><a class="l" href="#236">236: </a>
</span><span id="237" class="l"><a class="l" href="#237">237: </a> <span class="php-comment">/**
</span></span><span id="238" class="l"><a class="l" href="#238">238: </a><span class="php-comment"> * Renvoie la partie autorité, i.e. [ infoUtilisateur &quot;@&quot; ] hote [ &quot;:&quot; port ], ou
</span></span><span id="239" class="l"><a class="l" href="#239">239: </a><span class="php-comment"> * false si celle-ci est absente.
</span></span><span id="240" class="l"><a class="l" href="#240">240: </a><span class="php-comment"> *
</span></span><span id="241" class="l"><a class="l" href="#241">241: </a><span class="php-comment"> * @return string|bool
</span></span><span id="242" class="l"><a class="l" href="#242">242: </a><span class="php-comment"> */</span>
</span><span id="243" class="l"><a class="l" href="#243">243: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="_getAutorite" href="#_getAutorite">getAutorite</a>() {
</span><span id="244" class="l"><a class="l" href="#244">244: </a> <span class="php-keyword1">if</span> (!<span class="php-var">$this</span>-&gt;hote) {
</span><span id="245" class="l"><a class="l" href="#245">245: </a> <span class="php-keyword1">return</span> <span class="php-keyword1">false</span>;
</span><span id="246" class="l"><a class="l" href="#246">246: </a> }
</span><span id="247" class="l"><a class="l" href="#247">247: </a>
</span><span id="248" class="l"><a class="l" href="#248">248: </a> <span class="php-var">$autorite</span> = <span class="php-quote">''</span>;
</span><span id="249" class="l"><a class="l" href="#249">249: </a>
</span><span id="250" class="l"><a class="l" href="#250">250: </a> <span class="php-keyword1">if</span> (<span class="php-var">$this</span>-&gt;infoUtilisateur !== <span class="php-keyword1">false</span>) {
</span><span id="251" class="l"><a class="l" href="#251">251: </a> <span class="php-var">$autorite</span> .= <span class="php-var">$this</span>-&gt;infoUtilisateur . <span class="php-quote">'@'</span>;
</span><span id="252" class="l"><a class="l" href="#252">252: </a> }
</span><span id="253" class="l"><a class="l" href="#253">253: </a>
</span><span id="254" class="l"><a class="l" href="#254">254: </a> <span class="php-var">$autorite</span> .= <span class="php-var">$this</span>-&gt;hote;
</span><span id="255" class="l"><a class="l" href="#255">255: </a>
</span><span id="256" class="l"><a class="l" href="#256">256: </a> <span class="php-keyword1">if</span> (<span class="php-var">$this</span>-&gt;port !== <span class="php-keyword1">false</span>) {
</span><span id="257" class="l"><a class="l" href="#257">257: </a> <span class="php-var">$autorite</span> .= <span class="php-quote">':'</span> . <span class="php-var">$this</span>-&gt;port;
</span><span id="258" class="l"><a class="l" href="#258">258: </a> }
</span><span id="259" class="l"><a class="l" href="#259">259: </a>
</span><span id="260" class="l"><a class="l" href="#260">260: </a> <span class="php-keyword1">return</span> <span class="php-var">$autorite</span>;
</span><span id="261" class="l"><a class="l" href="#261">261: </a> }
</span><span id="262" class="l"><a class="l" href="#262">262: </a>
</span><span id="263" class="l"><a class="l" href="#263">263: </a> <span class="php-comment">/**
</span></span><span id="264" class="l"><a class="l" href="#264">264: </a><span class="php-comment"> * @param string|false $autorite
</span></span><span id="265" class="l"><a class="l" href="#265">265: </a><span class="php-comment"> *
</span></span><span id="266" class="l"><a class="l" href="#266">266: </a><span class="php-comment"> * @return void
</span></span><span id="267" class="l"><a class="l" href="#267">267: </a><span class="php-comment"> */</span>
</span><span id="268" class="l"><a class="l" href="#268">268: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="_setAutorite" href="#_setAutorite">setAutorite</a>(<span class="php-var">$autorite</span>) {
</span><span id="269" class="l"><a class="l" href="#269">269: </a> <span class="php-var">$this</span>-&gt;user = <span class="php-keyword1">false</span>;
</span><span id="270" class="l"><a class="l" href="#270">270: </a> <span class="php-var">$this</span>-&gt;pass = <span class="php-keyword1">false</span>;
</span><span id="271" class="l"><a class="l" href="#271">271: </a> <span class="php-var">$this</span>-&gt;hote = <span class="php-keyword1">false</span>;
</span><span id="272" class="l"><a class="l" href="#272">272: </a> <span class="php-var">$this</span>-&gt;port = <span class="php-keyword1">false</span>;
</span><span id="273" class="l"><a class="l" href="#273">273: </a> <span class="php-keyword1">if</span> (<span class="php-keyword2">preg_match</span>(<span class="php-quote">'@^(([^\@]+)\@)?([^:]+)(:(\d*))?$@'</span>, <span class="php-var">$autorite</span>, <span class="php-var">$reg</span>)) {
</span><span id="274" class="l"><a class="l" href="#274">274: </a> <span class="php-keyword1">if</span> (<span class="php-var">$reg</span>[<span class="php-num">1</span>]) {
</span><span id="275" class="l"><a class="l" href="#275">275: </a> <span class="php-var">$this</span>-&gt;infoUtilisateur = <span class="php-var">$reg</span>[<span class="php-num">2</span>];
</span><span id="276" class="l"><a class="l" href="#276">276: </a> }
</span><span id="277" class="l"><a class="l" href="#277">277: </a>
</span><span id="278" class="l"><a class="l" href="#278">278: </a> <span class="php-var">$this</span>-&gt;hote = <span class="php-var">$reg</span>[<span class="php-num">3</span>];
</span><span id="279" class="l"><a class="l" href="#279">279: </a> <span class="php-keyword1">if</span> (<span class="php-keyword1">isset</span>(<span class="php-var">$reg</span>[<span class="php-num">5</span>])) {
</span><span id="280" class="l"><a class="l" href="#280">280: </a> <span class="php-var">$this</span>-&gt;port = <span class="php-keyword2">intval</span>(<span class="php-var">$reg</span>[<span class="php-num">5</span>]);
</span><span id="281" class="l"><a class="l" href="#281">281: </a> }
</span><span id="282" class="l"><a class="l" href="#282">282: </a>
</span><span id="283" class="l"><a class="l" href="#283">283: </a> <span class="php-var">$this</span>-&gt;hote = <span class="php-var">$reg</span>[<span class="php-num">3</span>];
</span><span id="284" class="l"><a class="l" href="#284">284: </a> <span class="php-keyword1">if</span> (<span class="php-keyword1">isset</span>(<span class="php-var">$reg</span>[<span class="php-num">5</span>])) {
</span><span id="285" class="l"><a class="l" href="#285">285: </a> <span class="php-var">$this</span>-&gt;port = <span class="php-keyword2">intval</span>(<span class="php-var">$reg</span>[<span class="php-num">5</span>]);
</span><span id="286" class="l"><a class="l" href="#286">286: </a> }
</span><span id="287" class="l"><a class="l" href="#287">287: </a> }
</span><span id="288" class="l"><a class="l" href="#288">288: </a> }
</span><span id="289" class="l"><a class="l" href="#289">289: </a>
</span><span id="290" class="l"><a class="l" href="#290">290: </a> <span class="php-comment">/**
</span></span><span id="291" class="l"><a class="l" href="#291">291: </a><span class="php-comment"> * Renvoie la partie chemin (chemin) (éventuellement vide).
</span></span><span id="292" class="l"><a class="l" href="#292">292: </a><span class="php-comment"> *
</span></span><span id="293" class="l"><a class="l" href="#293">293: </a><span class="php-comment"> * @return string
</span></span><span id="294" class="l"><a class="l" href="#294">294: </a><span class="php-comment"> */</span>
</span><span id="295" class="l"><a class="l" href="#295">295: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="_getChemin" href="#_getChemin">getChemin</a>() {
</span><span id="296" class="l"><a class="l" href="#296">296: </a> <span class="php-keyword1">return</span> <span class="php-var">$this</span>-&gt;chemin;
</span><span id="297" class="l"><a class="l" href="#297">297: </a> }
</span><span id="298" class="l"><a class="l" href="#298">298: </a>
</span><span id="299" class="l"><a class="l" href="#299">299: </a> <span class="php-comment">/**
</span></span><span id="300" class="l"><a class="l" href="#300">300: </a><span class="php-comment"> * @param string $chemin
</span></span><span id="301" class="l"><a class="l" href="#301">301: </a><span class="php-comment"> *
</span></span><span id="302" class="l"><a class="l" href="#302">302: </a><span class="php-comment"> * @return void
</span></span><span id="303" class="l"><a class="l" href="#303">303: </a><span class="php-comment"> */</span>
</span><span id="304" class="l"><a class="l" href="#304">304: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="_setChemin" href="#_setChemin">setChemin</a>(<span class="php-var">$chemin</span>) {
</span><span id="305" class="l"><a class="l" href="#305">305: </a> <span class="php-var">$this</span>-&gt;chemin = <span class="php-var">$chemin</span>;
</span><span id="306" class="l"><a class="l" href="#306">306: </a> }
</span><span id="307" class="l"><a class="l" href="#307">307: </a>
</span><span id="308" class="l"><a class="l" href="#308">308: </a> <span class="php-comment">/**
</span></span><span id="309" class="l"><a class="l" href="#309">309: </a><span class="php-comment"> * renvoie la chaine de requête (requete string) (sans le premier &quot;?&quot;), ou false si &quot;?&quot;
</span></span><span id="310" class="l"><a class="l" href="#310">310: </a><span class="php-comment"> * n'est pas présent dans l'url.
</span></span><span id="311" class="l"><a class="l" href="#311">311: </a><span class="php-comment"> *
</span></span><span id="312" class="l"><a class="l" href="#312">312: </a><span class="php-comment"> * @return string|bool
</span></span><span id="313" class="l"><a class="l" href="#313">313: </a><span class="php-comment"> * @see self::getVariablesRequete()
</span></span><span id="314" class="l"><a class="l" href="#314">314: </a><span class="php-comment"> */</span>
</span><span id="315" class="l"><a class="l" href="#315">315: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="_getRequete" href="#_getRequete">getRequete</a>() {
</span><span id="316" class="l"><a class="l" href="#316">316: </a> <span class="php-keyword1">return</span> <span class="php-var">$this</span>-&gt;requete;
</span><span id="317" class="l"><a class="l" href="#317">317: </a> }
</span><span id="318" class="l"><a class="l" href="#318">318: </a>
</span><span id="319" class="l"><a class="l" href="#319">319: </a> <span class="php-comment">/**
</span></span><span id="320" class="l"><a class="l" href="#320">320: </a><span class="php-comment"> * @param string|bool $requete
</span></span><span id="321" class="l"><a class="l" href="#321">321: </a><span class="php-comment"> *
</span></span><span id="322" class="l"><a class="l" href="#322">322: </a><span class="php-comment"> * @return void
</span></span><span id="323" class="l"><a class="l" href="#323">323: </a><span class="php-comment"> * @see self::setVariablesRequete()
</span></span><span id="324" class="l"><a class="l" href="#324">324: </a><span class="php-comment"> */</span>
</span><span id="325" class="l"><a class="l" href="#325">325: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="_setRequete" href="#_setRequete">setRequete</a>(<span class="php-var">$requete</span>) {
</span><span id="326" class="l"><a class="l" href="#326">326: </a> <span class="php-var">$this</span>-&gt;requete = <span class="php-var">$requete</span>;
</span><span id="327" class="l"><a class="l" href="#327">327: </a> }
</span><span id="328" class="l"><a class="l" href="#328">328: </a>
</span><span id="329" class="l"><a class="l" href="#329">329: </a> <span class="php-comment">/**
</span></span><span id="330" class="l"><a class="l" href="#330">330: </a><span class="php-comment"> * Renvoie le nom du fragment, ou false si &quot;#&quot; n'est pas present dans l'URL.
</span></span><span id="331" class="l"><a class="l" href="#331">331: </a><span class="php-comment"> *
</span></span><span id="332" class="l"><a class="l" href="#332">332: </a><span class="php-comment"> * @return string|bool
</span></span><span id="333" class="l"><a class="l" href="#333">333: </a><span class="php-comment"> */</span>
</span><span id="334" class="l"><a class="l" href="#334">334: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="_getFragment" href="#_getFragment">getFragment</a>() {
</span><span id="335" class="l"><a class="l" href="#335">335: </a> <span class="php-keyword1">return</span> <span class="php-var">$this</span>-&gt;fragment;
</span><span id="336" class="l"><a class="l" href="#336">336: </a> }
</span><span id="337" class="l"><a class="l" href="#337">337: </a>
</span><span id="338" class="l"><a class="l" href="#338">338: </a> <span class="php-comment">/**
</span></span><span id="339" class="l"><a class="l" href="#339">339: </a><span class="php-comment"> * @param string|bool $fragment
</span></span><span id="340" class="l"><a class="l" href="#340">340: </a><span class="php-comment"> *
</span></span><span id="341" class="l"><a class="l" href="#341">341: </a><span class="php-comment"> * @return void
</span></span><span id="342" class="l"><a class="l" href="#342">342: </a><span class="php-comment"> */</span>
</span><span id="343" class="l"><a class="l" href="#343">343: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="_setFragment" href="#_setFragment">setFragment</a>(<span class="php-var">$fragment</span>) {
</span><span id="344" class="l"><a class="l" href="#344">344: </a> <span class="php-var">$this</span>-&gt;fragment = <span class="php-var">$fragment</span>;
</span><span id="345" class="l"><a class="l" href="#345">345: </a> }
</span><span id="346" class="l"><a class="l" href="#346">346: </a>
</span><span id="347" class="l"><a class="l" href="#347">347: </a> <span class="php-comment">/**
</span></span><span id="348" class="l"><a class="l" href="#348">348: </a><span class="php-comment"> * Renvoie la requete string sous forme d'un tableau de variables telles qu'elles apparaitraient
</span></span><span id="349" class="l"><a class="l" href="#349">349: </a><span class="php-comment"> * dans le $_GET d'un script PHP
</span></span><span id="350" class="l"><a class="l" href="#350">350: </a><span class="php-comment"> *
</span></span><span id="351" class="l"><a class="l" href="#351">351: </a><span class="php-comment"> * @return array
</span></span><span id="352" class="l"><a class="l" href="#352">352: </a><span class="php-comment"> */</span>
</span><span id="353" class="l"><a class="l" href="#353">353: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="_getVariablesRequete" href="#_getVariablesRequete">getVariablesRequete</a>() {
</span><span id="354" class="l"><a class="l" href="#354">354: </a> <span class="php-var">$pattern</span> = <span class="php-quote">'/'</span> .
</span><span id="355" class="l"><a class="l" href="#355">355: </a> <span class="php-keyword2">preg_quote</span>(<span class="php-var">$this</span>-&gt;getOption(self::OPTION_SEPARATEUR_ENTREE), <span class="php-quote">'/'</span>) .
</span><span id="356" class="l"><a class="l" href="#356">356: </a> <span class="php-quote">'/'</span>;
</span><span id="357" class="l"><a class="l" href="#357">357: </a> <span class="php-var">$parties</span> = <span class="php-keyword2">preg_split</span>(<span class="php-var">$pattern</span>, <span class="php-var">$this</span>-&gt;requete, -<span class="php-num">1</span>, PREG_SPLIT_NO_EMPTY);
</span><span id="358" class="l"><a class="l" href="#358">358: </a> <span class="php-var">$retour</span> = <span class="php-keyword1">array</span>();
</span><span id="359" class="l"><a class="l" href="#359">359: </a>
</span><span id="360" class="l"><a class="l" href="#360">360: </a> <span class="php-keyword1">foreach</span> (<span class="php-var">$parties</span> <span class="php-keyword1">as</span> <span class="php-var">$partie</span>) {
</span><span id="361" class="l"><a class="l" href="#361">361: </a> <span class="php-keyword1">if</span> (<span class="php-keyword2">strpos</span>(<span class="php-var">$partie</span>, <span class="php-quote">'='</span>) !== <span class="php-keyword1">false</span>) {
</span><span id="362" class="l"><a class="l" href="#362">362: </a> <span class="php-keyword1">list</span>(<span class="php-var">$cle</span>, <span class="php-var">$valeur</span>) = <span class="php-keyword2">explode</span>(<span class="php-quote">'='</span>, <span class="php-var">$partie</span>, <span class="php-num">2</span>);
</span><span id="363" class="l"><a class="l" href="#363">363: </a> } <span class="php-keyword1">else</span> {
</span><span id="364" class="l"><a class="l" href="#364">364: </a> <span class="php-var">$cle</span> = <span class="php-var">$partie</span>;
</span><span id="365" class="l"><a class="l" href="#365">365: </a> <span class="php-var">$valeur</span> = <span class="php-keyword1">null</span>;
</span><span id="366" class="l"><a class="l" href="#366">366: </a> }
</span><span id="282" class="l"><a class="l" href="#282">282: </a> }
</span><span id="283" class="l"><a class="l" href="#283">283: </a> }
</span><span id="284" class="l"><a class="l" href="#284">284: </a>
</span><span id="285" class="l"><a class="l" href="#285">285: </a> <span class="php-comment">/**
</span></span><span id="286" class="l"><a class="l" href="#286">286: </a><span class="php-comment"> * Renvoie la partie chemin (chemin) (éventuellement vide).
</span></span><span id="287" class="l"><a class="l" href="#287">287: </a><span class="php-comment"> *
</span></span><span id="288" class="l"><a class="l" href="#288">288: </a><span class="php-comment"> * @return string
</span></span><span id="289" class="l"><a class="l" href="#289">289: </a><span class="php-comment"> */</span>
</span><span id="290" class="l"><a class="l" href="#290">290: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="_getChemin" href="#_getChemin">getChemin</a>() {
</span><span id="291" class="l"><a class="l" href="#291">291: </a> <span class="php-keyword1">return</span> <span class="php-var">$this</span>-&gt;chemin;
</span><span id="292" class="l"><a class="l" href="#292">292: </a> }
</span><span id="293" class="l"><a class="l" href="#293">293: </a>
</span><span id="294" class="l"><a class="l" href="#294">294: </a> <span class="php-comment">/**
</span></span><span id="295" class="l"><a class="l" href="#295">295: </a><span class="php-comment"> * @param string $chemin
</span></span><span id="296" class="l"><a class="l" href="#296">296: </a><span class="php-comment"> *
</span></span><span id="297" class="l"><a class="l" href="#297">297: </a><span class="php-comment"> * @return void
</span></span><span id="298" class="l"><a class="l" href="#298">298: </a><span class="php-comment"> */</span>
</span><span id="299" class="l"><a class="l" href="#299">299: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="_setChemin" href="#_setChemin">setChemin</a>(<span class="php-var">$chemin</span>) {
</span><span id="300" class="l"><a class="l" href="#300">300: </a> <span class="php-var">$this</span>-&gt;chemin = <span class="php-var">$chemin</span>;
</span><span id="301" class="l"><a class="l" href="#301">301: </a> }
</span><span id="302" class="l"><a class="l" href="#302">302: </a>
</span><span id="303" class="l"><a class="l" href="#303">303: </a> <span class="php-comment">/**
</span></span><span id="304" class="l"><a class="l" href="#304">304: </a><span class="php-comment"> * renvoie la chaine de requête (requete string) (sans le premier &quot;?&quot;), ou false si &quot;?&quot;
</span></span><span id="305" class="l"><a class="l" href="#305">305: </a><span class="php-comment"> * n'est pas présent dans l'url.
</span></span><span id="306" class="l"><a class="l" href="#306">306: </a><span class="php-comment"> *
</span></span><span id="307" class="l"><a class="l" href="#307">307: </a><span class="php-comment"> * @return string|bool
</span></span><span id="308" class="l"><a class="l" href="#308">308: </a><span class="php-comment"> * @see self::getVariablesRequete()
</span></span><span id="309" class="l"><a class="l" href="#309">309: </a><span class="php-comment"> */</span>
</span><span id="310" class="l"><a class="l" href="#310">310: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="_getRequete" href="#_getRequete">getRequete</a>() {
</span><span id="311" class="l"><a class="l" href="#311">311: </a> <span class="php-keyword1">return</span> <span class="php-var">$this</span>-&gt;requete;
</span><span id="312" class="l"><a class="l" href="#312">312: </a> }
</span><span id="313" class="l"><a class="l" href="#313">313: </a>
</span><span id="314" class="l"><a class="l" href="#314">314: </a> <span class="php-comment">/**
</span></span><span id="315" class="l"><a class="l" href="#315">315: </a><span class="php-comment"> * @param string|bool $requete
</span></span><span id="316" class="l"><a class="l" href="#316">316: </a><span class="php-comment"> *
</span></span><span id="317" class="l"><a class="l" href="#317">317: </a><span class="php-comment"> * @return void
</span></span><span id="318" class="l"><a class="l" href="#318">318: </a><span class="php-comment"> * @see self::setVariablesRequete()
</span></span><span id="319" class="l"><a class="l" href="#319">319: </a><span class="php-comment"> */</span>
</span><span id="320" class="l"><a class="l" href="#320">320: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="_setRequete" href="#_setRequete">setRequete</a>(<span class="php-var">$requete</span>) {
</span><span id="321" class="l"><a class="l" href="#321">321: </a> <span class="php-var">$this</span>-&gt;requete = <span class="php-var">$requete</span>;
</span><span id="322" class="l"><a class="l" href="#322">322: </a> }
</span><span id="323" class="l"><a class="l" href="#323">323: </a>
</span><span id="324" class="l"><a class="l" href="#324">324: </a> <span class="php-comment">/**
</span></span><span id="325" class="l"><a class="l" href="#325">325: </a><span class="php-comment"> * Renvoie le nom du fragment, ou false si &quot;#&quot; n'est pas present dans l'URL.
</span></span><span id="326" class="l"><a class="l" href="#326">326: </a><span class="php-comment"> *
</span></span><span id="327" class="l"><a class="l" href="#327">327: </a><span class="php-comment"> * @return string|bool
</span></span><span id="328" class="l"><a class="l" href="#328">328: </a><span class="php-comment"> */</span>
</span><span id="329" class="l"><a class="l" href="#329">329: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="_getFragment" href="#_getFragment">getFragment</a>() {
</span><span id="330" class="l"><a class="l" href="#330">330: </a> <span class="php-keyword1">return</span> <span class="php-var">$this</span>-&gt;fragment;
</span><span id="331" class="l"><a class="l" href="#331">331: </a> }
</span><span id="332" class="l"><a class="l" href="#332">332: </a>
</span><span id="333" class="l"><a class="l" href="#333">333: </a> <span class="php-comment">/**
</span></span><span id="334" class="l"><a class="l" href="#334">334: </a><span class="php-comment"> * @param string|bool $fragment
</span></span><span id="335" class="l"><a class="l" href="#335">335: </a><span class="php-comment"> *
</span></span><span id="336" class="l"><a class="l" href="#336">336: </a><span class="php-comment"> * @return void
</span></span><span id="337" class="l"><a class="l" href="#337">337: </a><span class="php-comment"> */</span>
</span><span id="338" class="l"><a class="l" href="#338">338: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="_setFragment" href="#_setFragment">setFragment</a>(<span class="php-var">$fragment</span>) {
</span><span id="339" class="l"><a class="l" href="#339">339: </a> <span class="php-var">$this</span>-&gt;fragment = <span class="php-var">$fragment</span>;
</span><span id="340" class="l"><a class="l" href="#340">340: </a> }
</span><span id="341" class="l"><a class="l" href="#341">341: </a>
</span><span id="342" class="l"><a class="l" href="#342">342: </a> <span class="php-comment">/**
</span></span><span id="343" class="l"><a class="l" href="#343">343: </a><span class="php-comment"> * Renvoie la requete string sous forme d'un tableau de variables telles qu'elles apparaitraient
</span></span><span id="344" class="l"><a class="l" href="#344">344: </a><span class="php-comment"> * dans le $_GET d'un script PHP
</span></span><span id="345" class="l"><a class="l" href="#345">345: </a><span class="php-comment"> *
</span></span><span id="346" class="l"><a class="l" href="#346">346: </a><span class="php-comment"> * @return array
</span></span><span id="347" class="l"><a class="l" href="#347">347: </a><span class="php-comment"> */</span>
</span><span id="348" class="l"><a class="l" href="#348">348: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="_getVariablesRequete" href="#_getVariablesRequete">getVariablesRequete</a>() {
</span><span id="349" class="l"><a class="l" href="#349">349: </a> <span class="php-var">$pattern</span> = <span class="php-quote">'/'</span> .
</span><span id="350" class="l"><a class="l" href="#350">350: </a> <span class="php-keyword2">preg_quote</span>(<span class="php-var">$this</span>-&gt;getOption(self::OPTION_SEPARATEUR_ENTREE), <span class="php-quote">'/'</span>) .
</span><span id="351" class="l"><a class="l" href="#351">351: </a> <span class="php-quote">'/'</span>;
</span><span id="352" class="l"><a class="l" href="#352">352: </a> <span class="php-var">$parties</span> = <span class="php-keyword2">preg_split</span>(<span class="php-var">$pattern</span>, <span class="php-var">$this</span>-&gt;requete, -<span class="php-num">1</span>, PREG_SPLIT_NO_EMPTY);
</span><span id="353" class="l"><a class="l" href="#353">353: </a> <span class="php-var">$retour</span> = <span class="php-keyword1">array</span>();
</span><span id="354" class="l"><a class="l" href="#354">354: </a>
</span><span id="355" class="l"><a class="l" href="#355">355: </a> <span class="php-keyword1">foreach</span> (<span class="php-var">$parties</span> <span class="php-keyword1">as</span> <span class="php-var">$partie</span>) {
</span><span id="356" class="l"><a class="l" href="#356">356: </a> <span class="php-keyword1">if</span> (<span class="php-keyword2">strpos</span>(<span class="php-var">$partie</span>, <span class="php-quote">'='</span>) !== <span class="php-keyword1">false</span>) {
</span><span id="357" class="l"><a class="l" href="#357">357: </a> <span class="php-keyword1">list</span>(<span class="php-var">$cle</span>, <span class="php-var">$valeur</span>) = <span class="php-keyword2">explode</span>(<span class="php-quote">'='</span>, <span class="php-var">$partie</span>, <span class="php-num">2</span>);
</span><span id="358" class="l"><a class="l" href="#358">358: </a> } <span class="php-keyword1">else</span> {
</span><span id="359" class="l"><a class="l" href="#359">359: </a> <span class="php-var">$cle</span> = <span class="php-var">$partie</span>;
</span><span id="360" class="l"><a class="l" href="#360">360: </a> <span class="php-var">$valeur</span> = <span class="php-keyword1">null</span>;
</span><span id="361" class="l"><a class="l" href="#361">361: </a> }
</span><span id="362" class="l"><a class="l" href="#362">362: </a>
</span><span id="363" class="l"><a class="l" href="#363">363: </a> <span class="php-keyword1">if</span> (<span class="php-var">$this</span>-&gt;getOption(self::OPTION_ENCODER_CLES)) {
</span><span id="364" class="l"><a class="l" href="#364">364: </a> <span class="php-var">$cle</span> = <span class="php-keyword2">rawurldecode</span>(<span class="php-var">$cle</span>);
</span><span id="365" class="l"><a class="l" href="#365">365: </a> }
</span><span id="366" class="l"><a class="l" href="#366">366: </a> <span class="php-var">$valeur</span> = <span class="php-keyword2">rawurldecode</span>(<span class="php-var">$valeur</span>);
</span><span id="367" class="l"><a class="l" href="#367">367: </a>
</span><span id="368" class="l"><a class="l" href="#368">368: </a> <span class="php-keyword1">if</span> (<span class="php-var">$this</span>-&gt;getOption(self::OPTION_ENCODER_CLES)) {
</span><span id="369" class="l"><a class="l" href="#369">369: </a> <span class="php-var">$cle</span> = <span class="php-keyword2">rawurldecode</span>(<span class="php-var">$cle</span>);
</span><span id="370" class="l"><a class="l" href="#370">370: </a> }
</span><span id="371" class="l"><a class="l" href="#371">371: </a> <span class="php-var">$valeur</span> = <span class="php-keyword2">rawurldecode</span>(<span class="php-var">$valeur</span>);
</span><span id="372" class="l"><a class="l" href="#372">372: </a>
</span><span id="373" class="l"><a class="l" href="#373">373: </a> <span class="php-keyword1">if</span> (<span class="php-var">$this</span>-&gt;getOption(self::OPTION_UTILISER_CROCHETS) &amp;&amp;
</span><span id="374" class="l"><a class="l" href="#374">374: </a> <span class="php-keyword2">preg_match</span>(<span class="php-quote">'#^(.*)\[([0-9a-z_-]*)\]#i'</span>, <span class="php-var">$cle</span>, <span class="php-var">$matches</span>)) {
</span><span id="375" class="l"><a class="l" href="#375">375: </a>
</span><span id="376" class="l"><a class="l" href="#376">376: </a> <span class="php-var">$cle</span> = <span class="php-var">$matches</span>[<span class="php-num">1</span>];
</span><span id="377" class="l"><a class="l" href="#377">377: </a> <span class="php-var">$idx</span> = <span class="php-var">$matches</span>[<span class="php-num">2</span>];
</span><span id="368" class="l"><a class="l" href="#368">368: </a> <span class="php-keyword1">if</span> (<span class="php-var">$this</span>-&gt;getOption(self::OPTION_UTILISER_CROCHETS) &amp;&amp;
</span><span id="369" class="l"><a class="l" href="#369">369: </a> <span class="php-keyword2">preg_match</span>(<span class="php-quote">'#^(.*)\[([0-9a-z_-]*)\]#i'</span>, <span class="php-var">$cle</span>, <span class="php-var">$matches</span>)) {
</span><span id="370" class="l"><a class="l" href="#370">370: </a>
</span><span id="371" class="l"><a class="l" href="#371">371: </a> <span class="php-var">$cle</span> = <span class="php-var">$matches</span>[<span class="php-num">1</span>];
</span><span id="372" class="l"><a class="l" href="#372">372: </a> <span class="php-var">$idx</span> = <span class="php-var">$matches</span>[<span class="php-num">2</span>];
</span><span id="373" class="l"><a class="l" href="#373">373: </a>
</span><span id="374" class="l"><a class="l" href="#374">374: </a> <span class="php-comment">// On s'assure que c'est bien un tableau</span>
</span><span id="375" class="l"><a class="l" href="#375">375: </a> <span class="php-keyword1">if</span> (<span class="php-keyword1">empty</span>(<span class="php-var">$retour</span>[<span class="php-var">$cle</span>]) || !<span class="php-keyword2">is_array</span>(<span class="php-var">$retour</span>[<span class="php-var">$cle</span>])) {
</span><span id="376" class="l"><a class="l" href="#376">376: </a> <span class="php-var">$retour</span>[<span class="php-var">$cle</span>] = <span class="php-keyword1">array</span>();
</span><span id="377" class="l"><a class="l" href="#377">377: </a> }
</span><span id="378" class="l"><a class="l" href="#378">378: </a>
</span><span id="379" class="l"><a class="l" href="#379">379: </a> <span class="php-comment">// On s'assure que c'est bien un tableau</span>
</span><span id="380" class="l"><a class="l" href="#380">380: </a> <span class="php-keyword1">if</span> (<span class="php-keyword1">empty</span>(<span class="php-var">$retour</span>[<span class="php-var">$cle</span>]) || !<span class="php-keyword2">is_array</span>(<span class="php-var">$retour</span>[<span class="php-var">$cle</span>])) {
</span><span id="381" class="l"><a class="l" href="#381">381: </a> <span class="php-var">$retour</span>[<span class="php-var">$cle</span>] = <span class="php-keyword1">array</span>();
</span><span id="382" class="l"><a class="l" href="#382">382: </a> }
</span><span id="383" class="l"><a class="l" href="#383">383: </a>
</span><span id="384" class="l"><a class="l" href="#384">384: </a> <span class="php-comment">// Ajout des données</span>
</span><span id="385" class="l"><a class="l" href="#385">385: </a> <span class="php-keyword1">if</span> (<span class="php-var">$idx</span> === <span class="php-quote">''</span>) {
</span><span id="386" class="l"><a class="l" href="#386">386: </a> <span class="php-var">$retour</span>[<span class="php-var">$cle</span>][] = <span class="php-var">$valeur</span>;
</span><span id="387" class="l"><a class="l" href="#387">387: </a> } <span class="php-keyword1">else</span> {
</span><span id="388" class="l"><a class="l" href="#388">388: </a> <span class="php-var">$retour</span>[<span class="php-var">$cle</span>][<span class="php-var">$idx</span>] = <span class="php-var">$valeur</span>;
</span><span id="389" class="l"><a class="l" href="#389">389: </a> }
</span><span id="390" class="l"><a class="l" href="#390">390: </a> } <span class="php-keyword1">elseif</span> (!<span class="php-var">$this</span>-&gt;getOption(self::OPTION_UTILISER_CROCHETS)
</span><span id="391" class="l"><a class="l" href="#391">391: </a> &amp;&amp; !<span class="php-keyword1">empty</span>(<span class="php-var">$retour</span>[<span class="php-var">$cle</span>])
</span><span id="392" class="l"><a class="l" href="#392">392: </a> ) {
</span><span id="393" class="l"><a class="l" href="#393">393: </a> <span class="php-var">$retour</span>[<span class="php-var">$cle</span>] = (<span class="php-keyword1">array</span>) <span class="php-var">$retour</span>[<span class="php-var">$cle</span>];
</span><span id="394" class="l"><a class="l" href="#394">394: </a> <span class="php-var">$retour</span>[<span class="php-var">$cle</span>][] = <span class="php-var">$valeur</span>;
</span><span id="395" class="l"><a class="l" href="#395">395: </a> } <span class="php-keyword1">else</span> {
</span><span id="396" class="l"><a class="l" href="#396">396: </a> <span class="php-var">$retour</span>[<span class="php-var">$cle</span>] = <span class="php-var">$valeur</span>;
</span><span id="397" class="l"><a class="l" href="#397">397: </a> }
</span><span id="398" class="l"><a class="l" href="#398">398: </a> }
</span><span id="399" class="l"><a class="l" href="#399">399: </a>
</span><span id="400" class="l"><a class="l" href="#400">400: </a> <span class="php-keyword1">return</span> <span class="php-var">$retour</span>;
</span><span id="401" class="l"><a class="l" href="#401">401: </a> }
</span><span id="402" class="l"><a class="l" href="#402">402: </a>
</span><span id="403" class="l"><a class="l" href="#403">403: </a> <span class="php-comment">/**
</span></span><span id="404" class="l"><a class="l" href="#404">404: </a><span class="php-comment"> * @param array $tableau (nom =&gt; valeur) tableau
</span></span><span id="405" class="l"><a class="l" href="#405">405: </a><span class="php-comment"> *
</span></span><span id="406" class="l"><a class="l" href="#406">406: </a><span class="php-comment"> * @return void
</span></span><span id="407" class="l"><a class="l" href="#407">407: </a><span class="php-comment"> */</span>
</span><span id="408" class="l"><a class="l" href="#408">408: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="_setVariablesRequete" href="#_setVariablesRequete">setVariablesRequete</a>(<span class="php-keyword1">array</span> <span class="php-var">$tableau</span>) {
</span><span id="409" class="l"><a class="l" href="#409">409: </a> <span class="php-keyword1">if</span> (!<span class="php-var">$tableau</span>) {
</span><span id="410" class="l"><a class="l" href="#410">410: </a> <span class="php-var">$this</span>-&gt;requete = <span class="php-keyword1">false</span>;
</span><span id="411" class="l"><a class="l" href="#411">411: </a> } <span class="php-keyword1">else</span> {
</span><span id="412" class="l"><a class="l" href="#412">412: </a> <span class="php-keyword1">foreach</span> (<span class="php-var">$tableau</span> <span class="php-keyword1">as</span> <span class="php-var">$nom</span> =&gt; <span class="php-var">$valeur</span>) {
</span><span id="413" class="l"><a class="l" href="#413">413: </a> <span class="php-keyword1">if</span> (<span class="php-var">$this</span>-&gt;getOption(self::OPTION_ENCODER_CLES)) {
</span><span id="414" class="l"><a class="l" href="#414">414: </a> <span class="php-var">$nom</span> = <span class="php-keyword2">rawurlencode</span>(<span class="php-var">$nom</span>);
</span><span id="415" class="l"><a class="l" href="#415">415: </a> }
</span><span id="416" class="l"><a class="l" href="#416">416: </a>
</span><span id="417" class="l"><a class="l" href="#417">417: </a> <span class="php-keyword1">if</span> (<span class="php-keyword2">is_array</span>(<span class="php-var">$valeur</span>)) {
</span><span id="418" class="l"><a class="l" href="#418">418: </a> <span class="php-keyword1">foreach</span> (<span class="php-var">$valeur</span> <span class="php-keyword1">as</span> <span class="php-var">$k</span> =&gt; <span class="php-var">$v</span>) {
</span><span id="419" class="l"><a class="l" href="#419">419: </a> <span class="php-var">$parties</span>[] = <span class="php-var">$this</span>-&gt;getOption(self::OPTION_UTILISER_CROCHETS)
</span><span id="420" class="l"><a class="l" href="#420">420: </a> ? <span class="php-keyword2">sprintf</span>(<span class="php-quote">'%s[%s]=%s'</span>, <span class="php-var">$nom</span>, <span class="php-var">$k</span>, <span class="php-var">$v</span>)
</span><span id="421" class="l"><a class="l" href="#421">421: </a> : (<span class="php-var">$nom</span> . <span class="php-quote">'='</span> . <span class="php-var">$v</span>);
</span><span id="422" class="l"><a class="l" href="#422">422: </a> }
</span><span id="423" class="l"><a class="l" href="#423">423: </a> } <span class="php-keyword1">elseif</span> (!<span class="php-keyword2">is_null</span>(<span class="php-var">$valeur</span>)) {
</span><span id="424" class="l"><a class="l" href="#424">424: </a> <span class="php-var">$parties</span>[] = <span class="php-var">$nom</span> . <span class="php-quote">'='</span> . <span class="php-var">$valeur</span>;
</span><span id="425" class="l"><a class="l" href="#425">425: </a> } <span class="php-keyword1">else</span> {
</span><span id="426" class="l"><a class="l" href="#426">426: </a> <span class="php-var">$parties</span>[] = <span class="php-var">$nom</span>;
</span><span id="427" class="l"><a class="l" href="#427">427: </a> }
</span><span id="428" class="l"><a class="l" href="#428">428: </a> }
</span><span id="429" class="l"><a class="l" href="#429">429: </a> <span class="php-var">$this</span>-&gt;requete = <span class="php-keyword2">implode</span>(<span class="php-var">$this</span>-&gt;getOption(self::OPTION_SEPARATEUR_SORTIE),
</span><span id="430" class="l"><a class="l" href="#430">430: </a> <span class="php-var">$parties</span>);
</span><span id="431" class="l"><a class="l" href="#431">431: </a> }
</span><span id="432" class="l"><a class="l" href="#432">432: </a> }
</span><span id="433" class="l"><a class="l" href="#433">433: </a>
</span><span id="434" class="l"><a class="l" href="#434">434: </a> <span class="php-comment">/**
</span></span><span id="435" class="l"><a class="l" href="#435">435: </a><span class="php-comment"> * @param string $nom
</span></span><span id="436" class="l"><a class="l" href="#436">436: </a><span class="php-comment"> * @param mixed $valeur
</span></span><span id="437" class="l"><a class="l" href="#437">437: </a><span class="php-comment"> *
</span></span><span id="438" class="l"><a class="l" href="#438">438: </a><span class="php-comment"> * @return array
</span></span><span id="439" class="l"><a class="l" href="#439">439: </a><span class="php-comment"> */</span>
</span><span id="440" class="l"><a class="l" href="#440">440: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="_setVariableRequete" href="#_setVariableRequete">setVariableRequete</a>(<span class="php-var">$nom</span>, <span class="php-var">$valeur</span>) {
</span><span id="441" class="l"><a class="l" href="#441">441: </a> <span class="php-var">$tableau</span> = <span class="php-var">$this</span>-&gt;getVariablesRequete();
</span><span id="442" class="l"><a class="l" href="#442">442: </a> <span class="php-var">$tableau</span>[<span class="php-var">$nom</span>] = <span class="php-var">$valeur</span>;
</span><span id="443" class="l"><a class="l" href="#443">443: </a> <span class="php-var">$this</span>-&gt;setVariablesRequete(<span class="php-var">$tableau</span>);
</span><span id="444" class="l"><a class="l" href="#444">444: </a> }
</span><span id="445" class="l"><a class="l" href="#445">445: </a>
</span><span id="446" class="l"><a class="l" href="#446">446: </a> <span class="php-comment">/**
</span></span><span id="447" class="l"><a class="l" href="#447">447: </a><span class="php-comment"> * @param string $nom
</span></span><span id="448" class="l"><a class="l" href="#448">448: </a><span class="php-comment"> *
</span></span><span id="449" class="l"><a class="l" href="#449">449: </a><span class="php-comment"> * @return void
</span></span><span id="450" class="l"><a class="l" href="#450">450: </a><span class="php-comment"> */</span>
</span><span id="451" class="l"><a class="l" href="#451">451: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="_unsetVariableRequete" href="#_unsetVariableRequete">unsetVariableRequete</a>(<span class="php-var">$nom</span>) {
</span><span id="452" class="l"><a class="l" href="#452">452: </a> <span class="php-var">$tableau</span> = <span class="php-var">$this</span>-&gt;getVariablesRequete();
</span><span id="453" class="l"><a class="l" href="#453">453: </a> <span class="php-keyword1">unset</span>(<span class="php-var">$tableau</span>[<span class="php-var">$nom</span>]);
</span><span id="454" class="l"><a class="l" href="#454">454: </a> <span class="php-var">$this</span>-&gt;setVariablesRequete(<span class="php-var">$tableau</span>);
</span><span id="455" class="l"><a class="l" href="#455">455: </a> }
</span><span id="456" class="l"><a class="l" href="#456">456: </a>
</span><span id="457" class="l"><a class="l" href="#457">457: </a> <span class="php-comment">/**
</span></span><span id="458" class="l"><a class="l" href="#458">458: </a><span class="php-comment"> * @param array $noms tableau des noms de variable à supprimer de l'url.
</span></span><span id="459" class="l"><a class="l" href="#459">459: </a><span class="php-comment"> *
</span></span><span id="460" class="l"><a class="l" href="#460">460: </a><span class="php-comment"> * @return void
</span></span><span id="461" class="l"><a class="l" href="#461">461: </a><span class="php-comment"> */</span>
</span><span id="462" class="l"><a class="l" href="#462">462: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="_unsetVariablesRequete" href="#_unsetVariablesRequete">unsetVariablesRequete</a>(<span class="php-var">$noms</span>) {
</span><span id="463" class="l"><a class="l" href="#463">463: </a> <span class="php-var">$tableau</span> = <span class="php-var">$this</span>-&gt;getVariablesRequete();
</span><span id="464" class="l"><a class="l" href="#464">464: </a> <span class="php-keyword1">foreach</span> (<span class="php-var">$noms</span> <span class="php-keyword1">as</span> <span class="php-var">$nom</span>) {
</span><span id="465" class="l"><a class="l" href="#465">465: </a> <span class="php-keyword1">unset</span>(<span class="php-var">$tableau</span>[<span class="php-var">$nom</span>]);
</span><span id="466" class="l"><a class="l" href="#466">466: </a> }
</span><span id="467" class="l"><a class="l" href="#467">467: </a> <span class="php-var">$this</span>-&gt;setVariablesRequete(<span class="php-var">$tableau</span>);
</span><span id="468" class="l"><a class="l" href="#468">468: </a> }
</span><span id="469" class="l"><a class="l" href="#469">469: </a>
</span><span id="470" class="l"><a class="l" href="#470">470: </a> <span class="php-comment">/**
</span></span><span id="471" class="l"><a class="l" href="#471">471: </a><span class="php-comment"> * Renvoie un représentation sous forme de chaine de l'URL
</span></span><span id="472" class="l"><a class="l" href="#472">472: </a><span class="php-comment"> *
</span></span><span id="473" class="l"><a class="l" href="#473">473: </a><span class="php-comment"> * @return string
</span></span><span id="474" class="l"><a class="l" href="#474">474: </a><span class="php-comment"> */</span>
</span><span id="475" class="l"><a class="l" href="#475">475: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="_getURL" href="#_getURL">getURL</a>() {
</span><span id="476" class="l"><a class="l" href="#476">476: </a> <span class="php-comment">// Voir RFC 3986, section 5.3</span>
</span><span id="477" class="l"><a class="l" href="#477">477: </a> <span class="php-var">$url</span> = <span class="php-quote">&quot;&quot;</span>;
</span><span id="478" class="l"><a class="l" href="#478">478: </a>
</span><span id="479" class="l"><a class="l" href="#479">479: </a> <span class="php-keyword1">if</span> (<span class="php-var">$this</span>-&gt;schema !== <span class="php-keyword1">false</span>) {
</span><span id="480" class="l"><a class="l" href="#480">480: </a> <span class="php-var">$url</span> .= <span class="php-var">$this</span>-&gt;schema . <span class="php-quote">':'</span>;
</span><span id="379" class="l"><a class="l" href="#379">379: </a> <span class="php-comment">// Ajout des données</span>
</span><span id="380" class="l"><a class="l" href="#380">380: </a> <span class="php-keyword1">if</span> (<span class="php-var">$idx</span> === <span class="php-quote">''</span>) {
</span><span id="381" class="l"><a class="l" href="#381">381: </a> <span class="php-var">$retour</span>[<span class="php-var">$cle</span>][] = <span class="php-var">$valeur</span>;
</span><span id="382" class="l"><a class="l" href="#382">382: </a> } <span class="php-keyword1">else</span> {
</span><span id="383" class="l"><a class="l" href="#383">383: </a> <span class="php-var">$retour</span>[<span class="php-var">$cle</span>][<span class="php-var">$idx</span>] = <span class="php-var">$valeur</span>;
</span><span id="384" class="l"><a class="l" href="#384">384: </a> }
</span><span id="385" class="l"><a class="l" href="#385">385: </a> } <span class="php-keyword1">elseif</span> (!<span class="php-var">$this</span>-&gt;getOption(self::OPTION_UTILISER_CROCHETS)
</span><span id="386" class="l"><a class="l" href="#386">386: </a> &amp;&amp; !<span class="php-keyword1">empty</span>(<span class="php-var">$retour</span>[<span class="php-var">$cle</span>])
</span><span id="387" class="l"><a class="l" href="#387">387: </a> ) {
</span><span id="388" class="l"><a class="l" href="#388">388: </a> <span class="php-var">$retour</span>[<span class="php-var">$cle</span>] = (<span class="php-keyword1">array</span>) <span class="php-var">$retour</span>[<span class="php-var">$cle</span>];
</span><span id="389" class="l"><a class="l" href="#389">389: </a> <span class="php-var">$retour</span>[<span class="php-var">$cle</span>][] = <span class="php-var">$valeur</span>;
</span><span id="390" class="l"><a class="l" href="#390">390: </a> } <span class="php-keyword1">else</span> {
</span><span id="391" class="l"><a class="l" href="#391">391: </a> <span class="php-var">$retour</span>[<span class="php-var">$cle</span>] = <span class="php-var">$valeur</span>;
</span><span id="392" class="l"><a class="l" href="#392">392: </a> }
</span><span id="393" class="l"><a class="l" href="#393">393: </a> }
</span><span id="394" class="l"><a class="l" href="#394">394: </a>
</span><span id="395" class="l"><a class="l" href="#395">395: </a> <span class="php-keyword1">return</span> <span class="php-var">$retour</span>;
</span><span id="396" class="l"><a class="l" href="#396">396: </a> }
</span><span id="397" class="l"><a class="l" href="#397">397: </a>
</span><span id="398" class="l"><a class="l" href="#398">398: </a> <span class="php-comment">/**
</span></span><span id="399" class="l"><a class="l" href="#399">399: </a><span class="php-comment"> * @param array $tableau (nom =&gt; valeur) tableau
</span></span><span id="400" class="l"><a class="l" href="#400">400: </a><span class="php-comment"> *
</span></span><span id="401" class="l"><a class="l" href="#401">401: </a><span class="php-comment"> * @return void
</span></span><span id="402" class="l"><a class="l" href="#402">402: </a><span class="php-comment"> */</span>
</span><span id="403" class="l"><a class="l" href="#403">403: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="_setVariablesRequete" href="#_setVariablesRequete">setVariablesRequete</a>(<span class="php-keyword1">array</span> <span class="php-var">$tableau</span>) {
</span><span id="404" class="l"><a class="l" href="#404">404: </a> <span class="php-keyword1">if</span> (!<span class="php-var">$tableau</span>) {
</span><span id="405" class="l"><a class="l" href="#405">405: </a> <span class="php-var">$this</span>-&gt;requete = <span class="php-keyword1">false</span>;
</span><span id="406" class="l"><a class="l" href="#406">406: </a> } <span class="php-keyword1">else</span> {
</span><span id="407" class="l"><a class="l" href="#407">407: </a> <span class="php-keyword1">foreach</span> (<span class="php-var">$tableau</span> <span class="php-keyword1">as</span> <span class="php-var">$nom</span> =&gt; <span class="php-var">$valeur</span>) {
</span><span id="408" class="l"><a class="l" href="#408">408: </a> <span class="php-keyword1">if</span> (<span class="php-var">$this</span>-&gt;getOption(self::OPTION_ENCODER_CLES)) {
</span><span id="409" class="l"><a class="l" href="#409">409: </a> <span class="php-var">$nom</span> = <span class="php-keyword2">rawurlencode</span>(<span class="php-var">$nom</span>);
</span><span id="410" class="l"><a class="l" href="#410">410: </a> }
</span><span id="411" class="l"><a class="l" href="#411">411: </a>
</span><span id="412" class="l"><a class="l" href="#412">412: </a> <span class="php-keyword1">if</span> (<span class="php-keyword2">is_array</span>(<span class="php-var">$valeur</span>)) {
</span><span id="413" class="l"><a class="l" href="#413">413: </a> <span class="php-keyword1">foreach</span> (<span class="php-var">$valeur</span> <span class="php-keyword1">as</span> <span class="php-var">$k</span> =&gt; <span class="php-var">$v</span>) {
</span><span id="414" class="l"><a class="l" href="#414">414: </a> <span class="php-var">$parties</span>[] = <span class="php-var">$this</span>-&gt;getOption(self::OPTION_UTILISER_CROCHETS)
</span><span id="415" class="l"><a class="l" href="#415">415: </a> ? <span class="php-keyword2">sprintf</span>(<span class="php-quote">'%s[%s]=%s'</span>, <span class="php-var">$nom</span>, <span class="php-var">$k</span>, <span class="php-var">$v</span>)
</span><span id="416" class="l"><a class="l" href="#416">416: </a> : (<span class="php-var">$nom</span> . <span class="php-quote">'='</span> . <span class="php-var">$v</span>);
</span><span id="417" class="l"><a class="l" href="#417">417: </a> }
</span><span id="418" class="l"><a class="l" href="#418">418: </a> } <span class="php-keyword1">elseif</span> (!<span class="php-keyword2">is_null</span>(<span class="php-var">$valeur</span>)) {
</span><span id="419" class="l"><a class="l" href="#419">419: </a> <span class="php-var">$parties</span>[] = <span class="php-var">$nom</span> . <span class="php-quote">'='</span> . <span class="php-var">$valeur</span>;
</span><span id="420" class="l"><a class="l" href="#420">420: </a> } <span class="php-keyword1">else</span> {
</span><span id="421" class="l"><a class="l" href="#421">421: </a> <span class="php-var">$parties</span>[] = <span class="php-var">$nom</span>;
</span><span id="422" class="l"><a class="l" href="#422">422: </a> }
</span><span id="423" class="l"><a class="l" href="#423">423: </a> }
</span><span id="424" class="l"><a class="l" href="#424">424: </a> <span class="php-var">$this</span>-&gt;requete = <span class="php-keyword2">implode</span>(<span class="php-var">$this</span>-&gt;getOption(self::OPTION_SEPARATEUR_SORTIE),
</span><span id="425" class="l"><a class="l" href="#425">425: </a> <span class="php-var">$parties</span>);
</span><span id="426" class="l"><a class="l" href="#426">426: </a> }
</span><span id="427" class="l"><a class="l" href="#427">427: </a> }
</span><span id="428" class="l"><a class="l" href="#428">428: </a>
</span><span id="429" class="l"><a class="l" href="#429">429: </a> <span class="php-comment">/**
</span></span><span id="430" class="l"><a class="l" href="#430">430: </a><span class="php-comment"> * @param string $nom
</span></span><span id="431" class="l"><a class="l" href="#431">431: </a><span class="php-comment"> * @param mixed $valeur
</span></span><span id="432" class="l"><a class="l" href="#432">432: </a><span class="php-comment"> *
</span></span><span id="433" class="l"><a class="l" href="#433">433: </a><span class="php-comment"> * @return array
</span></span><span id="434" class="l"><a class="l" href="#434">434: </a><span class="php-comment"> */</span>
</span><span id="435" class="l"><a class="l" href="#435">435: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="_setVariableRequete" href="#_setVariableRequete">setVariableRequete</a>(<span class="php-var">$nom</span>, <span class="php-var">$valeur</span>) {
</span><span id="436" class="l"><a class="l" href="#436">436: </a> <span class="php-var">$tableau</span> = <span class="php-var">$this</span>-&gt;getVariablesRequete();
</span><span id="437" class="l"><a class="l" href="#437">437: </a> <span class="php-var">$tableau</span>[<span class="php-var">$nom</span>] = <span class="php-var">$valeur</span>;
</span><span id="438" class="l"><a class="l" href="#438">438: </a> <span class="php-var">$this</span>-&gt;setVariablesRequete(<span class="php-var">$tableau</span>);
</span><span id="439" class="l"><a class="l" href="#439">439: </a> }
</span><span id="440" class="l"><a class="l" href="#440">440: </a>
</span><span id="441" class="l"><a class="l" href="#441">441: </a> <span class="php-comment">/**
</span></span><span id="442" class="l"><a class="l" href="#442">442: </a><span class="php-comment"> * @param string $nom
</span></span><span id="443" class="l"><a class="l" href="#443">443: </a><span class="php-comment"> *
</span></span><span id="444" class="l"><a class="l" href="#444">444: </a><span class="php-comment"> * @return void
</span></span><span id="445" class="l"><a class="l" href="#445">445: </a><span class="php-comment"> */</span>
</span><span id="446" class="l"><a class="l" href="#446">446: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="_unsetVariableRequete" href="#_unsetVariableRequete">unsetVariableRequete</a>(<span class="php-var">$nom</span>) {
</span><span id="447" class="l"><a class="l" href="#447">447: </a> <span class="php-var">$tableau</span> = <span class="php-var">$this</span>-&gt;getVariablesRequete();
</span><span id="448" class="l"><a class="l" href="#448">448: </a> <span class="php-keyword1">unset</span>(<span class="php-var">$tableau</span>[<span class="php-var">$nom</span>]);
</span><span id="449" class="l"><a class="l" href="#449">449: </a> <span class="php-var">$this</span>-&gt;setVariablesRequete(<span class="php-var">$tableau</span>);
</span><span id="450" class="l"><a class="l" href="#450">450: </a> }
</span><span id="451" class="l"><a class="l" href="#451">451: </a>
</span><span id="452" class="l"><a class="l" href="#452">452: </a> <span class="php-comment">/**
</span></span><span id="453" class="l"><a class="l" href="#453">453: </a><span class="php-comment"> * @param array $noms tableau des noms de variable à supprimer de l'url.
</span></span><span id="454" class="l"><a class="l" href="#454">454: </a><span class="php-comment"> *
</span></span><span id="455" class="l"><a class="l" href="#455">455: </a><span class="php-comment"> * @return void
</span></span><span id="456" class="l"><a class="l" href="#456">456: </a><span class="php-comment"> */</span>
</span><span id="457" class="l"><a class="l" href="#457">457: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="_unsetVariablesRequete" href="#_unsetVariablesRequete">unsetVariablesRequete</a>(<span class="php-var">$noms</span>) {
</span><span id="458" class="l"><a class="l" href="#458">458: </a> <span class="php-var">$tableau</span> = <span class="php-var">$this</span>-&gt;getVariablesRequete();
</span><span id="459" class="l"><a class="l" href="#459">459: </a> <span class="php-keyword1">foreach</span> (<span class="php-var">$noms</span> <span class="php-keyword1">as</span> <span class="php-var">$nom</span>) {
</span><span id="460" class="l"><a class="l" href="#460">460: </a> <span class="php-keyword1">unset</span>(<span class="php-var">$tableau</span>[<span class="php-var">$nom</span>]);
</span><span id="461" class="l"><a class="l" href="#461">461: </a> }
</span><span id="462" class="l"><a class="l" href="#462">462: </a> <span class="php-var">$this</span>-&gt;setVariablesRequete(<span class="php-var">$tableau</span>);
</span><span id="463" class="l"><a class="l" href="#463">463: </a> }
</span><span id="464" class="l"><a class="l" href="#464">464: </a>
</span><span id="465" class="l"><a class="l" href="#465">465: </a> <span class="php-comment">/**
</span></span><span id="466" class="l"><a class="l" href="#466">466: </a><span class="php-comment"> * Renvoie un représentation sous forme de chaine de l'URL
</span></span><span id="467" class="l"><a class="l" href="#467">467: </a><span class="php-comment"> *
</span></span><span id="468" class="l"><a class="l" href="#468">468: </a><span class="php-comment"> * @return string
</span></span><span id="469" class="l"><a class="l" href="#469">469: </a><span class="php-comment"> */</span>
</span><span id="470" class="l"><a class="l" href="#470">470: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="_getURL" href="#_getURL">getURL</a>() {
</span><span id="471" class="l"><a class="l" href="#471">471: </a> <span class="php-comment">// Voir RFC 3986, section 5.3</span>
</span><span id="472" class="l"><a class="l" href="#472">472: </a> <span class="php-var">$url</span> = <span class="php-quote">&quot;&quot;</span>;
</span><span id="473" class="l"><a class="l" href="#473">473: </a>
</span><span id="474" class="l"><a class="l" href="#474">474: </a> <span class="php-keyword1">if</span> (<span class="php-var">$this</span>-&gt;schema !== <span class="php-keyword1">false</span>) {
</span><span id="475" class="l"><a class="l" href="#475">475: </a> <span class="php-var">$url</span> .= <span class="php-var">$this</span>-&gt;schema . <span class="php-quote">':'</span>;
</span><span id="476" class="l"><a class="l" href="#476">476: </a> }
</span><span id="477" class="l"><a class="l" href="#477">477: </a>
</span><span id="478" class="l"><a class="l" href="#478">478: </a> <span class="php-var">$autorite</span> = <span class="php-var">$this</span>-&gt;getAutorite();
</span><span id="479" class="l"><a class="l" href="#479">479: </a> <span class="php-keyword1">if</span> (<span class="php-var">$autorite</span> !== <span class="php-keyword1">false</span>) {
</span><span id="480" class="l"><a class="l" href="#480">480: </a> <span class="php-var">$url</span> .= <span class="php-quote">'//'</span> . <span class="php-var">$autorite</span>;
</span><span id="481" class="l"><a class="l" href="#481">481: </a> }
</span><span id="482" class="l"><a class="l" href="#482">482: </a>
</span><span id="483" class="l"><a class="l" href="#483">483: </a> <span class="php-var">$autorite</span> = <span class="php-var">$this</span>-&gt;getAutorite();
</span><span id="484" class="l"><a class="l" href="#484">484: </a> <span class="php-keyword1">if</span> (<span class="php-var">$autorite</span> !== <span class="php-keyword1">false</span>) {
</span><span id="485" class="l"><a class="l" href="#485">485: </a> <span class="php-var">$url</span> .= <span class="php-quote">'//'</span> . <span class="php-var">$autorite</span>;
</span><span id="482" class="l"><a class="l" href="#482">482: </a> <span class="php-var">$url</span> .= <span class="php-var">$this</span>-&gt;chemin;
</span><span id="483" class="l"><a class="l" href="#483">483: </a>
</span><span id="484" class="l"><a class="l" href="#484">484: </a> <span class="php-keyword1">if</span> (<span class="php-var">$this</span>-&gt;requete !== <span class="php-keyword1">false</span>) {
</span><span id="485" class="l"><a class="l" href="#485">485: </a> <span class="php-var">$url</span> .= <span class="php-quote">'?'</span> . <span class="php-var">$this</span>-&gt;requete;
</span><span id="486" class="l"><a class="l" href="#486">486: </a> }
</span><span id="487" class="l"><a class="l" href="#487">487: </a> <span class="php-var">$url</span> .= <span class="php-var">$this</span>-&gt;chemin;
</span><span id="488" class="l"><a class="l" href="#488">488: </a>
</span><span id="489" class="l"><a class="l" href="#489">489: </a> <span class="php-keyword1">if</span> (<span class="php-var">$this</span>-&gt;requete !== <span class="php-keyword1">false</span>) {
</span><span id="490" class="l"><a class="l" href="#490">490: </a> <span class="php-var">$url</span> .= <span class="php-quote">'?'</span> . <span class="php-var">$this</span>-&gt;requete;
</span><span id="491" class="l"><a class="l" href="#491">491: </a> }
</span><span id="492" class="l"><a class="l" href="#492">492: </a>
</span><span id="493" class="l"><a class="l" href="#493">493: </a> <span class="php-keyword1">if</span> (<span class="php-var">$this</span>-&gt;fragment !== <span class="php-keyword1">false</span>) {
</span><span id="494" class="l"><a class="l" href="#494">494: </a> <span class="php-var">$url</span> .= <span class="php-quote">'#'</span> . <span class="php-var">$this</span>-&gt;fragment;
</span><span id="495" class="l"><a class="l" href="#495">495: </a> }
</span><span id="496" class="l"><a class="l" href="#496">496: </a>
</span><span id="497" class="l"><a class="l" href="#497">497: </a> <span class="php-keyword1">return</span> <span class="php-var">$url</span>;
</span><span id="498" class="l"><a class="l" href="#498">498: </a> }
</span><span id="499" class="l"><a class="l" href="#499">499: </a>
</span><span id="500" class="l"><a class="l" href="#500">500: </a> <span class="php-comment">/**
</span></span><span id="501" class="l"><a class="l" href="#501">501: </a><span class="php-comment"> * Renvoie une représentation de cette URL sous forme de chaine normalisée. Utile pour la
</span></span><span id="502" class="l"><a class="l" href="#502">502: </a><span class="php-comment"> * comparaison d'URLs
</span></span><span id="503" class="l"><a class="l" href="#503">503: </a><span class="php-comment"> *
</span></span><span id="504" class="l"><a class="l" href="#504">504: </a><span class="php-comment"> * @return string
</span></span><span id="505" class="l"><a class="l" href="#505">505: </a><span class="php-comment"> */</span>
</span><span id="506" class="l"><a class="l" href="#506">506: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="_getURLNormalisee" href="#_getURLNormalisee">getURLNormalisee</a>() {
</span><span id="507" class="l"><a class="l" href="#507">507: </a> <span class="php-var">$url</span> = <span class="php-keyword1">clone</span> <span class="php-var">$this</span>;
</span><span id="508" class="l"><a class="l" href="#508">508: </a> <span class="php-var">$url</span>-&gt;normaliser();
</span><span id="509" class="l"><a class="l" href="#509">509: </a> <span class="php-keyword1">return</span> <span class="php-var">$url</span>-&gt;getUrl();
</span><span id="510" class="l"><a class="l" href="#510">510: </a> }
</span><span id="511" class="l"><a class="l" href="#511">511: </a>
</span><span id="512" class="l"><a class="l" href="#512">512: </a> <span class="php-comment">/**
</span></span><span id="513" class="l"><a class="l" href="#513">513: </a><span class="php-comment"> * Renvoie une instance normalisée de Url
</span></span><span id="514" class="l"><a class="l" href="#514">514: </a><span class="php-comment"> *
</span></span><span id="515" class="l"><a class="l" href="#515">515: </a><span class="php-comment"> * @return Url
</span></span><span id="516" class="l"><a class="l" href="#516">516: </a><span class="php-comment"> */</span>
</span><span id="517" class="l"><a class="l" href="#517">517: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="_normaliser" href="#_normaliser">normaliser</a>() {
</span><span id="518" class="l"><a class="l" href="#518">518: </a> <span class="php-comment">// See RFC 3886, section 6</span>
</span><span id="487" class="l"><a class="l" href="#487">487: </a>
</span><span id="488" class="l"><a class="l" href="#488">488: </a> <span class="php-keyword1">if</span> (<span class="php-var">$this</span>-&gt;fragment !== <span class="php-keyword1">false</span>) {
</span><span id="489" class="l"><a class="l" href="#489">489: </a> <span class="php-var">$url</span> .= <span class="php-quote">'#'</span> . <span class="php-var">$this</span>-&gt;fragment;
</span><span id="490" class="l"><a class="l" href="#490">490: </a> }
</span><span id="491" class="l"><a class="l" href="#491">491: </a>
</span><span id="492" class="l"><a class="l" href="#492">492: </a> <span class="php-keyword1">return</span> <span class="php-var">$url</span>;
</span><span id="493" class="l"><a class="l" href="#493">493: </a> }
</span><span id="494" class="l"><a class="l" href="#494">494: </a>
</span><span id="495" class="l"><a class="l" href="#495">495: </a> <span class="php-comment">/**
</span></span><span id="496" class="l"><a class="l" href="#496">496: </a><span class="php-comment"> * Renvoie une représentation de cette URL sous forme de chaine normalisée. Utile pour la
</span></span><span id="497" class="l"><a class="l" href="#497">497: </a><span class="php-comment"> * comparaison d'URLs
</span></span><span id="498" class="l"><a class="l" href="#498">498: </a><span class="php-comment"> *
</span></span><span id="499" class="l"><a class="l" href="#499">499: </a><span class="php-comment"> * @return string
</span></span><span id="500" class="l"><a class="l" href="#500">500: </a><span class="php-comment"> */</span>
</span><span id="501" class="l"><a class="l" href="#501">501: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="_getURLNormalisee" href="#_getURLNormalisee">getURLNormalisee</a>() {
</span><span id="502" class="l"><a class="l" href="#502">502: </a> <span class="php-var">$url</span> = <span class="php-keyword1">clone</span> <span class="php-var">$this</span>;
</span><span id="503" class="l"><a class="l" href="#503">503: </a> <span class="php-var">$url</span>-&gt;normaliser();
</span><span id="504" class="l"><a class="l" href="#504">504: </a> <span class="php-keyword1">return</span> <span class="php-var">$url</span>-&gt;getUrl();
</span><span id="505" class="l"><a class="l" href="#505">505: </a> }
</span><span id="506" class="l"><a class="l" href="#506">506: </a>
</span><span id="507" class="l"><a class="l" href="#507">507: </a> <span class="php-comment">/**
</span></span><span id="508" class="l"><a class="l" href="#508">508: </a><span class="php-comment"> * Renvoie une instance normalisée de Url
</span></span><span id="509" class="l"><a class="l" href="#509">509: </a><span class="php-comment"> *
</span></span><span id="510" class="l"><a class="l" href="#510">510: </a><span class="php-comment"> * @return Url
</span></span><span id="511" class="l"><a class="l" href="#511">511: </a><span class="php-comment"> */</span>
</span><span id="512" class="l"><a class="l" href="#512">512: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="_normaliser" href="#_normaliser">normaliser</a>() {
</span><span id="513" class="l"><a class="l" href="#513">513: </a> <span class="php-comment">// See RFC 3886, section 6</span>
</span><span id="514" class="l"><a class="l" href="#514">514: </a>
</span><span id="515" class="l"><a class="l" href="#515">515: </a> <span class="php-comment">// les cchémas sont insesibles à la casse</span>
</span><span id="516" class="l"><a class="l" href="#516">516: </a> <span class="php-keyword1">if</span> (<span class="php-var">$this</span>-&gt;schema) {
</span><span id="517" class="l"><a class="l" href="#517">517: </a> <span class="php-var">$this</span>-&gt;schema = <span class="php-keyword2">strtolower</span>(<span class="php-var">$this</span>-&gt;schema);
</span><span id="518" class="l"><a class="l" href="#518">518: </a> }
</span><span id="519" class="l"><a class="l" href="#519">519: </a>
</span><span id="520" class="l"><a class="l" href="#520">520: </a> <span class="php-comment">// les cchémas sont insesibles à la casse</span>
</span><span id="521" class="l"><a class="l" href="#521">521: </a> <span class="php-keyword1">if</span> (<span class="php-var">$this</span>-&gt;schema) {
</span><span id="522" class="l"><a class="l" href="#522">522: </a> <span class="php-var">$this</span>-&gt;schema = <span class="php-keyword2">strtolower</span>(<span class="php-var">$this</span>-&gt;schema);
</span><span id="520" class="l"><a class="l" href="#520">520: </a> <span class="php-comment">// les noms d'hotes sont insensibles à la casse</span>
</span><span id="521" class="l"><a class="l" href="#521">521: </a> <span class="php-keyword1">if</span> (<span class="php-var">$this</span>-&gt;hote) {
</span><span id="522" class="l"><a class="l" href="#522">522: </a> <span class="php-var">$this</span>-&gt;hote = <span class="php-keyword2">strtolower</span>(<span class="php-var">$this</span>-&gt;hote);
</span><span id="523" class="l"><a class="l" href="#523">523: </a> }
</span><span id="524" class="l"><a class="l" href="#524">524: </a>
</span><span id="525" class="l"><a class="l" href="#525">525: </a> <span class="php-comment">// les noms d'hotes sont insensibles à la casse</span>
</span><span id="526" class="l"><a class="l" href="#526">526: </a> <span class="php-keyword1">if</span> (<span class="php-var">$this</span>-&gt;hote) {
</span><span id="527" class="l"><a class="l" href="#527">527: </a> <span class="php-var">$this</span>-&gt;hote = <span class="php-keyword2">strtolower</span>(<span class="php-var">$this</span>-&gt;hote);
</span><span id="528" class="l"><a class="l" href="#528">528: </a> }
</span><span id="525" class="l"><a class="l" href="#525">525: </a> <span class="php-comment">// Supprimer le numéro de port par défaut pour les schemas connus (RFC 3986, section 6.2.3)</span>
</span><span id="526" class="l"><a class="l" href="#526">526: </a> <span class="php-keyword1">if</span> (<span class="php-var">$this</span>-&gt;port &amp;&amp;
</span><span id="527" class="l"><a class="l" href="#527">527: </a> <span class="php-var">$this</span>-&gt;schema &amp;&amp;
</span><span id="528" class="l"><a class="l" href="#528">528: </a> <span class="php-var">$this</span>-&gt;port == <span class="php-keyword2">getservbyname</span>(<span class="php-var">$this</span>-&gt;schema, <span class="php-quote">'tcp'</span>)) {
</span><span id="529" class="l"><a class="l" href="#529">529: </a>
</span><span id="530" class="l"><a class="l" href="#530">530: </a> <span class="php-comment">// Supprimer le numéro de port par défaut pour les schemas connus (RFC 3986, section 6.2.3)</span>
</span><span id="531" class="l"><a class="l" href="#531">531: </a> <span class="php-keyword1">if</span> (<span class="php-var">$this</span>-&gt;port &amp;&amp;
</span><span id="532" class="l"><a class="l" href="#532">532: </a> <span class="php-var">$this</span>-&gt;schema &amp;&amp;
</span><span id="533" class="l"><a class="l" href="#533">533: </a> <span class="php-var">$this</span>-&gt;port == <span class="php-keyword2">getservbyname</span>(<span class="php-var">$this</span>-&gt;schema, <span class="php-quote">'tcp'</span>)) {
</span><span id="534" class="l"><a class="l" href="#534">534: </a>
</span><span id="535" class="l"><a class="l" href="#535">535: </a> <span class="php-var">$this</span>-&gt;port = <span class="php-keyword1">false</span>;
</span><span id="536" class="l"><a class="l" href="#536">536: </a> }
</span><span id="537" class="l"><a class="l" href="#537">537: </a>
</span><span id="538" class="l"><a class="l" href="#538">538: </a> <span class="php-comment">// normalisation dans le cas d'un encodage avec %XX pourcentage (RFC 3986, section 6.2.2.1)</span>
</span><span id="539" class="l"><a class="l" href="#539">539: </a> <span class="php-keyword1">foreach</span> (<span class="php-keyword1">array</span>(<span class="php-quote">'infoUtilisateur'</span>, <span class="php-quote">'hote'</span>, <span class="php-quote">'chemin'</span>) <span class="php-keyword1">as</span> <span class="php-var">$partie</span>) {
</span><span id="540" class="l"><a class="l" href="#540">540: </a> <span class="php-keyword1">if</span> (<span class="php-var">$this</span>-&gt;<span class="php-var">$partie</span>) {
</span><span id="541" class="l"><a class="l" href="#541">541: </a> <span class="php-var">$this</span>-&gt;<span class="php-var">$partie</span> = <span class="php-keyword2">preg_replace</span>(<span class="php-quote">'/%[0-9a-f]{2}/ie'</span>, <span class="php-quote">'strtoupper(&quot;\0&quot;)'</span>, <span class="php-var">$this</span>-&gt;<span class="php-var">$partie</span>);
</span><span id="542" class="l"><a class="l" href="#542">542: </a> }
</span><span id="543" class="l"><a class="l" href="#543">543: </a> }
</span><span id="544" class="l"><a class="l" href="#544">544: </a>
</span><span id="545" class="l"><a class="l" href="#545">545: </a> <span class="php-comment">// normalisation des segments du chemin (RFC 3986, section 6.2.2.3)</span>
</span><span id="546" class="l"><a class="l" href="#546">546: </a> <span class="php-var">$this</span>-&gt;chemin = self::supprimerSegmentsAPoints(<span class="php-var">$this</span>-&gt;chemin);
</span><span id="547" class="l"><a class="l" href="#547">547: </a>
</span><span id="548" class="l"><a class="l" href="#548">548: </a> <span class="php-comment">// normalisation basée sur le schéma (RFC 3986, section 6.2.3)</span>
</span><span id="549" class="l"><a class="l" href="#549">549: </a> <span class="php-keyword1">if</span> (<span class="php-var">$this</span>-&gt;hote &amp;&amp; !<span class="php-var">$this</span>-&gt;chemin) {
</span><span id="550" class="l"><a class="l" href="#550">550: </a> <span class="php-var">$this</span>-&gt;chemin = <span class="php-quote">'/'</span>;
</span><span id="551" class="l"><a class="l" href="#551">551: </a> }
</span><span id="552" class="l"><a class="l" href="#552">552: </a> }
</span><span id="553" class="l"><a class="l" href="#553">553: </a>
</span><span id="554" class="l"><a class="l" href="#554">554: </a> <span class="php-comment">/**
</span></span><span id="555" class="l"><a class="l" href="#555">555: </a><span class="php-comment"> * Renvoie vrai ou faux suivant que l'instance en cours représente une URL relative ou absolue.
</span></span><span id="556" class="l"><a class="l" href="#556">556: </a><span class="php-comment"> *
</span></span><span id="557" class="l"><a class="l" href="#557">557: </a><span class="php-comment"> * @return bool
</span></span><span id="558" class="l"><a class="l" href="#558">558: </a><span class="php-comment"> */</span>
</span><span id="559" class="l"><a class="l" href="#559">559: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="_etreAbsolue" href="#_etreAbsolue">etreAbsolue</a>() {
</span><span id="560" class="l"><a class="l" href="#560">560: </a> <span class="php-keyword1">return</span> (bool) <span class="php-var">$this</span>-&gt;schema;
</span><span id="561" class="l"><a class="l" href="#561">561: </a> }
</span><span id="562" class="l"><a class="l" href="#562">562: </a>
</span><span id="563" class="l"><a class="l" href="#563">563: </a> <span class="php-comment">/**
</span></span><span id="564" class="l"><a class="l" href="#564">564: </a><span class="php-comment"> * Renvoie une instance de Url représentant une URL absolue relative à
</span></span><span id="565" class="l"><a class="l" href="#565">565: </a><span class="php-comment"> * cette URL.
</span></span><span id="566" class="l"><a class="l" href="#566">566: </a><span class="php-comment"> *
</span></span><span id="567" class="l"><a class="l" href="#567">567: </a><span class="php-comment"> * @param Url|string $reference URL relative
</span></span><span id="568" class="l"><a class="l" href="#568">568: </a><span class="php-comment"> *
</span></span><span id="569" class="l"><a class="l" href="#569">569: </a><span class="php-comment"> * @return Url
</span></span><span id="570" class="l"><a class="l" href="#570">570: </a><span class="php-comment"> */</span>
</span><span id="571" class="l"><a class="l" href="#571">571: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="_resoudre" href="#_resoudre">resoudre</a>(<span class="php-var">$reference</span>) {
</span><span id="572" class="l"><a class="l" href="#572">572: </a> <span class="php-keyword1">if</span> (<span class="php-keyword2">is_string</span>(<span class="php-var">$reference</span>)) {
</span><span id="573" class="l"><a class="l" href="#573">573: </a> <span class="php-var">$reference</span> = <span class="php-keyword1">new</span> self(<span class="php-var">$reference</span>);
</span><span id="574" class="l"><a class="l" href="#574">574: </a> }
</span><span id="575" class="l"><a class="l" href="#575">575: </a> <span class="php-keyword1">if</span> (!<span class="php-var">$this</span>-&gt;etreAbsolue()) {
</span><span id="576" class="l"><a class="l" href="#576">576: </a> <span class="php-keyword1">throw</span> <span class="php-keyword1">new</span> Exception(<span class="php-quote">'L\'URL de base doit être absolue !'</span>);
</span><span id="577" class="l"><a class="l" href="#577">577: </a> }
</span><span id="578" class="l"><a class="l" href="#578">578: </a>
</span><span id="579" class="l"><a class="l" href="#579">579: </a> <span class="php-comment">// Un parseur non strict peut choisir d'ignorer un schema dans la référence</span>
</span><span id="580" class="l"><a class="l" href="#580">580: </a> <span class="php-comment">// si celui ci est identique au schéma de base de l'URI.</span>
</span><span id="581" class="l"><a class="l" href="#581">581: </a> <span class="php-keyword1">if</span> (!<span class="php-var">$this</span>-&gt;getOption(self::OPTION_STRICTE) &amp;&amp; <span class="php-var">$reference</span>-&gt;schema == <span class="php-var">$this</span>-&gt;schema) {
</span><span id="582" class="l"><a class="l" href="#582">582: </a> <span class="php-var">$reference</span>-&gt;schema = <span class="php-keyword1">false</span>;
</span><span id="583" class="l"><a class="l" href="#583">583: </a> }
</span><span id="584" class="l"><a class="l" href="#584">584: </a>
</span><span id="585" class="l"><a class="l" href="#585">585: </a> <span class="php-var">$cible</span> = <span class="php-keyword1">new</span> self(<span class="php-quote">''</span>);
</span><span id="586" class="l"><a class="l" href="#586">586: </a> <span class="php-keyword1">if</span> (<span class="php-var">$reference</span>-&gt;schema !== <span class="php-keyword1">false</span>) {
</span><span id="587" class="l"><a class="l" href="#587">587: </a> <span class="php-var">$cible</span>-&gt;schema = <span class="php-var">$reference</span>-&gt;schema;
</span><span id="588" class="l"><a class="l" href="#588">588: </a> <span class="php-var">$cible</span>-&gt;setAutorite(<span class="php-var">$reference</span>-&gt;getAutorite());
</span><span id="589" class="l"><a class="l" href="#589">589: </a> <span class="php-var">$cible</span>-&gt;chemin = self::supprimerSegmentsAPoints(<span class="php-var">$reference</span>-&gt;chemin);
</span><span id="590" class="l"><a class="l" href="#590">590: </a> <span class="php-var">$cible</span>-&gt;requete = <span class="php-var">$reference</span>-&gt;requete;
</span><span id="591" class="l"><a class="l" href="#591">591: </a> } <span class="php-keyword1">else</span> {
</span><span id="592" class="l"><a class="l" href="#592">592: </a> <span class="php-var">$autorite</span> = <span class="php-var">$reference</span>-&gt;getAutorite();
</span><span id="593" class="l"><a class="l" href="#593">593: </a> <span class="php-keyword1">if</span> (<span class="php-var">$autorite</span> !== <span class="php-keyword1">false</span>) {
</span><span id="594" class="l"><a class="l" href="#594">594: </a> <span class="php-var">$cible</span>-&gt;setAutorite(<span class="php-var">$autorite</span>);
</span><span id="595" class="l"><a class="l" href="#595">595: </a> <span class="php-var">$cible</span>-&gt;chemin = self::supprimerSegmentsAPoints(<span class="php-var">$reference</span>-&gt;chemin);
</span><span id="596" class="l"><a class="l" href="#596">596: </a> <span class="php-var">$cible</span>-&gt;requete = <span class="php-var">$reference</span>-&gt;requete;
</span><span id="597" class="l"><a class="l" href="#597">597: </a> } <span class="php-keyword1">else</span> {
</span><span id="598" class="l"><a class="l" href="#598">598: </a> <span class="php-keyword1">if</span> (<span class="php-var">$reference</span>-&gt;chemin == <span class="php-quote">''</span>) {
</span><span id="599" class="l"><a class="l" href="#599">599: </a> <span class="php-var">$cible</span>-&gt;chemin = <span class="php-var">$this</span>-&gt;chemin;
</span><span id="600" class="l"><a class="l" href="#600">600: </a> <span class="php-keyword1">if</span> (<span class="php-var">$reference</span>-&gt;requete !== <span class="php-keyword1">false</span>) {
</span><span id="601" class="l"><a class="l" href="#601">601: </a> <span class="php-var">$cible</span>-&gt;requete = <span class="php-var">$reference</span>-&gt;requete;
</span><span id="602" class="l"><a class="l" href="#602">602: </a> } <span class="php-keyword1">else</span> {
</span><span id="603" class="l"><a class="l" href="#603">603: </a> <span class="php-var">$cible</span>-&gt;requete = <span class="php-var">$this</span>-&gt;requete;
</span><span id="604" class="l"><a class="l" href="#604">604: </a> }
</span><span id="605" class="l"><a class="l" href="#605">605: </a> } <span class="php-keyword1">else</span> {
</span><span id="606" class="l"><a class="l" href="#606">606: </a> <span class="php-keyword1">if</span> (<span class="php-keyword2">substr</span>(<span class="php-var">$reference</span>-&gt;chemin, <span class="php-num">0</span>, <span class="php-num">1</span>) == <span class="php-quote">'/'</span>) {
</span><span id="607" class="l"><a class="l" href="#607">607: </a> <span class="php-var">$cible</span>-&gt;chemin = self::supprimerSegmentsAPoints(<span class="php-var">$reference</span>-&gt;chemin);
</span><span id="608" class="l"><a class="l" href="#608">608: </a> } <span class="php-keyword1">else</span> {
</span><span id="609" class="l"><a class="l" href="#609">609: </a> <span class="php-comment">// Concaténation chemins (RFC 3986, section 5.2.3)</span>
</span><span id="610" class="l"><a class="l" href="#610">610: </a> <span class="php-keyword1">if</span> (<span class="php-var">$this</span>-&gt;hote !== <span class="php-keyword1">false</span> &amp;&amp; <span class="php-var">$this</span>-&gt;chemin == <span class="php-quote">''</span>) {
</span><span id="611" class="l"><a class="l" href="#611">611: </a> <span class="php-var">$cible</span>-&gt;chemin = <span class="php-quote">'/'</span> . <span class="php-var">$this</span>-&gt;chemin;
</span><span id="612" class="l"><a class="l" href="#612">612: </a> } <span class="php-keyword1">else</span> {
</span><span id="613" class="l"><a class="l" href="#613">613: </a> <span class="php-var">$i</span> = <span class="php-keyword2">strrpos</span>(<span class="php-var">$this</span>-&gt;chemin, <span class="php-quote">'/'</span>);
</span><span id="614" class="l"><a class="l" href="#614">614: </a> <span class="php-keyword1">if</span> (<span class="php-var">$i</span> !== <span class="php-keyword1">false</span>) {
</span><span id="615" class="l"><a class="l" href="#615">615: </a> <span class="php-var">$cible</span>-&gt;chemin = <span class="php-keyword2">substr</span>(<span class="php-var">$this</span>-&gt;chemin, <span class="php-num">0</span>, <span class="php-var">$i</span> + <span class="php-num">1</span>);
</span><span id="616" class="l"><a class="l" href="#616">616: </a> }
</span><span id="617" class="l"><a class="l" href="#617">617: </a> <span class="php-var">$cible</span>-&gt;chemin .= <span class="php-var">$reference</span>-&gt;chemin;
</span><span id="618" class="l"><a class="l" href="#618">618: </a> }
</span><span id="619" class="l"><a class="l" href="#619">619: </a> <span class="php-var">$cible</span>-&gt;chemin = self::supprimerSegmentsAPoints(<span class="php-var">$cible</span>-&gt;chemin);
</span><span id="620" class="l"><a class="l" href="#620">620: </a> }
</span><span id="621" class="l"><a class="l" href="#621">621: </a> <span class="php-var">$cible</span>-&gt;requete = <span class="php-var">$reference</span>-&gt;requete;
</span><span id="622" class="l"><a class="l" href="#622">622: </a> }
</span><span id="623" class="l"><a class="l" href="#623">623: </a> <span class="php-var">$cible</span>-&gt;setAutorite(<span class="php-var">$this</span>-&gt;getAutorite());
</span><span id="624" class="l"><a class="l" href="#624">624: </a> }
</span><span id="625" class="l"><a class="l" href="#625">625: </a> <span class="php-var">$cible</span>-&gt;schema = <span class="php-var">$this</span>-&gt;schema;
</span><span id="626" class="l"><a class="l" href="#626">626: </a> }
</span><span id="530" class="l"><a class="l" href="#530">530: </a> <span class="php-var">$this</span>-&gt;port = <span class="php-keyword1">false</span>;
</span><span id="531" class="l"><a class="l" href="#531">531: </a> }
</span><span id="532" class="l"><a class="l" href="#532">532: </a>
</span><span id="533" class="l"><a class="l" href="#533">533: </a> <span class="php-comment">// normalisation dans le cas d'un encodage avec %XX pourcentage (RFC 3986, section 6.2.2.1)</span>
</span><span id="534" class="l"><a class="l" href="#534">534: </a> <span class="php-keyword1">foreach</span> (<span class="php-keyword1">array</span>(<span class="php-quote">'infoUtilisateur'</span>, <span class="php-quote">'hote'</span>, <span class="php-quote">'chemin'</span>) <span class="php-keyword1">as</span> <span class="php-var">$partie</span>) {
</span><span id="535" class="l"><a class="l" href="#535">535: </a> <span class="php-keyword1">if</span> (<span class="php-var">$this</span>-&gt;<span class="php-var">$partie</span>) {
</span><span id="536" class="l"><a class="l" href="#536">536: </a> <span class="php-var">$this</span>-&gt;<span class="php-var">$partie</span> = <span class="php-keyword2">preg_replace</span>(<span class="php-quote">'/%[0-9a-f]{2}/ie'</span>, <span class="php-quote">'strtoupper(&quot;\0&quot;)'</span>, <span class="php-var">$this</span>-&gt;<span class="php-var">$partie</span>);
</span><span id="537" class="l"><a class="l" href="#537">537: </a> }
</span><span id="538" class="l"><a class="l" href="#538">538: </a> }
</span><span id="539" class="l"><a class="l" href="#539">539: </a>
</span><span id="540" class="l"><a class="l" href="#540">540: </a> <span class="php-comment">// normalisation des segments du chemin (RFC 3986, section 6.2.2.3)</span>
</span><span id="541" class="l"><a class="l" href="#541">541: </a> <span class="php-var">$this</span>-&gt;chemin = self::supprimerSegmentsAPoints(<span class="php-var">$this</span>-&gt;chemin);
</span><span id="542" class="l"><a class="l" href="#542">542: </a>
</span><span id="543" class="l"><a class="l" href="#543">543: </a> <span class="php-comment">// normalisation basée sur le schéma (RFC 3986, section 6.2.3)</span>
</span><span id="544" class="l"><a class="l" href="#544">544: </a> <span class="php-keyword1">if</span> (<span class="php-var">$this</span>-&gt;hote &amp;&amp; !<span class="php-var">$this</span>-&gt;chemin) {
</span><span id="545" class="l"><a class="l" href="#545">545: </a> <span class="php-var">$this</span>-&gt;chemin = <span class="php-quote">'/'</span>;
</span><span id="546" class="l"><a class="l" href="#546">546: </a> }
</span><span id="547" class="l"><a class="l" href="#547">547: </a> }
</span><span id="548" class="l"><a class="l" href="#548">548: </a>
</span><span id="549" class="l"><a class="l" href="#549">549: </a> <span class="php-comment">/**
</span></span><span id="550" class="l"><a class="l" href="#550">550: </a><span class="php-comment"> * Renvoie vrai ou faux suivant que l'instance en cours représente une URL relative ou absolue.
</span></span><span id="551" class="l"><a class="l" href="#551">551: </a><span class="php-comment"> *
</span></span><span id="552" class="l"><a class="l" href="#552">552: </a><span class="php-comment"> * @return bool
</span></span><span id="553" class="l"><a class="l" href="#553">553: </a><span class="php-comment"> */</span>
</span><span id="554" class="l"><a class="l" href="#554">554: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="_etreAbsolue" href="#_etreAbsolue">etreAbsolue</a>() {
</span><span id="555" class="l"><a class="l" href="#555">555: </a> <span class="php-keyword1">return</span> (bool) <span class="php-var">$this</span>-&gt;schema;
</span><span id="556" class="l"><a class="l" href="#556">556: </a> }
</span><span id="557" class="l"><a class="l" href="#557">557: </a>
</span><span id="558" class="l"><a class="l" href="#558">558: </a> <span class="php-comment">/**
</span></span><span id="559" class="l"><a class="l" href="#559">559: </a><span class="php-comment"> * Renvoie une instance de Url représentant une URL absolue relative à
</span></span><span id="560" class="l"><a class="l" href="#560">560: </a><span class="php-comment"> * cette URL.
</span></span><span id="561" class="l"><a class="l" href="#561">561: </a><span class="php-comment"> *
</span></span><span id="562" class="l"><a class="l" href="#562">562: </a><span class="php-comment"> * @param Url|string $reference URL relative
</span></span><span id="563" class="l"><a class="l" href="#563">563: </a><span class="php-comment"> *
</span></span><span id="564" class="l"><a class="l" href="#564">564: </a><span class="php-comment"> * @return Url
</span></span><span id="565" class="l"><a class="l" href="#565">565: </a><span class="php-comment"> */</span>
</span><span id="566" class="l"><a class="l" href="#566">566: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="_resoudre" href="#_resoudre">resoudre</a>(<span class="php-var">$reference</span>) {
</span><span id="567" class="l"><a class="l" href="#567">567: </a> <span class="php-keyword1">if</span> (<span class="php-keyword2">is_string</span>(<span class="php-var">$reference</span>)) {
</span><span id="568" class="l"><a class="l" href="#568">568: </a> <span class="php-var">$reference</span> = <span class="php-keyword1">new</span> self(<span class="php-var">$reference</span>);
</span><span id="569" class="l"><a class="l" href="#569">569: </a> }
</span><span id="570" class="l"><a class="l" href="#570">570: </a> <span class="php-keyword1">if</span> (!<span class="php-var">$this</span>-&gt;etreAbsolue()) {
</span><span id="571" class="l"><a class="l" href="#571">571: </a> <span class="php-keyword1">throw</span> <span class="php-keyword1">new</span> Exception(<span class="php-quote">'L\'URL de base doit être absolue !'</span>);
</span><span id="572" class="l"><a class="l" href="#572">572: </a> }
</span><span id="573" class="l"><a class="l" href="#573">573: </a>
</span><span id="574" class="l"><a class="l" href="#574">574: </a> <span class="php-comment">// Un parseur non strict peut choisir d'ignorer un schema dans la référence</span>
</span><span id="575" class="l"><a class="l" href="#575">575: </a> <span class="php-comment">// si celui ci est identique au schéma de base de l'URI.</span>
</span><span id="576" class="l"><a class="l" href="#576">576: </a> <span class="php-keyword1">if</span> (!<span class="php-var">$this</span>-&gt;getOption(self::OPTION_STRICTE) &amp;&amp; <span class="php-var">$reference</span>-&gt;schema == <span class="php-var">$this</span>-&gt;schema) {
</span><span id="577" class="l"><a class="l" href="#577">577: </a> <span class="php-var">$reference</span>-&gt;schema = <span class="php-keyword1">false</span>;
</span><span id="578" class="l"><a class="l" href="#578">578: </a> }
</span><span id="579" class="l"><a class="l" href="#579">579: </a>
</span><span id="580" class="l"><a class="l" href="#580">580: </a> <span class="php-var">$cible</span> = <span class="php-keyword1">new</span> self(<span class="php-quote">''</span>);
</span><span id="581" class="l"><a class="l" href="#581">581: </a> <span class="php-keyword1">if</span> (<span class="php-var">$reference</span>-&gt;schema !== <span class="php-keyword1">false</span>) {
</span><span id="582" class="l"><a class="l" href="#582">582: </a> <span class="php-var">$cible</span>-&gt;schema = <span class="php-var">$reference</span>-&gt;schema;
</span><span id="583" class="l"><a class="l" href="#583">583: </a> <span class="php-var">$cible</span>-&gt;setAutorite(<span class="php-var">$reference</span>-&gt;getAutorite());
</span><span id="584" class="l"><a class="l" href="#584">584: </a> <span class="php-var">$cible</span>-&gt;chemin = self::supprimerSegmentsAPoints(<span class="php-var">$reference</span>-&gt;chemin);
</span><span id="585" class="l"><a class="l" href="#585">585: </a> <span class="php-var">$cible</span>-&gt;requete = <span class="php-var">$reference</span>-&gt;requete;
</span><span id="586" class="l"><a class="l" href="#586">586: </a> } <span class="php-keyword1">else</span> {
</span><span id="587" class="l"><a class="l" href="#587">587: </a> <span class="php-var">$autorite</span> = <span class="php-var">$reference</span>-&gt;getAutorite();
</span><span id="588" class="l"><a class="l" href="#588">588: </a> <span class="php-keyword1">if</span> (<span class="php-var">$autorite</span> !== <span class="php-keyword1">false</span>) {
</span><span id="589" class="l"><a class="l" href="#589">589: </a> <span class="php-var">$cible</span>-&gt;setAutorite(<span class="php-var">$autorite</span>);
</span><span id="590" class="l"><a class="l" href="#590">590: </a> <span class="php-var">$cible</span>-&gt;chemin = self::supprimerSegmentsAPoints(<span class="php-var">$reference</span>-&gt;chemin);
</span><span id="591" class="l"><a class="l" href="#591">591: </a> <span class="php-var">$cible</span>-&gt;requete = <span class="php-var">$reference</span>-&gt;requete;
</span><span id="592" class="l"><a class="l" href="#592">592: </a> } <span class="php-keyword1">else</span> {
</span><span id="593" class="l"><a class="l" href="#593">593: </a> <span class="php-keyword1">if</span> (<span class="php-var">$reference</span>-&gt;chemin == <span class="php-quote">''</span>) {
</span><span id="594" class="l"><a class="l" href="#594">594: </a> <span class="php-var">$cible</span>-&gt;chemin = <span class="php-var">$this</span>-&gt;chemin;
</span><span id="595" class="l"><a class="l" href="#595">595: </a> <span class="php-keyword1">if</span> (<span class="php-var">$reference</span>-&gt;requete !== <span class="php-keyword1">false</span>) {
</span><span id="596" class="l"><a class="l" href="#596">596: </a> <span class="php-var">$cible</span>-&gt;requete = <span class="php-var">$reference</span>-&gt;requete;
</span><span id="597" class="l"><a class="l" href="#597">597: </a> } <span class="php-keyword1">else</span> {
</span><span id="598" class="l"><a class="l" href="#598">598: </a> <span class="php-var">$cible</span>-&gt;requete = <span class="php-var">$this</span>-&gt;requete;
</span><span id="599" class="l"><a class="l" href="#599">599: </a> }
</span><span id="600" class="l"><a class="l" href="#600">600: </a> } <span class="php-keyword1">else</span> {
</span><span id="601" class="l"><a class="l" href="#601">601: </a> <span class="php-keyword1">if</span> (<span class="php-keyword2">substr</span>(<span class="php-var">$reference</span>-&gt;chemin, <span class="php-num">0</span>, <span class="php-num">1</span>) == <span class="php-quote">'/'</span>) {
</span><span id="602" class="l"><a class="l" href="#602">602: </a> <span class="php-var">$cible</span>-&gt;chemin = self::supprimerSegmentsAPoints(<span class="php-var">$reference</span>-&gt;chemin);
</span><span id="603" class="l"><a class="l" href="#603">603: </a> } <span class="php-keyword1">else</span> {
</span><span id="604" class="l"><a class="l" href="#604">604: </a> <span class="php-comment">// Concaténation chemins (RFC 3986, section 5.2.3)</span>
</span><span id="605" class="l"><a class="l" href="#605">605: </a> <span class="php-keyword1">if</span> (<span class="php-var">$this</span>-&gt;hote !== <span class="php-keyword1">false</span> &amp;&amp; <span class="php-var">$this</span>-&gt;chemin == <span class="php-quote">''</span>) {
</span><span id="606" class="l"><a class="l" href="#606">606: </a> <span class="php-var">$cible</span>-&gt;chemin = <span class="php-quote">'/'</span> . <span class="php-var">$this</span>-&gt;chemin;
</span><span id="607" class="l"><a class="l" href="#607">607: </a> } <span class="php-keyword1">else</span> {
</span><span id="608" class="l"><a class="l" href="#608">608: </a> <span class="php-var">$i</span> = <span class="php-keyword2">strrpos</span>(<span class="php-var">$this</span>-&gt;chemin, <span class="php-quote">'/'</span>);
</span><span id="609" class="l"><a class="l" href="#609">609: </a> <span class="php-keyword1">if</span> (<span class="php-var">$i</span> !== <span class="php-keyword1">false</span>) {
</span><span id="610" class="l"><a class="l" href="#610">610: </a> <span class="php-var">$cible</span>-&gt;chemin = <span class="php-keyword2">substr</span>(<span class="php-var">$this</span>-&gt;chemin, <span class="php-num">0</span>, <span class="php-var">$i</span> + <span class="php-num">1</span>);
</span><span id="611" class="l"><a class="l" href="#611">611: </a> }
</span><span id="612" class="l"><a class="l" href="#612">612: </a> <span class="php-var">$cible</span>-&gt;chemin .= <span class="php-var">$reference</span>-&gt;chemin;
</span><span id="613" class="l"><a class="l" href="#613">613: </a> }
</span><span id="614" class="l"><a class="l" href="#614">614: </a> <span class="php-var">$cible</span>-&gt;chemin = self::supprimerSegmentsAPoints(<span class="php-var">$cible</span>-&gt;chemin);
</span><span id="615" class="l"><a class="l" href="#615">615: </a> }
</span><span id="616" class="l"><a class="l" href="#616">616: </a> <span class="php-var">$cible</span>-&gt;requete = <span class="php-var">$reference</span>-&gt;requete;
</span><span id="617" class="l"><a class="l" href="#617">617: </a> }
</span><span id="618" class="l"><a class="l" href="#618">618: </a> <span class="php-var">$cible</span>-&gt;setAutorite(<span class="php-var">$this</span>-&gt;getAutorite());
</span><span id="619" class="l"><a class="l" href="#619">619: </a> }
</span><span id="620" class="l"><a class="l" href="#620">620: </a> <span class="php-var">$cible</span>-&gt;schema = <span class="php-var">$this</span>-&gt;schema;
</span><span id="621" class="l"><a class="l" href="#621">621: </a> }
</span><span id="622" class="l"><a class="l" href="#622">622: </a>
</span><span id="623" class="l"><a class="l" href="#623">623: </a> <span class="php-var">$cible</span>-&gt;fragment = <span class="php-var">$reference</span>-&gt;fragment;
</span><span id="624" class="l"><a class="l" href="#624">624: </a>
</span><span id="625" class="l"><a class="l" href="#625">625: </a> <span class="php-keyword1">return</span> <span class="php-var">$cible</span>;
</span><span id="626" class="l"><a class="l" href="#626">626: </a> }
</span><span id="627" class="l"><a class="l" href="#627">627: </a>
</span><span id="628" class="l"><a class="l" href="#628">628: </a> <span class="php-var">$cible</span>-&gt;fragment = <span class="php-var">$reference</span>-&gt;fragment;
</span><span id="629" class="l"><a class="l" href="#629">629: </a>
</span><span id="630" class="l"><a class="l" href="#630">630: </a> <span class="php-keyword1">return</span> <span class="php-var">$cible</span>;
</span><span id="631" class="l"><a class="l" href="#631">631: </a> }
</span><span id="632" class="l"><a class="l" href="#632">632: </a>
</span><span id="633" class="l"><a class="l" href="#633">633: </a> <span class="php-comment">/**
</span></span><span id="634" class="l"><a class="l" href="#634">634: </a><span class="php-comment"> * La suppression des segments à points est décrite dans la RFC 3986, section 5.2.4, e.g.
</span></span><span id="635" class="l"><a class="l" href="#635">635: </a><span class="php-comment"> * &quot;/foo/../bar/baz&quot; =&gt; &quot;/bar/baz&quot;
</span></span><span id="636" class="l"><a class="l" href="#636">636: </a><span class="php-comment"> *
</span></span><span id="637" class="l"><a class="l" href="#637">637: </a><span class="php-comment"> * @param string $chemin un chemin
</span></span><span id="638" class="l"><a class="l" href="#638">638: </a><span class="php-comment"> *
</span></span><span id="639" class="l"><a class="l" href="#639">639: </a><span class="php-comment"> * @return string un chemin
</span></span><span id="640" class="l"><a class="l" href="#640">640: </a><span class="php-comment"> */</span>
</span><span id="641" class="l"><a class="l" href="#641">641: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_supprimerSegmentsAPoints" href="#_supprimerSegmentsAPoints">supprimerSegmentsAPoints</a>(<span class="php-var">$chemin</span>) {
</span><span id="642" class="l"><a class="l" href="#642">642: </a> <span class="php-var">$sortie</span> = <span class="php-quote">''</span>;
</span><span id="643" class="l"><a class="l" href="#643">643: </a>
</span><span id="644" class="l"><a class="l" href="#644">644: </a> <span class="php-comment">// Assurons de ne pas nous retrouver piégés dans une boucle infinie due à un bug de</span>
</span><span id="645" class="l"><a class="l" href="#645">645: </a> <span class="php-comment">// cette méthode</span>
</span><span id="646" class="l"><a class="l" href="#646">646: </a> <span class="php-var">$j</span> = <span class="php-num">0</span>;
</span><span id="647" class="l"><a class="l" href="#647">647: </a> <span class="php-keyword1">while</span> (<span class="php-var">$chemin</span> &amp;&amp; <span class="php-var">$j</span>++ &lt; <span class="php-num">100</span>) {
</span><span id="648" class="l"><a class="l" href="#648">648: </a> <span class="php-comment">// Étape A</span>
</span><span id="649" class="l"><a class="l" href="#649">649: </a> <span class="php-keyword1">if</span> (<span class="php-keyword2">substr</span>(<span class="php-var">$chemin</span>, <span class="php-num">0</span>, <span class="php-num">2</span>) == <span class="php-quote">'./'</span>) {
</span><span id="650" class="l"><a class="l" href="#650">650: </a> <span class="php-var">$chemin</span> = <span class="php-keyword2">substr</span>(<span class="php-var">$chemin</span>, <span class="php-num">2</span>);
</span><span id="651" class="l"><a class="l" href="#651">651: </a> } <span class="php-keyword1">elseif</span> (<span class="php-keyword2">substr</span>(<span class="php-var">$chemin</span>, <span class="php-num">0</span>, <span class="php-num">3</span>) == <span class="php-quote">'../'</span>) {
</span><span id="652" class="l"><a class="l" href="#652">652: </a> <span class="php-var">$chemin</span> = <span class="php-keyword2">substr</span>(<span class="php-var">$chemin</span>, <span class="php-num">3</span>);
</span><span id="653" class="l"><a class="l" href="#653">653: </a>
</span><span id="654" class="l"><a class="l" href="#654">654: </a> <span class="php-comment">// Étape B</span>
</span><span id="655" class="l"><a class="l" href="#655">655: </a> } <span class="php-keyword1">elseif</span> (<span class="php-keyword2">substr</span>(<span class="php-var">$chemin</span>, <span class="php-num">0</span>, <span class="php-num">3</span>) == <span class="php-quote">'/./'</span> || <span class="php-var">$chemin</span> == <span class="php-quote">'/.'</span>) {
</span><span id="656" class="l"><a class="l" href="#656">656: </a> <span class="php-var">$chemin</span> = <span class="php-quote">'/'</span> . <span class="php-keyword2">substr</span>(<span class="php-var">$chemin</span>, <span class="php-num">3</span>);
</span><span id="657" class="l"><a class="l" href="#657">657: </a>
</span><span id="658" class="l"><a class="l" href="#658">658: </a> <span class="php-comment">// Étape C</span>
</span><span id="659" class="l"><a class="l" href="#659">659: </a> } <span class="php-keyword1">elseif</span> (<span class="php-keyword2">substr</span>(<span class="php-var">$chemin</span>, <span class="php-num">0</span>, <span class="php-num">4</span>) == <span class="php-quote">'/../'</span> || <span class="php-var">$chemin</span> == <span class="php-quote">'/..'</span>) {
</span><span id="660" class="l"><a class="l" href="#660">660: </a> <span class="php-var">$chemin</span> = <span class="php-quote">'/'</span> . <span class="php-keyword2">substr</span>(<span class="php-var">$chemin</span>, <span class="php-num">4</span>);
</span><span id="661" class="l"><a class="l" href="#661">661: </a> <span class="php-var">$i</span> = <span class="php-keyword2">strrpos</span>(<span class="php-var">$sortie</span>, <span class="php-quote">'/'</span>);
</span><span id="662" class="l"><a class="l" href="#662">662: </a> <span class="php-var">$sortie</span> = <span class="php-var">$i</span> === <span class="php-keyword1">false</span> ? <span class="php-quote">''</span> : <span class="php-keyword2">substr</span>(<span class="php-var">$sortie</span>, <span class="php-num">0</span>, <span class="php-var">$i</span>);
</span><span id="663" class="l"><a class="l" href="#663">663: </a>
</span><span id="664" class="l"><a class="l" href="#664">664: </a> <span class="php-comment">// Étape D</span>
</span><span id="665" class="l"><a class="l" href="#665">665: </a> } <span class="php-keyword1">elseif</span> (<span class="php-var">$chemin</span> == <span class="php-quote">'.'</span> || <span class="php-var">$chemin</span> == <span class="php-quote">'..'</span>) {
</span><span id="666" class="l"><a class="l" href="#666">666: </a> <span class="php-var">$chemin</span> = <span class="php-quote">''</span>;
</span><span id="667" class="l"><a class="l" href="#667">667: </a>
</span><span id="668" class="l"><a class="l" href="#668">668: </a> <span class="php-comment">// Étape E</span>
</span><span id="669" class="l"><a class="l" href="#669">669: </a> } <span class="php-keyword1">else</span> {
</span><span id="670" class="l"><a class="l" href="#670">670: </a> <span class="php-var">$i</span> = <span class="php-keyword2">strpos</span>(<span class="php-var">$chemin</span>, <span class="php-quote">'/'</span>);
</span><span id="671" class="l"><a class="l" href="#671">671: </a> <span class="php-keyword1">if</span> (<span class="php-var">$i</span> === <span class="php-num">0</span>) {
</span><span id="672" class="l"><a class="l" href="#672">672: </a> <span class="php-var">$i</span> = <span class="php-keyword2">strpos</span>(<span class="php-var">$chemin</span>, <span class="php-quote">'/'</span>, <span class="php-num">1</span>);
</span><span id="673" class="l"><a class="l" href="#673">673: </a> }
</span><span id="674" class="l"><a class="l" href="#674">674: </a> <span class="php-keyword1">if</span> (<span class="php-var">$i</span> === <span class="php-keyword1">false</span>) {
</span><span id="675" class="l"><a class="l" href="#675">675: </a> <span class="php-var">$i</span> = <span class="php-keyword2">strlen</span>(<span class="php-var">$chemin</span>);
</span><span id="676" class="l"><a class="l" href="#676">676: </a> }
</span><span id="677" class="l"><a class="l" href="#677">677: </a> <span class="php-var">$sortie</span> .= <span class="php-keyword2">substr</span>(<span class="php-var">$chemin</span>, <span class="php-num">0</span>, <span class="php-var">$i</span>);
</span><span id="678" class="l"><a class="l" href="#678">678: </a> <span class="php-var">$chemin</span> = <span class="php-keyword2">substr</span>(<span class="php-var">$chemin</span>, <span class="php-var">$i</span>);
</span><span id="679" class="l"><a class="l" href="#679">679: </a> }
</span><span id="680" class="l"><a class="l" href="#680">680: </a> }
</span><span id="681" class="l"><a class="l" href="#681">681: </a>
</span><span id="682" class="l"><a class="l" href="#682">682: </a> <span class="php-keyword1">return</span> <span class="php-var">$sortie</span>;
</span><span id="683" class="l"><a class="l" href="#683">683: </a> }
</span><span id="684" class="l"><a class="l" href="#684">684: </a>
</span><span id="685" class="l"><a class="l" href="#685">685: </a> <span class="php-comment">/**
</span></span><span id="686" class="l"><a class="l" href="#686">686: </a><span class="php-comment"> * Renvoie une instance de Url representant l'URL canonique du script PHP
</span></span><span id="687" class="l"><a class="l" href="#687">687: </a><span class="php-comment"> * en cours d'éxécution
</span></span><span id="688" class="l"><a class="l" href="#688">688: </a><span class="php-comment"> *
</span></span><span id="689" class="l"><a class="l" href="#689">689: </a><span class="php-comment"> * @return string
</span></span><span id="690" class="l"><a class="l" href="#690">690: </a><span class="php-comment"> */</span>
</span><span id="691" class="l"><a class="l" href="#691">691: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_getCanonique" href="#_getCanonique">getCanonique</a>() {
</span><span id="692" class="l"><a class="l" href="#692">692: </a> <span class="php-keyword1">if</span> (!<span class="php-keyword1">isset</span>(<span class="php-var">$_SERVER</span>[<span class="php-quote">'REQUEST_METHOD'</span>])) {
</span><span id="693" class="l"><a class="l" href="#693">693: </a> <span class="php-comment">// ALERT - pas d'URL en cours</span>
</span><span id="694" class="l"><a class="l" href="#694">694: </a> <span class="php-keyword1">throw</span> <span class="php-keyword1">new</span> Exception(<span class="php-quote">'Le script n\'a pas été appellé à travers un serveur web'</span>);
</span><span id="695" class="l"><a class="l" href="#695">695: </a> }
</span><span id="696" class="l"><a class="l" href="#696">696: </a>
</span><span id="697" class="l"><a class="l" href="#697">697: </a> <span class="php-comment">// on part d'une URL relative</span>
</span><span id="698" class="l"><a class="l" href="#698">698: </a> <span class="php-var">$url</span> = <span class="php-keyword1">new</span> self(<span class="php-var">$_SERVER</span>[<span class="php-quote">'PHP_SELF'</span>]);
</span><span id="699" class="l"><a class="l" href="#699">699: </a> <span class="php-var">$url</span>-&gt;schema = <span class="php-keyword1">isset</span>(<span class="php-var">$_SERVER</span>[<span class="php-quote">'HTTPS'</span>]) ? <span class="php-quote">'https'</span> : <span class="php-quote">'http'</span>;
</span><span id="700" class="l"><a class="l" href="#700">700: </a> <span class="php-var">$url</span>-&gt;hote = <span class="php-var">$_SERVER</span>[<span class="php-quote">'SERVER_NAME'</span>];
</span><span id="701" class="l"><a class="l" href="#701">701: </a> <span class="php-var">$port</span> = <span class="php-keyword2">intval</span>(<span class="php-var">$_SERVER</span>[<span class="php-quote">'SERVER_PORT'</span>]);
</span><span id="702" class="l"><a class="l" href="#702">702: </a> <span class="php-keyword1">if</span> (<span class="php-var">$url</span>-&gt;schema == <span class="php-quote">'http'</span> &amp;&amp; <span class="php-var">$port</span> != <span class="php-num">80</span> ||
</span><span id="703" class="l"><a class="l" href="#703">703: </a> <span class="php-var">$url</span>-&gt;schema == <span class="php-quote">'https'</span> &amp;&amp; <span class="php-var">$port</span> != <span class="php-num">443</span>) {
</span><span id="628" class="l"><a class="l" href="#628">628: </a> <span class="php-comment">/**
</span></span><span id="629" class="l"><a class="l" href="#629">629: </a><span class="php-comment"> * La suppression des segments à points est décrite dans la RFC 3986, section 5.2.4, e.g.
</span></span><span id="630" class="l"><a class="l" href="#630">630: </a><span class="php-comment"> * &quot;/foo/../bar/baz&quot; =&gt; &quot;/bar/baz&quot;
</span></span><span id="631" class="l"><a class="l" href="#631">631: </a><span class="php-comment"> *
</span></span><span id="632" class="l"><a class="l" href="#632">632: </a><span class="php-comment"> * @param string $chemin un chemin
</span></span><span id="633" class="l"><a class="l" href="#633">633: </a><span class="php-comment"> *
</span></span><span id="634" class="l"><a class="l" href="#634">634: </a><span class="php-comment"> * @return string un chemin
</span></span><span id="635" class="l"><a class="l" href="#635">635: </a><span class="php-comment"> */</span>
</span><span id="636" class="l"><a class="l" href="#636">636: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_supprimerSegmentsAPoints" href="#_supprimerSegmentsAPoints">supprimerSegmentsAPoints</a>(<span class="php-var">$chemin</span>) {
</span><span id="637" class="l"><a class="l" href="#637">637: </a> <span class="php-var">$sortie</span> = <span class="php-quote">''</span>;
</span><span id="638" class="l"><a class="l" href="#638">638: </a>
</span><span id="639" class="l"><a class="l" href="#639">639: </a> <span class="php-comment">// Assurons de ne pas nous retrouver piégés dans une boucle infinie due à un bug de</span>
</span><span id="640" class="l"><a class="l" href="#640">640: </a> <span class="php-comment">// cette méthode</span>
</span><span id="641" class="l"><a class="l" href="#641">641: </a> <span class="php-var">$j</span> = <span class="php-num">0</span>;
</span><span id="642" class="l"><a class="l" href="#642">642: </a> <span class="php-keyword1">while</span> (<span class="php-var">$chemin</span> &amp;&amp; <span class="php-var">$j</span>++ &lt; <span class="php-num">100</span>) {
</span><span id="643" class="l"><a class="l" href="#643">643: </a> <span class="php-comment">// Étape A</span>
</span><span id="644" class="l"><a class="l" href="#644">644: </a> <span class="php-keyword1">if</span> (<span class="php-keyword2">substr</span>(<span class="php-var">$chemin</span>, <span class="php-num">0</span>, <span class="php-num">2</span>) == <span class="php-quote">'./'</span>) {
</span><span id="645" class="l"><a class="l" href="#645">645: </a> <span class="php-var">$chemin</span> = <span class="php-keyword2">substr</span>(<span class="php-var">$chemin</span>, <span class="php-num">2</span>);
</span><span id="646" class="l"><a class="l" href="#646">646: </a> } <span class="php-keyword1">elseif</span> (<span class="php-keyword2">substr</span>(<span class="php-var">$chemin</span>, <span class="php-num">0</span>, <span class="php-num">3</span>) == <span class="php-quote">'../'</span>) {
</span><span id="647" class="l"><a class="l" href="#647">647: </a> <span class="php-var">$chemin</span> = <span class="php-keyword2">substr</span>(<span class="php-var">$chemin</span>, <span class="php-num">3</span>);
</span><span id="648" class="l"><a class="l" href="#648">648: </a>
</span><span id="649" class="l"><a class="l" href="#649">649: </a> <span class="php-comment">// Étape B</span>
</span><span id="650" class="l"><a class="l" href="#650">650: </a> } <span class="php-keyword1">elseif</span> (<span class="php-keyword2">substr</span>(<span class="php-var">$chemin</span>, <span class="php-num">0</span>, <span class="php-num">3</span>) == <span class="php-quote">'/./'</span> || <span class="php-var">$chemin</span> == <span class="php-quote">'/.'</span>) {
</span><span id="651" class="l"><a class="l" href="#651">651: </a> <span class="php-var">$chemin</span> = <span class="php-quote">'/'</span> . <span class="php-keyword2">substr</span>(<span class="php-var">$chemin</span>, <span class="php-num">3</span>);
</span><span id="652" class="l"><a class="l" href="#652">652: </a>
</span><span id="653" class="l"><a class="l" href="#653">653: </a> <span class="php-comment">// Étape C</span>
</span><span id="654" class="l"><a class="l" href="#654">654: </a> } <span class="php-keyword1">elseif</span> (<span class="php-keyword2">substr</span>(<span class="php-var">$chemin</span>, <span class="php-num">0</span>, <span class="php-num">4</span>) == <span class="php-quote">'/../'</span> || <span class="php-var">$chemin</span> == <span class="php-quote">'/..'</span>) {
</span><span id="655" class="l"><a class="l" href="#655">655: </a> <span class="php-var">$chemin</span> = <span class="php-quote">'/'</span> . <span class="php-keyword2">substr</span>(<span class="php-var">$chemin</span>, <span class="php-num">4</span>);
</span><span id="656" class="l"><a class="l" href="#656">656: </a> <span class="php-var">$i</span> = <span class="php-keyword2">strrpos</span>(<span class="php-var">$sortie</span>, <span class="php-quote">'/'</span>);
</span><span id="657" class="l"><a class="l" href="#657">657: </a> <span class="php-var">$sortie</span> = <span class="php-var">$i</span> === <span class="php-keyword1">false</span> ? <span class="php-quote">''</span> : <span class="php-keyword2">substr</span>(<span class="php-var">$sortie</span>, <span class="php-num">0</span>, <span class="php-var">$i</span>);
</span><span id="658" class="l"><a class="l" href="#658">658: </a>
</span><span id="659" class="l"><a class="l" href="#659">659: </a> <span class="php-comment">// Étape D</span>
</span><span id="660" class="l"><a class="l" href="#660">660: </a> } <span class="php-keyword1">elseif</span> (<span class="php-var">$chemin</span> == <span class="php-quote">'.'</span> || <span class="php-var">$chemin</span> == <span class="php-quote">'..'</span>) {
</span><span id="661" class="l"><a class="l" href="#661">661: </a> <span class="php-var">$chemin</span> = <span class="php-quote">''</span>;
</span><span id="662" class="l"><a class="l" href="#662">662: </a>
</span><span id="663" class="l"><a class="l" href="#663">663: </a> <span class="php-comment">// Étape E</span>
</span><span id="664" class="l"><a class="l" href="#664">664: </a> } <span class="php-keyword1">else</span> {
</span><span id="665" class="l"><a class="l" href="#665">665: </a> <span class="php-var">$i</span> = <span class="php-keyword2">strpos</span>(<span class="php-var">$chemin</span>, <span class="php-quote">'/'</span>);
</span><span id="666" class="l"><a class="l" href="#666">666: </a> <span class="php-keyword1">if</span> (<span class="php-var">$i</span> === <span class="php-num">0</span>) {
</span><span id="667" class="l"><a class="l" href="#667">667: </a> <span class="php-var">$i</span> = <span class="php-keyword2">strpos</span>(<span class="php-var">$chemin</span>, <span class="php-quote">'/'</span>, <span class="php-num">1</span>);
</span><span id="668" class="l"><a class="l" href="#668">668: </a> }
</span><span id="669" class="l"><a class="l" href="#669">669: </a> <span class="php-keyword1">if</span> (<span class="php-var">$i</span> === <span class="php-keyword1">false</span>) {
</span><span id="670" class="l"><a class="l" href="#670">670: </a> <span class="php-var">$i</span> = <span class="php-keyword2">strlen</span>(<span class="php-var">$chemin</span>);
</span><span id="671" class="l"><a class="l" href="#671">671: </a> }
</span><span id="672" class="l"><a class="l" href="#672">672: </a> <span class="php-var">$sortie</span> .= <span class="php-keyword2">substr</span>(<span class="php-var">$chemin</span>, <span class="php-num">0</span>, <span class="php-var">$i</span>);
</span><span id="673" class="l"><a class="l" href="#673">673: </a> <span class="php-var">$chemin</span> = <span class="php-keyword2">substr</span>(<span class="php-var">$chemin</span>, <span class="php-var">$i</span>);
</span><span id="674" class="l"><a class="l" href="#674">674: </a> }
</span><span id="675" class="l"><a class="l" href="#675">675: </a> }
</span><span id="676" class="l"><a class="l" href="#676">676: </a>
</span><span id="677" class="l"><a class="l" href="#677">677: </a> <span class="php-keyword1">return</span> <span class="php-var">$sortie</span>;
</span><span id="678" class="l"><a class="l" href="#678">678: </a> }
</span><span id="679" class="l"><a class="l" href="#679">679: </a>
</span><span id="680" class="l"><a class="l" href="#680">680: </a> <span class="php-comment">/**
</span></span><span id="681" class="l"><a class="l" href="#681">681: </a><span class="php-comment"> * Renvoie une instance de Url representant l'URL canonique du script PHP
</span></span><span id="682" class="l"><a class="l" href="#682">682: </a><span class="php-comment"> * en cours d'éxécution
</span></span><span id="683" class="l"><a class="l" href="#683">683: </a><span class="php-comment"> *
</span></span><span id="684" class="l"><a class="l" href="#684">684: </a><span class="php-comment"> * @return string
</span></span><span id="685" class="l"><a class="l" href="#685">685: </a><span class="php-comment"> */</span>
</span><span id="686" class="l"><a class="l" href="#686">686: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_getCanonique" href="#_getCanonique">getCanonique</a>() {
</span><span id="687" class="l"><a class="l" href="#687">687: </a> <span class="php-keyword1">if</span> (!<span class="php-keyword1">isset</span>(<span class="php-var">$_SERVER</span>[<span class="php-quote">'REQUEST_METHOD'</span>])) {
</span><span id="688" class="l"><a class="l" href="#688">688: </a> <span class="php-comment">// ALERT - pas d'URL en cours</span>
</span><span id="689" class="l"><a class="l" href="#689">689: </a> <span class="php-keyword1">throw</span> <span class="php-keyword1">new</span> Exception(<span class="php-quote">'Le script n\'a pas été appellé à travers un serveur web'</span>);
</span><span id="690" class="l"><a class="l" href="#690">690: </a> }
</span><span id="691" class="l"><a class="l" href="#691">691: </a>
</span><span id="692" class="l"><a class="l" href="#692">692: </a> <span class="php-comment">// on part d'une URL relative</span>
</span><span id="693" class="l"><a class="l" href="#693">693: </a> <span class="php-var">$url</span> = <span class="php-keyword1">new</span> self(<span class="php-var">$_SERVER</span>[<span class="php-quote">'PHP_SELF'</span>]);
</span><span id="694" class="l"><a class="l" href="#694">694: </a> <span class="php-var">$url</span>-&gt;schema = <span class="php-keyword1">isset</span>(<span class="php-var">$_SERVER</span>[<span class="php-quote">'HTTPS'</span>]) ? <span class="php-quote">'https'</span> : <span class="php-quote">'http'</span>;
</span><span id="695" class="l"><a class="l" href="#695">695: </a> <span class="php-var">$url</span>-&gt;hote = <span class="php-var">$_SERVER</span>[<span class="php-quote">'SERVER_NAME'</span>];
</span><span id="696" class="l"><a class="l" href="#696">696: </a> <span class="php-var">$port</span> = <span class="php-keyword2">intval</span>(<span class="php-var">$_SERVER</span>[<span class="php-quote">'SERVER_PORT'</span>]);
</span><span id="697" class="l"><a class="l" href="#697">697: </a> <span class="php-keyword1">if</span> (<span class="php-var">$url</span>-&gt;schema == <span class="php-quote">'http'</span> &amp;&amp; <span class="php-var">$port</span> != <span class="php-num">80</span> ||
</span><span id="698" class="l"><a class="l" href="#698">698: </a> <span class="php-var">$url</span>-&gt;schema == <span class="php-quote">'https'</span> &amp;&amp; <span class="php-var">$port</span> != <span class="php-num">443</span>) {
</span><span id="699" class="l"><a class="l" href="#699">699: </a>
</span><span id="700" class="l"><a class="l" href="#700">700: </a> <span class="php-var">$url</span>-&gt;port = <span class="php-var">$port</span>;
</span><span id="701" class="l"><a class="l" href="#701">701: </a> }
</span><span id="702" class="l"><a class="l" href="#702">702: </a> <span class="php-keyword1">return</span> <span class="php-var">$url</span>;
</span><span id="703" class="l"><a class="l" href="#703">703: </a> }
</span><span id="704" class="l"><a class="l" href="#704">704: </a>
</span><span id="705" class="l"><a class="l" href="#705">705: </a> <span class="php-var">$url</span>-&gt;port = <span class="php-var">$port</span>;
</span><span id="706" class="l"><a class="l" href="#706">706: </a> }
</span><span id="707" class="l"><a class="l" href="#707">707: </a> <span class="php-keyword1">return</span> <span class="php-var">$url</span>;
</span><span id="708" class="l"><a class="l" href="#708">708: </a> }
</span><span id="709" class="l"><a class="l" href="#709">709: </a>
</span><span id="710" class="l"><a class="l" href="#710">710: </a> <span class="php-comment">/**
</span></span><span id="711" class="l"><a class="l" href="#711">711: </a><span class="php-comment"> * Renvoie l'URL utilisée pour récupérer la requête en cours
</span></span><span id="712" class="l"><a class="l" href="#712">712: </a><span class="php-comment"> *
</span></span><span id="713" class="l"><a class="l" href="#713">713: </a><span class="php-comment"> * @return string
</span></span><span id="714" class="l"><a class="l" href="#714">714: </a><span class="php-comment"> */</span>
</span><span id="715" class="l"><a class="l" href="#715">715: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_getURLDemande" href="#_getURLDemande">getURLDemande</a>() {
</span><span id="716" class="l"><a class="l" href="#716">716: </a> <span class="php-keyword1">return</span> self::getDemande()-&gt;getUrl();
</span><span id="717" class="l"><a class="l" href="#717">717: </a> }
</span><span id="718" class="l"><a class="l" href="#718">718: </a>
</span><span id="719" class="l"><a class="l" href="#719">719: </a> <span class="php-comment">/**
</span></span><span id="720" class="l"><a class="l" href="#720">720: </a><span class="php-comment"> * Renvoie une instance de Url representant l'URL utilisée pour
</span></span><span id="721" class="l"><a class="l" href="#721">721: </a><span class="php-comment"> * récupérer la requête en cours
</span></span><span id="722" class="l"><a class="l" href="#722">722: </a><span class="php-comment"> *
</span></span><span id="723" class="l"><a class="l" href="#723">723: </a><span class="php-comment"> * @return Url
</span></span><span id="724" class="l"><a class="l" href="#724">724: </a><span class="php-comment"> */</span>
</span><span id="725" class="l"><a class="l" href="#725">725: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_getDemande" href="#_getDemande">getDemande</a>() {
</span><span id="726" class="l"><a class="l" href="#726">726: </a> <span class="php-keyword1">if</span> (!<span class="php-keyword1">isset</span>(<span class="php-var">$_SERVER</span>[<span class="php-quote">'REQUEST_METHOD'</span>])) {
</span><span id="727" class="l"><a class="l" href="#727">727: </a> <span class="php-comment">// ALERTE - pas d'URL en cours</span>
</span><span id="728" class="l"><a class="l" href="#728">728: </a> <span class="php-keyword1">throw</span> <span class="php-keyword1">new</span> Exception(<span class="php-quote">'Le script n\'a pas été appellé à travers un serveur web'</span>);
</span><span id="729" class="l"><a class="l" href="#729">729: </a> }
</span><span id="730" class="l"><a class="l" href="#730">730: </a>
</span><span id="731" class="l"><a class="l" href="#731">731: </a> <span class="php-comment">// On part d'une URL relative</span>
</span><span id="732" class="l"><a class="l" href="#732">732: </a> <span class="php-var">$url</span> = <span class="php-keyword1">new</span> self(<span class="php-var">$_SERVER</span>[<span class="php-quote">'REQUEST_URI'</span>]);
</span><span id="733" class="l"><a class="l" href="#733">733: </a> <span class="php-var">$url</span>-&gt;schema = <span class="php-keyword1">isset</span>(<span class="php-var">$_SERVER</span>[<span class="php-quote">'HTTPS'</span>]) ? <span class="php-quote">'https'</span> : <span class="php-quote">'http'</span>;
</span><span id="734" class="l"><a class="l" href="#734">734: </a> <span class="php-comment">// On met à jour les valeurs de l'hote et si possible du port</span>
</span><span id="735" class="l"><a class="l" href="#735">735: </a> <span class="php-var">$url</span>-&gt;setAutorite(<span class="php-var">$_SERVER</span>[<span class="php-quote">'HTTP_hote'</span>]);
</span><span id="736" class="l"><a class="l" href="#736">736: </a> <span class="php-keyword1">return</span> <span class="php-var">$url</span>;
</span><span id="737" class="l"><a class="l" href="#737">737: </a> }
</span><span id="738" class="l"><a class="l" href="#738">738: </a>
</span><span id="739" class="l"><a class="l" href="#739">739: </a> <span class="php-comment">/**
</span></span><span id="740" class="l"><a class="l" href="#740">740: </a><span class="php-comment"> * Met à jour la valeur de l'option spécifiée.
</span></span><span id="741" class="l"><a class="l" href="#741">741: </a><span class="php-comment"> *
</span></span><span id="742" class="l"><a class="l" href="#742">742: </a><span class="php-comment"> * @param string $nomOption une des constantes commençant par self::OPTION_
</span></span><span id="743" class="l"><a class="l" href="#743">743: </a><span class="php-comment"> * @param mixed $valeur valeur de l'option
</span></span><span id="744" class="l"><a class="l" href="#744">744: </a><span class="php-comment"> *
</span></span><span id="745" class="l"><a class="l" href="#745">745: </a><span class="php-comment"> * @return void
</span></span><span id="746" class="l"><a class="l" href="#746">746: </a><span class="php-comment"> * @see self::OPTION_STRICTE
</span></span><span id="747" class="l"><a class="l" href="#747">747: </a><span class="php-comment"> * @see self::OPTION_UTILISER_CROCHETS
</span></span><span id="748" class="l"><a class="l" href="#748">748: </a><span class="php-comment"> * @see self::OPTION_ENCODER_CLES
</span></span><span id="749" class="l"><a class="l" href="#749">749: </a><span class="php-comment"> */</span>
</span><span id="750" class="l"><a class="l" href="#750">750: </a> <span class="php-keyword1">function</span> <a id="_setOption" href="#_setOption">setOption</a>(<span class="php-var">$nomOption</span>, <span class="php-var">$valeur</span>) {
</span><span id="751" class="l"><a class="l" href="#751">751: </a> <span class="php-keyword1">if</span> (!<span class="php-keyword2">array_key_exists</span>(<span class="php-var">$nomOption</span>, <span class="php-var">$this</span>-&gt;options)) {
</span><span id="752" class="l"><a class="l" href="#752">752: </a> <span class="php-keyword1">return</span> <span class="php-keyword1">false</span>;
</span><span id="753" class="l"><a class="l" href="#753">753: </a> }
</span><span id="754" class="l"><a class="l" href="#754">754: </a> <span class="php-var">$this</span>-&gt;options[<span class="php-var">$nomOption</span>] = <span class="php-var">$valeur</span>;
</span><span id="755" class="l"><a class="l" href="#755">755: </a> }
</span><span id="756" class="l"><a class="l" href="#756">756: </a>
</span><span id="757" class="l"><a class="l" href="#757">757: </a> <span class="php-comment">/**
</span></span><span id="758" class="l"><a class="l" href="#758">758: </a><span class="php-comment"> * Renvoie la valeur de l'option specifiée.
</span></span><span id="759" class="l"><a class="l" href="#759">759: </a><span class="php-comment"> *
</span></span><span id="760" class="l"><a class="l" href="#760">760: </a><span class="php-comment"> * @param string $nomOption Nom de l'option demandée
</span></span><span id="761" class="l"><a class="l" href="#761">761: </a><span class="php-comment"> *
</span></span><span id="762" class="l"><a class="l" href="#762">762: </a><span class="php-comment"> * @return mixed
</span></span><span id="763" class="l"><a class="l" href="#763">763: </a><span class="php-comment"> */</span>
</span><span id="764" class="l"><a class="l" href="#764">764: </a> <span class="php-keyword1">function</span> <a id="_getOption" href="#_getOption">getOption</a>(<span class="php-var">$nomOption</span>) {
</span><span id="765" class="l"><a class="l" href="#765">765: </a> <span class="php-keyword1">return</span> <span class="php-keyword1">isset</span>(<span class="php-var">$this</span>-&gt;options[<span class="php-var">$nomOption</span>])
</span><span id="766" class="l"><a class="l" href="#766">766: </a> ? <span class="php-var">$this</span>-&gt;options[<span class="php-var">$nomOption</span>] : <span class="php-keyword1">false</span>;
</span><span id="767" class="l"><a class="l" href="#767">767: </a> }
</span><span id="768" class="l"><a class="l" href="#768">768: </a>
</span><span id="769" class="l"><a class="l" href="#769">769: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="___toString" href="#___toString">__toString</a>() {
</span><span id="770" class="l"><a class="l" href="#770">770: </a> <span class="php-keyword1">return</span> <span class="php-var">$this</span>-&gt;getURL();
</span><span id="771" class="l"><a class="l" href="#771">771: </a> }
</span><span id="772" class="l"><a class="l" href="#772">772: </a>}
</span><span id="773" class="l"><a class="l" href="#773">773: </a></span></code></pre>
</span><span id="705" class="l"><a class="l" href="#705">705: </a> <span class="php-comment">/**
</span></span><span id="706" class="l"><a class="l" href="#706">706: </a><span class="php-comment"> * Renvoie l'URL utilisée pour récupérer la requête en cours
</span></span><span id="707" class="l"><a class="l" href="#707">707: </a><span class="php-comment"> *
</span></span><span id="708" class="l"><a class="l" href="#708">708: </a><span class="php-comment"> * @return string
</span></span><span id="709" class="l"><a class="l" href="#709">709: </a><span class="php-comment"> */</span>
</span><span id="710" class="l"><a class="l" href="#710">710: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_getURLDemande" href="#_getURLDemande">getURLDemande</a>() {
</span><span id="711" class="l"><a class="l" href="#711">711: </a> <span class="php-keyword1">return</span> self::getDemande()-&gt;getUrl();
</span><span id="712" class="l"><a class="l" href="#712">712: </a> }
</span><span id="713" class="l"><a class="l" href="#713">713: </a>
</span><span id="714" class="l"><a class="l" href="#714">714: </a> <span class="php-comment">/**
</span></span><span id="715" class="l"><a class="l" href="#715">715: </a><span class="php-comment"> * Renvoie une instance de Url representant l'URL utilisée pour
</span></span><span id="716" class="l"><a class="l" href="#716">716: </a><span class="php-comment"> * récupérer la requête en cours
</span></span><span id="717" class="l"><a class="l" href="#717">717: </a><span class="php-comment"> *
</span></span><span id="718" class="l"><a class="l" href="#718">718: </a><span class="php-comment"> * @return Url
</span></span><span id="719" class="l"><a class="l" href="#719">719: </a><span class="php-comment"> */</span>
</span><span id="720" class="l"><a class="l" href="#720">720: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_getDemande" href="#_getDemande">getDemande</a>() {
</span><span id="721" class="l"><a class="l" href="#721">721: </a> <span class="php-keyword1">if</span> (!<span class="php-keyword1">isset</span>(<span class="php-var">$_SERVER</span>[<span class="php-quote">'REQUEST_METHOD'</span>])) {
</span><span id="722" class="l"><a class="l" href="#722">722: </a> <span class="php-comment">// ALERTE - pas d'URL en cours</span>
</span><span id="723" class="l"><a class="l" href="#723">723: </a> <span class="php-keyword1">throw</span> <span class="php-keyword1">new</span> Exception(<span class="php-quote">'Le script n\'a pas été appellé à travers un serveur web'</span>);
</span><span id="724" class="l"><a class="l" href="#724">724: </a> }
</span><span id="725" class="l"><a class="l" href="#725">725: </a>
</span><span id="726" class="l"><a class="l" href="#726">726: </a> <span class="php-comment">// On part d'une URL relative</span>
</span><span id="727" class="l"><a class="l" href="#727">727: </a> <span class="php-var">$url</span> = <span class="php-keyword1">new</span> self(<span class="php-var">$_SERVER</span>[<span class="php-quote">'REQUEST_URI'</span>]);
</span><span id="728" class="l"><a class="l" href="#728">728: </a> <span class="php-var">$url</span>-&gt;schema = <span class="php-keyword1">isset</span>(<span class="php-var">$_SERVER</span>[<span class="php-quote">'HTTPS'</span>]) ? <span class="php-quote">'https'</span> : <span class="php-quote">'http'</span>;
</span><span id="729" class="l"><a class="l" href="#729">729: </a> <span class="php-comment">// On met à jour les valeurs de l'hote et si possible du port</span>
</span><span id="730" class="l"><a class="l" href="#730">730: </a> <span class="php-var">$url</span>-&gt;setAutorite(<span class="php-var">$_SERVER</span>[<span class="php-quote">'HTTP_hote'</span>]);
</span><span id="731" class="l"><a class="l" href="#731">731: </a> <span class="php-keyword1">return</span> <span class="php-var">$url</span>;
</span><span id="732" class="l"><a class="l" href="#732">732: </a> }
</span><span id="733" class="l"><a class="l" href="#733">733: </a>
</span><span id="734" class="l"><a class="l" href="#734">734: </a> <span class="php-comment">/**
</span></span><span id="735" class="l"><a class="l" href="#735">735: </a><span class="php-comment"> * Met à jour la valeur de l'option spécifiée.
</span></span><span id="736" class="l"><a class="l" href="#736">736: </a><span class="php-comment"> *
</span></span><span id="737" class="l"><a class="l" href="#737">737: </a><span class="php-comment"> * @param string $nomOption une des constantes commençant par self::OPTION_
</span></span><span id="738" class="l"><a class="l" href="#738">738: </a><span class="php-comment"> * @param mixed $valeur valeur de l'option
</span></span><span id="739" class="l"><a class="l" href="#739">739: </a><span class="php-comment"> *
</span></span><span id="740" class="l"><a class="l" href="#740">740: </a><span class="php-comment"> * @return void
</span></span><span id="741" class="l"><a class="l" href="#741">741: </a><span class="php-comment"> * @see self::OPTION_STRICTE
</span></span><span id="742" class="l"><a class="l" href="#742">742: </a><span class="php-comment"> * @see self::OPTION_UTILISER_CROCHETS
</span></span><span id="743" class="l"><a class="l" href="#743">743: </a><span class="php-comment"> * @see self::OPTION_ENCODER_CLES
</span></span><span id="744" class="l"><a class="l" href="#744">744: </a><span class="php-comment"> */</span>
</span><span id="745" class="l"><a class="l" href="#745">745: </a> <span class="php-keyword1">function</span> <a id="_setOption" href="#_setOption">setOption</a>(<span class="php-var">$nomOption</span>, <span class="php-var">$valeur</span>) {
</span><span id="746" class="l"><a class="l" href="#746">746: </a> <span class="php-keyword1">if</span> (!<span class="php-keyword2">array_key_exists</span>(<span class="php-var">$nomOption</span>, <span class="php-var">$this</span>-&gt;options)) {
</span><span id="747" class="l"><a class="l" href="#747">747: </a> <span class="php-keyword1">return</span> <span class="php-keyword1">false</span>;
</span><span id="748" class="l"><a class="l" href="#748">748: </a> }
</span><span id="749" class="l"><a class="l" href="#749">749: </a> <span class="php-var">$this</span>-&gt;options[<span class="php-var">$nomOption</span>] = <span class="php-var">$valeur</span>;
</span><span id="750" class="l"><a class="l" href="#750">750: </a> }
</span><span id="751" class="l"><a class="l" href="#751">751: </a>
</span><span id="752" class="l"><a class="l" href="#752">752: </a> <span class="php-comment">/**
</span></span><span id="753" class="l"><a class="l" href="#753">753: </a><span class="php-comment"> * Renvoie la valeur de l'option specifiée.
</span></span><span id="754" class="l"><a class="l" href="#754">754: </a><span class="php-comment"> *
</span></span><span id="755" class="l"><a class="l" href="#755">755: </a><span class="php-comment"> * @param string $nomOption Nom de l'option demandée
</span></span><span id="756" class="l"><a class="l" href="#756">756: </a><span class="php-comment"> *
</span></span><span id="757" class="l"><a class="l" href="#757">757: </a><span class="php-comment"> * @return mixed
</span></span><span id="758" class="l"><a class="l" href="#758">758: </a><span class="php-comment"> */</span>
</span><span id="759" class="l"><a class="l" href="#759">759: </a> <span class="php-keyword1">function</span> <a id="_getOption" href="#_getOption">getOption</a>(<span class="php-var">$nomOption</span>) {
</span><span id="760" class="l"><a class="l" href="#760">760: </a> <span class="php-keyword1">return</span> <span class="php-keyword1">isset</span>(<span class="php-var">$this</span>-&gt;options[<span class="php-var">$nomOption</span>])
</span><span id="761" class="l"><a class="l" href="#761">761: </a> ? <span class="php-var">$this</span>-&gt;options[<span class="php-var">$nomOption</span>] : <span class="php-keyword1">false</span>;
</span><span id="762" class="l"><a class="l" href="#762">762: </a> }
</span><span id="763" class="l"><a class="l" href="#763">763: </a>
</span><span id="764" class="l"><a class="l" href="#764">764: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="___toString" href="#___toString">__toString</a>() {
</span><span id="765" class="l"><a class="l" href="#765">765: </a> <span class="php-keyword1">return</span> <span class="php-var">$this</span>-&gt;getURL();
</span><span id="766" class="l"><a class="l" href="#766">766: </a> }
</span><span id="767" class="l"><a class="l" href="#767">767: </a>}
</span><span id="768" class="l"><a class="l" href="#768">768: </a></span></code></pre>
 
<div id="footer">
TBFramework - v0.2 API documentation generated by <a href="http://apigen.org">ApiGen 2.8.0</a>
/branches/v0.2-buhl/doc/ApiGen/class-Url.html
7,7 → 7,7
<title>Class Url | TBFramework - v0.2</title>
 
<script type="text/javascript" src="resources/combined.js?4205936287"></script>
<script type="text/javascript" src="elementlist.js?117657638"></script>
<script type="text/javascript" src="elementlist.js?1835392179"></script>
<link rel="stylesheet" type="text/css" media="all" href="resources/style.css?3505392360">
 
</head>
40,6 → 40,7
<li><a href="class-Controleur.html">Controleur</a></li>
<li><a href="class-Debug.html">Debug</a></li>
<li><a href="class-GestionnaireException.html">GestionnaireException</a></li>
<li><a href="class-I18n.html">I18n</a></li>
<li><a href="class-Log.html">Log</a></li>
<li><a href="class-Modele.html">Modele</a></li>
<li><a href="class-Registre.html">Registre</a></li>
123,17 → 124,17
<b>Package:</b> <a href="package-Framework.html">Framework</a><br>
 
<b>Category:</b>
Php5<br>
PHP 5.2<br>
<b>Copyright:</b>
2009 Tela-Botanica<br>
Copyright (c) 2009, Tela Botanica (<a
href="mailto:accueil&#64;tela-botanica.org">accueil&#64;<!-- -->tela-botanica.org</a>)<br>
<b>License:</b>
<a href="http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt">Licence CECILL</a><br>
<a href="GNU-GPL-v3">&lt;http://www.gnu.org/licenses/gpl.html&gt;</a><br>
<b>License:</b>
<a href="http://www.gnu.org/licenses/gpl.html">Licence GNU-GPL</a><br>
<a href="CECILL-v2">&lt;http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt&gt;</a><br>
<b>Author:</b>
Christian Schmidt &lt;<a
href="mailto:schmidt&#64;php.net">schmidt&#64;<!-- -->php.net</a>&gt; // Autre
auteurs<br>
Christian SCHMIDT&lt;<a
href="mailto:schmidt&#64;php.net">schmidt&#64;<!-- -->php.net</a>&gt;<br>
<b>Author:</b>
Aurélien PERONNET &lt;<a
href="mailto:aurelien&#64;tela-botanica.org">aurelien&#64;<!-- -->tela-botanica.org</a>&gt;<br>
140,11 → 141,7
<b>Author:</b>
Jean-Pascal MILCENT &lt;<a
href="mailto:jpm&#64;tela-botanica.org">jpm&#64;<!-- -->tela-botanica.org</a>&gt;<br>
<b>Version:</b>
SVN: $Id: Url.php 171 2010-03-23 11:23:38Z jpm $<br>
<b>Link:</b>
/doc/framework/<br>
<b>Located at</b> <a href="source-class-Url.html#3-772" title="Go to source code">Url.php</a><br>
<b>Located at</b> <a href="source-class-Url.html#3-767" title="Go to source code">Url.php</a><br>
</div>
 
 
162,7 → 159,7
 
<td class="name"><div>
<a class="anchor" href="#___construct">#</a>
<code><a href="source-class-Url.html#98-135" title="Go to source code">__construct</a>( <span>string <var>$url</var></span>, <span>array <var>$options</var> = <span class="php-keyword1">null</span></span> )</code>
<code><a href="source-class-Url.html#93-130" title="Go to source code">__construct</a>( <span>string <var>$url</var></span>, <span>array <var>$options</var> = <span class="php-keyword1">null</span></span> )</code>
 
<div class="description short">
198,7 → 195,7
 
<td class="name"><div>
<a class="anchor" href="#_getSchema">#</a>
<code><a href="source-class-Url.html#137-145" title="Go to source code">getSchema</a>( )</code>
<code><a href="source-class-Url.html#132-140" title="Go to source code">getSchema</a>( )</code>
 
<div class="description short">
237,7 → 234,7
 
<td class="name"><div>
<a class="anchor" href="#_setSchema">#</a>
<code><a href="source-class-Url.html#147-155" title="Go to source code">setSchema</a>( <span>string|boolean <var>$schema</var></span> )</code>
<code><a href="source-class-Url.html#142-150" title="Go to source code">setSchema</a>( <span>string|boolean <var>$schema</var></span> )</code>
 
<div class="description short">
275,7 → 272,7
 
<td class="name"><div>
<a class="anchor" href="#_getUtilisateur">#</a>
<code><a href="source-class-Url.html#157-165" title="Go to source code">getUtilisateur</a>( )</code>
<code><a href="source-class-Url.html#152-160" title="Go to source code">getUtilisateur</a>( )</code>
 
<div class="description short">
315,7 → 312,7
 
<td class="name"><div>
<a class="anchor" href="#_getMotDePasse">#</a>
<code><a href="source-class-Url.html#167-176" title="Go to source code">getMotDePasse</a>( )</code>
<code><a href="source-class-Url.html#162-171" title="Go to source code">getMotDePasse</a>( )</code>
 
<div class="description short">
359,7 → 356,7
 
<td class="name"><div>
<a class="anchor" href="#_getInfoUtilisateur">#</a>
<code><a href="source-class-Url.html#178-186" title="Go to source code">getInfoUtilisateur</a>( )</code>
<code><a href="source-class-Url.html#173-181" title="Go to source code">getInfoUtilisateur</a>( )</code>
 
<div class="description short">
398,7 → 395,7
 
<td class="name"><div>
<a class="anchor" href="#_setInfoUtilisateur">#</a>
<code><a href="source-class-Url.html#188-202" title="Go to source code">setInfoUtilisateur</a>( <span>string|boolean <var>$infoUtilisateur</var></span>, <span>string|boolean <var>$motDePasse</var> = <span class="php-keyword1">false</span></span> )</code>
<code><a href="source-class-Url.html#183-197" title="Go to source code">setInfoUtilisateur</a>( <span>string|boolean <var>$infoUtilisateur</var></span>, <span>string|boolean <var>$motDePasse</var> = <span class="php-keyword1">false</span></span> )</code>
 
<div class="description short">
442,7 → 439,7
 
<td class="name"><div>
<a class="anchor" href="#_getHote">#</a>
<code><a href="source-class-Url.html#204-212" title="Go to source code">getHote</a>( )</code>
<code><a href="source-class-Url.html#199-207" title="Go to source code">getHote</a>( )</code>
 
<div class="description short">
481,7 → 478,7
 
<td class="name"><div>
<a class="anchor" href="#_setHote">#</a>
<code><a href="source-class-Url.html#214-221" title="Go to source code">setHote</a>( <span>string|boolean <var>$hote</var></span> )</code>
<code><a href="source-class-Url.html#209-216" title="Go to source code">setHote</a>( <span>string|boolean <var>$hote</var></span> )</code>
 
<div class="description short">
515,7 → 512,7
 
<td class="name"><div>
<a class="anchor" href="#_getPort">#</a>
<code><a href="source-class-Url.html#223-231" title="Go to source code">getPort</a>( )</code>
<code><a href="source-class-Url.html#218-226" title="Go to source code">getPort</a>( )</code>
 
<div class="description short">
554,7 → 551,7
 
<td class="name"><div>
<a class="anchor" href="#_setPort">#</a>
<code><a href="source-class-Url.html#233-240" title="Go to source code">setPort</a>( <span>integer|boolean <var>$port</var></span> )</code>
<code><a href="source-class-Url.html#228-235" title="Go to source code">setPort</a>( <span>integer|boolean <var>$port</var></span> )</code>
 
<div class="description short">
588,7 → 585,7
 
<td class="name"><div>
<a class="anchor" href="#_getAutorite">#</a>
<code><a href="source-class-Url.html#242-266" title="Go to source code">getAutorite</a>( )</code>
<code><a href="source-class-Url.html#237-261" title="Go to source code">getAutorite</a>( )</code>
 
<div class="description short">
627,7 → 624,7
 
<td class="name"><div>
<a class="anchor" href="#_setAutorite">#</a>
<code><a href="source-class-Url.html#268-288" title="Go to source code">setAutorite</a>( <span>string|false <var>$autorite</var></span> )</code>
<code><a href="source-class-Url.html#263-283" title="Go to source code">setAutorite</a>( <span>string|false <var>$autorite</var></span> )</code>
 
<div class="description short">
661,7 → 658,7
 
<td class="name"><div>
<a class="anchor" href="#_getChemin">#</a>
<code><a href="source-class-Url.html#290-297" title="Go to source code">getChemin</a>( )</code>
<code><a href="source-class-Url.html#285-292" title="Go to source code">getChemin</a>( )</code>
 
<div class="description short">
698,7 → 695,7
 
<td class="name"><div>
<a class="anchor" href="#_setChemin">#</a>
<code><a href="source-class-Url.html#299-306" title="Go to source code">setChemin</a>( <span>string <var>$chemin</var></span> )</code>
<code><a href="source-class-Url.html#294-301" title="Go to source code">setChemin</a>( <span>string <var>$chemin</var></span> )</code>
 
<div class="description short">
732,7 → 729,7
 
<td class="name"><div>
<a class="anchor" href="#_getRequete">#</a>
<code><a href="source-class-Url.html#308-317" title="Go to source code">getRequete</a>( )</code>
<code><a href="source-class-Url.html#303-312" title="Go to source code">getRequete</a>( )</code>
 
<div class="description short">
775,7 → 772,7
 
<td class="name"><div>
<a class="anchor" href="#_setRequete">#</a>
<code><a href="source-class-Url.html#319-327" title="Go to source code">setRequete</a>( <span>string|boolean <var>$requete</var></span> )</code>
<code><a href="source-class-Url.html#314-322" title="Go to source code">setRequete</a>( <span>string|boolean <var>$requete</var></span> )</code>
 
<div class="description short">
813,7 → 810,7
 
<td class="name"><div>
<a class="anchor" href="#_getFragment">#</a>
<code><a href="source-class-Url.html#329-336" title="Go to source code">getFragment</a>( )</code>
<code><a href="source-class-Url.html#324-331" title="Go to source code">getFragment</a>( )</code>
 
<div class="description short">
850,7 → 847,7
 
<td class="name"><div>
<a class="anchor" href="#_setFragment">#</a>
<code><a href="source-class-Url.html#338-345" title="Go to source code">setFragment</a>( <span>string|boolean <var>$fragment</var></span> )</code>
<code><a href="source-class-Url.html#333-340" title="Go to source code">setFragment</a>( <span>string|boolean <var>$fragment</var></span> )</code>
 
<div class="description short">
884,7 → 881,7
 
<td class="name"><div>
<a class="anchor" href="#_getVariablesRequete">#</a>
<code><a href="source-class-Url.html#347-401" title="Go to source code">getVariablesRequete</a>( )</code>
<code><a href="source-class-Url.html#342-396" title="Go to source code">getVariablesRequete</a>( )</code>
 
<div class="description short">
923,7 → 920,7
 
<td class="name"><div>
<a class="anchor" href="#_setVariablesRequete">#</a>
<code><a href="source-class-Url.html#403-432" title="Go to source code">setVariablesRequete</a>( <span>array <var>$tableau</var></span> )</code>
<code><a href="source-class-Url.html#398-427" title="Go to source code">setVariablesRequete</a>( <span>array <var>$tableau</var></span> )</code>
 
<div class="description short">
957,7 → 954,7
 
<td class="name"><div>
<a class="anchor" href="#_setVariableRequete">#</a>
<code><a href="source-class-Url.html#434-444" title="Go to source code">setVariableRequete</a>( <span>string <var>$nom</var></span>, <span>mixed <var>$valeur</var></span> )</code>
<code><a href="source-class-Url.html#429-439" title="Go to source code">setVariableRequete</a>( <span>string <var>$nom</var></span>, <span>mixed <var>$valeur</var></span> )</code>
 
<div class="description short">
997,7 → 994,7
 
<td class="name"><div>
<a class="anchor" href="#_unsetVariableRequete">#</a>
<code><a href="source-class-Url.html#446-455" title="Go to source code">unsetVariableRequete</a>( <span>string <var>$nom</var></span> )</code>
<code><a href="source-class-Url.html#441-450" title="Go to source code">unsetVariableRequete</a>( <span>string <var>$nom</var></span> )</code>
 
<div class="description short">
1031,7 → 1028,7
 
<td class="name"><div>
<a class="anchor" href="#_unsetVariablesRequete">#</a>
<code><a href="source-class-Url.html#457-468" title="Go to source code">unsetVariablesRequete</a>( <span>array <var>$noms</var></span> )</code>
<code><a href="source-class-Url.html#452-463" title="Go to source code">unsetVariablesRequete</a>( <span>array <var>$noms</var></span> )</code>
 
<div class="description short">
1065,7 → 1062,7
 
<td class="name"><div>
<a class="anchor" href="#_getURL">#</a>
<code><a href="source-class-Url.html#470-498" title="Go to source code">getURL</a>( )</code>
<code><a href="source-class-Url.html#465-493" title="Go to source code">getURL</a>( )</code>
 
<div class="description short">
1102,7 → 1099,7
 
<td class="name"><div>
<a class="anchor" href="#_getURLNormalisee">#</a>
<code><a href="source-class-Url.html#500-510" title="Go to source code">getURLNormalisee</a>( )</code>
<code><a href="source-class-Url.html#495-505" title="Go to source code">getURLNormalisee</a>( )</code>
 
<div class="description short">
1141,7 → 1138,7
 
<td class="name"><div>
<a class="anchor" href="#_normaliser">#</a>
<code><a href="source-class-Url.html#512-552" title="Go to source code">normaliser</a>( )</code>
<code><a href="source-class-Url.html#507-547" title="Go to source code">normaliser</a>( )</code>
 
<div class="description short">
1178,7 → 1175,7
 
<td class="name"><div>
<a class="anchor" href="#_etreAbsolue">#</a>
<code><a href="source-class-Url.html#554-561" title="Go to source code">etreAbsolue</a>( )</code>
<code><a href="source-class-Url.html#549-556" title="Go to source code">etreAbsolue</a>( )</code>
 
<div class="description short">
1217,7 → 1214,7
 
<td class="name"><div>
<a class="anchor" href="#_resoudre">#</a>
<code><a href="source-class-Url.html#563-631" title="Go to source code">resoudre</a>( <span><code><a href="class-Url.html">Url</a></code>|string <var>$reference</var></span> )</code>
<code><a href="source-class-Url.html#558-626" title="Go to source code">resoudre</a>( <span><code><a href="class-Url.html">Url</a></code>|string <var>$reference</var></span> )</code>
 
<div class="description short">
1261,7 → 1258,7
 
<td class="name"><div>
<a class="anchor" href="#_getCanonique">#</a>
<code><a href="source-class-Url.html#685-708" title="Go to source code">getCanonique</a>( )</code>
<code><a href="source-class-Url.html#680-703" title="Go to source code">getCanonique</a>( )</code>
 
<div class="description short">
1300,7 → 1297,7
 
<td class="name"><div>
<a class="anchor" href="#_getURLDemande">#</a>
<code><a href="source-class-Url.html#710-717" title="Go to source code">getURLDemande</a>( )</code>
<code><a href="source-class-Url.html#705-712" title="Go to source code">getURLDemande</a>( )</code>
 
<div class="description short">
1337,7 → 1334,7
 
<td class="name"><div>
<a class="anchor" href="#_getDemande">#</a>
<code><a href="source-class-Url.html#719-737" title="Go to source code">getDemande</a>( )</code>
<code><a href="source-class-Url.html#714-732" title="Go to source code">getDemande</a>( )</code>
 
<div class="description short">
1376,7 → 1373,7
 
<td class="name"><div>
<a class="anchor" href="#_setOption">#</a>
<code><a href="source-class-Url.html#739-755" title="Go to source code">setOption</a>( <span>string <var>$nomOption</var></span>, <span>mixed <var>$valeur</var></span> )</code>
<code><a href="source-class-Url.html#734-750" title="Go to source code">setOption</a>( <span>string <var>$nomOption</var></span>, <span>mixed <var>$valeur</var></span> )</code>
 
<div class="description short">
1422,7 → 1419,7
 
<td class="name"><div>
<a class="anchor" href="#_getOption">#</a>
<code><a href="source-class-Url.html#757-767" title="Go to source code">getOption</a>( <span>string <var>$nomOption</var></span> )</code>
<code><a href="source-class-Url.html#752-762" title="Go to source code">getOption</a>( <span>string <var>$nomOption</var></span> )</code>
 
<div class="description short">
1464,7 → 1461,7
 
<td class="name"><div>
<a class="anchor" href="#___toString">#</a>
<code><a href="source-class-Url.html#769-771" title="Go to source code">__toString</a>( )</code>
<code><a href="source-class-Url.html#764-766" title="Go to source code">__toString</a>( )</code>
 
<div class="description short">
1497,7 → 1494,7
 
<td class="attributes"><code>string</code></td>
<td class="name"><code>
<a href="source-class-Url.html#23-27" title="Go to source code"><b>OPTION_STRICTE</b></a>
<a href="source-class-Url.html#18-22" title="Go to source code"><b>OPTION_STRICTE</b></a>
</code></td>
<td class="value"><code><span class="php-quote">'strict'</span></code></td>
<td class="description"><div>
1523,7 → 1520,7
 
<td class="attributes"><code>string</code></td>
<td class="name"><code>
<a href="source-class-Url.html#29-32" title="Go to source code"><b>OPTION_UTILISER_CROCHETS</b></a>
<a href="source-class-Url.html#24-27" title="Go to source code"><b>OPTION_UTILISER_CROCHETS</b></a>
</code></td>
<td class="value"><code><span class="php-quote">'use_brackets'</span></code></td>
<td class="description"><div>
1549,7 → 1546,7
 
<td class="attributes"><code>string</code></td>
<td class="name"><code>
<a href="source-class-Url.html#34-37" title="Go to source code"><b>OPTION_ENCODER_CLES</b></a>
<a href="source-class-Url.html#29-32" title="Go to source code"><b>OPTION_ENCODER_CLES</b></a>
</code></td>
<td class="value"><code><span class="php-quote">'encode_keys'</span></code></td>
<td class="description"><div>
1575,7 → 1572,7
 
<td class="attributes"><code>string</code></td>
<td class="name"><code>
<a href="source-class-Url.html#39-44" title="Go to source code"><b>OPTION_SEPARATEUR_ENTREE</b></a>
<a href="source-class-Url.html#34-39" title="Go to source code"><b>OPTION_SEPARATEUR_ENTREE</b></a>
</code></td>
<td class="value"><code><span class="php-quote">'input_separator'</span></code></td>
<td class="description"><div>
1603,7 → 1600,7
 
<td class="attributes"><code>string</code></td>
<td class="name"><code>
<a href="source-class-Url.html#46-50" title="Go to source code"><b>OPTION_SEPARATEUR_SORTIE</b></a>
<a href="source-class-Url.html#41-45" title="Go to source code"><b>OPTION_SEPARATEUR_SORTIE</b></a>
</code></td>
<td class="value"><code><span class="php-quote">'output_separator'</span></code></td>
<td class="description"><div>
/branches/v0.2-buhl/doc/ApiGen/todo.html
7,7 → 7,7
<title>Todo | TBFramework - v0.2</title>
 
<script type="text/javascript" src="resources/combined.js?4205936287"></script>
<script type="text/javascript" src="elementlist.js?117657638"></script>
<script type="text/javascript" src="elementlist.js?1835392179"></script>
<link rel="stylesheet" type="text/css" media="all" href="resources/style.css?3505392360">
 
</head>
40,6 → 40,7
<li><a href="class-Controleur.html">Controleur</a></li>
<li><a href="class-Debug.html">Debug</a></li>
<li><a href="class-GestionnaireException.html">GestionnaireException</a></li>
<li><a href="class-I18n.html">I18n</a></li>
<li><a href="class-Log.html">Log</a></li>
<li><a href="class-Modele.html">Modele</a></li>
<li><a href="class-PDOStatement.html">PDOStatement</a></li>
/branches/v0.2-buhl/doc/ApiGen/source-class-Modele.html
8,7 → 8,7
<title>File Modele.php | TBFramework - v0.2</title>
 
<script type="text/javascript" src="resources/combined.js?4205936287"></script>
<script type="text/javascript" src="elementlist.js?117657638"></script>
<script type="text/javascript" src="elementlist.js?1835392179"></script>
<link rel="stylesheet" type="text/css" media="all" href="resources/style.css?3505392360">
 
</head>
41,6 → 41,7
<li><a href="class-Controleur.html">Controleur</a></li>
<li><a href="class-Debug.html">Debug</a></li>
<li><a href="class-GestionnaireException.html">GestionnaireException</a></li>
<li><a href="class-I18n.html">I18n</a></li>
<li><a href="class-Log.html">Log</a></li>
<li class="active"><a href="class-Modele.html">Modele</a></li>
<li><a href="class-Registre.html">Registre</a></li>
102,350 → 103,345
<pre><code><span id="1" class="l"><a class="l" href="#1"> 1: </a><span class="xlang">&lt;?php</span>
</span><span id="2" class="l"><a class="l" href="#2"> 2: </a><span class="php-comment">// declare(encoding='UTF-8');</span>
</span><span id="3" class="l"><a class="l" href="#3"> 3: </a><span class="php-comment">/**
</span></span><span id="4" class="l"><a class="l" href="#4"> 4: </a><span class="php-comment">* Classe modèle, donc d'accés au données, elle ne devrait pas être appelée de l'extérieur.
</span></span><span id="5" class="l"><a class="l" href="#5"> 5: </a><span class="php-comment">* Elle fait office d'abstraction légère de base de données en utilisant diveres possibilités
</span></span><span id="6" class="l"><a class="l" href="#6"> 6: </a><span class="php-comment">* d'abstraction de base de données (PDO, mysql, mysqli, sqlite)
</span></span><span id="7" class="l"><a class="l" href="#7"> 7: </a><span class="php-comment">* Elle est abstraite donc doit obligatoirement être étendue.
</span></span><span id="8" class="l"><a class="l" href="#8"> 8: </a><span class="php-comment">*
</span></span><span id="9" class="l"><a class="l" href="#9"> 9: </a><span class="php-comment">* PHP Version 5
</span></span><span id="10" class="l"><a class="l" href="#10"> 10: </a><span class="php-comment">*
</span></span><span id="11" class="l"><a class="l" href="#11"> 11: </a><span class="php-comment">* @category Class
</span></span><span id="12" class="l"><a class="l" href="#12"> 12: </a><span class="php-comment">* @package Framework
</span></span><span id="13" class="l"><a class="l" href="#13"> 13: </a><span class="php-comment">* @author aurelien &lt;aurelien@tela-botanica.org&gt;
</span></span><span id="14" class="l"><a class="l" href="#14"> 14: </a><span class="php-comment">* @copyright 2009 Tela-Botanica
</span></span><span id="15" class="l"><a class="l" href="#15"> 15: </a><span class="php-comment">* @license http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
</span></span><span id="16" class="l"><a class="l" href="#16"> 16: </a><span class="php-comment">* @license http://www.gnu.org/licenses/gpl.html Licence GNU-GPL
</span></span><span id="17" class="l"><a class="l" href="#17"> 17: </a><span class="php-comment">* @version SVN: $$Id: Modele.php 426 2013-04-30 16:58:14Z jpm $$
</span></span><span id="18" class="l"><a class="l" href="#18"> 18: </a><span class="php-comment">* @link /doc/framework/
</span></span><span id="19" class="l"><a class="l" href="#19"> 19: </a><span class="php-comment">*
</span></span><span id="20" class="l"><a class="l" href="#20"> 20: </a><span class="php-comment">*/</span>
</span><span id="21" class="l"><a class="l" href="#21"> 21: </a><span class="php-keyword1">abstract</span> <span class="php-keyword1">class</span> <a id="Modele" href="#Modele">Modele</a> {
</span><span id="22" class="l"><a class="l" href="#22"> 22: </a>
</span><span id="23" class="l"><a class="l" href="#23"> 23: </a> <span class="php-comment">/**
</span></span><span id="24" class="l"><a class="l" href="#24"> 24: </a><span class="php-comment"> * Mode de fetch associatif
</span></span><span id="25" class="l"><a class="l" href="#25"> 25: </a><span class="php-comment"> */</span>
</span><span id="26" class="l"><a class="l" href="#26"> 26: </a> <span class="php-keyword1">private</span> <span class="php-var"><a id="$ASSOC" href="#$ASSOC">$ASSOC</a></span> = <span class="php-quote">''</span>;
</span></span><span id="4" class="l"><a class="l" href="#4"> 4: </a><span class="php-comment"> * Classe modèle, donc d'accés au données, elle ne devrait pas être appelée de l'extérieur.
</span></span><span id="5" class="l"><a class="l" href="#5"> 5: </a><span class="php-comment"> * Elle fait office d'abstraction légère de base de données en utilisant diveres possibilités
</span></span><span id="6" class="l"><a class="l" href="#6"> 6: </a><span class="php-comment"> * d'abstraction de base de données (PDO, mysql, mysqli, sqlite)
</span></span><span id="7" class="l"><a class="l" href="#7"> 7: </a><span class="php-comment"> * Elle est abstraite donc doit obligatoirement être étendue.
</span></span><span id="8" class="l"><a class="l" href="#8"> 8: </a><span class="php-comment"> *
</span></span><span id="9" class="l"><a class="l" href="#9"> 9: </a><span class="php-comment"> * @category PHP 5.2
</span></span><span id="10" class="l"><a class="l" href="#10"> 10: </a><span class="php-comment"> * @package Framework
</span></span><span id="11" class="l"><a class="l" href="#11"> 11: </a><span class="php-comment"> * @author Aurélien PERONNET &lt;aurelien@tela-botanica.org&gt;
</span></span><span id="12" class="l"><a class="l" href="#12"> 12: </a><span class="php-comment"> * @copyright Copyright (c) 2009, Tela Botanica (accueil@tela-botanica.org)
</span></span><span id="13" class="l"><a class="l" href="#13"> 13: </a><span class="php-comment"> * @license GNU-GPL-v3 &lt;http://www.gnu.org/licenses/gpl.html&gt;
</span></span><span id="14" class="l"><a class="l" href="#14"> 14: </a><span class="php-comment"> * @license CECILL-v2 &lt;http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt&gt;
</span></span><span id="15" class="l"><a class="l" href="#15"> 15: </a><span class="php-comment"> */</span>
</span><span id="16" class="l"><a class="l" href="#16"> 16: </a><span class="php-keyword1">abstract</span> <span class="php-keyword1">class</span> <a id="Modele" href="#Modele">Modele</a> {
</span><span id="17" class="l"><a class="l" href="#17"> 17: </a>
</span><span id="18" class="l"><a class="l" href="#18"> 18: </a> <span class="php-comment">/**
</span></span><span id="19" class="l"><a class="l" href="#19"> 19: </a><span class="php-comment"> * Mode de fetch associatif
</span></span><span id="20" class="l"><a class="l" href="#20"> 20: </a><span class="php-comment"> */</span>
</span><span id="21" class="l"><a class="l" href="#21"> 21: </a> <span class="php-keyword1">private</span> <span class="php-var"><a id="$ASSOC" href="#$ASSOC">$ASSOC</a></span> = <span class="php-quote">''</span>;
</span><span id="22" class="l"><a class="l" href="#22"> 22: </a> <span class="php-comment">/**
</span></span><span id="23" class="l"><a class="l" href="#23"> 23: </a><span class="php-comment"> * Mode de fetch objet
</span></span><span id="24" class="l"><a class="l" href="#24"> 24: </a><span class="php-comment"> */</span>
</span><span id="25" class="l"><a class="l" href="#25"> 25: </a> <span class="php-keyword1">private</span> <span class="php-var"><a id="$OBJECT" href="#$OBJECT">$OBJECT</a></span> = <span class="php-quote">''</span>;
</span><span id="26" class="l"><a class="l" href="#26"> 26: </a>
</span><span id="27" class="l"><a class="l" href="#27"> 27: </a> <span class="php-comment">/**
</span></span><span id="28" class="l"><a class="l" href="#28"> 28: </a><span class="php-comment"> * Mode de fetch objet
</span></span><span id="28" class="l"><a class="l" href="#28"> 28: </a><span class="php-comment"> * abstraction de base de données utilisée
</span></span><span id="29" class="l"><a class="l" href="#29"> 29: </a><span class="php-comment"> */</span>
</span><span id="30" class="l"><a class="l" href="#30"> 30: </a> <span class="php-keyword1">private</span> <span class="php-var"><a id="$OBJECT" href="#$OBJECT">$OBJECT</a></span> = <span class="php-quote">''</span>;
</span><span id="31" class="l"><a class="l" href="#31"> 31: </a>
</span><span id="32" class="l"><a class="l" href="#32"> 32: </a> <span class="php-comment">/**
</span></span><span id="33" class="l"><a class="l" href="#33"> 33: </a><span class="php-comment"> * abstraction de base de données utilisée
</span></span><span id="34" class="l"><a class="l" href="#34"> 34: </a><span class="php-comment"> */</span>
</span><span id="35" class="l"><a class="l" href="#35"> 35: </a> <span class="php-keyword1">private</span> <span class="php-var"><a id="$abstraction" href="#$abstraction">$abstraction</a></span>;
</span><span id="36" class="l"><a class="l" href="#36"> 36: </a> <span class="php-comment">/**
</span></span><span id="37" class="l"><a class="l" href="#37"> 37: </a><span class="php-comment"> * registre global
</span></span><span id="38" class="l"><a class="l" href="#38"> 38: </a><span class="php-comment"> */</span>
</span><span id="39" class="l"><a class="l" href="#39"> 39: </a> <span class="php-keyword1">private</span> <span class="php-var"><a id="$registre" href="#$registre">$registre</a></span>;
</span><span id="40" class="l"><a class="l" href="#40"> 40: </a> <span class="php-comment">/**
</span></span><span id="41" class="l"><a class="l" href="#41"> 41: </a><span class="php-comment"> * DSN pour accéder à la base de données
</span></span><span id="42" class="l"><a class="l" href="#42"> 42: </a><span class="php-comment"> */</span>
</span><span id="43" class="l"><a class="l" href="#43"> 43: </a> <span class="php-keyword1">private</span> <span class="php-var"><a id="$dsn" href="#$dsn">$dsn</a></span>;
</span><span id="44" class="l"><a class="l" href="#44"> 44: </a> <span class="php-comment">/**
</span></span><span id="45" class="l"><a class="l" href="#45"> 45: </a><span class="php-comment"> * Type de base de données (mysql, mysqli, etc ...)
</span></span><span id="46" class="l"><a class="l" href="#46"> 46: </a><span class="php-comment"> */</span>
</span><span id="47" class="l"><a class="l" href="#47"> 47: </a> <span class="php-keyword1">private</span> <span class="php-var"><a id="$type" href="#$type">$type</a></span>;
</span><span id="48" class="l"><a class="l" href="#48"> 48: </a> <span class="php-comment">/**
</span></span><span id="49" class="l"><a class="l" href="#49"> 49: </a><span class="php-comment"> * Hote herbergeant la base de données
</span></span><span id="50" class="l"><a class="l" href="#50"> 50: </a><span class="php-comment"> */</span>
</span><span id="51" class="l"><a class="l" href="#51"> 51: </a> <span class="php-keyword1">private</span> <span class="php-var"><a id="$hote" href="#$hote">$hote</a></span>;
</span><span id="52" class="l"><a class="l" href="#52"> 52: </a> <span class="php-comment">/**
</span></span><span id="53" class="l"><a class="l" href="#53"> 53: </a><span class="php-comment"> * Nom de la base de données à laquelle le modèle doit se connecter
</span></span><span id="54" class="l"><a class="l" href="#54"> 54: </a><span class="php-comment"> */</span>
</span><span id="55" class="l"><a class="l" href="#55"> 55: </a> <span class="php-keyword1">private</span> <span class="php-var"><a id="$bdd_nom" href="#$bdd_nom">$bdd_nom</a></span>;
</span><span id="56" class="l"><a class="l" href="#56"> 56: </a> <span class="php-comment">/**
</span></span><span id="57" class="l"><a class="l" href="#57"> 57: </a><span class="php-comment"> * Nom d'utilisateur
</span></span><span id="58" class="l"><a class="l" href="#58"> 58: </a><span class="php-comment"> */</span>
</span><span id="59" class="l"><a class="l" href="#59"> 59: </a> <span class="php-keyword1">private</span> <span class="php-var"><a id="$utilisateur" href="#$utilisateur">$utilisateur</a></span>;
</span><span id="30" class="l"><a class="l" href="#30"> 30: </a> <span class="php-keyword1">private</span> <span class="php-var"><a id="$abstraction" href="#$abstraction">$abstraction</a></span>;
</span><span id="31" class="l"><a class="l" href="#31"> 31: </a> <span class="php-comment">/**
</span></span><span id="32" class="l"><a class="l" href="#32"> 32: </a><span class="php-comment"> * registre global
</span></span><span id="33" class="l"><a class="l" href="#33"> 33: </a><span class="php-comment"> */</span>
</span><span id="34" class="l"><a class="l" href="#34"> 34: </a> <span class="php-keyword1">private</span> <span class="php-var"><a id="$registre" href="#$registre">$registre</a></span>;
</span><span id="35" class="l"><a class="l" href="#35"> 35: </a> <span class="php-comment">/**
</span></span><span id="36" class="l"><a class="l" href="#36"> 36: </a><span class="php-comment"> * DSN pour accéder à la base de données
</span></span><span id="37" class="l"><a class="l" href="#37"> 37: </a><span class="php-comment"> */</span>
</span><span id="38" class="l"><a class="l" href="#38"> 38: </a> <span class="php-keyword1">private</span> <span class="php-var"><a id="$dsn" href="#$dsn">$dsn</a></span>;
</span><span id="39" class="l"><a class="l" href="#39"> 39: </a> <span class="php-comment">/**
</span></span><span id="40" class="l"><a class="l" href="#40"> 40: </a><span class="php-comment"> * Type de base de données (mysql, mysqli, etc ...)
</span></span><span id="41" class="l"><a class="l" href="#41"> 41: </a><span class="php-comment"> */</span>
</span><span id="42" class="l"><a class="l" href="#42"> 42: </a> <span class="php-keyword1">private</span> <span class="php-var"><a id="$type" href="#$type">$type</a></span>;
</span><span id="43" class="l"><a class="l" href="#43"> 43: </a> <span class="php-comment">/**
</span></span><span id="44" class="l"><a class="l" href="#44"> 44: </a><span class="php-comment"> * Hote herbergeant la base de données
</span></span><span id="45" class="l"><a class="l" href="#45"> 45: </a><span class="php-comment"> */</span>
</span><span id="46" class="l"><a class="l" href="#46"> 46: </a> <span class="php-keyword1">private</span> <span class="php-var"><a id="$hote" href="#$hote">$hote</a></span>;
</span><span id="47" class="l"><a class="l" href="#47"> 47: </a> <span class="php-comment">/**
</span></span><span id="48" class="l"><a class="l" href="#48"> 48: </a><span class="php-comment"> * Nom de la base de données à laquelle le modèle doit se connecter
</span></span><span id="49" class="l"><a class="l" href="#49"> 49: </a><span class="php-comment"> */</span>
</span><span id="50" class="l"><a class="l" href="#50"> 50: </a> <span class="php-keyword1">private</span> <span class="php-var"><a id="$bdd_nom" href="#$bdd_nom">$bdd_nom</a></span>;
</span><span id="51" class="l"><a class="l" href="#51"> 51: </a> <span class="php-comment">/**
</span></span><span id="52" class="l"><a class="l" href="#52"> 52: </a><span class="php-comment"> * Nom d'utilisateur
</span></span><span id="53" class="l"><a class="l" href="#53"> 53: </a><span class="php-comment"> */</span>
</span><span id="54" class="l"><a class="l" href="#54"> 54: </a> <span class="php-keyword1">private</span> <span class="php-var"><a id="$utilisateur" href="#$utilisateur">$utilisateur</a></span>;
</span><span id="55" class="l"><a class="l" href="#55"> 55: </a> <span class="php-comment">/**
</span></span><span id="56" class="l"><a class="l" href="#56"> 56: </a><span class="php-comment"> * Mot de passe
</span></span><span id="57" class="l"><a class="l" href="#57"> 57: </a><span class="php-comment"> */</span>
</span><span id="58" class="l"><a class="l" href="#58"> 58: </a> <span class="php-keyword1">private</span> <span class="php-var"><a id="$pass" href="#$pass">$pass</a></span>;
</span><span id="59" class="l"><a class="l" href="#59"> 59: </a>
</span><span id="60" class="l"><a class="l" href="#60"> 60: </a> <span class="php-comment">/**
</span></span><span id="61" class="l"><a class="l" href="#61"> 61: </a><span class="php-comment"> * Mot de passe
</span></span><span id="61" class="l"><a class="l" href="#61"> 61: </a><span class="php-comment"> * Encodage de la base de données
</span></span><span id="62" class="l"><a class="l" href="#62"> 62: </a><span class="php-comment"> */</span>
</span><span id="63" class="l"><a class="l" href="#63"> 63: </a> <span class="php-keyword1">private</span> <span class="php-var"><a id="$pass" href="#$pass">$pass</a></span>;
</span><span id="64" class="l"><a class="l" href="#64"> 64: </a>
</span><span id="65" class="l"><a class="l" href="#65"> 65: </a> <span class="php-comment">/**
</span></span><span id="66" class="l"><a class="l" href="#66"> 66: </a><span class="php-comment"> * Encodage de la base de données
</span></span><span id="67" class="l"><a class="l" href="#67"> 67: </a><span class="php-comment"> */</span>
</span><span id="68" class="l"><a class="l" href="#68"> 68: </a> <span class="php-keyword1">private</span> <span class="php-var"><a id="$encodage" href="#$encodage">$encodage</a></span> = <span class="php-keyword1">null</span>;
</span><span id="63" class="l"><a class="l" href="#63"> 63: </a> <span class="php-keyword1">private</span> <span class="php-var"><a id="$encodage" href="#$encodage">$encodage</a></span> = <span class="php-keyword1">null</span>;
</span><span id="64" class="l"><a class="l" href="#64"> 64: </a> <span class="php-comment">/**
</span></span><span id="65" class="l"><a class="l" href="#65"> 65: </a><span class="php-comment"> * Connexion à la base de données
</span></span><span id="66" class="l"><a class="l" href="#66"> 66: </a><span class="php-comment"> */</span>
</span><span id="67" class="l"><a class="l" href="#67"> 67: </a> <span class="php-keyword1">private</span> <span class="php-var"><a id="$connexion" href="#$connexion">$connexion</a></span> = <span class="php-keyword1">null</span>;
</span><span id="68" class="l"><a class="l" href="#68"> 68: </a>
</span><span id="69" class="l"><a class="l" href="#69"> 69: </a> <span class="php-comment">/**
</span></span><span id="70" class="l"><a class="l" href="#70"> 70: </a><span class="php-comment"> * Connexion à la base de données
</span></span><span id="70" class="l"><a class="l" href="#70"> 70: </a><span class="php-comment"> * Constructeur par défaut, appelé à l'initialisation.
</span></span><span id="71" class="l"><a class="l" href="#71"> 71: </a><span class="php-comment"> */</span>
</span><span id="72" class="l"><a class="l" href="#72"> 72: </a> <span class="php-keyword1">private</span> <span class="php-var"><a id="$connexion" href="#$connexion">$connexion</a></span> = <span class="php-keyword1">null</span>;
</span><span id="73" class="l"><a class="l" href="#73"> 73: </a>
</span><span id="74" class="l"><a class="l" href="#74"> 74: </a> <span class="php-comment">/**
</span></span><span id="75" class="l"><a class="l" href="#75"> 75: </a><span class="php-comment"> * Constructeur par défaut, appelé à l'initialisation.
</span></span><span id="76" class="l"><a class="l" href="#76"> 76: </a><span class="php-comment"> */</span>
</span><span id="77" class="l"><a class="l" href="#77"> 77: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="___construct" href="#___construct">__construct</a>() {
</span><span id="78" class="l"><a class="l" href="#78"> 78: </a> <span class="php-comment">// les différents paramètres nécessaires sont lus à partir du registre</span>
</span><span id="79" class="l"><a class="l" href="#79"> 79: </a> <span class="php-var">$this</span>-&gt;registre = Registre::getInstance();
</span><span id="80" class="l"><a class="l" href="#80"> 80: </a> <span class="php-var">$this</span>-&gt;abstraction = <span class="php-keyword2">strtolower</span>(Config::get(<span class="php-quote">'bdd_abstraction'</span>));
</span><span id="81" class="l"><a class="l" href="#81"> 81: </a> <span class="php-var">$this</span>-&gt;type = Config::get(<span class="php-quote">'bdd_protocole'</span>);
</span><span id="82" class="l"><a class="l" href="#82"> 82: </a> <span class="php-var">$this</span>-&gt;hote = Config::get(<span class="php-quote">'bdd_serveur'</span>);
</span><span id="83" class="l"><a class="l" href="#83"> 83: </a> <span class="php-var">$this</span>-&gt;bdd_nom = Config::get(<span class="php-quote">'bdd_nom'</span>);
</span><span id="84" class="l"><a class="l" href="#84"> 84: </a> <span class="php-var">$this</span>-&gt;utilisateur = Config::get(<span class="php-quote">'bdd_utilisateur'</span>);
</span><span id="85" class="l"><a class="l" href="#85"> 85: </a> <span class="php-var">$this</span>-&gt;pass = Config::get(<span class="php-quote">'bdd_mot_de_passe'</span>);
</span><span id="86" class="l"><a class="l" href="#86"> 86: </a> <span class="php-var">$this</span>-&gt;encodage = Config::get(<span class="php-quote">'bdd_encodage'</span>);
</span><span id="87" class="l"><a class="l" href="#87"> 87: </a>
</span><span id="88" class="l"><a class="l" href="#88"> 88: </a> <span class="php-var">$this</span>-&gt;dsn = <span class="php-var">$this</span>-&gt;type.<span class="php-quote">':dbname='</span>.<span class="php-var">$this</span>-&gt;bdd_nom.<span class="php-quote">';host='</span>.<span class="php-var">$this</span>-&gt;hote;
</span><span id="89" class="l"><a class="l" href="#89"> 89: </a> <span class="php-var">$this</span>-&gt;initialiserProtocole();
</span><span id="90" class="l"><a class="l" href="#90"> 90: </a> }
</span><span id="91" class="l"><a class="l" href="#91"> 91: </a>
</span><span id="92" class="l"><a class="l" href="#92"> 92: </a> <span class="php-comment">/**
</span></span><span id="93" class="l"><a class="l" href="#93"> 93: </a><span class="php-comment"> * Connection à la base de données en utilisant les informations fournies par
</span></span><span id="94" class="l"><a class="l" href="#94"> 94: </a><span class="php-comment"> * le fichier de configuration.
</span></span><span id="95" class="l"><a class="l" href="#95"> 95: </a><span class="php-comment"> * private et final car n'a pas vocation a être appelée par l'utilisateur.
</span></span><span id="96" class="l"><a class="l" href="#96"> 96: </a><span class="php-comment"> *
</span></span><span id="97" class="l"><a class="l" href="#97"> 97: </a><span class="php-comment"> * @throws Exception une exception dans le cas ou là connexion échoue
</span></span><span id="98" class="l"><a class="l" href="#98"> 98: </a><span class="php-comment"> */</span>
</span><span id="99" class="l"><a class="l" href="#99"> 99: </a> <span class="php-keyword1">final</span> <span class="php-keyword1">private</span> <span class="php-keyword1">function</span> <a id="_connecter" href="#_connecter">connecter</a>() {
</span><span id="100" class="l"><a class="l" href="#100">100: </a> <span class="php-keyword1">switch</span> (<span class="php-var">$this</span>-&gt;abstraction) {
</span><span id="101" class="l"><a class="l" href="#101">101: </a> <span class="php-keyword1">case</span> <span class="php-quote">'pdo'</span>:
</span><span id="102" class="l"><a class="l" href="#102">102: </a> <span class="php-keyword1">try</span> {
</span><span id="103" class="l"><a class="l" href="#103">103: </a> <span class="php-var">$this</span>-&gt;connexion = <span class="php-keyword1">new</span> PDO(<span class="php-var">$this</span>-&gt;dsn, <span class="php-var">$this</span>-&gt;utilisateur, <span class="php-var">$this</span>-&gt;pass);
</span><span id="104" class="l"><a class="l" href="#104">104: </a> <span class="php-var">$this</span>-&gt;connexion-&gt;setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
</span><span id="105" class="l"><a class="l" href="#105">105: </a> } <span class="php-keyword1">catch</span> (PDOException <span class="php-var">$e</span>) {
</span><span id="106" class="l"><a class="l" href="#106">106: </a> <span class="php-keyword1">throw</span> <span class="php-keyword1">new</span> Exception(<span class="php-quote">'Erreur de connexion à la base de données : '</span>.<span class="php-var">$e</span>-&gt;getMessage());
</span><span id="107" class="l"><a class="l" href="#107">107: </a> }
</span><span id="108" class="l"><a class="l" href="#108">108: </a> <span class="php-keyword1">break</span>;
</span><span id="109" class="l"><a class="l" href="#109">109: </a>
</span><span id="110" class="l"><a class="l" href="#110">110: </a> <span class="php-keyword1">case</span> <span class="php-quote">'mysql'</span>:
</span><span id="111" class="l"><a class="l" href="#111">111: </a> <span class="php-var">$this</span>-&gt;connexion = <span class="php-keyword2">mysql_connect</span>(<span class="php-var">$this</span>-&gt;hote,<span class="php-var">$this</span>-&gt;utilisateur,<span class="php-var">$this</span>-&gt;pass);
</span><span id="112" class="l"><a class="l" href="#112">112: </a> <span class="php-keyword1">if</span> (<span class="php-var">$this</span>-&gt;connexion != <span class="php-keyword1">null</span>) {
</span><span id="113" class="l"><a class="l" href="#113">113: </a> <span class="php-keyword2">mysql_select_db</span>(<span class="php-var">$this</span>-&gt;bdd_nom, <span class="php-var">$this</span>-&gt;connexion);
</span><span id="114" class="l"><a class="l" href="#114">114: </a> } <span class="php-keyword1">else</span> {
</span><span id="115" class="l"><a class="l" href="#115">115: </a> <span class="php-keyword1">throw</span> <span class="php-keyword1">new</span> Exception(<span class="php-quote">'Erreur de connexion à la base de données, vérifiez les paramètres du fichier de configuration'</span>);
</span><span id="116" class="l"><a class="l" href="#116">116: </a> }
</span><span id="117" class="l"><a class="l" href="#117">117: </a> <span class="php-keyword1">break</span>;
</span><span id="118" class="l"><a class="l" href="#118">118: </a>
</span><span id="119" class="l"><a class="l" href="#119">119: </a> <span class="php-keyword1">case</span> <span class="php-quote">'mysqli'</span>:
</span><span id="120" class="l"><a class="l" href="#120">120: </a> <span class="php-var">$this</span>-&gt;connexion = <span class="php-keyword1">new</span> mysqli(<span class="php-var">$this</span>-&gt;hote,<span class="php-var">$this</span>-&gt;utilisateur,<span class="php-var">$this</span>-&gt;pass, <span class="php-var">$this</span>-&gt;bdd_nom);
</span><span id="121" class="l"><a class="l" href="#121">121: </a> <span class="php-keyword1">if</span> (!<span class="php-var">$this</span>-&gt;connexion) {
</span><span id="122" class="l"><a class="l" href="#122">122: </a> <span class="php-keyword1">throw</span> <span class="php-keyword1">new</span> Exception(<span class="php-quote">'Erreur de connexion à la base de données, vérifiez les paramètres du fichier de configuration'</span>);
</span><span id="123" class="l"><a class="l" href="#123">123: </a> <span class="php-keyword1">return</span>;
</span><span id="124" class="l"><a class="l" href="#124">124: </a> }
</span><span id="125" class="l"><a class="l" href="#125">125: </a> <span class="php-keyword1">break</span>;
</span><span id="126" class="l"><a class="l" href="#126">126: </a>
</span><span id="127" class="l"><a class="l" href="#127">127: </a> <span class="php-keyword1">case</span> <span class="php-quote">'sqlite3'</span>:
</span><span id="128" class="l"><a class="l" href="#128">128: </a> <span class="php-comment">// cas particulier de sqllite, on considère que le nom de la base de données correspond au fichier à ouvrir</span>
</span><span id="129" class="l"><a class="l" href="#129">129: </a> <span class="php-var">$this</span>-&gt;connexion = <span class="php-keyword1">new</span> SQLite3(<span class="php-var">$this</span>-&gt;bdd_nom);
</span><span id="130" class="l"><a class="l" href="#130">130: </a> <span class="php-keyword1">if</span> (!<span class="php-var">$this</span>-&gt;connexion) {
</span><span id="131" class="l"><a class="l" href="#131">131: </a> <span class="php-keyword1">throw</span> <span class="php-keyword1">new</span> Exception(<span class="php-quote">'Erreur de connexion à la base de données, vérifiez les paramètres du fichier de configuration'</span>);
</span><span id="132" class="l"><a class="l" href="#132">132: </a> <span class="php-keyword1">return</span>;
</span><span id="133" class="l"><a class="l" href="#133">133: </a> }
</span><span id="134" class="l"><a class="l" href="#134">134: </a> <span class="php-keyword1">break</span>;
</span><span id="135" class="l"><a class="l" href="#135">135: </a>
</span><span id="136" class="l"><a class="l" href="#136">136: </a> <span class="php-keyword1">default</span>:
</span><span id="137" class="l"><a class="l" href="#137">137: </a> <span class="php-var">$this</span>-&gt;connexion = <span class="php-keyword1">null</span>;
</span><span id="138" class="l"><a class="l" href="#138">138: </a> }
</span><span id="72" class="l"><a class="l" href="#72"> 72: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="___construct" href="#___construct">__construct</a>() {
</span><span id="73" class="l"><a class="l" href="#73"> 73: </a> <span class="php-comment">// les différents paramètres nécessaires sont lus à partir du registre</span>
</span><span id="74" class="l"><a class="l" href="#74"> 74: </a> <span class="php-var">$this</span>-&gt;registre = Registre::getInstance();
</span><span id="75" class="l"><a class="l" href="#75"> 75: </a> <span class="php-var">$this</span>-&gt;abstraction = <span class="php-keyword2">strtolower</span>(Config::get(<span class="php-quote">'bdd_abstraction'</span>));
</span><span id="76" class="l"><a class="l" href="#76"> 76: </a> <span class="php-var">$this</span>-&gt;type = Config::get(<span class="php-quote">'bdd_protocole'</span>);
</span><span id="77" class="l"><a class="l" href="#77"> 77: </a> <span class="php-var">$this</span>-&gt;hote = Config::get(<span class="php-quote">'bdd_serveur'</span>);
</span><span id="78" class="l"><a class="l" href="#78"> 78: </a> <span class="php-var">$this</span>-&gt;bdd_nom = Config::get(<span class="php-quote">'bdd_nom'</span>);
</span><span id="79" class="l"><a class="l" href="#79"> 79: </a> <span class="php-var">$this</span>-&gt;utilisateur = Config::get(<span class="php-quote">'bdd_utilisateur'</span>);
</span><span id="80" class="l"><a class="l" href="#80"> 80: </a> <span class="php-var">$this</span>-&gt;pass = Config::get(<span class="php-quote">'bdd_mot_de_passe'</span>);
</span><span id="81" class="l"><a class="l" href="#81"> 81: </a> <span class="php-var">$this</span>-&gt;encodage = Config::get(<span class="php-quote">'bdd_encodage'</span>);
</span><span id="82" class="l"><a class="l" href="#82"> 82: </a>
</span><span id="83" class="l"><a class="l" href="#83"> 83: </a> <span class="php-var">$this</span>-&gt;dsn = <span class="php-var">$this</span>-&gt;type.<span class="php-quote">':dbname='</span>.<span class="php-var">$this</span>-&gt;bdd_nom.<span class="php-quote">';host='</span>.<span class="php-var">$this</span>-&gt;hote;
</span><span id="84" class="l"><a class="l" href="#84"> 84: </a> <span class="php-var">$this</span>-&gt;initialiserProtocole();
</span><span id="85" class="l"><a class="l" href="#85"> 85: </a> }
</span><span id="86" class="l"><a class="l" href="#86"> 86: </a>
</span><span id="87" class="l"><a class="l" href="#87"> 87: </a> <span class="php-comment">/**
</span></span><span id="88" class="l"><a class="l" href="#88"> 88: </a><span class="php-comment"> * Connection à la base de données en utilisant les informations fournies par
</span></span><span id="89" class="l"><a class="l" href="#89"> 89: </a><span class="php-comment"> * le fichier de configuration.
</span></span><span id="90" class="l"><a class="l" href="#90"> 90: </a><span class="php-comment"> * private et final car n'a pas vocation a être appelée par l'utilisateur.
</span></span><span id="91" class="l"><a class="l" href="#91"> 91: </a><span class="php-comment"> *
</span></span><span id="92" class="l"><a class="l" href="#92"> 92: </a><span class="php-comment"> * @throws Exception une exception dans le cas ou là connexion échoue
</span></span><span id="93" class="l"><a class="l" href="#93"> 93: </a><span class="php-comment"> */</span>
</span><span id="94" class="l"><a class="l" href="#94"> 94: </a> <span class="php-keyword1">final</span> <span class="php-keyword1">private</span> <span class="php-keyword1">function</span> <a id="_connecter" href="#_connecter">connecter</a>() {
</span><span id="95" class="l"><a class="l" href="#95"> 95: </a> <span class="php-keyword1">switch</span> (<span class="php-var">$this</span>-&gt;abstraction) {
</span><span id="96" class="l"><a class="l" href="#96"> 96: </a> <span class="php-keyword1">case</span> <span class="php-quote">'pdo'</span>:
</span><span id="97" class="l"><a class="l" href="#97"> 97: </a> <span class="php-keyword1">try</span> {
</span><span id="98" class="l"><a class="l" href="#98"> 98: </a> <span class="php-var">$this</span>-&gt;connexion = <span class="php-keyword1">new</span> PDO(<span class="php-var">$this</span>-&gt;dsn, <span class="php-var">$this</span>-&gt;utilisateur, <span class="php-var">$this</span>-&gt;pass);
</span><span id="99" class="l"><a class="l" href="#99"> 99: </a> <span class="php-var">$this</span>-&gt;connexion-&gt;setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
</span><span id="100" class="l"><a class="l" href="#100">100: </a> } <span class="php-keyword1">catch</span> (PDOException <span class="php-var">$e</span>) {
</span><span id="101" class="l"><a class="l" href="#101">101: </a> <span class="php-keyword1">throw</span> <span class="php-keyword1">new</span> Exception(<span class="php-quote">'Erreur de connexion à la base de données : '</span>.<span class="php-var">$e</span>-&gt;getMessage());
</span><span id="102" class="l"><a class="l" href="#102">102: </a> }
</span><span id="103" class="l"><a class="l" href="#103">103: </a> <span class="php-keyword1">break</span>;
</span><span id="104" class="l"><a class="l" href="#104">104: </a>
</span><span id="105" class="l"><a class="l" href="#105">105: </a> <span class="php-keyword1">case</span> <span class="php-quote">'mysql'</span>:
</span><span id="106" class="l"><a class="l" href="#106">106: </a> <span class="php-var">$this</span>-&gt;connexion = <span class="php-keyword2">mysql_connect</span>(<span class="php-var">$this</span>-&gt;hote,<span class="php-var">$this</span>-&gt;utilisateur,<span class="php-var">$this</span>-&gt;pass);
</span><span id="107" class="l"><a class="l" href="#107">107: </a> <span class="php-keyword1">if</span> (<span class="php-var">$this</span>-&gt;connexion != <span class="php-keyword1">null</span>) {
</span><span id="108" class="l"><a class="l" href="#108">108: </a> <span class="php-keyword2">mysql_select_db</span>(<span class="php-var">$this</span>-&gt;bdd_nom, <span class="php-var">$this</span>-&gt;connexion);
</span><span id="109" class="l"><a class="l" href="#109">109: </a> } <span class="php-keyword1">else</span> {
</span><span id="110" class="l"><a class="l" href="#110">110: </a> <span class="php-keyword1">throw</span> <span class="php-keyword1">new</span> Exception(<span class="php-quote">'Erreur de connexion à la base de données, vérifiez les paramètres du fichier de configuration'</span>);
</span><span id="111" class="l"><a class="l" href="#111">111: </a> }
</span><span id="112" class="l"><a class="l" href="#112">112: </a> <span class="php-keyword1">break</span>;
</span><span id="113" class="l"><a class="l" href="#113">113: </a>
</span><span id="114" class="l"><a class="l" href="#114">114: </a> <span class="php-keyword1">case</span> <span class="php-quote">'mysqli'</span>:
</span><span id="115" class="l"><a class="l" href="#115">115: </a> <span class="php-var">$this</span>-&gt;connexion = <span class="php-keyword1">new</span> mysqli(<span class="php-var">$this</span>-&gt;hote,<span class="php-var">$this</span>-&gt;utilisateur,<span class="php-var">$this</span>-&gt;pass, <span class="php-var">$this</span>-&gt;bdd_nom);
</span><span id="116" class="l"><a class="l" href="#116">116: </a> <span class="php-keyword1">if</span> (!<span class="php-var">$this</span>-&gt;connexion) {
</span><span id="117" class="l"><a class="l" href="#117">117: </a> <span class="php-keyword1">throw</span> <span class="php-keyword1">new</span> Exception(<span class="php-quote">'Erreur de connexion à la base de données, vérifiez les paramètres du fichier de configuration'</span>);
</span><span id="118" class="l"><a class="l" href="#118">118: </a> <span class="php-keyword1">return</span>;
</span><span id="119" class="l"><a class="l" href="#119">119: </a> }
</span><span id="120" class="l"><a class="l" href="#120">120: </a> <span class="php-keyword1">break</span>;
</span><span id="121" class="l"><a class="l" href="#121">121: </a>
</span><span id="122" class="l"><a class="l" href="#122">122: </a> <span class="php-keyword1">case</span> <span class="php-quote">'sqlite3'</span>:
</span><span id="123" class="l"><a class="l" href="#123">123: </a> <span class="php-comment">// cas particulier de sqllite, on considère que le nom de la base de données correspond au fichier à ouvrir</span>
</span><span id="124" class="l"><a class="l" href="#124">124: </a> <span class="php-var">$this</span>-&gt;connexion = <span class="php-keyword1">new</span> SQLite3(<span class="php-var">$this</span>-&gt;bdd_nom);
</span><span id="125" class="l"><a class="l" href="#125">125: </a> <span class="php-keyword1">if</span> (!<span class="php-var">$this</span>-&gt;connexion) {
</span><span id="126" class="l"><a class="l" href="#126">126: </a> <span class="php-keyword1">throw</span> <span class="php-keyword1">new</span> Exception(<span class="php-quote">'Erreur de connexion à la base de données, vérifiez les paramètres du fichier de configuration'</span>);
</span><span id="127" class="l"><a class="l" href="#127">127: </a> <span class="php-keyword1">return</span>;
</span><span id="128" class="l"><a class="l" href="#128">128: </a> }
</span><span id="129" class="l"><a class="l" href="#129">129: </a> <span class="php-keyword1">break</span>;
</span><span id="130" class="l"><a class="l" href="#130">130: </a>
</span><span id="131" class="l"><a class="l" href="#131">131: </a> <span class="php-keyword1">default</span>:
</span><span id="132" class="l"><a class="l" href="#132">132: </a> <span class="php-var">$this</span>-&gt;connexion = <span class="php-keyword1">null</span>;
</span><span id="133" class="l"><a class="l" href="#133">133: </a> }
</span><span id="134" class="l"><a class="l" href="#134">134: </a>
</span><span id="135" class="l"><a class="l" href="#135">135: </a> <span class="php-keyword1">if</span> (<span class="php-var">$this</span>-&gt;encodage != <span class="php-keyword1">null</span>) {
</span><span id="136" class="l"><a class="l" href="#136">136: </a> <span class="php-var">$this</span>-&gt;requete(<span class="php-quote">&quot;SET names '&quot;</span>.<span class="php-var">$this</span>-&gt;encodage.<span class="php-quote">&quot;'&quot;</span>);
</span><span id="137" class="l"><a class="l" href="#137">137: </a> }
</span><span id="138" class="l"><a class="l" href="#138">138: </a> }
</span><span id="139" class="l"><a class="l" href="#139">139: </a>
</span><span id="140" class="l"><a class="l" href="#140">140: </a> <span class="php-keyword1">if</span> (<span class="php-var">$this</span>-&gt;encodage != <span class="php-keyword1">null</span>) {
</span><span id="141" class="l"><a class="l" href="#141">141: </a> <span class="php-var">$this</span>-&gt;requete(<span class="php-quote">&quot;SET names '&quot;</span>.<span class="php-var">$this</span>-&gt;encodage.<span class="php-quote">&quot;'&quot;</span>);
</span><span id="142" class="l"><a class="l" href="#142">142: </a> }
</span><span id="143" class="l"><a class="l" href="#143">143: </a> }
</span><span id="144" class="l"><a class="l" href="#144">144: </a>
</span><span id="145" class="l"><a class="l" href="#145">145: </a> <span class="php-comment">/**
</span></span><span id="146" class="l"><a class="l" href="#146">146: </a><span class="php-comment"> * Fonction qui appelle la bonne fonction pour executer une requête suivant le type de bdd.
</span></span><span id="147" class="l"><a class="l" href="#147">147: </a><span class="php-comment"> *
</span></span><span id="148" class="l"><a class="l" href="#148">148: </a><span class="php-comment"> * @param string la requete à effectuer
</span></span><span id="149" class="l"><a class="l" href="#149">149: </a><span class="php-comment"> * @return PDOStatement un objet contenant le résultat de la requête
</span></span><span id="150" class="l"><a class="l" href="#150">150: </a><span class="php-comment"> */</span>
</span><span id="151" class="l"><a class="l" href="#151">151: </a> <span class="php-keyword1">final</span> <span class="php-keyword1">protected</span> <span class="php-keyword1">function</span> <a id="_requete" href="#_requete">requete</a>(<span class="php-var">$requete</span>) {
</span><span id="152" class="l"><a class="l" href="#152">152: </a> <span class="php-comment">// on ne se connecte que lors du premier appel à une requete (lazy connexion)</span>
</span><span id="153" class="l"><a class="l" href="#153">153: </a> <span class="php-keyword1">if</span> (<span class="php-var">$this</span>-&gt;connexion == <span class="php-keyword1">null</span>) {
</span><span id="154" class="l"><a class="l" href="#154">154: </a> <span class="php-var">$this</span>-&gt;connecter();
</span><span id="155" class="l"><a class="l" href="#155">155: </a> }
</span><span id="156" class="l"><a class="l" href="#156">156: </a>
</span><span id="157" class="l"><a class="l" href="#157">157: </a> <span class="php-var">$retour</span> = <span class="php-keyword1">null</span>;
</span><span id="158" class="l"><a class="l" href="#158">158: </a>
</span><span id="159" class="l"><a class="l" href="#159">159: </a> <span class="php-keyword1">switch</span> (<span class="php-var">$this</span>-&gt;abstraction) {
</span><span id="160" class="l"><a class="l" href="#160">160: </a> <span class="php-keyword1">case</span> <span class="php-quote">'pdo'</span>:
</span><span id="161" class="l"><a class="l" href="#161">161: </a> <span class="php-var">$retour</span> = <span class="php-var">$this</span>-&gt;connexion-&gt;query(<span class="php-var">$requete</span>);
</span><span id="162" class="l"><a class="l" href="#162">162: </a> <span class="php-keyword1">break</span>;
</span><span id="163" class="l"><a class="l" href="#163">163: </a> <span class="php-keyword1">case</span> <span class="php-quote">'mysql'</span>:
</span><span id="164" class="l"><a class="l" href="#164">164: </a> <span class="php-var">$retour</span> = <span class="php-keyword2">mysql_query</span>(<span class="php-var">$requete</span>,<span class="php-var">$this</span>-&gt;connexion);
</span><span id="165" class="l"><a class="l" href="#165">165: </a> <span class="php-keyword1">break</span>;
</span><span id="166" class="l"><a class="l" href="#166">166: </a> <span class="php-keyword1">case</span> <span class="php-quote">'mysqli'</span>:
</span><span id="167" class="l"><a class="l" href="#167">167: </a> <span class="php-var">$retour</span> = <span class="php-var">$this</span>-&gt;connexion-&gt;query(<span class="php-var">$requete</span>);
</span><span id="168" class="l"><a class="l" href="#168">168: </a> <span class="php-keyword1">break</span>;
</span><span id="169" class="l"><a class="l" href="#169">169: </a> <span class="php-keyword1">case</span> <span class="php-quote">'sqlite3'</span>:
</span><span id="170" class="l"><a class="l" href="#170">170: </a> <span class="php-var">$retour</span> = <span class="php-var">$this</span>-&gt;connexion-&gt;<span class="php-keyword2">exec</span>(<span class="php-var">$requete</span>);
</span><span id="171" class="l"><a class="l" href="#171">171: </a> <span class="php-keyword1">break</span>;
</span><span id="172" class="l"><a class="l" href="#172">172: </a> }
</span><span id="173" class="l"><a class="l" href="#173">173: </a>
</span><span id="174" class="l"><a class="l" href="#174">174: </a> <span class="php-keyword1">return</span> <span class="php-var">$retour</span>;
</span><span id="175" class="l"><a class="l" href="#175">175: </a> }
</span><span id="176" class="l"><a class="l" href="#176">176: </a>
</span><span id="177" class="l"><a class="l" href="#177">177: </a> <span class="php-keyword1">final</span> <span class="php-keyword1">protected</span> <span class="php-keyword1">function</span> <a id="_requeteUn" href="#_requeteUn">requeteUn</a>(<span class="php-var">$requete</span>,<span class="php-var">$mode</span> = <span class="php-quote">'ASSOC'</span>) {
</span><span id="178" class="l"><a class="l" href="#178">178: </a> <span class="php-comment">// Connection seulement lors du premier appel à une requete (lazy connexion)</span>
</span><span id="179" class="l"><a class="l" href="#179">179: </a> <span class="php-keyword1">if</span> (<span class="php-var">$this</span>-&gt;connexion == <span class="php-keyword1">null</span>) {
</span><span id="180" class="l"><a class="l" href="#180">180: </a> <span class="php-var">$this</span>-&gt;connecter();
</span><span id="181" class="l"><a class="l" href="#181">181: </a> }
</span><span id="182" class="l"><a class="l" href="#182">182: </a>
</span><span id="183" class="l"><a class="l" href="#183">183: </a> <span class="php-var">$retour</span> = <span class="php-keyword1">null</span>;
</span><span id="184" class="l"><a class="l" href="#184">184: </a> <span class="php-keyword1">switch</span> (<span class="php-var">$this</span>-&gt;abstraction) {
</span><span id="185" class="l"><a class="l" href="#185">185: </a> <span class="php-keyword1">case</span> <span class="php-quote">'pdo'</span>:
</span><span id="186" class="l"><a class="l" href="#186">186: </a> <span class="php-keyword1">try</span> {
</span><span id="187" class="l"><a class="l" href="#187">187: </a> <span class="php-var">$res_req</span> = <span class="php-var">$this</span>-&gt;connexion-&gt;query(<span class="php-var">$requete</span>);
</span><span id="188" class="l"><a class="l" href="#188">188: </a> <span class="php-var">$retour</span> = (<span class="php-var">$res_req</span> !== <span class="php-keyword1">false</span>) ? <span class="php-var">$res_req</span>-&gt;fetch(<span class="php-var">$this</span>-&gt;<span class="php-var">$mode</span>) : <span class="php-var">$res_req</span>;
</span><span id="189" class="l"><a class="l" href="#189">189: </a> } <span class="php-keyword1">catch</span> (PDOException <span class="php-var">$e</span>) {
</span><span id="190" class="l"><a class="l" href="#190">190: </a> <span class="php-var">$message</span> = <span class="php-quote">'Requête echec. Fichier : &quot;%s&quot;. Ligne : &quot;%s&quot;. Message : %s'</span>;
</span><span id="191" class="l"><a class="l" href="#191">191: </a> <span class="php-keyword2">trigger_error</span>(<span class="php-keyword2">sprintf</span>(<span class="php-var">$message</span>, <span class="php-var">$e</span>-&gt;getFile(), <span class="php-var">$e</span>-&gt;getLine(), <span class="php-var">$e</span>-&gt;getMessage()), E_USER_WARNING);
</span><span id="192" class="l"><a class="l" href="#192">192: </a> }
</span><span id="140" class="l"><a class="l" href="#140">140: </a> <span class="php-comment">/**
</span></span><span id="141" class="l"><a class="l" href="#141">141: </a><span class="php-comment"> * Fonction qui appelle la bonne fonction pour executer une requête suivant le type de bdd.
</span></span><span id="142" class="l"><a class="l" href="#142">142: </a><span class="php-comment"> *
</span></span><span id="143" class="l"><a class="l" href="#143">143: </a><span class="php-comment"> * @param string la requete à effectuer
</span></span><span id="144" class="l"><a class="l" href="#144">144: </a><span class="php-comment"> * @return PDOStatement un objet contenant le résultat de la requête
</span></span><span id="145" class="l"><a class="l" href="#145">145: </a><span class="php-comment"> */</span>
</span><span id="146" class="l"><a class="l" href="#146">146: </a> <span class="php-keyword1">final</span> <span class="php-keyword1">protected</span> <span class="php-keyword1">function</span> <a id="_requete" href="#_requete">requete</a>(<span class="php-var">$requete</span>) {
</span><span id="147" class="l"><a class="l" href="#147">147: </a> <span class="php-comment">// on ne se connecte que lors du premier appel à une requete (lazy connexion)</span>
</span><span id="148" class="l"><a class="l" href="#148">148: </a> <span class="php-keyword1">if</span> (<span class="php-var">$this</span>-&gt;connexion == <span class="php-keyword1">null</span>) {
</span><span id="149" class="l"><a class="l" href="#149">149: </a> <span class="php-var">$this</span>-&gt;connecter();
</span><span id="150" class="l"><a class="l" href="#150">150: </a> }
</span><span id="151" class="l"><a class="l" href="#151">151: </a>
</span><span id="152" class="l"><a class="l" href="#152">152: </a> <span class="php-var">$retour</span> = <span class="php-keyword1">null</span>;
</span><span id="153" class="l"><a class="l" href="#153">153: </a>
</span><span id="154" class="l"><a class="l" href="#154">154: </a> <span class="php-keyword1">switch</span> (<span class="php-var">$this</span>-&gt;abstraction) {
</span><span id="155" class="l"><a class="l" href="#155">155: </a> <span class="php-keyword1">case</span> <span class="php-quote">'pdo'</span>:
</span><span id="156" class="l"><a class="l" href="#156">156: </a> <span class="php-var">$retour</span> = <span class="php-var">$this</span>-&gt;connexion-&gt;query(<span class="php-var">$requete</span>);
</span><span id="157" class="l"><a class="l" href="#157">157: </a> <span class="php-keyword1">break</span>;
</span><span id="158" class="l"><a class="l" href="#158">158: </a> <span class="php-keyword1">case</span> <span class="php-quote">'mysql'</span>:
</span><span id="159" class="l"><a class="l" href="#159">159: </a> <span class="php-var">$retour</span> = <span class="php-keyword2">mysql_query</span>(<span class="php-var">$requete</span>,<span class="php-var">$this</span>-&gt;connexion);
</span><span id="160" class="l"><a class="l" href="#160">160: </a> <span class="php-keyword1">break</span>;
</span><span id="161" class="l"><a class="l" href="#161">161: </a> <span class="php-keyword1">case</span> <span class="php-quote">'mysqli'</span>:
</span><span id="162" class="l"><a class="l" href="#162">162: </a> <span class="php-var">$retour</span> = <span class="php-var">$this</span>-&gt;connexion-&gt;query(<span class="php-var">$requete</span>);
</span><span id="163" class="l"><a class="l" href="#163">163: </a> <span class="php-keyword1">break</span>;
</span><span id="164" class="l"><a class="l" href="#164">164: </a> <span class="php-keyword1">case</span> <span class="php-quote">'sqlite3'</span>:
</span><span id="165" class="l"><a class="l" href="#165">165: </a> <span class="php-var">$retour</span> = <span class="php-var">$this</span>-&gt;connexion-&gt;<span class="php-keyword2">exec</span>(<span class="php-var">$requete</span>);
</span><span id="166" class="l"><a class="l" href="#166">166: </a> <span class="php-keyword1">break</span>;
</span><span id="167" class="l"><a class="l" href="#167">167: </a> }
</span><span id="168" class="l"><a class="l" href="#168">168: </a>
</span><span id="169" class="l"><a class="l" href="#169">169: </a> <span class="php-keyword1">return</span> <span class="php-var">$retour</span>;
</span><span id="170" class="l"><a class="l" href="#170">170: </a> }
</span><span id="171" class="l"><a class="l" href="#171">171: </a>
</span><span id="172" class="l"><a class="l" href="#172">172: </a> <span class="php-keyword1">final</span> <span class="php-keyword1">protected</span> <span class="php-keyword1">function</span> <a id="_requeteUn" href="#_requeteUn">requeteUn</a>(<span class="php-var">$requete</span>,<span class="php-var">$mode</span> = <span class="php-quote">'ASSOC'</span>) {
</span><span id="173" class="l"><a class="l" href="#173">173: </a> <span class="php-comment">// Connection seulement lors du premier appel à une requete (lazy connexion)</span>
</span><span id="174" class="l"><a class="l" href="#174">174: </a> <span class="php-keyword1">if</span> (<span class="php-var">$this</span>-&gt;connexion == <span class="php-keyword1">null</span>) {
</span><span id="175" class="l"><a class="l" href="#175">175: </a> <span class="php-var">$this</span>-&gt;connecter();
</span><span id="176" class="l"><a class="l" href="#176">176: </a> }
</span><span id="177" class="l"><a class="l" href="#177">177: </a>
</span><span id="178" class="l"><a class="l" href="#178">178: </a> <span class="php-var">$retour</span> = <span class="php-keyword1">null</span>;
</span><span id="179" class="l"><a class="l" href="#179">179: </a> <span class="php-keyword1">switch</span> (<span class="php-var">$this</span>-&gt;abstraction) {
</span><span id="180" class="l"><a class="l" href="#180">180: </a> <span class="php-keyword1">case</span> <span class="php-quote">'pdo'</span>:
</span><span id="181" class="l"><a class="l" href="#181">181: </a> <span class="php-keyword1">try</span> {
</span><span id="182" class="l"><a class="l" href="#182">182: </a> <span class="php-var">$res_req</span> = <span class="php-var">$this</span>-&gt;connexion-&gt;query(<span class="php-var">$requete</span>);
</span><span id="183" class="l"><a class="l" href="#183">183: </a> <span class="php-var">$retour</span> = (<span class="php-var">$res_req</span> !== <span class="php-keyword1">false</span>) ? <span class="php-var">$res_req</span>-&gt;fetch(<span class="php-var">$this</span>-&gt;<span class="php-var">$mode</span>) : <span class="php-var">$res_req</span>;
</span><span id="184" class="l"><a class="l" href="#184">184: </a> } <span class="php-keyword1">catch</span> (PDOException <span class="php-var">$e</span>) {
</span><span id="185" class="l"><a class="l" href="#185">185: </a> <span class="php-var">$message</span> = <span class="php-quote">'Requête echec. Fichier : &quot;%s&quot;. Ligne : &quot;%s&quot;. Message : %s'</span>;
</span><span id="186" class="l"><a class="l" href="#186">186: </a> <span class="php-keyword2">trigger_error</span>(<span class="php-keyword2">sprintf</span>(<span class="php-var">$message</span>, <span class="php-var">$e</span>-&gt;getFile(), <span class="php-var">$e</span>-&gt;getLine(), <span class="php-var">$e</span>-&gt;getMessage()), E_USER_WARNING);
</span><span id="187" class="l"><a class="l" href="#187">187: </a> }
</span><span id="188" class="l"><a class="l" href="#188">188: </a> <span class="php-keyword1">break</span>;
</span><span id="189" class="l"><a class="l" href="#189">189: </a> <span class="php-keyword1">case</span> <span class="php-quote">'mysql'</span>:
</span><span id="190" class="l"><a class="l" href="#190">190: </a> <span class="php-var">$res</span> = <span class="php-keyword2">mysql_query</span>(<span class="php-var">$requete</span>,<span class="php-var">$this</span>-&gt;connexion);
</span><span id="191" class="l"><a class="l" href="#191">191: </a> <span class="php-var">$fonction_fetch</span> = <span class="php-var">$this</span>-&gt;<span class="php-var">$mode</span>;
</span><span id="192" class="l"><a class="l" href="#192">192: </a> <span class="php-var">$retour</span> = <span class="php-var">$fonction_fetch</span>(<span class="php-var">$res</span>);
</span><span id="193" class="l"><a class="l" href="#193">193: </a> <span class="php-keyword1">break</span>;
</span><span id="194" class="l"><a class="l" href="#194">194: </a> <span class="php-keyword1">case</span> <span class="php-quote">'mysql'</span>:
</span><span id="195" class="l"><a class="l" href="#195">195: </a> <span class="php-var">$res</span> = <span class="php-keyword2">mysql_query</span>(<span class="php-var">$requete</span>,<span class="php-var">$this</span>-&gt;connexion);
</span><span id="194" class="l"><a class="l" href="#194">194: </a> <span class="php-keyword1">case</span> <span class="php-quote">'mysqli'</span>:
</span><span id="195" class="l"><a class="l" href="#195">195: </a> <span class="php-var">$res</span> = <span class="php-var">$this</span>-&gt;connexion-&gt;query(<span class="php-var">$requete</span>);
</span><span id="196" class="l"><a class="l" href="#196">196: </a> <span class="php-var">$fonction_fetch</span> = <span class="php-var">$this</span>-&gt;<span class="php-var">$mode</span>;
</span><span id="197" class="l"><a class="l" href="#197">197: </a> <span class="php-var">$retour</span> = <span class="php-var">$fonction_fetch</span>(<span class="php-var">$res</span>);
</span><span id="197" class="l"><a class="l" href="#197">197: </a> <span class="php-var">$retour</span> = <span class="php-var">$res</span>-&gt;<span class="php-var">$fonction_fetch</span>();
</span><span id="198" class="l"><a class="l" href="#198">198: </a> <span class="php-keyword1">break</span>;
</span><span id="199" class="l"><a class="l" href="#199">199: </a> <span class="php-keyword1">case</span> <span class="php-quote">'mysqli'</span>:
</span><span id="200" class="l"><a class="l" href="#200">200: </a> <span class="php-var">$res</span> = <span class="php-var">$this</span>-&gt;connexion-&gt;query(<span class="php-var">$requete</span>);
</span><span id="201" class="l"><a class="l" href="#201">201: </a> <span class="php-var">$fonction_fetch</span> = <span class="php-var">$this</span>-&gt;<span class="php-var">$mode</span>;
</span><span id="202" class="l"><a class="l" href="#202">202: </a> <span class="php-var">$retour</span> = <span class="php-var">$res</span>-&gt;<span class="php-var">$fonction_fetch</span>();
</span><span id="203" class="l"><a class="l" href="#203">203: </a> <span class="php-keyword1">break</span>;
</span><span id="204" class="l"><a class="l" href="#204">204: </a> <span class="php-keyword1">case</span> <span class="php-quote">'sqlite3'</span>:
</span><span id="205" class="l"><a class="l" href="#205">205: </a> <span class="php-var">$retour</span> = <span class="php-var">$this</span>-&gt;connexion-&gt;querySingle(<span class="php-var">$requete</span>);
</span><span id="206" class="l"><a class="l" href="#206">206: </a> <span class="php-keyword1">break</span>;
</span><span id="207" class="l"><a class="l" href="#207">207: </a> }
</span><span id="208" class="l"><a class="l" href="#208">208: </a>
</span><span id="209" class="l"><a class="l" href="#209">209: </a> <span class="php-keyword1">return</span> <span class="php-var">$retour</span>;
</span><span id="210" class="l"><a class="l" href="#210">210: </a> }
</span><span id="211" class="l"><a class="l" href="#211">211: </a>
</span><span id="212" class="l"><a class="l" href="#212">212: </a>
</span><span id="213" class="l"><a class="l" href="#213">213: </a> <span class="php-keyword1">final</span> <span class="php-keyword1">protected</span> <span class="php-keyword1">function</span> <a id="_requeteTous" href="#_requeteTous">requeteTous</a>(<span class="php-var">$requete</span>,<span class="php-var">$mode</span> = <span class="php-quote">'ASSOC'</span>) {
</span><span id="214" class="l"><a class="l" href="#214">214: </a> <span class="php-comment">// Connexion seulement lors du premier appel à une requete (lazy connexion)</span>
</span><span id="215" class="l"><a class="l" href="#215">215: </a> <span class="php-keyword1">if</span> (<span class="php-var">$this</span>-&gt;connexion == <span class="php-keyword1">null</span>) {
</span><span id="216" class="l"><a class="l" href="#216">216: </a> <span class="php-var">$this</span>-&gt;connecter();
</span><span id="217" class="l"><a class="l" href="#217">217: </a> }
</span><span id="218" class="l"><a class="l" href="#218">218: </a>
</span><span id="219" class="l"><a class="l" href="#219">219: </a> <span class="php-var">$retour</span> = <span class="php-keyword1">null</span>;
</span><span id="220" class="l"><a class="l" href="#220">220: </a>
</span><span id="221" class="l"><a class="l" href="#221">221: </a> <span class="php-keyword1">switch</span> (<span class="php-var">$this</span>-&gt;abstraction) {
</span><span id="222" class="l"><a class="l" href="#222">222: </a> <span class="php-keyword1">case</span> <span class="php-quote">'pdo'</span>:
</span><span id="223" class="l"><a class="l" href="#223">223: </a> <span class="php-keyword1">try</span> {
</span><span id="224" class="l"><a class="l" href="#224">224: </a> <span class="php-var">$res_req</span> = <span class="php-var">$this</span>-&gt;connexion-&gt;query(<span class="php-var">$requete</span>);
</span><span id="225" class="l"><a class="l" href="#225">225: </a> <span class="php-keyword1">if</span> (<span class="php-var">$res_req</span> !== <span class="php-keyword1">false</span>) {
</span><span id="226" class="l"><a class="l" href="#226">226: </a> <span class="php-var">$retour</span> = <span class="php-var">$res_req</span>-&gt;fetchAll(<span class="php-var">$this</span>-&gt;<span class="php-var">$mode</span>);
</span><span id="227" class="l"><a class="l" href="#227">227: </a> } <span class="php-keyword1">else</span> {
</span><span id="228" class="l"><a class="l" href="#228">228: </a> <span class="php-var">$retour</span> = <span class="php-keyword1">false</span>;
</span><span id="229" class="l"><a class="l" href="#229">229: </a> }
</span><span id="230" class="l"><a class="l" href="#230">230: </a> } <span class="php-keyword1">catch</span> (PDOException <span class="php-var">$e</span>) {
</span><span id="231" class="l"><a class="l" href="#231">231: </a> <span class="php-var">$message</span> = <span class="php-quote">'Requête echec. Fichier : &quot;%s&quot;. Ligne : &quot;%s&quot;. Message : %s'</span>;
</span><span id="232" class="l"><a class="l" href="#232">232: </a> <span class="php-keyword2">trigger_error</span>(<span class="php-keyword2">sprintf</span>(<span class="php-var">$message</span>, <span class="php-var">$e</span>-&gt;getFile(), <span class="php-var">$e</span>-&gt;getLine(), <span class="php-var">$e</span>-&gt;getMessage()), E_USER_WARNING);
</span><span id="233" class="l"><a class="l" href="#233">233: </a> }
</span><span id="234" class="l"><a class="l" href="#234">234: </a> <span class="php-keyword1">break</span>;
</span><span id="235" class="l"><a class="l" href="#235">235: </a> <span class="php-keyword1">case</span> <span class="php-quote">'mysql'</span>:
</span><span id="236" class="l"><a class="l" href="#236">236: </a> <span class="php-var">$res</span> = <span class="php-keyword2">mysql_query</span>(<span class="php-var">$requete</span>, <span class="php-var">$this</span>-&gt;connexion);
</span><span id="237" class="l"><a class="l" href="#237">237: </a> <span class="php-var">$fonction_fetch</span> = <span class="php-var">$this</span>-&gt;<span class="php-var">$mode</span>;
</span><span id="238" class="l"><a class="l" href="#238">238: </a> <span class="php-keyword1">while</span> (<span class="php-var">$ligne</span> = <span class="php-var">$fonction_fetch</span>(<span class="php-var">$res</span>)) {
</span><span id="239" class="l"><a class="l" href="#239">239: </a> <span class="php-var">$retour</span>[] = <span class="php-var">$ligne</span>;
</span><span id="240" class="l"><a class="l" href="#240">240: </a> }
</span><span id="241" class="l"><a class="l" href="#241">241: </a> <span class="php-keyword1">break</span>;
</span><span id="242" class="l"><a class="l" href="#242">242: </a> <span class="php-keyword1">case</span> <span class="php-quote">'mysqli'</span>:
</span><span id="243" class="l"><a class="l" href="#243">243: </a> <span class="php-var">$res</span> = <span class="php-var">$this</span>-&gt;connexion-&gt;query(<span class="php-var">$requete</span>);
</span><span id="244" class="l"><a class="l" href="#244">244: </a> <span class="php-var">$function_fetch</span> = <span class="php-var">$this</span>-&gt;<span class="php-var">$mode</span>;
</span><span id="245" class="l"><a class="l" href="#245">245: </a> <span class="php-keyword1">while</span> (<span class="php-var">$ligne</span> = <span class="php-var">$res</span>-&gt;<span class="php-var">$function_fetch</span>()) {
</span><span id="246" class="l"><a class="l" href="#246">246: </a> <span class="php-var">$retour</span>[] = <span class="php-var">$ligne</span>;
</span><span id="247" class="l"><a class="l" href="#247">247: </a> }
</span><span id="248" class="l"><a class="l" href="#248">248: </a> <span class="php-keyword1">break</span>;
</span><span id="249" class="l"><a class="l" href="#249">249: </a> <span class="php-keyword1">case</span> <span class="php-quote">'sqlite3'</span>:
</span><span id="250" class="l"><a class="l" href="#250">250: </a> <span class="php-var">$res</span> = <span class="php-var">$this</span>-&gt;connexion-&gt;query(<span class="php-var">$requete</span>);
</span><span id="251" class="l"><a class="l" href="#251">251: </a> <span class="php-keyword1">while</span> (<span class="php-var">$ligne</span> = <span class="php-var">$res</span>-&gt;fetch_array(<span class="php-var">$this</span>-&gt;ASSOC)) {
</span><span id="252" class="l"><a class="l" href="#252">252: </a> <span class="php-keyword1">if</span> (<span class="php-var">$mode</span> == <span class="php-var">$this</span>-&gt;ASSOC) {
</span><span id="253" class="l"><a class="l" href="#253">253: </a> <span class="php-var">$retour</span>[] = <span class="php-var">$ligne</span>;
</span><span id="254" class="l"><a class="l" href="#254">254: </a> } <span class="php-keyword1">elseif</span> (<span class="php-var">$mode</span> == <span class="php-var">$this</span>-&gt;OBJECT) {
</span><span id="255" class="l"><a class="l" href="#255">255: </a> <span class="php-comment">// cas particulier de sqllite</span>
</span><span id="256" class="l"><a class="l" href="#256">256: </a> <span class="php-comment">// qui n'a pas de fonction fetch_object</span>
</span><span id="257" class="l"><a class="l" href="#257">257: </a> <span class="php-var">$ligneObjet</span> = <span class="php-keyword1">new</span> stdClass();
</span><span id="258" class="l"><a class="l" href="#258">258: </a> <span class="php-keyword1">foreach</span> (<span class="php-var">$ligne</span> <span class="php-keyword1">as</span> <span class="php-var">$colonne</span> =&gt; <span class="php-var">$valeur</span>) {
</span><span id="259" class="l"><a class="l" href="#259">259: </a> <span class="php-var">$ligneObjet</span>-&gt;<span class="php-var">$colonne</span> = <span class="php-var">$valeur</span>;
</span><span id="260" class="l"><a class="l" href="#260">260: </a> }
</span><span id="261" class="l"><a class="l" href="#261">261: </a> <span class="php-var">$retour</span>[] = <span class="php-var">$ligneObjet</span>;
</span><span id="262" class="l"><a class="l" href="#262">262: </a> }
</span><span id="263" class="l"><a class="l" href="#263">263: </a> }
</span><span id="264" class="l"><a class="l" href="#264">264: </a> <span class="php-keyword1">break</span>;
</span><span id="265" class="l"><a class="l" href="#265">265: </a> }
</span><span id="266" class="l"><a class="l" href="#266">266: </a>
</span><span id="267" class="l"><a class="l" href="#267">267: </a> <span class="php-keyword1">return</span> <span class="php-var">$retour</span>;
</span><span id="268" class="l"><a class="l" href="#268">268: </a> }
</span><span id="269" class="l"><a class="l" href="#269">269: </a>
</span><span id="270" class="l"><a class="l" href="#270">270: </a> <span class="php-comment">/**
</span></span><span id="271" class="l"><a class="l" href="#271">271: </a><span class="php-comment"> * protège une chaine de caractères avant l'insertion dans la base de données
</span></span><span id="272" class="l"><a class="l" href="#272">272: </a><span class="php-comment"> */</span>
</span><span id="273" class="l"><a class="l" href="#273">273: </a> <span class="php-keyword1">final</span> <span class="php-keyword1">protected</span> <span class="php-keyword1">function</span> <a id="_proteger" href="#_proteger">proteger</a>(<span class="php-var">$chaine</span>) {
</span><span id="274" class="l"><a class="l" href="#274">274: </a> <span class="php-comment">// on ne se connecte que lors du premier appel à une requete</span>
</span><span id="275" class="l"><a class="l" href="#275">275: </a> <span class="php-keyword1">if</span> (<span class="php-var">$this</span>-&gt;connexion == <span class="php-keyword1">null</span>) {
</span><span id="276" class="l"><a class="l" href="#276">276: </a> <span class="php-var">$this</span>-&gt;connecter();
</span><span id="277" class="l"><a class="l" href="#277">277: </a> }
</span><span id="278" class="l"><a class="l" href="#278">278: </a>
</span><span id="279" class="l"><a class="l" href="#279">279: </a> <span class="php-var">$retour</span> = <span class="php-var">$chaine</span>;
</span><span id="280" class="l"><a class="l" href="#280">280: </a> <span class="php-keyword1">switch</span> (<span class="php-var">$this</span>-&gt;abstraction) {
</span><span id="281" class="l"><a class="l" href="#281">281: </a> <span class="php-keyword1">case</span> <span class="php-quote">'pdo'</span>:
</span><span id="282" class="l"><a class="l" href="#282">282: </a> <span class="php-var">$retour</span> = <span class="php-var">$this</span>-&gt;connexion-&gt;quote(<span class="php-var">$chaine</span>);
</span><span id="283" class="l"><a class="l" href="#283">283: </a> <span class="php-keyword1">break</span>;
</span><span id="284" class="l"><a class="l" href="#284">284: </a> <span class="php-keyword1">case</span> <span class="php-quote">'mysql'</span>:
</span><span id="285" class="l"><a class="l" href="#285">285: </a> <span class="php-var">$retour</span> = <span class="php-quote">'&quot;'</span>.<span class="php-keyword2">mysql_real_escape_string</span>(<span class="php-var">$chaine</span>, <span class="php-var">$this</span>-&gt;connexion).<span class="php-quote">'&quot;'</span>;
</span><span id="286" class="l"><a class="l" href="#286">286: </a> <span class="php-keyword1">break</span>;
</span><span id="287" class="l"><a class="l" href="#287">287: </a> <span class="php-keyword1">case</span> <span class="php-quote">'mysqli'</span>:
</span><span id="288" class="l"><a class="l" href="#288">288: </a> <span class="php-var">$retour</span> = <span class="php-quote">'&quot;'</span>.<span class="php-var">$this</span>-&gt;connexion-&gt;real_escape_string(<span class="php-var">$chaine</span>).<span class="php-quote">'&quot;'</span>;
</span><span id="289" class="l"><a class="l" href="#289">289: </a> <span class="php-keyword1">break</span>;
</span><span id="290" class="l"><a class="l" href="#290">290: </a> <span class="php-keyword1">case</span> <span class="php-quote">'sqlite3'</span>:
</span><span id="291" class="l"><a class="l" href="#291">291: </a> <span class="php-var">$retour</span> = <span class="php-var">$this</span>-&gt;connexion-&gt;escapeString(<span class="php-var">$chaine</span>);
</span><span id="292" class="l"><a class="l" href="#292">292: </a> <span class="php-keyword1">break</span>;
</span><span id="293" class="l"><a class="l" href="#293">293: </a> }
</span><span id="294" class="l"><a class="l" href="#294">294: </a> <span class="php-keyword1">return</span> <span class="php-var">$retour</span>;
</span><span id="295" class="l"><a class="l" href="#295">295: </a> }
</span><span id="296" class="l"><a class="l" href="#296">296: </a>
</span><span id="297" class="l"><a class="l" href="#297">297: </a> <span class="php-comment">/**
</span></span><span id="298" class="l"><a class="l" href="#298">298: </a><span class="php-comment"> * initialise les constantes de classe à leur bonne valeur
</span></span><span id="299" class="l"><a class="l" href="#299">299: </a><span class="php-comment"> * et lance une exception si le protocole n'est pas bien défini
</span></span><span id="300" class="l"><a class="l" href="#300">300: </a><span class="php-comment"> * @throws Exception
</span></span><span id="301" class="l"><a class="l" href="#301">301: </a><span class="php-comment"> */</span>
</span><span id="302" class="l"><a class="l" href="#302">302: </a> <span class="php-keyword1">final</span> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="_initialiserProtocole" href="#_initialiserProtocole">initialiserProtocole</a>() {
</span><span id="303" class="l"><a class="l" href="#303">303: </a>
</span><span id="304" class="l"><a class="l" href="#304">304: </a> <span class="php-keyword1">switch</span> (<span class="php-var">$this</span>-&gt;abstraction) {
</span><span id="305" class="l"><a class="l" href="#305">305: </a> <span class="php-keyword1">case</span> <span class="php-quote">'pdo'</span>:
</span><span id="306" class="l"><a class="l" href="#306">306: </a> <span class="php-var">$this</span>-&gt;ASSOC = PDO::FETCH_ASSOC;
</span><span id="307" class="l"><a class="l" href="#307">307: </a> <span class="php-var">$this</span>-&gt;OBJECT = PDO::FETCH_CLASS;
</span><span id="308" class="l"><a class="l" href="#308">308: </a> <span class="php-keyword1">break</span>;
</span><span id="309" class="l"><a class="l" href="#309">309: </a> <span class="php-keyword1">case</span> <span class="php-quote">'mysql'</span>:
</span><span id="310" class="l"><a class="l" href="#310">310: </a> <span class="php-var">$this</span>-&gt;ASSOC = <span class="php-quote">'mysql_fetch_assoc'</span>;
</span><span id="311" class="l"><a class="l" href="#311">311: </a> <span class="php-var">$this</span>-&gt;OBJECT = <span class="php-quote">'mysql_fetch_object'</span>;
</span><span id="312" class="l"><a class="l" href="#312">312: </a> <span class="php-keyword1">break</span>;
</span><span id="313" class="l"><a class="l" href="#313">313: </a> <span class="php-keyword1">case</span> <span class="php-quote">'mysqli'</span>:
</span><span id="314" class="l"><a class="l" href="#314">314: </a> <span class="php-var">$this</span>-&gt;ASSOC = <span class="php-quote">'fetch_assoc'</span>;
</span><span id="315" class="l"><a class="l" href="#315">315: </a> <span class="php-var">$this</span>-&gt;OBJECT = <span class="php-quote">'fetch_object'</span>;
</span><span id="316" class="l"><a class="l" href="#316">316: </a> <span class="php-keyword1">break</span>;
</span><span id="317" class="l"><a class="l" href="#317">317: </a> <span class="php-keyword1">case</span> <span class="php-quote">'sqlite3'</span>:
</span><span id="318" class="l"><a class="l" href="#318">318: </a> <span class="php-var">$this</span>-&gt;ASSOC = <span class="php-quote">'SQLITE3_ASSOC'</span>;
</span><span id="319" class="l"><a class="l" href="#319">319: </a> <span class="php-var">$this</span>-&gt;OBJECT = <span class="php-quote">'SQLITE3_OBJECT'</span>;
</span><span id="320" class="l"><a class="l" href="#320">320: </a> <span class="php-keyword1">break</span>;
</span><span id="321" class="l"><a class="l" href="#321">321: </a> <span class="php-keyword1">default</span>:
</span><span id="322" class="l"><a class="l" href="#322">322: </a> <span class="php-keyword1">throw</span> <span class="php-keyword1">new</span> Exception(<span class="php-quote">'Erreur : l\'abstraction '</span>.<span class="php-var">$this</span>-&gt;abstraction.<span class="php-quote">' n\'est pas prise en charge'</span>);
</span><span id="323" class="l"><a class="l" href="#323">323: </a> <span class="php-keyword1">break</span>;
</span><span id="324" class="l"><a class="l" href="#324">324: </a> }
</span><span id="325" class="l"><a class="l" href="#325">325: </a> }
</span><span id="326" class="l"><a class="l" href="#326">326: </a>
</span><span id="327" class="l"><a class="l" href="#327">327: </a> <span class="php-comment">/**
</span></span><span id="328" class="l"><a class="l" href="#328">328: </a><span class="php-comment"> * Destructeur de classe, se contente de fermer explicitement la connexion
</span></span><span id="329" class="l"><a class="l" href="#329">329: </a><span class="php-comment"> */</span>
</span><span id="330" class="l"><a class="l" href="#330">330: </a> <span class="php-keyword1">final</span> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="___destruct" href="#___destruct">__destruct</a>() {
</span><span id="331" class="l"><a class="l" href="#331">331: </a> <span class="php-keyword1">switch</span> (<span class="php-var">$this</span>-&gt;abstraction) {
</span><span id="332" class="l"><a class="l" href="#332">332: </a> <span class="php-keyword1">case</span> <span class="php-quote">'pdo'</span>:
</span><span id="333" class="l"><a class="l" href="#333">333: </a> <span class="php-var">$this</span>-&gt;connexion = <span class="php-keyword1">null</span>;
</span><span id="334" class="l"><a class="l" href="#334">334: </a> <span class="php-keyword1">break</span>;
</span><span id="335" class="l"><a class="l" href="#335">335: </a> <span class="php-keyword1">case</span> <span class="php-quote">'mysql'</span>:
</span><span id="336" class="l"><a class="l" href="#336">336: </a> <span class="php-keyword1">return</span> <span class="php-keyword2">mysql_close</span>(<span class="php-var">$this</span>-&gt;connexion);
</span><span id="337" class="l"><a class="l" href="#337">337: </a> <span class="php-keyword1">break</span>;
</span><span id="338" class="l"><a class="l" href="#338">338: </a> <span class="php-keyword1">case</span> <span class="php-quote">'mysqli'</span>:
</span><span id="339" class="l"><a class="l" href="#339">339: </a> <span class="php-var">$this</span>-&gt;connexion-&gt;close();
</span><span id="340" class="l"><a class="l" href="#340">340: </a> <span class="php-keyword1">break</span>;
</span><span id="341" class="l"><a class="l" href="#341">341: </a> <span class="php-keyword1">case</span> <span class="php-quote">'sqlite3'</span>:
</span><span id="342" class="l"><a class="l" href="#342">342: </a> <span class="php-var">$this</span>-&gt;connexion-&gt;close();
</span><span id="343" class="l"><a class="l" href="#343">343: </a> <span class="php-keyword1">break</span>;
</span><span id="344" class="l"><a class="l" href="#344">344: </a> }
</span><span id="345" class="l"><a class="l" href="#345">345: </a> }
</span><span id="346" class="l"><a class="l" href="#346">346: </a>}
</span><span id="347" class="l"><a class="l" href="#347">347: </a></span><span class="xlang">?&gt;</span></code></pre>
</span><span id="199" class="l"><a class="l" href="#199">199: </a> <span class="php-keyword1">case</span> <span class="php-quote">'sqlite3'</span>:
</span><span id="200" class="l"><a class="l" href="#200">200: </a> <span class="php-var">$retour</span> = <span class="php-var">$this</span>-&gt;connexion-&gt;querySingle(<span class="php-var">$requete</span>);
</span><span id="201" class="l"><a class="l" href="#201">201: </a> <span class="php-keyword1">break</span>;
</span><span id="202" class="l"><a class="l" href="#202">202: </a> }
</span><span id="203" class="l"><a class="l" href="#203">203: </a>
</span><span id="204" class="l"><a class="l" href="#204">204: </a> <span class="php-keyword1">return</span> <span class="php-var">$retour</span>;
</span><span id="205" class="l"><a class="l" href="#205">205: </a> }
</span><span id="206" class="l"><a class="l" href="#206">206: </a>
</span><span id="207" class="l"><a class="l" href="#207">207: </a>
</span><span id="208" class="l"><a class="l" href="#208">208: </a> <span class="php-keyword1">final</span> <span class="php-keyword1">protected</span> <span class="php-keyword1">function</span> <a id="_requeteTous" href="#_requeteTous">requeteTous</a>(<span class="php-var">$requete</span>,<span class="php-var">$mode</span> = <span class="php-quote">'ASSOC'</span>) {
</span><span id="209" class="l"><a class="l" href="#209">209: </a> <span class="php-comment">// Connexion seulement lors du premier appel à une requete (lazy connexion)</span>
</span><span id="210" class="l"><a class="l" href="#210">210: </a> <span class="php-keyword1">if</span> (<span class="php-var">$this</span>-&gt;connexion == <span class="php-keyword1">null</span>) {
</span><span id="211" class="l"><a class="l" href="#211">211: </a> <span class="php-var">$this</span>-&gt;connecter();
</span><span id="212" class="l"><a class="l" href="#212">212: </a> }
</span><span id="213" class="l"><a class="l" href="#213">213: </a>
</span><span id="214" class="l"><a class="l" href="#214">214: </a> <span class="php-var">$retour</span> = <span class="php-keyword1">null</span>;
</span><span id="215" class="l"><a class="l" href="#215">215: </a>
</span><span id="216" class="l"><a class="l" href="#216">216: </a> <span class="php-keyword1">switch</span> (<span class="php-var">$this</span>-&gt;abstraction) {
</span><span id="217" class="l"><a class="l" href="#217">217: </a> <span class="php-keyword1">case</span> <span class="php-quote">'pdo'</span>:
</span><span id="218" class="l"><a class="l" href="#218">218: </a> <span class="php-keyword1">try</span> {
</span><span id="219" class="l"><a class="l" href="#219">219: </a> <span class="php-var">$res_req</span> = <span class="php-var">$this</span>-&gt;connexion-&gt;query(<span class="php-var">$requete</span>);
</span><span id="220" class="l"><a class="l" href="#220">220: </a> <span class="php-keyword1">if</span> (<span class="php-var">$res_req</span> !== <span class="php-keyword1">false</span>) {
</span><span id="221" class="l"><a class="l" href="#221">221: </a> <span class="php-var">$retour</span> = <span class="php-var">$res_req</span>-&gt;fetchAll(<span class="php-var">$this</span>-&gt;<span class="php-var">$mode</span>);
</span><span id="222" class="l"><a class="l" href="#222">222: </a> } <span class="php-keyword1">else</span> {
</span><span id="223" class="l"><a class="l" href="#223">223: </a> <span class="php-var">$retour</span> = <span class="php-keyword1">false</span>;
</span><span id="224" class="l"><a class="l" href="#224">224: </a> }
</span><span id="225" class="l"><a class="l" href="#225">225: </a> } <span class="php-keyword1">catch</span> (PDOException <span class="php-var">$e</span>) {
</span><span id="226" class="l"><a class="l" href="#226">226: </a> <span class="php-var">$message</span> = <span class="php-quote">'Requête echec. Fichier : &quot;%s&quot;. Ligne : &quot;%s&quot;. Message : %s'</span>;
</span><span id="227" class="l"><a class="l" href="#227">227: </a> <span class="php-keyword2">trigger_error</span>(<span class="php-keyword2">sprintf</span>(<span class="php-var">$message</span>, <span class="php-var">$e</span>-&gt;getFile(), <span class="php-var">$e</span>-&gt;getLine(), <span class="php-var">$e</span>-&gt;getMessage()), E_USER_WARNING);
</span><span id="228" class="l"><a class="l" href="#228">228: </a> }
</span><span id="229" class="l"><a class="l" href="#229">229: </a> <span class="php-keyword1">break</span>;
</span><span id="230" class="l"><a class="l" href="#230">230: </a> <span class="php-keyword1">case</span> <span class="php-quote">'mysql'</span>:
</span><span id="231" class="l"><a class="l" href="#231">231: </a> <span class="php-var">$res</span> = <span class="php-keyword2">mysql_query</span>(<span class="php-var">$requete</span>, <span class="php-var">$this</span>-&gt;connexion);
</span><span id="232" class="l"><a class="l" href="#232">232: </a> <span class="php-var">$fonction_fetch</span> = <span class="php-var">$this</span>-&gt;<span class="php-var">$mode</span>;
</span><span id="233" class="l"><a class="l" href="#233">233: </a> <span class="php-keyword1">while</span> (<span class="php-var">$ligne</span> = <span class="php-var">$fonction_fetch</span>(<span class="php-var">$res</span>)) {
</span><span id="234" class="l"><a class="l" href="#234">234: </a> <span class="php-var">$retour</span>[] = <span class="php-var">$ligne</span>;
</span><span id="235" class="l"><a class="l" href="#235">235: </a> }
</span><span id="236" class="l"><a class="l" href="#236">236: </a> <span class="php-keyword1">break</span>;
</span><span id="237" class="l"><a class="l" href="#237">237: </a> <span class="php-keyword1">case</span> <span class="php-quote">'mysqli'</span>:
</span><span id="238" class="l"><a class="l" href="#238">238: </a> <span class="php-var">$res</span> = <span class="php-var">$this</span>-&gt;connexion-&gt;query(<span class="php-var">$requete</span>);
</span><span id="239" class="l"><a class="l" href="#239">239: </a> <span class="php-var">$function_fetch</span> = <span class="php-var">$this</span>-&gt;<span class="php-var">$mode</span>;
</span><span id="240" class="l"><a class="l" href="#240">240: </a> <span class="php-keyword1">while</span> (<span class="php-var">$ligne</span> = <span class="php-var">$res</span>-&gt;<span class="php-var">$function_fetch</span>()) {
</span><span id="241" class="l"><a class="l" href="#241">241: </a> <span class="php-var">$retour</span>[] = <span class="php-var">$ligne</span>;
</span><span id="242" class="l"><a class="l" href="#242">242: </a> }
</span><span id="243" class="l"><a class="l" href="#243">243: </a> <span class="php-keyword1">break</span>;
</span><span id="244" class="l"><a class="l" href="#244">244: </a> <span class="php-keyword1">case</span> <span class="php-quote">'sqlite3'</span>:
</span><span id="245" class="l"><a class="l" href="#245">245: </a> <span class="php-var">$res</span> = <span class="php-var">$this</span>-&gt;connexion-&gt;query(<span class="php-var">$requete</span>);
</span><span id="246" class="l"><a class="l" href="#246">246: </a> <span class="php-keyword1">while</span> (<span class="php-var">$ligne</span> = <span class="php-var">$res</span>-&gt;fetch_array(<span class="php-var">$this</span>-&gt;ASSOC)) {
</span><span id="247" class="l"><a class="l" href="#247">247: </a> <span class="php-keyword1">if</span> (<span class="php-var">$mode</span> == <span class="php-var">$this</span>-&gt;ASSOC) {
</span><span id="248" class="l"><a class="l" href="#248">248: </a> <span class="php-var">$retour</span>[] = <span class="php-var">$ligne</span>;
</span><span id="249" class="l"><a class="l" href="#249">249: </a> } <span class="php-keyword1">elseif</span> (<span class="php-var">$mode</span> == <span class="php-var">$this</span>-&gt;OBJECT) {
</span><span id="250" class="l"><a class="l" href="#250">250: </a> <span class="php-comment">// cas particulier de sqllite</span>
</span><span id="251" class="l"><a class="l" href="#251">251: </a> <span class="php-comment">// qui n'a pas de fonction fetch_object</span>
</span><span id="252" class="l"><a class="l" href="#252">252: </a> <span class="php-var">$ligneObjet</span> = <span class="php-keyword1">new</span> stdClass();
</span><span id="253" class="l"><a class="l" href="#253">253: </a> <span class="php-keyword1">foreach</span> (<span class="php-var">$ligne</span> <span class="php-keyword1">as</span> <span class="php-var">$colonne</span> =&gt; <span class="php-var">$valeur</span>) {
</span><span id="254" class="l"><a class="l" href="#254">254: </a> <span class="php-var">$ligneObjet</span>-&gt;<span class="php-var">$colonne</span> = <span class="php-var">$valeur</span>;
</span><span id="255" class="l"><a class="l" href="#255">255: </a> }
</span><span id="256" class="l"><a class="l" href="#256">256: </a> <span class="php-var">$retour</span>[] = <span class="php-var">$ligneObjet</span>;
</span><span id="257" class="l"><a class="l" href="#257">257: </a> }
</span><span id="258" class="l"><a class="l" href="#258">258: </a> }
</span><span id="259" class="l"><a class="l" href="#259">259: </a> <span class="php-keyword1">break</span>;
</span><span id="260" class="l"><a class="l" href="#260">260: </a> }
</span><span id="261" class="l"><a class="l" href="#261">261: </a>
</span><span id="262" class="l"><a class="l" href="#262">262: </a> <span class="php-keyword1">return</span> <span class="php-var">$retour</span>;
</span><span id="263" class="l"><a class="l" href="#263">263: </a> }
</span><span id="264" class="l"><a class="l" href="#264">264: </a>
</span><span id="265" class="l"><a class="l" href="#265">265: </a> <span class="php-comment">/**
</span></span><span id="266" class="l"><a class="l" href="#266">266: </a><span class="php-comment"> * protège une chaine de caractères avant l'insertion dans la base de données
</span></span><span id="267" class="l"><a class="l" href="#267">267: </a><span class="php-comment"> */</span>
</span><span id="268" class="l"><a class="l" href="#268">268: </a> <span class="php-keyword1">final</span> <span class="php-keyword1">protected</span> <span class="php-keyword1">function</span> <a id="_proteger" href="#_proteger">proteger</a>(<span class="php-var">$chaine</span>) {
</span><span id="269" class="l"><a class="l" href="#269">269: </a> <span class="php-comment">// on ne se connecte que lors du premier appel à une requete</span>
</span><span id="270" class="l"><a class="l" href="#270">270: </a> <span class="php-keyword1">if</span> (<span class="php-var">$this</span>-&gt;connexion == <span class="php-keyword1">null</span>) {
</span><span id="271" class="l"><a class="l" href="#271">271: </a> <span class="php-var">$this</span>-&gt;connecter();
</span><span id="272" class="l"><a class="l" href="#272">272: </a> }
</span><span id="273" class="l"><a class="l" href="#273">273: </a>
</span><span id="274" class="l"><a class="l" href="#274">274: </a> <span class="php-var">$retour</span> = <span class="php-var">$chaine</span>;
</span><span id="275" class="l"><a class="l" href="#275">275: </a> <span class="php-keyword1">switch</span> (<span class="php-var">$this</span>-&gt;abstraction) {
</span><span id="276" class="l"><a class="l" href="#276">276: </a> <span class="php-keyword1">case</span> <span class="php-quote">'pdo'</span>:
</span><span id="277" class="l"><a class="l" href="#277">277: </a> <span class="php-var">$retour</span> = <span class="php-var">$this</span>-&gt;connexion-&gt;quote(<span class="php-var">$chaine</span>);
</span><span id="278" class="l"><a class="l" href="#278">278: </a> <span class="php-keyword1">break</span>;
</span><span id="279" class="l"><a class="l" href="#279">279: </a> <span class="php-keyword1">case</span> <span class="php-quote">'mysql'</span>:
</span><span id="280" class="l"><a class="l" href="#280">280: </a> <span class="php-var">$retour</span> = <span class="php-quote">'&quot;'</span>.<span class="php-keyword2">mysql_real_escape_string</span>(<span class="php-var">$chaine</span>, <span class="php-var">$this</span>-&gt;connexion).<span class="php-quote">'&quot;'</span>;
</span><span id="281" class="l"><a class="l" href="#281">281: </a> <span class="php-keyword1">break</span>;
</span><span id="282" class="l"><a class="l" href="#282">282: </a> <span class="php-keyword1">case</span> <span class="php-quote">'mysqli'</span>:
</span><span id="283" class="l"><a class="l" href="#283">283: </a> <span class="php-var">$retour</span> = <span class="php-quote">'&quot;'</span>.<span class="php-var">$this</span>-&gt;connexion-&gt;real_escape_string(<span class="php-var">$chaine</span>).<span class="php-quote">'&quot;'</span>;
</span><span id="284" class="l"><a class="l" href="#284">284: </a> <span class="php-keyword1">break</span>;
</span><span id="285" class="l"><a class="l" href="#285">285: </a> <span class="php-keyword1">case</span> <span class="php-quote">'sqlite3'</span>:
</span><span id="286" class="l"><a class="l" href="#286">286: </a> <span class="php-var">$retour</span> = <span class="php-var">$this</span>-&gt;connexion-&gt;escapeString(<span class="php-var">$chaine</span>);
</span><span id="287" class="l"><a class="l" href="#287">287: </a> <span class="php-keyword1">break</span>;
</span><span id="288" class="l"><a class="l" href="#288">288: </a> }
</span><span id="289" class="l"><a class="l" href="#289">289: </a> <span class="php-keyword1">return</span> <span class="php-var">$retour</span>;
</span><span id="290" class="l"><a class="l" href="#290">290: </a> }
</span><span id="291" class="l"><a class="l" href="#291">291: </a>
</span><span id="292" class="l"><a class="l" href="#292">292: </a> <span class="php-comment">/**
</span></span><span id="293" class="l"><a class="l" href="#293">293: </a><span class="php-comment"> * initialise les constantes de classe à leur bonne valeur
</span></span><span id="294" class="l"><a class="l" href="#294">294: </a><span class="php-comment"> * et lance une exception si le protocole n'est pas bien défini
</span></span><span id="295" class="l"><a class="l" href="#295">295: </a><span class="php-comment"> * @throws Exception
</span></span><span id="296" class="l"><a class="l" href="#296">296: </a><span class="php-comment"> */</span>
</span><span id="297" class="l"><a class="l" href="#297">297: </a> <span class="php-keyword1">final</span> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="_initialiserProtocole" href="#_initialiserProtocole">initialiserProtocole</a>() {
</span><span id="298" class="l"><a class="l" href="#298">298: </a>
</span><span id="299" class="l"><a class="l" href="#299">299: </a> <span class="php-keyword1">switch</span> (<span class="php-var">$this</span>-&gt;abstraction) {
</span><span id="300" class="l"><a class="l" href="#300">300: </a> <span class="php-keyword1">case</span> <span class="php-quote">'pdo'</span>:
</span><span id="301" class="l"><a class="l" href="#301">301: </a> <span class="php-var">$this</span>-&gt;ASSOC = PDO::FETCH_ASSOC;
</span><span id="302" class="l"><a class="l" href="#302">302: </a> <span class="php-var">$this</span>-&gt;OBJECT = PDO::FETCH_CLASS;
</span><span id="303" class="l"><a class="l" href="#303">303: </a> <span class="php-keyword1">break</span>;
</span><span id="304" class="l"><a class="l" href="#304">304: </a> <span class="php-keyword1">case</span> <span class="php-quote">'mysql'</span>:
</span><span id="305" class="l"><a class="l" href="#305">305: </a> <span class="php-var">$this</span>-&gt;ASSOC = <span class="php-quote">'mysql_fetch_assoc'</span>;
</span><span id="306" class="l"><a class="l" href="#306">306: </a> <span class="php-var">$this</span>-&gt;OBJECT = <span class="php-quote">'mysql_fetch_object'</span>;
</span><span id="307" class="l"><a class="l" href="#307">307: </a> <span class="php-keyword1">break</span>;
</span><span id="308" class="l"><a class="l" href="#308">308: </a> <span class="php-keyword1">case</span> <span class="php-quote">'mysqli'</span>:
</span><span id="309" class="l"><a class="l" href="#309">309: </a> <span class="php-var">$this</span>-&gt;ASSOC = <span class="php-quote">'fetch_assoc'</span>;
</span><span id="310" class="l"><a class="l" href="#310">310: </a> <span class="php-var">$this</span>-&gt;OBJECT = <span class="php-quote">'fetch_object'</span>;
</span><span id="311" class="l"><a class="l" href="#311">311: </a> <span class="php-keyword1">break</span>;
</span><span id="312" class="l"><a class="l" href="#312">312: </a> <span class="php-keyword1">case</span> <span class="php-quote">'sqlite3'</span>:
</span><span id="313" class="l"><a class="l" href="#313">313: </a> <span class="php-var">$this</span>-&gt;ASSOC = <span class="php-quote">'SQLITE3_ASSOC'</span>;
</span><span id="314" class="l"><a class="l" href="#314">314: </a> <span class="php-var">$this</span>-&gt;OBJECT = <span class="php-quote">'SQLITE3_OBJECT'</span>;
</span><span id="315" class="l"><a class="l" href="#315">315: </a> <span class="php-keyword1">break</span>;
</span><span id="316" class="l"><a class="l" href="#316">316: </a> <span class="php-keyword1">default</span>:
</span><span id="317" class="l"><a class="l" href="#317">317: </a> <span class="php-keyword1">throw</span> <span class="php-keyword1">new</span> Exception(<span class="php-quote">'Erreur : l\'abstraction '</span>.<span class="php-var">$this</span>-&gt;abstraction.<span class="php-quote">' n\'est pas prise en charge'</span>);
</span><span id="318" class="l"><a class="l" href="#318">318: </a> <span class="php-keyword1">break</span>;
</span><span id="319" class="l"><a class="l" href="#319">319: </a> }
</span><span id="320" class="l"><a class="l" href="#320">320: </a> }
</span><span id="321" class="l"><a class="l" href="#321">321: </a>
</span><span id="322" class="l"><a class="l" href="#322">322: </a> <span class="php-comment">/**
</span></span><span id="323" class="l"><a class="l" href="#323">323: </a><span class="php-comment"> * Destructeur de classe, se contente de fermer explicitement la connexion
</span></span><span id="324" class="l"><a class="l" href="#324">324: </a><span class="php-comment"> */</span>
</span><span id="325" class="l"><a class="l" href="#325">325: </a> <span class="php-keyword1">final</span> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="___destruct" href="#___destruct">__destruct</a>() {
</span><span id="326" class="l"><a class="l" href="#326">326: </a> <span class="php-keyword1">switch</span> (<span class="php-var">$this</span>-&gt;abstraction) {
</span><span id="327" class="l"><a class="l" href="#327">327: </a> <span class="php-keyword1">case</span> <span class="php-quote">'pdo'</span>:
</span><span id="328" class="l"><a class="l" href="#328">328: </a> <span class="php-var">$this</span>-&gt;connexion = <span class="php-keyword1">null</span>;
</span><span id="329" class="l"><a class="l" href="#329">329: </a> <span class="php-keyword1">break</span>;
</span><span id="330" class="l"><a class="l" href="#330">330: </a> <span class="php-keyword1">case</span> <span class="php-quote">'mysql'</span>:
</span><span id="331" class="l"><a class="l" href="#331">331: </a> <span class="php-keyword1">return</span> <span class="php-keyword2">mysql_close</span>(<span class="php-var">$this</span>-&gt;connexion);
</span><span id="332" class="l"><a class="l" href="#332">332: </a> <span class="php-keyword1">break</span>;
</span><span id="333" class="l"><a class="l" href="#333">333: </a> <span class="php-keyword1">case</span> <span class="php-quote">'mysqli'</span>:
</span><span id="334" class="l"><a class="l" href="#334">334: </a> <span class="php-var">$this</span>-&gt;connexion-&gt;close();
</span><span id="335" class="l"><a class="l" href="#335">335: </a> <span class="php-keyword1">break</span>;
</span><span id="336" class="l"><a class="l" href="#336">336: </a> <span class="php-keyword1">case</span> <span class="php-quote">'sqlite3'</span>:
</span><span id="337" class="l"><a class="l" href="#337">337: </a> <span class="php-var">$this</span>-&gt;connexion-&gt;close();
</span><span id="338" class="l"><a class="l" href="#338">338: </a> <span class="php-keyword1">break</span>;
</span><span id="339" class="l"><a class="l" href="#339">339: </a> }
</span><span id="340" class="l"><a class="l" href="#340">340: </a> }
</span><span id="341" class="l"><a class="l" href="#341">341: </a>}
</span><span id="342" class="l"><a class="l" href="#342">342: </a></span><span class="xlang">?&gt;</span></code></pre>
 
<div id="footer">
TBFramework - v0.2 API documentation generated by <a href="http://apigen.org">ApiGen 2.8.0</a>
/branches/v0.2-buhl/doc/ApiGen/index.html
39,6 → 39,7
<li><a href="class-Controleur.html">Controleur</a></li>
<li><a href="class-Debug.html">Debug</a></li>
<li><a href="class-GestionnaireException.html">GestionnaireException</a></li>
<li><a href="class-I18n.html">I18n</a></li>
<li><a href="class-Log.html">Log</a></li>
<li><a href="class-Modele.html">Modele</a></li>
<li><a href="class-PDOStatement.html">PDOStatement</a></li>
/branches/v0.2-buhl/doc/ApiGen/class-Modele.html
7,7 → 7,7
<title>Class Modele | TBFramework - v0.2</title>
 
<script type="text/javascript" src="resources/combined.js?4205936287"></script>
<script type="text/javascript" src="elementlist.js?117657638"></script>
<script type="text/javascript" src="elementlist.js?1835392179"></script>
<link rel="stylesheet" type="text/css" media="all" href="resources/style.css?3505392360">
 
</head>
40,6 → 40,7
<li><a href="class-Controleur.html">Controleur</a></li>
<li><a href="class-Debug.html">Debug</a></li>
<li><a href="class-GestionnaireException.html">GestionnaireException</a></li>
<li><a href="class-I18n.html">I18n</a></li>
<li><a href="class-Log.html">Log</a></li>
<li class="active"><a href="class-Modele.html">Modele</a></li>
<li><a href="class-Registre.html">Registre</a></li>
108,8 → 109,6
utilisant diveres possibilités d'abstraction de base de données (PDO, mysql,
mysqli, sqlite) Elle est abstraite donc doit obligatoirement être étendue.</p>
 
<p>PHP Version 5</p>
 
</div>
 
 
127,21 → 126,18
<b>Package:</b> <a href="package-Framework.html">Framework</a><br>
 
<b>Category:</b>
Class<br>
PHP 5.2<br>
<b>Copyright:</b>
2009 Tela-Botanica<br>
Copyright (c) 2009, Tela Botanica (<a
href="mailto:accueil&#64;tela-botanica.org">accueil&#64;<!-- -->tela-botanica.org</a>)<br>
<b>License:</b>
<a href="http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt">Licence CECILL</a><br>
<a href="GNU-GPL-v3">&lt;http://www.gnu.org/licenses/gpl.html&gt;</a><br>
<b>License:</b>
<a href="http://www.gnu.org/licenses/gpl.html">Licence GNU-GPL</a><br>
<a href="CECILL-v2">&lt;http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt&gt;</a><br>
<b>Author:</b>
aurelien &lt;<a
Aurélien PERONNET &lt;<a
href="mailto:aurelien&#64;tela-botanica.org">aurelien&#64;<!-- -->tela-botanica.org</a>&gt;<br>
<b>Version:</b>
SVN: $$Id: Modele.php 426 2013-04-30 16:58:14Z jpm $$<br>
<b>Link:</b>
/doc/framework/<br>
<b>Located at</b> <a href="source-class-Modele.html#3-346" title="Go to source code">Modele.php</a><br>
<b>Located at</b> <a href="source-class-Modele.html#3-341" title="Go to source code">Modele.php</a><br>
</div>
 
 
159,7 → 155,7
 
<td class="name"><div>
<a class="anchor" href="#___construct">#</a>
<code><a href="source-class-Modele.html#74-90" title="Go to source code">__construct</a>( )</code>
<code><a href="source-class-Modele.html#69-85" title="Go to source code">__construct</a>( )</code>
 
<div class="description short">
192,7 → 188,7
 
<td class="name"><div>
<a class="anchor" href="#_requete">#</a>
<code><a href="source-class-Modele.html#145-175" title="Go to source code">requete</a>( <span>string <var>$requete</var></span> )</code>
<code><a href="source-class-Modele.html#140-170" title="Go to source code">requete</a>( <span>string <var>$requete</var></span> )</code>
 
<div class="description short">
236,7 → 232,7
 
<td class="name"><div>
<a class="anchor" href="#_requeteUn">#</a>
<code><a href="source-class-Modele.html#177-210" title="Go to source code">requeteUn</a>( <span>mixed <var>$requete</var></span>, <span>mixed <var>$mode</var> = <span class="php-quote">'ASSOC'</span></span> )</code>
<code><a href="source-class-Modele.html#172-205" title="Go to source code">requeteUn</a>( <span>mixed <var>$requete</var></span>, <span>mixed <var>$mode</var> = <span class="php-quote">'ASSOC'</span></span> )</code>
 
<div class="description short">
265,7 → 261,7
 
<td class="name"><div>
<a class="anchor" href="#_requeteTous">#</a>
<code><a href="source-class-Modele.html#213-268" title="Go to source code">requeteTous</a>( <span>mixed <var>$requete</var></span>, <span>mixed <var>$mode</var> = <span class="php-quote">'ASSOC'</span></span> )</code>
<code><a href="source-class-Modele.html#208-263" title="Go to source code">requeteTous</a>( <span>mixed <var>$requete</var></span>, <span>mixed <var>$mode</var> = <span class="php-quote">'ASSOC'</span></span> )</code>
 
<div class="description short">
294,7 → 290,7
 
<td class="name"><div>
<a class="anchor" href="#_proteger">#</a>
<code><a href="source-class-Modele.html#270-295" title="Go to source code">proteger</a>( <span>mixed <var>$chaine</var></span> )</code>
<code><a href="source-class-Modele.html#265-290" title="Go to source code">proteger</a>( <span>mixed <var>$chaine</var></span> )</code>
 
<div class="description short">
329,7 → 325,7
 
<td class="name"><div>
<a class="anchor" href="#_initialiserProtocole">#</a>
<code><a href="source-class-Modele.html#297-325" title="Go to source code">initialiserProtocole</a>( )</code>
<code><a href="source-class-Modele.html#292-320" title="Go to source code">initialiserProtocole</a>( )</code>
 
<div class="description short">
368,7 → 364,7
 
<td class="name"><div>
<a class="anchor" href="#___destruct">#</a>
<code><a href="source-class-Modele.html#327-345" title="Go to source code">__destruct</a>( )</code>
<code><a href="source-class-Modele.html#322-340" title="Go to source code">__destruct</a>( )</code>
 
<div class="description short">
/branches/v0.2-buhl/doc/ApiGen/source-class-I18n.html
New file
0,0 → 1,358
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="generator" content="ApiGen 2.8.0">
<meta name="robots" content="noindex">
 
<title>File I18n.php | TBFramework - v0.2</title>
 
<script type="text/javascript" src="resources/combined.js?4205936287"></script>
<script type="text/javascript" src="elementlist.js?1835392179"></script>
<link rel="stylesheet" type="text/css" media="all" href="resources/style.css?3505392360">
 
</head>
 
<body>
<div id="left">
<div id="menu">
<a href="index.html" title="Overview"><span>Overview</span></a>
 
 
<div id="groups">
<h3>Packages</h3>
<ul>
<li class="active"><a href="package-Framework.html">Framework</a>
</li>
<li><a href="package-PHP.html">PHP</a>
</li>
</ul>
</div>
 
<hr>
 
 
<div id="elements">
<h3>Classes</h3>
<ul>
<li><a href="class-Application.html">Application</a></li>
<li><a href="class-Chronometre.html">Chronometre</a></li>
<li><a href="class-Config.html">Config</a></li>
<li><a href="class-Controleur.html">Controleur</a></li>
<li><a href="class-Debug.html">Debug</a></li>
<li><a href="class-GestionnaireException.html">GestionnaireException</a></li>
<li class="active"><a href="class-I18n.html">I18n</a></li>
<li><a href="class-Log.html">Log</a></li>
<li><a href="class-Modele.html">Modele</a></li>
<li><a href="class-Registre.html">Registre</a></li>
<li><a href="class-SquelettePhp.html">SquelettePhp</a></li>
<li><a href="class-Url.html">Url</a></li>
</ul>
 
 
 
 
 
<h3>Functions</h3>
<ul>
<li><a href="function-autoloadAppliDefaut.html">autoloadAppliDefaut</a></li>
<li><a href="function-autoloadFw.html">autoloadFw</a></li>
</ul>
</div>
</div>
</div>
 
<div id="splitter"></div>
 
<div id="right">
<div id="rightInner">
<form id="search">
<input type="hidden" name="cx" value="">
<input type="hidden" name="ie" value="UTF-8">
<input type="text" name="q" class="text">
<input type="submit" value="Search">
</form>
 
<div id="navigation">
<ul>
<li>
<a href="index.html" title="Overview"><span>Overview</span></a>
</li>
<li>
<a href="package-Framework.html" title="Summary of Framework"><span>Package</span></a>
</li>
<li>
<a href="class-I18n.html" title="Summary of I18n"><span>Class</span></a>
</li>
</ul>
<ul>
<li>
<a href="tree.html" title="Tree view of classes, interfaces, traits and exceptions"><span>Tree</span></a>
</li>
<li>
<a href="deprecated.html" title="List of deprecated elements"><span>Deprecated</span></a>
</li>
<li>
<a href="todo.html" title="Todo list"><span>Todo</span></a>
</li>
</ul>
<ul>
</ul>
</div>
 
<pre><code><span id="1" class="l"><a class="l" href="#1"> 1: </a><span class="xlang">&lt;?php</span>
</span><span id="2" class="l"><a class="l" href="#2"> 2: </a><span class="php-comment">// declare(encoding='UTF-8');</span>
</span><span id="3" class="l"><a class="l" href="#3"> 3: </a><span class="php-comment">/**
</span></span><span id="4" class="l"><a class="l" href="#4"> 4: </a><span class="php-comment"> * I18n permet de traduire une application à partir de données stockées dans des fichiers ini.
</span></span><span id="5" class="l"><a class="l" href="#5"> 5: </a><span class="php-comment"> * Si vous souhaitez utiliser le fonctionnement par défaut vous devrez :
</span></span><span id="6" class="l"><a class="l" href="#6"> 6: </a><span class="php-comment"> * - déposer les fichiers ini dans le dossier définit par la variable de config &quot;chemin_i18n&quot;.
</span></span><span id="7" class="l"><a class="l" href="#7"> 7: </a><span class="php-comment"> * - nommer les fichiers selon la forme &quot;locale.ini&quot; (Ex.: fr.ini ou fr_CH.ini ).
</span></span><span id="8" class="l"><a class="l" href="#8"> 8: </a><span class="php-comment"> *
</span></span><span id="9" class="l"><a class="l" href="#9"> 9: </a><span class="php-comment"> * Elle offre l'accès en lecture seule aux paramètres de des fichiers ini.
</span></span><span id="10" class="l"><a class="l" href="#10"> 10: </a><span class="php-comment"> * C'est une Singleton. Une seule classe de traduction peut être instanciée par Application.
</span></span><span id="11" class="l"><a class="l" href="#11"> 11: </a><span class="php-comment"> *
</span></span><span id="12" class="l"><a class="l" href="#12"> 12: </a><span class="php-comment"> * @category PHP 5.2
</span></span><span id="13" class="l"><a class="l" href="#13"> 13: </a><span class="php-comment"> * @package Framework
</span></span><span id="14" class="l"><a class="l" href="#14"> 14: </a><span class="php-comment"> * @author Jean-Pascal MILCENT &lt;jpm@tela-botanica.org&gt;
</span></span><span id="15" class="l"><a class="l" href="#15"> 15: </a><span class="php-comment"> * @copyright Copyright (c) 2010, Tela Botanica (accueil@tela-botanica.org)
</span></span><span id="16" class="l"><a class="l" href="#16"> 16: </a><span class="php-comment"> * @license GNU-GPL-v3 &lt;http://www.gnu.org/licenses/gpl.html&gt;
</span></span><span id="17" class="l"><a class="l" href="#17"> 17: </a><span class="php-comment"> * @license CECILL-v2 &lt;http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt&gt;
</span></span><span id="18" class="l"><a class="l" href="#18"> 18: </a><span class="php-comment"> */</span>
</span><span id="19" class="l"><a class="l" href="#19"> 19: </a>
</span><span id="20" class="l"><a class="l" href="#20"> 20: </a><span class="php-keyword1">class</span> <a id="I18n" href="#I18n">I18n</a> {
</span><span id="21" class="l"><a class="l" href="#21"> 21: </a> <span class="php-comment">/** Format de traduction utilisant les fichier .ini */</span>
</span><span id="22" class="l"><a class="l" href="#22"> 22: </a> <span class="php-keyword1">const</span> <a id="FORMAT_INI" href="#FORMAT_INI">FORMAT_INI</a> = <span class="php-quote">'.ini'</span>;
</span><span id="23" class="l"><a class="l" href="#23"> 23: </a>
</span><span id="24" class="l"><a class="l" href="#24"> 24: </a> <span class="php-comment">/** Instance de la classe pointant sur elle même (pour le pattern singleton) */</span>
</span><span id="25" class="l"><a class="l" href="#25"> 25: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-var"><a id="$instance" href="#$instance">$instance</a></span> = <span class="php-keyword1">null</span>;
</span><span id="26" class="l"><a class="l" href="#26"> 26: </a>
</span><span id="27" class="l"><a class="l" href="#27"> 27: </a> <span class="php-comment">/** Fichiers de traduction disponibles. */</span>
</span><span id="28" class="l"><a class="l" href="#28"> 28: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-var"><a id="$traductions" href="#$traductions">$traductions</a></span> = <span class="php-keyword1">array</span>();
</span><span id="29" class="l"><a class="l" href="#29"> 29: </a>
</span><span id="30" class="l"><a class="l" href="#30"> 30: </a> <span class="php-comment">/** Langue courrante utilisée par l'application. */</span>
</span><span id="31" class="l"><a class="l" href="#31"> 31: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-var"><a id="$langue" href="#$langue">$langue</a></span> = <span class="php-keyword1">null</span>;
</span><span id="32" class="l"><a class="l" href="#32"> 32: </a>
</span><span id="33" class="l"><a class="l" href="#33"> 33: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">function</span> <a id="___construct" href="#___construct">__construct</a>() {
</span><span id="34" class="l"><a class="l" href="#34"> 34: </a> self::verifierParametresConfig();
</span><span id="35" class="l"><a class="l" href="#35"> 35: </a> self::trouverLangue();
</span><span id="36" class="l"><a class="l" href="#36"> 36: </a> }
</span><span id="37" class="l"><a class="l" href="#37"> 37: </a>
</span><span id="38" class="l"><a class="l" href="#38"> 38: </a> <span class="php-comment">/**
</span></span><span id="39" class="l"><a class="l" href="#39"> 39: </a><span class="php-comment"> * Accesseur pour la valeur d'une traduction
</span></span><span id="40" class="l"><a class="l" href="#40"> 40: </a><span class="php-comment"> * @param string $param le nom du paramètre
</span></span><span id="41" class="l"><a class="l" href="#41"> 41: </a><span class="php-comment"> * @return string la valeur du paramètre
</span></span><span id="42" class="l"><a class="l" href="#42"> 42: </a><span class="php-comment"> */</span>
</span><span id="43" class="l"><a class="l" href="#43"> 43: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_get" href="#_get">get</a>(<span class="php-var">$identifiant</span>, <span class="php-var">$langue</span> = <span class="php-keyword1">null</span>) {
</span><span id="44" class="l"><a class="l" href="#44"> 44: </a> self::verifierCreationInstance();
</span><span id="45" class="l"><a class="l" href="#45"> 45: </a> <span class="php-var">$texte</span> = <span class="php-quote">''</span>;
</span><span id="46" class="l"><a class="l" href="#46"> 46: </a>
</span><span id="47" class="l"><a class="l" href="#47"> 47: </a> <span class="php-comment">// Récupération de la langue actuellement demandée</span>
</span><span id="48" class="l"><a class="l" href="#48"> 48: </a> <span class="php-var">$langue_a_charger</span> = self::<span class="php-var">$langue</span>;
</span><span id="49" class="l"><a class="l" href="#49"> 49: </a> <span class="php-keyword1">if</span> (!<span class="php-keyword2">is_null</span>(<span class="php-var">$langue</span>)) {
</span><span id="50" class="l"><a class="l" href="#50"> 50: </a> <span class="php-var">$langue_a_charger</span> = <span class="php-var">$langue</span>;
</span><span id="51" class="l"><a class="l" href="#51"> 51: </a> }
</span><span id="52" class="l"><a class="l" href="#52"> 52: </a>
</span><span id="53" class="l"><a class="l" href="#53"> 53: </a> <span class="php-keyword1">if</span> (!<span class="php-keyword1">isset</span>(self::<span class="php-var">$traductions</span>[<span class="php-var">$langue_a_charger</span>])) {
</span><span id="54" class="l"><a class="l" href="#54"> 54: </a> <span class="php-comment">// Tentative de chargement du fichier de traduction</span>
</span><span id="55" class="l"><a class="l" href="#55"> 55: </a> <span class="php-var">$chargement</span> = self::charger(<span class="php-var">$langue_a_charger</span>);
</span><span id="56" class="l"><a class="l" href="#56"> 56: </a> <span class="php-keyword1">if</span> (<span class="php-var">$chargement</span> === <span class="php-keyword1">false</span>) {
</span><span id="57" class="l"><a class="l" href="#57"> 57: </a> <span class="php-var">$m</span> = <span class="php-quote">&quot;Le fichier d'i18n pour la langue '</span><span class="php-var">$langue_a_charger</span><span class="php-quote">' demandée n'a pas été trouvé.&quot;</span>;
</span><span id="58" class="l"><a class="l" href="#58"> 58: </a> self::ajouterErreur(<span class="php-var">$m</span>);
</span><span id="59" class="l"><a class="l" href="#59"> 59: </a> }
</span><span id="60" class="l"><a class="l" href="#60"> 60: </a> }
</span><span id="61" class="l"><a class="l" href="#61"> 61: </a>
</span><span id="62" class="l"><a class="l" href="#62"> 62: </a> <span class="php-comment">// Recherche de la langue dans le tableau des traductions</span>
</span><span id="63" class="l"><a class="l" href="#63"> 63: </a> <span class="php-keyword1">if</span> (<span class="php-keyword1">isset</span>(self::<span class="php-var">$traductions</span>[<span class="php-var">$langue_a_charger</span>]) &amp;&amp; self::<span class="php-var">$traductions</span>[<span class="php-var">$langue_a_charger</span>] !== <span class="php-keyword1">false</span>) {
</span><span id="64" class="l"><a class="l" href="#64"> 64: </a> <span class="php-comment">// Recherche de la traduction demandée</span>
</span><span id="65" class="l"><a class="l" href="#65"> 65: </a> <span class="php-var">$valeur</span> = self::getValeur(<span class="php-var">$identifiant</span>, self::<span class="php-var">$traductions</span>[<span class="php-var">$langue_a_charger</span>]);
</span><span id="66" class="l"><a class="l" href="#66"> 66: </a> <span class="php-keyword1">if</span> (<span class="php-var">$valeur</span> !== <span class="php-keyword1">false</span>) {
</span><span id="67" class="l"><a class="l" href="#67"> 67: </a> <span class="php-var">$texte</span> = <span class="php-var">$valeur</span>;
</span><span id="68" class="l"><a class="l" href="#68"> 68: </a> } <span class="php-keyword1">else</span> {
</span><span id="69" class="l"><a class="l" href="#69"> 69: </a> <span class="php-var">$m</span> = <span class="php-quote">&quot;Le traduction n'existe pas pour l'identifiant '</span><span class="php-var">$identifiant</span><span class="php-quote">' demandé.&quot;</span>;
</span><span id="70" class="l"><a class="l" href="#70"> 70: </a> self::ajouterErreur(<span class="php-var">$m</span>);
</span><span id="71" class="l"><a class="l" href="#71"> 71: </a> }
</span><span id="72" class="l"><a class="l" href="#72"> 72: </a> }
</span><span id="73" class="l"><a class="l" href="#73"> 73: </a>
</span><span id="74" class="l"><a class="l" href="#74"> 74: </a> <span class="php-keyword1">return</span> <span class="php-var">$texte</span>;
</span><span id="75" class="l"><a class="l" href="#75"> 75: </a> }
</span><span id="76" class="l"><a class="l" href="#76"> 76: </a>
</span><span id="77" class="l"><a class="l" href="#77"> 77: </a> <span class="php-comment">/**
</span></span><span id="78" class="l"><a class="l" href="#78"> 78: </a><span class="php-comment"> * Charge un fichier ini dans le tableau des paramètres de l'appli
</span></span><span id="79" class="l"><a class="l" href="#79"> 79: </a><span class="php-comment"> * @param string $fichier_ini le nom du fichier à charger
</span></span><span id="80" class="l"><a class="l" href="#80"> 80: </a><span class="php-comment"> * @return boolean true, si le fichier a été trouvé et correctement chargé, sinon false.
</span></span><span id="81" class="l"><a class="l" href="#81"> 81: </a><span class="php-comment"> */</span>
</span><span id="82" class="l"><a class="l" href="#82"> 82: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_charger" href="#_charger">charger</a>(<span class="php-var">$langue</span>, <span class="php-var">$fichier</span> = <span class="php-keyword1">null</span>, <span class="php-var">$format</span> = self::FORMAT_INI) {
</span><span id="83" class="l"><a class="l" href="#83"> 83: </a> self::verifierCreationInstance();
</span><span id="84" class="l"><a class="l" href="#84"> 84: </a> <span class="php-var">$ok</span> = <span class="php-keyword1">false</span>;
</span><span id="85" class="l"><a class="l" href="#85"> 85: </a>
</span><span id="86" class="l"><a class="l" href="#86"> 86: </a> <span class="php-comment">// Création du chemin vers le fichier de traduction par défaut</span>
</span><span id="87" class="l"><a class="l" href="#87"> 87: </a> <span class="php-keyword1">if</span> (<span class="php-keyword2">is_null</span>(<span class="php-var">$fichier</span>)) {
</span><span id="88" class="l"><a class="l" href="#88"> 88: </a> <span class="php-var">$fichier</span> = Config::get(<span class="php-quote">'chemin_i18n'</span>).<span class="php-var">$langue</span>.<span class="php-var">$format</span>;
</span><span id="89" class="l"><a class="l" href="#89"> 89: </a> }
</span><span id="90" class="l"><a class="l" href="#90"> 90: </a>
</span><span id="91" class="l"><a class="l" href="#91"> 91: </a> <span class="php-comment">// Chargement</span>
</span><span id="92" class="l"><a class="l" href="#92"> 92: </a> <span class="php-keyword1">if</span> (<span class="php-var">$format</span> == self::FORMAT_INI) {
</span><span id="93" class="l"><a class="l" href="#93"> 93: </a> <span class="php-var">$ok</span> = self::chargerFichierIni(<span class="php-var">$fichier</span>, <span class="php-var">$langue</span>);
</span><span id="94" class="l"><a class="l" href="#94"> 94: </a> } <span class="php-keyword1">else</span> {
</span><span id="95" class="l"><a class="l" href="#95"> 95: </a> <span class="php-var">$m</span> = <span class="php-quote">&quot;Le format '</span><span class="php-var">$format</span><span class="php-quote">' de fichier de traduction n'est pas pris en compte par le Framework.&quot;</span>;
</span><span id="96" class="l"><a class="l" href="#96"> 96: </a> self::ajouterErreur(<span class="php-var">$m</span>);
</span><span id="97" class="l"><a class="l" href="#97"> 97: </a> }
</span><span id="98" class="l"><a class="l" href="#98"> 98: </a>
</span><span id="99" class="l"><a class="l" href="#99"> 99: </a> <span class="php-keyword1">return</span> <span class="php-var">$ok</span>;
</span><span id="100" class="l"><a class="l" href="#100">100: </a> }
</span><span id="101" class="l"><a class="l" href="#101">101: </a>
</span><span id="102" class="l"><a class="l" href="#102">102: </a> <span class="php-comment">/**
</span></span><span id="103" class="l"><a class="l" href="#103">103: </a><span class="php-comment"> * Définit la langue utiliser pour rechercher une traduction.
</span></span><span id="104" class="l"><a class="l" href="#104">104: </a><span class="php-comment"> * @param string $fichier_ini le nom du fichier à charger
</span></span><span id="105" class="l"><a class="l" href="#105">105: </a><span class="php-comment"> * @return array le fichier ini parsé
</span></span><span id="106" class="l"><a class="l" href="#106">106: </a><span class="php-comment"> */</span>
</span><span id="107" class="l"><a class="l" href="#107">107: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_setLangue" href="#_setLangue">setLangue</a>(<span class="php-var">$langue</span>) {
</span><span id="108" class="l"><a class="l" href="#108">108: </a> self::verifierCreationInstance();
</span><span id="109" class="l"><a class="l" href="#109">109: </a> self::<span class="php-var">$langue</span> = <span class="php-var">$langue</span>;
</span><span id="110" class="l"><a class="l" href="#110">110: </a> }
</span><span id="111" class="l"><a class="l" href="#111">111: </a>
</span><span id="112" class="l"><a class="l" href="#112">112: </a> <span class="php-comment">/**
</span></span><span id="113" class="l"><a class="l" href="#113">113: </a><span class="php-comment"> * Renvoie la valeur demandé grâce une chaine de paramètres
</span></span><span id="114" class="l"><a class="l" href="#114">114: </a><span class="php-comment"> * @param string $param la chaine identifiante
</span></span><span id="115" class="l"><a class="l" href="#115">115: </a><span class="php-comment"> * @param array $i18n le tableau de traductions
</span></span><span id="116" class="l"><a class="l" href="#116">116: </a><span class="php-comment"> * @return mixed la valeur correspondante à la chaine identifiante si elle est trouvée, sinon false.
</span></span><span id="117" class="l"><a class="l" href="#117">117: </a><span class="php-comment"> */</span>
</span><span id="118" class="l"><a class="l" href="#118">118: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_getValeur" href="#_getValeur">getValeur</a>(<span class="php-var">$param</span>, <span class="php-var">$i18n</span>) {
</span><span id="119" class="l"><a class="l" href="#119">119: </a> <span class="php-keyword1">if</span> (<span class="php-var">$param</span> === <span class="php-keyword1">null</span>) {
</span><span id="120" class="l"><a class="l" href="#120">120: </a> <span class="php-keyword1">return</span> <span class="php-keyword1">false</span>;
</span><span id="121" class="l"><a class="l" href="#121">121: </a> } <span class="php-keyword1">else</span> {
</span><span id="122" class="l"><a class="l" href="#122">122: </a> <span class="php-keyword1">if</span> (<span class="php-keyword1">isset</span>(<span class="php-var">$i18n</span>[<span class="php-var">$param</span>])) {
</span><span id="123" class="l"><a class="l" href="#123">123: </a> <span class="php-keyword1">return</span> <span class="php-var">$i18n</span>[<span class="php-var">$param</span>];
</span><span id="124" class="l"><a class="l" href="#124">124: </a> } <span class="php-keyword1">else</span> <span class="php-keyword1">if</span> (<span class="php-keyword2">strpos</span>(<span class="php-var">$param</span>, <span class="php-quote">'.'</span>) !== <span class="php-keyword1">false</span>) {
</span><span id="125" class="l"><a class="l" href="#125">125: </a> <span class="php-var">$pieces</span> = <span class="php-keyword2">explode</span>(<span class="php-quote">'.'</span>, <span class="php-var">$param</span>, <span class="php-num">2</span>);
</span><span id="126" class="l"><a class="l" href="#126">126: </a> <span class="php-keyword1">if</span> (<span class="php-keyword2">strlen</span>(<span class="php-var">$pieces</span>[<span class="php-num">0</span>]) &amp;&amp; <span class="php-keyword2">strlen</span>(<span class="php-var">$pieces</span>[<span class="php-num">1</span>])) {
</span><span id="127" class="l"><a class="l" href="#127">127: </a> <span class="php-keyword1">if</span> (<span class="php-keyword1">isset</span>(<span class="php-var">$i18n</span>[<span class="php-var">$pieces</span>[<span class="php-num">0</span>]])) {
</span><span id="128" class="l"><a class="l" href="#128">128: </a> <span class="php-keyword1">if</span> (<span class="php-keyword2">is_array</span>(<span class="php-var">$i18n</span>[<span class="php-var">$pieces</span>[<span class="php-num">0</span>]])) {
</span><span id="129" class="l"><a class="l" href="#129">129: </a> <span class="php-keyword1">return</span> self::getValeur(<span class="php-var">$pieces</span>[<span class="php-num">1</span>], <span class="php-var">$i18n</span>[<span class="php-var">$pieces</span>[<span class="php-num">0</span>]]);
</span><span id="130" class="l"><a class="l" href="#130">130: </a> }
</span><span id="131" class="l"><a class="l" href="#131">131: </a> }
</span><span id="132" class="l"><a class="l" href="#132">132: </a> }
</span><span id="133" class="l"><a class="l" href="#133">133: </a> } <span class="php-keyword1">else</span> {
</span><span id="134" class="l"><a class="l" href="#134">134: </a> <span class="php-keyword1">return</span> <span class="php-keyword1">false</span>;
</span><span id="135" class="l"><a class="l" href="#135">135: </a> }
</span><span id="136" class="l"><a class="l" href="#136">136: </a> }
</span><span id="137" class="l"><a class="l" href="#137">137: </a> }
</span><span id="138" class="l"><a class="l" href="#138">138: </a>
</span><span id="139" class="l"><a class="l" href="#139">139: </a> <span class="php-comment">/**
</span></span><span id="140" class="l"><a class="l" href="#140">140: </a><span class="php-comment"> * Parse le fichier ini donné en paramètre
</span></span><span id="141" class="l"><a class="l" href="#141">141: </a><span class="php-comment"> * @param string $fichier_ini nom du fichier ini à parser
</span></span><span id="142" class="l"><a class="l" href="#142">142: </a><span class="php-comment"> * @param string $langue la langue correspondant au fichier
</span></span><span id="143" class="l"><a class="l" href="#143">143: </a><span class="php-comment"> * @return boolean true si le chargement c'est bien passé, sinon false.
</span></span><span id="144" class="l"><a class="l" href="#144">144: </a><span class="php-comment"> */</span>
</span><span id="145" class="l"><a class="l" href="#145">145: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_chargerFichierIni" href="#_chargerFichierIni">chargerFichierIni</a>(<span class="php-var">$fichier_ini</span>, <span class="php-var">$langue</span>) {
</span><span id="146" class="l"><a class="l" href="#146">146: </a> self::<span class="php-var">$traductions</span>[<span class="php-var">$langue</span>] = <span class="php-keyword1">false</span>;
</span><span id="147" class="l"><a class="l" href="#147">147: </a> <span class="php-keyword1">if</span> (<span class="php-keyword2">file_exists</span>(<span class="php-var">$fichier_ini</span>)) {
</span><span id="148" class="l"><a class="l" href="#148">148: </a> <span class="php-var">$ini</span> = <span class="php-keyword2">parse_ini_file</span>(<span class="php-var">$fichier_ini</span>, <span class="php-keyword1">true</span>);
</span><span id="149" class="l"><a class="l" href="#149">149: </a> Debug::printr(<span class="php-var">$ini</span>, <span class="php-quote">'Avant :'</span>);
</span><span id="150" class="l"><a class="l" href="#150">150: </a> <span class="php-var">$ini</span> = self::analyserTableauIni(<span class="php-var">$ini</span>);
</span><span id="151" class="l"><a class="l" href="#151">151: </a> Debug::printr(<span class="php-var">$ini</span>, <span class="php-quote">'Aprés :'</span>);
</span><span id="152" class="l"><a class="l" href="#152">152: </a> self::<span class="php-var">$traductions</span>[<span class="php-var">$langue</span>] = <span class="php-var">$ini</span>;
</span><span id="153" class="l"><a class="l" href="#153">153: </a> }
</span><span id="154" class="l"><a class="l" href="#154">154: </a> <span class="php-keyword1">return</span> (self::<span class="php-var">$traductions</span>[<span class="php-var">$langue</span>] === <span class="php-keyword1">false</span>) ? <span class="php-keyword1">false</span> : <span class="php-keyword1">true</span>;
</span><span id="155" class="l"><a class="l" href="#155">155: </a> }
</span><span id="156" class="l"><a class="l" href="#156">156: </a>
</span><span id="157" class="l"><a class="l" href="#157">157: </a> <span class="php-comment">/**
</span></span><span id="158" class="l"><a class="l" href="#158">158: </a><span class="php-comment"> * Analyse un tableau de traductions pour évaluer les clés.
</span></span><span id="159" class="l"><a class="l" href="#159">159: </a><span class="php-comment"> * @param array $i18n le tableau de traductions
</span></span><span id="160" class="l"><a class="l" href="#160">160: </a><span class="php-comment"> * @return array le tableau analysé et modifié si nécessaire.
</span></span><span id="161" class="l"><a class="l" href="#161">161: </a><span class="php-comment"> */</span>
</span><span id="162" class="l"><a class="l" href="#162">162: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_analyserTableauIni" href="#_analyserTableauIni">analyserTableauIni</a>(<span class="php-var">$i18n</span> = <span class="php-keyword1">array</span>()) {
</span><span id="163" class="l"><a class="l" href="#163">163: </a> <span class="php-comment">//ATTENTION : il est important de passer la valeur par référence car nous la modifions dynamiquement dans la boucle</span>
</span><span id="164" class="l"><a class="l" href="#164">164: </a> <span class="php-keyword1">foreach</span> (<span class="php-var">$i18n</span> <span class="php-keyword1">as</span> <span class="php-var">$cle</span> =&gt; &amp;<span class="php-var">$valeur</span>) {
</span><span id="165" class="l"><a class="l" href="#165">165: </a> <span class="php-keyword1">if</span> (<span class="php-keyword2">is_array</span>(<span class="php-var">$valeur</span>)) {
</span><span id="166" class="l"><a class="l" href="#166">166: </a> <span class="php-var">$i18n</span>[<span class="php-var">$cle</span>] = self::analyserTableauIni(<span class="php-var">$valeur</span>);
</span><span id="167" class="l"><a class="l" href="#167">167: </a> } <span class="php-keyword1">else</span> {
</span><span id="168" class="l"><a class="l" href="#168">168: </a> <span class="php-var">$i18n</span> = self::evaluerCle(<span class="php-var">$i18n</span>, <span class="php-var">$cle</span>, <span class="php-var">$valeur</span>);
</span><span id="169" class="l"><a class="l" href="#169">169: </a> }
</span><span id="170" class="l"><a class="l" href="#170">170: </a> }
</span><span id="171" class="l"><a class="l" href="#171">171: </a> <span class="php-keyword1">return</span> <span class="php-var">$i18n</span>;
</span><span id="172" class="l"><a class="l" href="#172">172: </a> }
</span><span id="173" class="l"><a class="l" href="#173">173: </a>
</span><span id="174" class="l"><a class="l" href="#174">174: </a> <span class="php-comment">/**
</span></span><span id="175" class="l"><a class="l" href="#175">175: </a><span class="php-comment"> * Dans le cas des chaines de traduction à sous clé (ex.: cle.souscle), cette méthode
</span></span><span id="176" class="l"><a class="l" href="#176">176: </a><span class="php-comment"> * évalue les valeurs correspondantes et créée les sous tableaux associés.
</span></span><span id="177" class="l"><a class="l" href="#177">177: </a><span class="php-comment"> * @param array $i18n tableau de traductions (par référence)
</span></span><span id="178" class="l"><a class="l" href="#178">178: </a><span class="php-comment"> * @param string $cle la cle dans le tableau
</span></span><span id="179" class="l"><a class="l" href="#179">179: </a><span class="php-comment"> * @param string $valeur la valeur à affecter
</span></span><span id="180" class="l"><a class="l" href="#180">180: </a><span class="php-comment"> */</span>
</span><span id="181" class="l"><a class="l" href="#181">181: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_evaluerCle" href="#_evaluerCle">evaluerCle</a>(<span class="php-var">$i18n</span>, <span class="php-var">$cle</span>, <span class="php-var">$valeur</span>) {
</span><span id="182" class="l"><a class="l" href="#182">182: </a> <span class="php-keyword1">if</span> (<span class="php-keyword2">strpos</span>(<span class="php-var">$cle</span>, <span class="php-quote">'.'</span>) !== <span class="php-keyword1">false</span>) {
</span><span id="183" class="l"><a class="l" href="#183">183: </a> <span class="php-keyword1">unset</span>(<span class="php-var">$i18n</span>[<span class="php-var">$cle</span>]);
</span><span id="184" class="l"><a class="l" href="#184">184: </a> <span class="php-var">$pieces</span> = <span class="php-keyword2">explode</span>(<span class="php-quote">'.'</span>, <span class="php-var">$cle</span>, <span class="php-num">2</span>);
</span><span id="185" class="l"><a class="l" href="#185">185: </a> <span class="php-keyword1">if</span> (<span class="php-keyword2">strlen</span>(<span class="php-var">$pieces</span>[<span class="php-num">0</span>]) &amp;&amp; <span class="php-keyword2">strlen</span>(<span class="php-var">$pieces</span>[<span class="php-num">1</span>])) {
</span><span id="186" class="l"><a class="l" href="#186">186: </a> <span class="php-keyword1">if</span> (<span class="php-keyword1">isset</span>(<span class="php-var">$i18n</span>[<span class="php-var">$pieces</span>[<span class="php-num">0</span>]]) &amp;&amp; !<span class="php-keyword2">is_array</span>(<span class="php-var">$i18n</span>[<span class="php-var">$pieces</span>[<span class="php-num">0</span>]])) {
</span><span id="187" class="l"><a class="l" href="#187">187: </a> <span class="php-var">$m</span> = <span class="php-quote">&quot;Ne peut pas créer de sous-clé pour '</span><span class="php-var">{$pieces[0]}</span><span class="php-quote">' car la clé existe déjà&quot;</span>;
</span><span id="188" class="l"><a class="l" href="#188">188: </a> <span class="php-keyword2">trigger_error</span>(<span class="php-var">$m</span>, E_USER_WARNING);
</span><span id="189" class="l"><a class="l" href="#189">189: </a> } <span class="php-keyword1">else</span> {
</span><span id="190" class="l"><a class="l" href="#190">190: </a> <span class="php-var">$i18n</span>[<span class="php-var">$pieces</span>[<span class="php-num">0</span>]][<span class="php-var">$pieces</span>[<span class="php-num">1</span>]] = <span class="php-var">$valeur</span>;
</span><span id="191" class="l"><a class="l" href="#191">191: </a> <span class="php-var">$i18n</span>[<span class="php-var">$pieces</span>[<span class="php-num">0</span>]] = self::evaluerCle(<span class="php-var">$i18n</span>[<span class="php-var">$pieces</span>[<span class="php-num">0</span>]], <span class="php-var">$pieces</span>[<span class="php-num">1</span>], <span class="php-var">$valeur</span>);
</span><span id="192" class="l"><a class="l" href="#192">192: </a> }
</span><span id="193" class="l"><a class="l" href="#193">193: </a> } <span class="php-keyword1">else</span> {
</span><span id="194" class="l"><a class="l" href="#194">194: </a> <span class="php-var">$m</span> = <span class="php-quote">&quot;Clé invalide '</span><span class="php-var">$cle</span><span class="php-quote">'&quot;</span>;
</span><span id="195" class="l"><a class="l" href="#195">195: </a> <span class="php-keyword2">trigger_error</span>(<span class="php-var">$m</span>, E_USER_WARNING);
</span><span id="196" class="l"><a class="l" href="#196">196: </a> }
</span><span id="197" class="l"><a class="l" href="#197">197: </a> } <span class="php-keyword1">else</span> {
</span><span id="198" class="l"><a class="l" href="#198">198: </a> <span class="php-var">$i18n</span>[<span class="php-var">$cle</span>] = <span class="php-var">$valeur</span>;
</span><span id="199" class="l"><a class="l" href="#199">199: </a> }
</span><span id="200" class="l"><a class="l" href="#200">200: </a> <span class="php-keyword1">return</span> <span class="php-var">$i18n</span>;
</span><span id="201" class="l"><a class="l" href="#201">201: </a> }
</span><span id="202" class="l"><a class="l" href="#202">202: </a>
</span><span id="203" class="l"><a class="l" href="#203">203: </a> <span class="php-comment">/**
</span></span><span id="204" class="l"><a class="l" href="#204">204: </a><span class="php-comment"> * Cherche l'information sur la langue demandée par l'application
</span></span><span id="205" class="l"><a class="l" href="#205">205: </a><span class="php-comment"> */</span>
</span><span id="206" class="l"><a class="l" href="#206">206: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_trouverLangue" href="#_trouverLangue">trouverLangue</a>() {
</span><span id="207" class="l"><a class="l" href="#207">207: </a> <span class="php-keyword1">if</span> (<span class="php-keyword1">isset</span>(<span class="php-var">$_GET</span>[Config::get(<span class="php-quote">'i18n_url_parametre'</span>)])) {
</span><span id="208" class="l"><a class="l" href="#208">208: </a> self::<span class="php-var">$langue</span> = <span class="php-var">$_GET</span>[Config::get(<span class="php-quote">'i18n_url_parametre'</span>)];
</span><span id="209" class="l"><a class="l" href="#209">209: </a> } <span class="php-keyword1">else</span> {
</span><span id="210" class="l"><a class="l" href="#210">210: </a> self::<span class="php-var">$langue</span> = Config::get(<span class="php-quote">'i18n_langue_defaut'</span>);
</span><span id="211" class="l"><a class="l" href="#211">211: </a> }
</span><span id="212" class="l"><a class="l" href="#212">212: </a> }
</span><span id="213" class="l"><a class="l" href="#213">213: </a>
</span><span id="214" class="l"><a class="l" href="#214">214: </a> <span class="php-comment">/**
</span></span><span id="215" class="l"><a class="l" href="#215">215: </a><span class="php-comment"> * Vérifie si l'instance de classe à été crée, si non la crée
</span></span><span id="216" class="l"><a class="l" href="#216">216: </a><span class="php-comment"> */</span>
</span><span id="217" class="l"><a class="l" href="#217">217: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_verifierCreationInstance" href="#_verifierCreationInstance">verifierCreationInstance</a>() {
</span><span id="218" class="l"><a class="l" href="#218">218: </a> <span class="php-keyword1">if</span> (<span class="php-keyword1">empty</span>(self::<span class="php-var">$instance</span>)) {
</span><span id="219" class="l"><a class="l" href="#219">219: </a> self::<span class="php-var">$instance</span> = <span class="php-keyword1">new</span> I18n();
</span><span id="220" class="l"><a class="l" href="#220">220: </a> }
</span><span id="221" class="l"><a class="l" href="#221">221: </a> }
</span><span id="222" class="l"><a class="l" href="#222">222: </a>
</span><span id="223" class="l"><a class="l" href="#223">223: </a> <span class="php-comment">/**
</span></span><span id="224" class="l"><a class="l" href="#224">224: </a><span class="php-comment"> * Vérifie que tous les paramêtres de config nécessaires au fonctionnement de cette classe existe dans les fichiers
</span></span><span id="225" class="l"><a class="l" href="#225">225: </a><span class="php-comment"> * de configurations.
</span></span><span id="226" class="l"><a class="l" href="#226">226: </a><span class="php-comment"> */</span>
</span><span id="227" class="l"><a class="l" href="#227">227: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_verifierParametresConfig" href="#_verifierParametresConfig">verifierParametresConfig</a>() {
</span><span id="228" class="l"><a class="l" href="#228">228: </a> <span class="php-var">$ok</span> = <span class="php-keyword1">true</span>;
</span><span id="229" class="l"><a class="l" href="#229">229: </a> <span class="php-var">$parametres</span> = <span class="php-keyword1">array</span>(<span class="php-quote">'chemin_i18n'</span>, <span class="php-quote">'i18n_url_parametre'</span>, <span class="php-quote">'i18n_langue_defaut'</span>);
</span><span id="230" class="l"><a class="l" href="#230">230: </a> <span class="php-keyword1">foreach</span> (<span class="php-var">$parametres</span> <span class="php-keyword1">as</span> <span class="php-var">$param</span>) {
</span><span id="231" class="l"><a class="l" href="#231">231: </a> <span class="php-keyword1">if</span> (<span class="php-keyword2">is_null</span>(Config::get(<span class="php-var">$param</span>))) {
</span><span id="232" class="l"><a class="l" href="#232">232: </a> <span class="php-var">$m</span> = <span class="php-quote">&quot;L'utilisation de la classe I18n nécessite de définir '</span><span class="php-var">$param</span><span class="php-quote">' dans un fichier de configuration.&quot;</span>;
</span><span id="233" class="l"><a class="l" href="#233">233: </a> self::ajouterErreur(<span class="php-var">$m</span>);
</span><span id="234" class="l"><a class="l" href="#234">234: </a> <span class="php-var">$ok</span> = <span class="php-keyword1">false</span>;
</span><span id="235" class="l"><a class="l" href="#235">235: </a> }
</span><span id="236" class="l"><a class="l" href="#236">236: </a> }
</span><span id="237" class="l"><a class="l" href="#237">237: </a> <span class="php-keyword1">return</span> <span class="php-var">$ok</span>;
</span><span id="238" class="l"><a class="l" href="#238">238: </a> }
</span><span id="239" class="l"><a class="l" href="#239">239: </a>
</span><span id="240" class="l"><a class="l" href="#240">240: </a> <span class="php-comment">/**
</span></span><span id="241" class="l"><a class="l" href="#241">241: </a><span class="php-comment"> * Ajouter une message d'erreur
</span></span><span id="242" class="l"><a class="l" href="#242">242: </a><span class="php-comment"> */</span>
</span><span id="243" class="l"><a class="l" href="#243">243: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_ajouterErreur" href="#_ajouterErreur">ajouterErreur</a>(<span class="php-var">$m</span>, <span class="php-var">$e</span> = E_USER_WARNING) {
</span><span id="244" class="l"><a class="l" href="#244">244: </a> <span class="php-keyword1">if</span> (Config::get(<span class="php-quote">'fw_debogage'</span>) === <span class="php-keyword1">true</span>) {
</span><span id="245" class="l"><a class="l" href="#245">245: </a> <span class="php-keyword2">trigger_error</span>(<span class="php-var">$m</span>, <span class="php-var">$e</span>);
</span><span id="246" class="l"><a class="l" href="#246">246: </a> }
</span><span id="247" class="l"><a class="l" href="#247">247: </a> }
</span><span id="248" class="l"><a class="l" href="#248">248: </a></span>}</code></pre>
 
<div id="footer">
TBFramework - v0.2 API documentation generated by <a href="http://apigen.org">ApiGen 2.8.0</a>
</div>
</div>
</div>
</body>
</html>
/branches/v0.2-buhl/doc/ApiGen/package-PHP.html
7,7 → 7,7
<title>Package PHP | TBFramework - v0.2</title>
 
<script type="text/javascript" src="resources/combined.js?4205936287"></script>
<script type="text/javascript" src="elementlist.js?117657638"></script>
<script type="text/javascript" src="elementlist.js?1835392179"></script>
<link rel="stylesheet" type="text/css" media="all" href="resources/style.css?3505392360">
 
</head>
/branches/v0.2-buhl/doc/ApiGen/class-I18n.html
New file
0,0 → 1,344
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="generator" content="ApiGen 2.8.0">
 
<title>Class I18n | TBFramework - v0.2</title>
 
<script type="text/javascript" src="resources/combined.js?4205936287"></script>
<script type="text/javascript" src="elementlist.js?1835392179"></script>
<link rel="stylesheet" type="text/css" media="all" href="resources/style.css?3505392360">
 
</head>
 
<body>
<div id="left">
<div id="menu">
<a href="index.html" title="Overview"><span>Overview</span></a>
 
 
<div id="groups">
<h3>Packages</h3>
<ul>
<li class="active"><a href="package-Framework.html">Framework</a>
</li>
<li><a href="package-PHP.html">PHP</a>
</li>
</ul>
</div>
 
<hr>
 
 
<div id="elements">
<h3>Classes</h3>
<ul>
<li><a href="class-Application.html">Application</a></li>
<li><a href="class-Chronometre.html">Chronometre</a></li>
<li><a href="class-Config.html">Config</a></li>
<li><a href="class-Controleur.html">Controleur</a></li>
<li><a href="class-Debug.html">Debug</a></li>
<li><a href="class-GestionnaireException.html">GestionnaireException</a></li>
<li class="active"><a href="class-I18n.html">I18n</a></li>
<li><a href="class-Log.html">Log</a></li>
<li><a href="class-Modele.html">Modele</a></li>
<li><a href="class-Registre.html">Registre</a></li>
<li><a href="class-SquelettePhp.html">SquelettePhp</a></li>
<li><a href="class-Url.html">Url</a></li>
</ul>
 
 
 
 
 
<h3>Functions</h3>
<ul>
<li><a href="function-autoloadAppliDefaut.html">autoloadAppliDefaut</a></li>
<li><a href="function-autoloadFw.html">autoloadFw</a></li>
</ul>
</div>
</div>
</div>
 
<div id="splitter"></div>
 
<div id="right">
<div id="rightInner">
<form id="search">
<input type="hidden" name="cx" value="">
<input type="hidden" name="ie" value="UTF-8">
<input type="text" name="q" class="text">
<input type="submit" value="Search">
</form>
 
<div id="navigation">
<ul>
<li>
<a href="index.html" title="Overview"><span>Overview</span></a>
</li>
<li>
<a href="package-Framework.html" title="Summary of Framework"><span>Package</span></a>
</li>
<li class="active">
<span>Class</span> </li>
</ul>
<ul>
<li>
<a href="tree.html" title="Tree view of classes, interfaces, traits and exceptions"><span>Tree</span></a>
</li>
<li>
<a href="deprecated.html" title="List of deprecated elements"><span>Deprecated</span></a>
</li>
<li>
<a href="todo.html" title="Todo list"><span>Todo</span></a>
</li>
</ul>
<ul>
</ul>
</div>
 
<div id="content" class="class">
<h1>Class I18n</h1>
 
 
<div class="description">
<p>I18n permet de traduire une application à partir de données stockées dans
des fichiers ini. Si vous souhaitez utiliser le fonctionnement par défaut vous
devrez :</p>
 
<ul>
<li>déposer les fichiers ini dans le dossier définit par la variable de config
"chemin_i18n".</li>
 
<li>nommer les fichiers selon la forme "locale.ini" (Ex.: fr.ini ou fr_CH.ini
).</li>
</ul>
 
<p>Elle offre l'accès en lecture seule aux paramètres de des fichiers ini.
C'est une Singleton. Une seule classe de traduction peut être instanciée par
Application.</p>
 
</div>
 
 
 
 
 
 
 
 
 
<div class="info">
<b>Package:</b> <a href="package-Framework.html">Framework</a><br>
 
<b>Category:</b>
PHP 5.2<br>
<b>Copyright:</b>
Copyright (c) 2010, Tela Botanica (<a
href="mailto:accueil&#64;tela-botanica.org">accueil&#64;<!-- -->tela-botanica.org</a>)<br>
<b>License:</b>
<a href="GNU-GPL-v3">&lt;http://www.gnu.org/licenses/gpl.html&gt;</a><br>
<b>License:</b>
<a href="CECILL-v2">&lt;http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt&gt;</a><br>
<b>Author:</b>
Jean-Pascal MILCENT &lt;<a
href="mailto:jpm&#64;tela-botanica.org">jpm&#64;<!-- -->tela-botanica.org</a>&gt;<br>
<b>Located at</b> <a href="source-class-I18n.html#4-248" title="Go to source code">I18n.php</a><br>
</div>
 
 
 
<table class="summary" id="methods">
<caption>Methods summary</caption>
<tr data-order="get" id="_get">
 
<td class="attributes"><code>
public static
string
</code>
</td>
 
<td class="name"><div>
<a class="anchor" href="#_get">#</a>
<code><a href="source-class-I18n.html#38-75" title="Go to source code">get</a>( <span>string <var>$identifiant</var></span>, <span>mixed <var>$langue</var> = <span class="php-keyword1">null</span></span> )</code>
 
<div class="description short">
<p>Accesseur pour la valeur d'une traduction</p>
 
</div>
 
<div class="description detailed hidden">
<p>Accesseur pour la valeur d'une traduction</p>
 
 
 
<h4>Parameters</h4>
<div class="list"><dl>
<dt><var>$identifiant</var></dt>
<dd><code>string</code><br>$param le nom du paramètre</dd>
<dt><var>$langue</var></dt>
<dd></dd>
</dl></div>
 
<h4>Returns</h4>
<div class="list">
<code>string</code><br>la valeur du paramètre<br>
</div>
 
 
 
 
</div>
</div></td>
</tr>
<tr data-order="charger" id="_charger">
 
<td class="attributes"><code>
public static
boolean
</code>
</td>
 
<td class="name"><div>
<a class="anchor" href="#_charger">#</a>
<code><a href="source-class-I18n.html#77-100" title="Go to source code">charger</a>( <span>string <var>$langue</var></span>, <span>mixed <var>$fichier</var> = <span class="php-keyword1">null</span></span>, <span>mixed <var>$format</var> = <code><a href="class-I18n.html#FORMAT_INI">I18n::<b>FORMAT_INI</b></a></code></span> )</code>
 
<div class="description short">
<p>Charge un fichier ini dans le tableau des paramètres de l'appli</p>
 
</div>
 
<div class="description detailed hidden">
<p>Charge un fichier ini dans le tableau des paramètres de l'appli</p>
 
 
 
<h4>Parameters</h4>
<div class="list"><dl>
<dt><var>$langue</var></dt>
<dd><code>string</code><br>$fichier_ini le nom du fichier à charger</dd>
<dt><var>$fichier</var></dt>
<dd></dd>
<dt><var>$format</var></dt>
<dd></dd>
</dl></div>
 
<h4>Returns</h4>
<div class="list">
<code>boolean</code><br>true, si le fichier a été trouvé et correctement chargé, sinon false.<br>
</div>
 
 
 
 
</div>
</div></td>
</tr>
<tr data-order="setLangue" id="_setLangue">
 
<td class="attributes"><code>
public static
array
</code>
</td>
 
<td class="name"><div>
<a class="anchor" href="#_setLangue">#</a>
<code><a href="source-class-I18n.html#102-110" title="Go to source code">setLangue</a>( <span>string <var>$langue</var></span> )</code>
 
<div class="description short">
<p>Définit la langue utiliser pour rechercher une traduction.</p>
 
</div>
 
<div class="description detailed hidden">
<p>Définit la langue utiliser pour rechercher une traduction.</p>
 
 
 
<h4>Parameters</h4>
<div class="list"><dl>
<dt><var>$langue</var></dt>
<dd><code>string</code><br>$fichier_ini le nom du fichier à charger</dd>
</dl></div>
 
<h4>Returns</h4>
<div class="list">
<code>array</code><br>le fichier ini parsé<br>
</div>
 
 
 
 
</div>
</div></td>
</tr>
</table>
 
 
 
 
 
 
 
 
<table class="summary" id="constants">
<caption>Constants summary</caption>
<tr data-order="FORMAT_INI" id="FORMAT_INI">
 
<td class="attributes"><code>string</code></td>
<td class="name"><code>
<a href="source-class-I18n.html#21-22" title="Go to source code"><b>FORMAT_INI</b></a>
</code></td>
<td class="value"><code><span class="php-quote">'.ini'</span></code></td>
<td class="description"><div>
<a href="#FORMAT_INI" class="anchor">#</a>
 
<div class="description short">
<p>Format de traduction utilisant les fichier .ini</p>
 
</div>
 
<div class="description detailed hidden">
<p>Format de traduction utilisant les fichier .ini</p>
 
 
</div>
</div></td>
</tr>
</table>
 
 
 
 
 
 
 
 
 
 
</div>
 
<div id="footer">
TBFramework - v0.2 API documentation generated by <a href="http://apigen.org">ApiGen 2.8.0</a>
</div>
</div>
</div>
</body>
</html>
/branches/v0.2-buhl/doc/ApiGen/source-class-SquelettePhp.html
8,7 → 8,7
<title>File SquelettePhp.php | TBFramework - v0.2</title>
 
<script type="text/javascript" src="resources/combined.js?4205936287"></script>
<script type="text/javascript" src="elementlist.js?117657638"></script>
<script type="text/javascript" src="elementlist.js?1835392179"></script>
<link rel="stylesheet" type="text/css" media="all" href="resources/style.css?3505392360">
 
</head>
41,6 → 41,7
<li><a href="class-Controleur.html">Controleur</a></li>
<li><a href="class-Debug.html">Debug</a></li>
<li><a href="class-GestionnaireException.html">GestionnaireException</a></li>
<li><a href="class-I18n.html">I18n</a></li>
<li><a href="class-Log.html">Log</a></li>
<li><a href="class-Modele.html">Modele</a></li>
<li><a href="class-Registre.html">Registre</a></li>
105,74 → 106,72
</span></span><span id="4" class="l"><a class="l" href="#4"> 4: </a><span class="php-comment"> * Classe SquelettePhp, traitant les squelette Php utilisant la syntaxe courte php ou pas.
</span></span><span id="5" class="l"><a class="l" href="#5"> 5: </a><span class="php-comment"> * Ces méthodes sont statiques.
</span></span><span id="6" class="l"><a class="l" href="#6"> 6: </a><span class="php-comment"> *
</span></span><span id="7" class="l"><a class="l" href="#7"> 7: </a><span class="php-comment"> * @category php5
</span></span><span id="7" class="l"><a class="l" href="#7"> 7: </a><span class="php-comment"> * @category PHP 5.2
</span></span><span id="8" class="l"><a class="l" href="#8"> 8: </a><span class="php-comment"> * @package Framework
</span></span><span id="9" class="l"><a class="l" href="#9"> 9: </a><span class="php-comment"> * @author Jean-Pascal MILCENT &lt;jpm@tela-botanica.org&gt;
</span></span><span id="10" class="l"><a class="l" href="#10">10: </a><span class="php-comment"> * @copyright 2010 Tela-Botanica
</span></span><span id="11" class="l"><a class="l" href="#11">11: </a><span class="php-comment"> * @license http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
</span></span><span id="12" class="l"><a class="l" href="#12">12: </a><span class="php-comment"> * @license http://www.gnu.org/licenses/gpl.html Licence GNU-GPL
</span></span><span id="13" class="l"><a class="l" href="#13">13: </a><span class="php-comment"> * @version SVN: $$Id: SquelettePhp.php 153 2010-03-04 10:48:32Z jpm $$
</span></span><span id="14" class="l"><a class="l" href="#14">14: </a><span class="php-comment"> * @link /doc/framework/
</span></span><span id="15" class="l"><a class="l" href="#15">15: </a><span class="php-comment"> */</span>
</span><span id="16" class="l"><a class="l" href="#16">16: </a><span class="php-keyword1">class</span> <a id="SquelettePhp" href="#SquelettePhp">SquelettePhp</a> {
</span><span id="17" class="l"><a class="l" href="#17">17: </a>
</span><span id="18" class="l"><a class="l" href="#18">18: </a> <span class="php-comment">/**
</span></span><span id="19" class="l"><a class="l" href="#19">19: </a><span class="php-comment"> * Fonction prenant en paramètre un chemin de fichier squelette et un tableau associatif de données,
</span></span><span id="20" class="l"><a class="l" href="#20">20: </a><span class="php-comment"> * en extrait les variables, charge le squelette et retourne le résultat des deux combinés.
</span></span><span id="21" class="l"><a class="l" href="#21">21: </a><span class="php-comment"> *
</span></span><span id="22" class="l"><a class="l" href="#22">22: </a><span class="php-comment"> * @param String $fichier le chemin du fichier du squelette
</span></span><span id="23" class="l"><a class="l" href="#23">23: </a><span class="php-comment"> * @param Array $donnees un tableau associatif contenant les variables a injecter dans le squelette.
</span></span><span id="24" class="l"><a class="l" href="#24">24: </a><span class="php-comment"> *
</span></span><span id="25" class="l"><a class="l" href="#25">25: </a><span class="php-comment"> * @return boolean false si la vue n'existe pas, sinon la chaine résultat.
</span></span><span id="26" class="l"><a class="l" href="#26">26: </a><span class="php-comment"> */</span>
</span><span id="27" class="l"><a class="l" href="#27">27: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_analyser" href="#_analyser">analyser</a>(<span class="php-var">$fichier</span>, <span class="php-keyword1">Array</span> <span class="php-var">$donnees</span> = <span class="php-keyword1">array</span>()) {
</span><span id="28" class="l"><a class="l" href="#28">28: </a> <span class="php-var">$sortie</span> = <span class="php-keyword1">false</span>;
</span><span id="29" class="l"><a class="l" href="#29">29: </a> <span class="php-keyword1">if</span> (<span class="php-keyword2">file_exists</span>(<span class="php-var">$fichier</span>)) {
</span><span id="30" class="l"><a class="l" href="#30">30: </a> <span class="php-comment">// Extraction des variables du tableau de données</span>
</span><span id="31" class="l"><a class="l" href="#31">31: </a> <span class="php-keyword2">extract</span>(<span class="php-var">$donnees</span>);
</span><span id="32" class="l"><a class="l" href="#32">32: </a> <span class="php-comment">// Démarage de la bufferisation de sortie</span>
</span><span id="33" class="l"><a class="l" href="#33">33: </a> <span class="php-keyword2">ob_start</span>();
</span><span id="34" class="l"><a class="l" href="#34">34: </a> <span class="php-comment">// Si les tags courts sont activés</span>
</span><span id="35" class="l"><a class="l" href="#35">35: </a> <span class="php-keyword1">if</span> ((bool) @<span class="php-keyword2">ini_get</span>(<span class="php-quote">'short_open_tag'</span>) === <span class="php-keyword1">true</span>) {
</span><span id="36" class="l"><a class="l" href="#36">36: </a> <span class="php-comment">// Simple inclusion du squelette</span>
</span><span id="37" class="l"><a class="l" href="#37">37: </a> <span class="php-keyword1">include</span> <span class="php-var">$fichier</span>;
</span><span id="38" class="l"><a class="l" href="#38">38: </a> } <span class="php-keyword1">else</span> {
</span><span id="39" class="l"><a class="l" href="#39">39: </a> <span class="php-comment">// Sinon, remplacement des tags courts par la syntaxe classique avec echo</span>
</span><span id="40" class="l"><a class="l" href="#40">40: </a> <span class="php-var">$html_et_code_php</span> = self::traiterTagsCourts(<span class="php-var">$fichier</span>);
</span><span id="41" class="l"><a class="l" href="#41">41: </a> <span class="php-comment">// Pour évaluer du php mélangé dans du html il est nécessaire de fermer la balise php ouverte par eval</span>
</span><span id="42" class="l"><a class="l" href="#42">42: </a> <span class="php-var">$html_et_code_php</span> = <span class="php-quote">'?&gt;'</span>.<span class="php-var">$html_et_code_php</span>;
</span><span id="43" class="l"><a class="l" href="#43">43: </a> <span class="php-comment">// Interprétation du html et du php dans le buffer</span>
</span><span id="44" class="l"><a class="l" href="#44">44: </a> <span class="php-keyword1">echo</span> <span class="php-keyword2">eval</span>(<span class="php-var">$html_et_code_php</span>);
</span><span id="45" class="l"><a class="l" href="#45">45: </a> }
</span><span id="46" class="l"><a class="l" href="#46">46: </a> <span class="php-comment">// Récupèration du contenu du buffer</span>
</span><span id="47" class="l"><a class="l" href="#47">47: </a> <span class="php-var">$sortie</span> = <span class="php-keyword2">ob_get_contents</span>();
</span><span id="48" class="l"><a class="l" href="#48">48: </a> <span class="php-comment">// Suppression du buffer</span>
</span><span id="49" class="l"><a class="l" href="#49">49: </a> @<span class="php-keyword2">ob_end_clean</span>();
</span><span id="50" class="l"><a class="l" href="#50">50: </a> } <span class="php-keyword1">else</span> {
</span><span id="51" class="l"><a class="l" href="#51">51: </a> <span class="php-var">$msg</span> = <span class="php-quote">&quot;Le fichier du squelette '</span><span class="php-var">$fichier</span><span class="php-quote">' n'existe pas.&quot;</span>;
</span><span id="52" class="l"><a class="l" href="#52">52: </a> <span class="php-keyword2">trigger_error</span>(<span class="php-var">$msg</span>, E_USER_WARNING);
</span><span id="53" class="l"><a class="l" href="#53">53: </a> }
</span><span id="54" class="l"><a class="l" href="#54">54: </a> <span class="php-comment">// Retourne le contenu</span>
</span><span id="55" class="l"><a class="l" href="#55">55: </a> <span class="php-keyword1">return</span> <span class="php-var">$sortie</span>;
</span><span id="56" class="l"><a class="l" href="#56">56: </a> }
</span><span id="57" class="l"><a class="l" href="#57">57: </a>
</span><span id="58" class="l"><a class="l" href="#58">58: </a> <span class="php-comment">/**
</span></span><span id="59" class="l"><a class="l" href="#59">59: </a><span class="php-comment"> * Fonction chargeant le contenu du squelette et remplaçant les tags court php (&lt;?= ...) par un tag long avec echo.
</span></span><span id="10" class="l"><a class="l" href="#10">10: </a><span class="php-comment"> * @copyright Copyright (c) 2009, Tela Botanica (accueil@tela-botanica.org)
</span></span><span id="11" class="l"><a class="l" href="#11">11: </a><span class="php-comment"> * @license GNU-GPL-v3 &lt;http://www.gnu.org/licenses/gpl.html&gt;
</span></span><span id="12" class="l"><a class="l" href="#12">12: </a><span class="php-comment"> * @license CECILL-v2 &lt;http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt&gt;
</span></span><span id="13" class="l"><a class="l" href="#13">13: </a><span class="php-comment"> */</span>
</span><span id="14" class="l"><a class="l" href="#14">14: </a><span class="php-keyword1">class</span> <a id="SquelettePhp" href="#SquelettePhp">SquelettePhp</a> {
</span><span id="15" class="l"><a class="l" href="#15">15: </a>
</span><span id="16" class="l"><a class="l" href="#16">16: </a> <span class="php-comment">/**
</span></span><span id="17" class="l"><a class="l" href="#17">17: </a><span class="php-comment"> * Fonction prenant en paramètre un chemin de fichier squelette et un tableau associatif de données,
</span></span><span id="18" class="l"><a class="l" href="#18">18: </a><span class="php-comment"> * en extrait les variables, charge le squelette et retourne le résultat des deux combinés.
</span></span><span id="19" class="l"><a class="l" href="#19">19: </a><span class="php-comment"> *
</span></span><span id="20" class="l"><a class="l" href="#20">20: </a><span class="php-comment"> * @param String $fichier le chemin du fichier du squelette
</span></span><span id="21" class="l"><a class="l" href="#21">21: </a><span class="php-comment"> * @param Array $donnees un tableau associatif contenant les variables a injecter dans le squelette.
</span></span><span id="22" class="l"><a class="l" href="#22">22: </a><span class="php-comment"> *
</span></span><span id="23" class="l"><a class="l" href="#23">23: </a><span class="php-comment"> * @return boolean false si la vue n'existe pas, sinon la chaine résultat.
</span></span><span id="24" class="l"><a class="l" href="#24">24: </a><span class="php-comment"> */</span>
</span><span id="25" class="l"><a class="l" href="#25">25: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_analyser" href="#_analyser">analyser</a>(<span class="php-var">$fichier</span>, <span class="php-keyword1">Array</span> <span class="php-var">$donnees</span> = <span class="php-keyword1">array</span>()) {
</span><span id="26" class="l"><a class="l" href="#26">26: </a> <span class="php-var">$sortie</span> = <span class="php-keyword1">false</span>;
</span><span id="27" class="l"><a class="l" href="#27">27: </a> <span class="php-keyword1">if</span> (<span class="php-keyword2">file_exists</span>(<span class="php-var">$fichier</span>)) {
</span><span id="28" class="l"><a class="l" href="#28">28: </a> <span class="php-comment">// Extraction des variables du tableau de données</span>
</span><span id="29" class="l"><a class="l" href="#29">29: </a> <span class="php-keyword2">extract</span>(<span class="php-var">$donnees</span>);
</span><span id="30" class="l"><a class="l" href="#30">30: </a> <span class="php-comment">// Démarage de la bufferisation de sortie</span>
</span><span id="31" class="l"><a class="l" href="#31">31: </a> <span class="php-keyword2">ob_start</span>();
</span><span id="32" class="l"><a class="l" href="#32">32: </a> <span class="php-comment">// Si les tags courts sont activés</span>
</span><span id="33" class="l"><a class="l" href="#33">33: </a> <span class="php-keyword1">if</span> ((bool) @<span class="php-keyword2">ini_get</span>(<span class="php-quote">'short_open_tag'</span>) === <span class="php-keyword1">true</span>) {
</span><span id="34" class="l"><a class="l" href="#34">34: </a> <span class="php-comment">// Simple inclusion du squelette</span>
</span><span id="35" class="l"><a class="l" href="#35">35: </a> <span class="php-keyword1">include</span> <span class="php-var">$fichier</span>;
</span><span id="36" class="l"><a class="l" href="#36">36: </a> } <span class="php-keyword1">else</span> {
</span><span id="37" class="l"><a class="l" href="#37">37: </a> <span class="php-comment">// Sinon, remplacement des tags courts par la syntaxe classique avec echo</span>
</span><span id="38" class="l"><a class="l" href="#38">38: </a> <span class="php-var">$html_et_code_php</span> = self::traiterTagsCourts(<span class="php-var">$fichier</span>);
</span><span id="39" class="l"><a class="l" href="#39">39: </a> <span class="php-comment">// Pour évaluer du php mélangé dans du html il est nécessaire de fermer la balise php ouverte par eval</span>
</span><span id="40" class="l"><a class="l" href="#40">40: </a> <span class="php-var">$html_et_code_php</span> = <span class="php-quote">'?&gt;'</span>.<span class="php-var">$html_et_code_php</span>;
</span><span id="41" class="l"><a class="l" href="#41">41: </a> <span class="php-comment">// Interprétation du html et du php dans le buffer</span>
</span><span id="42" class="l"><a class="l" href="#42">42: </a> <span class="php-keyword1">echo</span> <span class="php-keyword2">eval</span>(<span class="php-var">$html_et_code_php</span>);
</span><span id="43" class="l"><a class="l" href="#43">43: </a> }
</span><span id="44" class="l"><a class="l" href="#44">44: </a> <span class="php-comment">// Récupèration du contenu du buffer</span>
</span><span id="45" class="l"><a class="l" href="#45">45: </a> <span class="php-var">$sortie</span> = <span class="php-keyword2">ob_get_contents</span>();
</span><span id="46" class="l"><a class="l" href="#46">46: </a> <span class="php-comment">// Suppression du buffer</span>
</span><span id="47" class="l"><a class="l" href="#47">47: </a> @<span class="php-keyword2">ob_end_clean</span>();
</span><span id="48" class="l"><a class="l" href="#48">48: </a> } <span class="php-keyword1">else</span> {
</span><span id="49" class="l"><a class="l" href="#49">49: </a> <span class="php-var">$msg</span> = <span class="php-quote">&quot;Le fichier du squelette '</span><span class="php-var">$fichier</span><span class="php-quote">' n'existe pas.&quot;</span>;
</span><span id="50" class="l"><a class="l" href="#50">50: </a> <span class="php-keyword2">trigger_error</span>(<span class="php-var">$msg</span>, E_USER_WARNING);
</span><span id="51" class="l"><a class="l" href="#51">51: </a> }
</span><span id="52" class="l"><a class="l" href="#52">52: </a> <span class="php-comment">// Retourne le contenu</span>
</span><span id="53" class="l"><a class="l" href="#53">53: </a> <span class="php-keyword1">return</span> <span class="php-var">$sortie</span>;
</span><span id="54" class="l"><a class="l" href="#54">54: </a> }
</span><span id="55" class="l"><a class="l" href="#55">55: </a>
</span><span id="56" class="l"><a class="l" href="#56">56: </a> <span class="php-comment">/**
</span></span><span id="57" class="l"><a class="l" href="#57">57: </a><span class="php-comment"> * Fonction chargeant le contenu du squelette et remplaçant les tags court php (&lt;?= ...) par un tag long avec echo.
</span></span><span id="58" class="l"><a class="l" href="#58">58: </a><span class="php-comment"> *
</span></span><span id="59" class="l"><a class="l" href="#59">59: </a><span class="php-comment"> * @param String $chemin_squelette le chemin du fichier du squelette
</span></span><span id="60" class="l"><a class="l" href="#60">60: </a><span class="php-comment"> *
</span></span><span id="61" class="l"><a class="l" href="#61">61: </a><span class="php-comment"> * @param String $chemin_squelette le chemin du fichier du squelette
</span></span><span id="62" class="l"><a class="l" href="#62">62: </a><span class="php-comment"> *
</span></span><span id="63" class="l"><a class="l" href="#63">63: </a><span class="php-comment"> * @return string le contenu du fichier du squelette php avec les tags courts remplacés.
</span></span><span id="64" class="l"><a class="l" href="#64">64: </a><span class="php-comment"> */</span>
</span><span id="65" class="l"><a class="l" href="#65">65: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_traiterTagsCourts" href="#_traiterTagsCourts">traiterTagsCourts</a>(<span class="php-var">$chemin_squelette</span>) {
</span><span id="66" class="l"><a class="l" href="#66">66: </a> <span class="php-var">$contenu</span> = <span class="php-keyword2">file_get_contents</span>(<span class="php-var">$chemin_squelette</span>);
</span><span id="67" class="l"><a class="l" href="#67">67: </a> <span class="php-comment">// Remplacement de tags courts par un tag long avec echo</span>
</span><span id="68" class="l"><a class="l" href="#68">68: </a> <span class="php-var">$contenu</span> = <span class="php-keyword2">str_replace</span>(<span class="php-quote">'&lt;?='</span>, <span class="php-quote">'&lt;?php echo '</span>, <span class="php-var">$contenu</span>);
</span><span id="69" class="l"><a class="l" href="#69">69: </a> <span class="php-comment">// Ajout systématique d'un point virgule avant la fermeture php</span>
</span><span id="70" class="l"><a class="l" href="#70">70: </a> <span class="php-var">$contenu</span> = <span class="php-keyword2">preg_replace</span>(<span class="php-quote">&quot;/;*\s*\?&gt;/&quot;</span>, <span class="php-quote">&quot;; ?&gt;&quot;</span>, <span class="php-var">$contenu</span>);
</span><span id="71" class="l"><a class="l" href="#71">71: </a> <span class="php-keyword1">return</span> <span class="php-var">$contenu</span>;
</span><span id="72" class="l"><a class="l" href="#72">72: </a> }
</span><span id="73" class="l"><a class="l" href="#73">73: </a>}
</span><span id="74" class="l"><a class="l" href="#74">74: </a></span><span class="xlang">?&gt;</span></code></pre>
</span></span><span id="61" class="l"><a class="l" href="#61">61: </a><span class="php-comment"> * @return string le contenu du fichier du squelette php avec les tags courts remplacés.
</span></span><span id="62" class="l"><a class="l" href="#62">62: </a><span class="php-comment"> */</span>
</span><span id="63" class="l"><a class="l" href="#63">63: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_traiterTagsCourts" href="#_traiterTagsCourts">traiterTagsCourts</a>(<span class="php-var">$chemin_squelette</span>) {
</span><span id="64" class="l"><a class="l" href="#64">64: </a> <span class="php-var">$contenu</span> = <span class="php-keyword2">file_get_contents</span>(<span class="php-var">$chemin_squelette</span>);
</span><span id="65" class="l"><a class="l" href="#65">65: </a> <span class="php-comment">// Remplacement de tags courts par un tag long avec echo</span>
</span><span id="66" class="l"><a class="l" href="#66">66: </a> <span class="php-var">$contenu</span> = <span class="php-keyword2">str_replace</span>(<span class="php-quote">'&lt;?='</span>, <span class="php-quote">'&lt;?php echo '</span>, <span class="php-var">$contenu</span>);
</span><span id="67" class="l"><a class="l" href="#67">67: </a> <span class="php-comment">// Ajout systématique d'un point virgule avant la fermeture php</span>
</span><span id="68" class="l"><a class="l" href="#68">68: </a> <span class="php-var">$contenu</span> = <span class="php-keyword2">preg_replace</span>(<span class="php-quote">&quot;/;*\s*\?&gt;/&quot;</span>, <span class="php-quote">&quot;; ?&gt;&quot;</span>, <span class="php-var">$contenu</span>);
</span><span id="69" class="l"><a class="l" href="#69">69: </a> <span class="php-keyword1">return</span> <span class="php-var">$contenu</span>;
</span><span id="70" class="l"><a class="l" href="#70">70: </a> }
</span><span id="71" class="l"><a class="l" href="#71">71: </a>}
</span><span id="72" class="l"><a class="l" href="#72">72: </a></span><span class="xlang">?&gt;</span></code></pre>
 
<div id="footer">
TBFramework - v0.2 API documentation generated by <a href="http://apigen.org">ApiGen 2.8.0</a>
/branches/v0.2-buhl/doc/ApiGen/class-SquelettePhp.html
7,7 → 7,7
<title>Class SquelettePhp | TBFramework - v0.2</title>
 
<script type="text/javascript" src="resources/combined.js?4205936287"></script>
<script type="text/javascript" src="elementlist.js?117657638"></script>
<script type="text/javascript" src="elementlist.js?1835392179"></script>
<link rel="stylesheet" type="text/css" media="all" href="resources/style.css?3505392360">
 
</head>
40,6 → 40,7
<li><a href="class-Controleur.html">Controleur</a></li>
<li><a href="class-Debug.html">Debug</a></li>
<li><a href="class-GestionnaireException.html">GestionnaireException</a></li>
<li><a href="class-I18n.html">I18n</a></li>
<li><a href="class-Log.html">Log</a></li>
<li><a href="class-Modele.html">Modele</a></li>
<li><a href="class-Registre.html">Registre</a></li>
123,21 → 124,18
<b>Package:</b> <a href="package-Framework.html">Framework</a><br>
 
<b>Category:</b>
php5<br>
PHP 5.2<br>
<b>Copyright:</b>
2010 Tela-Botanica<br>
Copyright (c) 2009, Tela Botanica (<a
href="mailto:accueil&#64;tela-botanica.org">accueil&#64;<!-- -->tela-botanica.org</a>)<br>
<b>License:</b>
<a href="http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt">Licence CECILL</a><br>
<a href="GNU-GPL-v3">&lt;http://www.gnu.org/licenses/gpl.html&gt;</a><br>
<b>License:</b>
<a href="http://www.gnu.org/licenses/gpl.html">Licence GNU-GPL</a><br>
<a href="CECILL-v2">&lt;http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt&gt;</a><br>
<b>Author:</b>
Jean-Pascal MILCENT &lt;<a
href="mailto:jpm&#64;tela-botanica.org">jpm&#64;<!-- -->tela-botanica.org</a>&gt;<br>
<b>Version:</b>
SVN: $$Id: SquelettePhp.php 153 2010-03-04 10:48:32Z jpm $$<br>
<b>Link:</b>
/doc/framework/<br>
<b>Located at</b> <a href="source-class-SquelettePhp.html#3-73" title="Go to source code">SquelettePhp.php</a><br>
<b>Located at</b> <a href="source-class-SquelettePhp.html#3-71" title="Go to source code">SquelettePhp.php</a><br>
</div>
 
 
155,7 → 153,7
 
<td class="name"><div>
<a class="anchor" href="#_analyser">#</a>
<code><a href="source-class-SquelettePhp.html#18-56" title="Go to source code">analyser</a>( <span>String <var>$fichier</var></span>, <span>array <var>$donnees</var> = <span class="php-keyword1">array</span>()</span> )</code>
<code><a href="source-class-SquelettePhp.html#16-54" title="Go to source code">analyser</a>( <span>String <var>$fichier</var></span>, <span>array <var>$donnees</var> = <span class="php-keyword1">array</span>()</span> )</code>
 
<div class="description short">
/branches/v0.2-buhl/doc/ApiGen/package-Framework.html
7,7 → 7,7
<title>Package Framework | TBFramework - v0.2</title>
 
<script type="text/javascript" src="resources/combined.js?4205936287"></script>
<script type="text/javascript" src="elementlist.js?117657638"></script>
<script type="text/javascript" src="elementlist.js?1835392179"></script>
<link rel="stylesheet" type="text/css" media="all" href="resources/style.css?3505392360">
 
</head>
40,6 → 40,7
<li><a href="class-Controleur.html">Controleur</a></li>
<li><a href="class-Debug.html">Debug</a></li>
<li><a href="class-GestionnaireException.html">GestionnaireException</a></li>
<li><a href="class-I18n.html">I18n</a></li>
<li><a href="class-Log.html">Log</a></li>
<li><a href="class-Modele.html">Modele</a></li>
<li><a href="class-Registre.html">Registre</a></li>
136,6 → 137,14
<td>Classe de gestion des exceptions. C'est un Singleton.</td>
</tr>
<tr>
<td class="name"><a href="class-I18n.html">I18n</a></td>
<td>I18n permet de traduire une application à partir de données stockées dans des
fichiers ini. Si vous souhaitez utiliser le fonctionnement par défaut vous
devrez : - déposer les fichiers ini dans le dossier définit par la variable de
config "chemin_i18n". - nommer les fichiers selon la forme "locale.ini" (Ex.:
fr.ini ou fr_CH.ini ).</td>
</tr>
<tr>
<td class="name"><a href="class-Log.html">Log</a></td>
<td>Classe permettant de logger des messages dans les fichier situés dans le
dossier de log.</td>
/branches/v0.2-buhl/doc/ApiGen/source-class-Chronometre.html
8,7 → 8,7
<title>File Chronometre.php | TBFramework - v0.2</title>
 
<script type="text/javascript" src="resources/combined.js?4205936287"></script>
<script type="text/javascript" src="elementlist.js?117657638"></script>
<script type="text/javascript" src="elementlist.js?1835392179"></script>
<link rel="stylesheet" type="text/css" media="all" href="resources/style.css?3505392360">
 
</head>
41,6 → 41,7
<li><a href="class-Controleur.html">Controleur</a></li>
<li><a href="class-Debug.html">Debug</a></li>
<li><a href="class-GestionnaireException.html">GestionnaireException</a></li>
<li><a href="class-I18n.html">I18n</a></li>
<li><a href="class-Log.html">Log</a></li>
<li><a href="class-Modele.html">Modele</a></li>
<li><a href="class-Registre.html">Registre</a></li>
101,90 → 102,90
 
<pre><code><span id="1" class="l"><a class="l" href="#1"> 1: </a><span class="xlang">&lt;?php</span>
</span><span id="2" class="l"><a class="l" href="#2"> 2: </a><span class="php-comment">// declare(encoding='UTF-8');</span>
</span><span id="3" class="l"><a class="l" href="#3"> 3: </a><span class="php-comment">/** Classe Chronometre() - Permet de stocker et d'afficher
</span></span><span id="4" class="l"><a class="l" href="#4"> 4: </a><span class="php-comment"> * les temps d'éxécution de script.
</span></span><span id="5" class="l"><a class="l" href="#5"> 5: </a><span class="php-comment"> *
</span></span><span id="6" class="l"><a class="l" href="#6"> 6: </a><span class="php-comment"> * Cette classe permet de réaliser un ensemble
</span></span><span id="7" class="l"><a class="l" href="#7"> 7: </a><span class="php-comment"> * de mesure de temps prises à
</span></span><span id="8" class="l"><a class="l" href="#8"> 8: </a><span class="php-comment"> * différents endroits d'un script.
</span></span><span id="9" class="l"><a class="l" href="#9"> 9: </a><span class="php-comment"> * Ces mesures peuvent ensuite être affichées au
</span></span><span id="10" class="l"><a class="l" href="#10"> 10: </a><span class="php-comment"> * sein d'un tableau XHTML.
</span></span><span id="11" class="l"><a class="l" href="#11"> 11: </a><span class="php-comment"> *
</span></span><span id="12" class="l"><a class="l" href="#12"> 12: </a><span class="php-comment"> *
</span></span><span id="13" class="l"><a class="l" href="#13"> 13: </a><span class="php-comment"> * PHP Version 5
</span></span><span id="14" class="l"><a class="l" href="#14"> 14: </a><span class="php-comment"> *
</span></span><span id="15" class="l"><a class="l" href="#15"> 15: </a><span class="php-comment"> * @category PHP
</span></span><span id="16" class="l"><a class="l" href="#16"> 16: </a><span class="php-comment"> * @package Framework
</span></span><span id="17" class="l"><a class="l" href="#17"> 17: </a><span class="php-comment"> * @author Jean-Pascal MILCENT &lt;jpm@tela-botanica.org&gt;
</span></span><span id="18" class="l"><a class="l" href="#18"> 18: </a><span class="php-comment"> * @copyright 2009 Tela-Botanica
</span></span><span id="19" class="l"><a class="l" href="#19"> 19: </a><span class="php-comment"> * @license http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
</span></span><span id="20" class="l"><a class="l" href="#20"> 20: </a><span class="php-comment"> * @version Release: &lt;package_version&gt;
</span></span><span id="21" class="l"><a class="l" href="#21"> 21: </a><span class="php-comment"> * @link /doc/framework/
</span></span><span id="22" class="l"><a class="l" href="#22"> 22: </a><span class="php-comment"> */</span>
</span><span id="23" class="l"><a class="l" href="#23"> 23: </a><span class="php-keyword1">class</span> <a id="Chronometre" href="#Chronometre">Chronometre</a> {
</span><span id="24" class="l"><a class="l" href="#24"> 24: </a> <span class="php-comment">/*** Attributs : ***/</span>
</span><span id="25" class="l"><a class="l" href="#25"> 25: </a> <span class="php-keyword1">private</span> <span class="php-var"><a id="$_temps" href="#$_temps">$_temps</a></span> = <span class="php-keyword1">array</span>();
</span><span id="26" class="l"><a class="l" href="#26"> 26: </a>
</span><span id="27" class="l"><a class="l" href="#27"> 27: </a> <span class="php-comment">/** Constructeur : **/</span>
</span><span id="28" class="l"><a class="l" href="#28"> 28: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="___construct" href="#___construct">__construct</a>() {
</span><span id="29" class="l"><a class="l" href="#29"> 29: </a> <span class="php-var">$this</span>-&gt;setTemps(<span class="php-keyword1">array</span>(<span class="php-quote">'depart'</span> =&gt; <span class="php-keyword2">microtime</span>()));
</span><span id="30" class="l"><a class="l" href="#30"> 30: </a> }
</span><span id="31" class="l"><a class="l" href="#31"> 31: </a>
</span><span id="32" class="l"><a class="l" href="#32"> 32: </a> <span class="php-comment">/** Accesseurs :
</span></span><span id="33" class="l"><a class="l" href="#33"> 33: </a><span class="php-comment"> *
</span></span><span id="34" class="l"><a class="l" href="#34"> 34: </a><span class="php-comment"> * @param string $cle la cle associée à un chronomètre particulier
</span></span><span id="35" class="l"><a class="l" href="#35"> 35: </a><span class="php-comment"> *
</span></span><span id="36" class="l"><a class="l" href="#36"> 36: </a><span class="php-comment"> * @return int le temps écoulé
</span></span><span id="37" class="l"><a class="l" href="#37"> 37: </a><span class="php-comment"> */</span>
</span><span id="38" class="l"><a class="l" href="#38"> 38: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="_getTemps" href="#_getTemps">getTemps</a>(<span class="php-var">$cle</span> = <span class="php-keyword1">null</span>) {
</span><span id="39" class="l"><a class="l" href="#39"> 39: </a> <span class="php-var">$temps</span> = <span class="php-quote">''</span>;
</span><span id="40" class="l"><a class="l" href="#40"> 40: </a> <span class="php-keyword1">if</span> (!<span class="php-keyword2">is_null</span>(<span class="php-var">$cle</span>)) {
</span><span id="41" class="l"><a class="l" href="#41"> 41: </a> <span class="php-var">$temps</span> = <span class="php-var">$this</span>-&gt;_temps[<span class="php-var">$cle</span>];
</span><span id="42" class="l"><a class="l" href="#42"> 42: </a> } <span class="php-keyword1">else</span> {
</span><span id="43" class="l"><a class="l" href="#43"> 43: </a> <span class="php-var">$temps</span> = <span class="php-var">$this</span>-&gt;_temps;
</span><span id="44" class="l"><a class="l" href="#44"> 44: </a> }
</span><span id="45" class="l"><a class="l" href="#45"> 45: </a> <span class="php-keyword1">return</span> <span class="php-var">$temps</span>;
</span><span id="46" class="l"><a class="l" href="#46"> 46: </a> }
</span><span id="47" class="l"><a class="l" href="#47"> 47: </a>
</span><span id="48" class="l"><a class="l" href="#48"> 48: </a> <span class="php-comment">/** Setteur pour la variable temps
</span></span><span id="49" class="l"><a class="l" href="#49"> 49: </a><span class="php-comment"> *
</span></span><span id="50" class="l"><a class="l" href="#50"> 50: </a><span class="php-comment"> * @param array() $moment ajoute des points de chronométrage au tableau _temps
</span></span><span id="51" class="l"><a class="l" href="#51"> 51: </a><span class="php-comment"> *
</span></span><span id="52" class="l"><a class="l" href="#52"> 52: </a><span class="php-comment"> * @return null
</span></span><span id="53" class="l"><a class="l" href="#53"> 53: </a><span class="php-comment"> */</span>
</span><span id="54" class="l"><a class="l" href="#54"> 54: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="_setTemps" href="#_setTemps">setTemps</a>(<span class="php-var">$moment</span> = <span class="php-keyword1">array</span> ()) {
</span><span id="55" class="l"><a class="l" href="#55"> 55: </a> <span class="php-keyword2">array_push</span>(<span class="php-var">$this</span>-&gt;_temps, <span class="php-var">$moment</span>);
</span><span id="56" class="l"><a class="l" href="#56"> 56: </a> }
</span><span id="57" class="l"><a class="l" href="#57"> 57: </a>
</span><span id="58" class="l"><a class="l" href="#58"> 58: </a> <span class="php-comment">/*** Méthodes : ***/</span>
</span><span id="59" class="l"><a class="l" href="#59"> 59: </a>
</span><span id="60" class="l"><a class="l" href="#60"> 60: </a> <span class="php-comment">/** Méthode afficherChrono() -
</span></span><span id="61" class="l"><a class="l" href="#61"> 61: </a><span class="php-comment"> * Permet d'afficher les temps d'éxécution de différentes parties d'un script.
</span></span><span id="62" class="l"><a class="l" href="#62"> 62: </a><span class="php-comment"> *
</span></span><span id="63" class="l"><a class="l" href="#63"> 63: </a><span class="php-comment"> * Cette fonction permet d'afficher un ensemble de
</span></span><span id="64" class="l"><a class="l" href="#64"> 64: </a><span class="php-comment"> * mesure de temps prises à différents endroits d'un script.
</span></span><span id="65" class="l"><a class="l" href="#65"> 65: </a><span class="php-comment"> * Ces mesures sont affichées au sein d'un tableau XHTML
</span></span><span id="66" class="l"><a class="l" href="#66"> 66: </a><span class="php-comment"> * dont on peut controler l'indentation des balises.
</span></span><span id="67" class="l"><a class="l" href="#67"> 67: </a><span class="php-comment"> * Pour un site en production, il suffit d'ajouter un style
</span></span><span id="68" class="l"><a class="l" href="#68"> 68: </a><span class="php-comment"> * #chrono {display:none;} dans la css. De cette façon,
</span></span><span id="69" class="l"><a class="l" href="#69"> 69: </a><span class="php-comment"> * le tableau ne s'affichera pas. Le webmaster lui pourra
</span></span><span id="70" class="l"><a class="l" href="#70"> 70: </a><span class="php-comment"> * rajouter sa propre feuille de style affichant le tableau.
</span></span><span id="71" class="l"><a class="l" href="#71"> 71: </a><span class="php-comment"> * Le développeur initial de cette fonction est Loic d'Anterroches.
</span></span><span id="72" class="l"><a class="l" href="#72"> 72: </a><span class="php-comment"> * Elle a été modifiée par Jean-Pascal Milcent.
</span></span><span id="73" class="l"><a class="l" href="#73"> 73: </a><span class="php-comment"> * Elle utilise une variable gobale : $_CHRONO_
</span></span><span id="74" class="l"><a class="l" href="#74"> 74: </a><span class="php-comment"> *
</span></span><span id="75" class="l"><a class="l" href="#75"> 75: </a><span class="php-comment"> * @author Loic d'Anterroches
</span></span><span id="76" class="l"><a class="l" href="#76"> 76: </a><span class="php-comment"> * @author Jean-Pascal MILCENT &lt;jpm@tela-botanica.org&gt;
</span></span><span id="77" class="l"><a class="l" href="#77"> 77: </a><span class="php-comment"> *
</span></span><span id="78" class="l"><a class="l" href="#78"> 78: </a><span class="php-comment"> * @param int $indentation_origine l'indentation de base.
</span></span><span id="79" class="l"><a class="l" href="#79"> 79: </a><span class="php-comment"> * @param int $indentation le pas d'indentation.
</span></span><span id="80" class="l"><a class="l" href="#80"> 80: </a><span class="php-comment"> * @return string la chaine XHTML de mesure des temps.
</span></span><span id="81" class="l"><a class="l" href="#81"> 81: </a><span class="php-comment"> */</span>
</span><span id="82" class="l"><a class="l" href="#82"> 82: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="_afficherChrono" href="#_afficherChrono">afficherChrono</a>(<span class="php-var">$indentation_origine</span> = <span class="php-num">8</span>, <span class="php-var">$indentation</span> = <span class="php-num">4</span>) {
</span><span id="83" class="l"><a class="l" href="#83"> 83: </a> <span class="php-comment">// Création du chrono de fin</span>
</span><span id="84" class="l"><a class="l" href="#84"> 84: </a> <span class="php-var">$GLOBALS</span>[<span class="php-quote">'_SCRIPT_'</span>][<span class="php-quote">'chrono'</span>]-&gt;setTemps(<span class="php-keyword1">array</span> (
</span><span id="85" class="l"><a class="l" href="#85"> 85: </a> <span class="php-quote">'fin'</span> =&gt; <span class="php-keyword2">microtime</span>()
</span><span id="86" class="l"><a class="l" href="#86"> 86: </a> ));
</span><span id="3" class="l"><a class="l" href="#3"> 3: </a><span class="php-comment">/** Classe Chronometre() - Permet de stocker et d'afficher les temps d'éxécution de script.
</span></span><span id="4" class="l"><a class="l" href="#4"> 4: </a><span class="php-comment"> *
</span></span><span id="5" class="l"><a class="l" href="#5"> 5: </a><span class="php-comment"> * Cette classe permet de réaliser un ensemble de mesure de temps prises à différents endroits d'un script.
</span></span><span id="6" class="l"><a class="l" href="#6"> 6: </a><span class="php-comment"> * Ces mesures peuvent ensuite être affichées au sein d'un tableau XHTML.
</span></span><span id="7" class="l"><a class="l" href="#7"> 7: </a><span class="php-comment"> *
</span></span><span id="8" class="l"><a class="l" href="#8"> 8: </a><span class="php-comment"> * @category PHP 5.2
</span></span><span id="9" class="l"><a class="l" href="#9"> 9: </a><span class="php-comment"> * @package Framework
</span></span><span id="10" class="l"><a class="l" href="#10"> 10: </a><span class="php-comment"> * @author Jean-Pascal MILCENT &lt;jpm@tela-botanica.org&gt;
</span></span><span id="11" class="l"><a class="l" href="#11"> 11: </a><span class="php-comment"> * @copyright Copyright (c) 2009, Tela Botanica (accueil@tela-botanica.org)
</span></span><span id="12" class="l"><a class="l" href="#12"> 12: </a><span class="php-comment"> * @license GNU-GPL-v3 &lt;http://www.gnu.org/licenses/gpl.html&gt;
</span></span><span id="13" class="l"><a class="l" href="#13"> 13: </a><span class="php-comment"> * @license CECILL-v2 &lt;http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt&gt;
</span></span><span id="14" class="l"><a class="l" href="#14"> 14: </a><span class="php-comment"> */</span>
</span><span id="15" class="l"><a class="l" href="#15"> 15: </a><span class="php-keyword1">class</span> <a id="Chronometre" href="#Chronometre">Chronometre</a> {
</span><span id="16" class="l"><a class="l" href="#16"> 16: </a> <span class="php-comment">/*** Attributs : ***/</span>
</span><span id="17" class="l"><a class="l" href="#17"> 17: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-var"><a id="$instance" href="#$instance">$instance</a></span> = <span class="php-keyword1">null</span>;
</span><span id="18" class="l"><a class="l" href="#18"> 18: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-var"><a id="$temps" href="#$temps">$temps</a></span> = <span class="php-keyword1">array</span>();
</span><span id="19" class="l"><a class="l" href="#19"> 19: </a>
</span><span id="20" class="l"><a class="l" href="#20"> 20: </a> <span class="php-comment">/** Constructeur : **/</span>
</span><span id="21" class="l"><a class="l" href="#21"> 21: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">function</span> <a id="___construct" href="#___construct">__construct</a>() {
</span><span id="22" class="l"><a class="l" href="#22"> 22: </a> self::setTemps(<span class="php-quote">'depart'</span>, <span class="php-keyword2">microtime</span>());
</span><span id="23" class="l"><a class="l" href="#23"> 23: </a> }
</span><span id="24" class="l"><a class="l" href="#24"> 24: </a>
</span><span id="25" class="l"><a class="l" href="#25"> 25: </a> <span class="php-comment">/** Accesseurs :
</span></span><span id="26" class="l"><a class="l" href="#26"> 26: </a><span class="php-comment"> *
</span></span><span id="27" class="l"><a class="l" href="#27"> 27: </a><span class="php-comment"> * @param string $cle la cle associée à un chronomètre particulier
</span></span><span id="28" class="l"><a class="l" href="#28"> 28: </a><span class="php-comment"> *
</span></span><span id="29" class="l"><a class="l" href="#29"> 29: </a><span class="php-comment"> * @return int le temps écoulé
</span></span><span id="30" class="l"><a class="l" href="#30"> 30: </a><span class="php-comment"> */</span>
</span><span id="31" class="l"><a class="l" href="#31"> 31: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_getTemps" href="#_getTemps">getTemps</a>(<span class="php-var">$cle</span> = <span class="php-keyword1">null</span>) {
</span><span id="32" class="l"><a class="l" href="#32"> 32: </a> <span class="php-var">$temps</span> = <span class="php-quote">''</span>;
</span><span id="33" class="l"><a class="l" href="#33"> 33: </a> <span class="php-keyword1">if</span> (!<span class="php-keyword2">is_null</span>(<span class="php-var">$cle</span>)) {
</span><span id="34" class="l"><a class="l" href="#34"> 34: </a> <span class="php-var">$temps</span> = self::<span class="php-var">$temps</span>[<span class="php-var">$cle</span>];
</span><span id="35" class="l"><a class="l" href="#35"> 35: </a> } <span class="php-keyword1">else</span> {
</span><span id="36" class="l"><a class="l" href="#36"> 36: </a> <span class="php-var">$temps</span> = self::<span class="php-var">$temps</span>;
</span><span id="37" class="l"><a class="l" href="#37"> 37: </a> }
</span><span id="38" class="l"><a class="l" href="#38"> 38: </a> <span class="php-keyword1">return</span> <span class="php-var">$temps</span>;
</span><span id="39" class="l"><a class="l" href="#39"> 39: </a> }
</span><span id="40" class="l"><a class="l" href="#40"> 40: </a>
</span><span id="41" class="l"><a class="l" href="#41"> 41: </a> <span class="php-comment">/** Setteur pour la variable temps
</span></span><span id="42" class="l"><a class="l" href="#42"> 42: </a><span class="php-comment"> *
</span></span><span id="43" class="l"><a class="l" href="#43"> 43: </a><span class="php-comment"> * @param array() $moment ajoute des points de chronométrage au tableau _temps
</span></span><span id="44" class="l"><a class="l" href="#44"> 44: </a><span class="php-comment"> *
</span></span><span id="45" class="l"><a class="l" href="#45"> 45: </a><span class="php-comment"> * @return null
</span></span><span id="46" class="l"><a class="l" href="#46"> 46: </a><span class="php-comment"> */</span>
</span><span id="47" class="l"><a class="l" href="#47"> 47: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_setTemps" href="#_setTemps">setTemps</a>(<span class="php-var">$cle</span>, <span class="php-var">$moment</span>) {
</span><span id="48" class="l"><a class="l" href="#48"> 48: </a> <span class="php-keyword2">array_push</span>(self::<span class="php-var">$temps</span>, <span class="php-keyword1">array</span>(<span class="php-var">$cle</span> =&gt; <span class="php-var">$moment</span>));
</span><span id="49" class="l"><a class="l" href="#49"> 49: </a> }
</span><span id="50" class="l"><a class="l" href="#50"> 50: </a>
</span><span id="51" class="l"><a class="l" href="#51"> 51: </a> <span class="php-comment">/*** Méthodes : ***/</span>
</span><span id="52" class="l"><a class="l" href="#52"> 52: </a>
</span><span id="53" class="l"><a class="l" href="#53"> 53: </a> <span class="php-comment">/**
</span></span><span id="54" class="l"><a class="l" href="#54"> 54: </a><span class="php-comment"> * Effectue un chronometrage.
</span></span><span id="55" class="l"><a class="l" href="#55"> 55: </a><span class="php-comment"> *
</span></span><span id="56" class="l"><a class="l" href="#56"> 56: </a><span class="php-comment"> * @param string le nom du point de chronométrage
</span></span><span id="57" class="l"><a class="l" href="#57"> 57: </a><span class="php-comment"> * @return null
</span></span><span id="58" class="l"><a class="l" href="#58"> 58: </a><span class="php-comment"> */</span>
</span><span id="59" class="l"><a class="l" href="#59"> 59: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_chrono" href="#_chrono">chrono</a>(<span class="php-var">$cle</span>) {
</span><span id="60" class="l"><a class="l" href="#60"> 60: </a> <span class="php-var">$moment</span> = <span class="php-keyword2">microtime</span>();
</span><span id="61" class="l"><a class="l" href="#61"> 61: </a> self::verifierCreationInstance();
</span><span id="62" class="l"><a class="l" href="#62"> 62: </a> self::setTemps(<span class="php-var">$cle</span>, <span class="php-var">$moment</span>);
</span><span id="63" class="l"><a class="l" href="#63"> 63: </a> }
</span><span id="64" class="l"><a class="l" href="#64"> 64: </a>
</span><span id="65" class="l"><a class="l" href="#65"> 65: </a> <span class="php-comment">/**
</span></span><span id="66" class="l"><a class="l" href="#66"> 66: </a><span class="php-comment"> * Permet d'afficher les temps d'éxécution de différentes parties d'un script.
</span></span><span id="67" class="l"><a class="l" href="#67"> 67: </a><span class="php-comment"> *
</span></span><span id="68" class="l"><a class="l" href="#68"> 68: </a><span class="php-comment"> * Cette fonction permet d'afficher un ensemble de mesure de temps prises à différents endroits d'un script.
</span></span><span id="69" class="l"><a class="l" href="#69"> 69: </a><span class="php-comment"> * Ces mesures sont affichées au sein d'un tableau XHTML dont on peut controler l'indentation des balises.
</span></span><span id="70" class="l"><a class="l" href="#70"> 70: </a><span class="php-comment"> * Pour un site en production, il suffit d'ajouter un style #chrono {display:none;} dans la css.
</span></span><span id="71" class="l"><a class="l" href="#71"> 71: </a><span class="php-comment"> * De cette façon, le tableau ne s'affichera pas. Le webmaster lui pourra rajouter sa propre feuille de style
</span></span><span id="72" class="l"><a class="l" href="#72"> 72: </a><span class="php-comment"> * affichant le tableau.
</span></span><span id="73" class="l"><a class="l" href="#73"> 73: </a><span class="php-comment"> * Le développeur initial de cette fonction est Loic d'Anterroches.
</span></span><span id="74" class="l"><a class="l" href="#74"> 74: </a><span class="php-comment"> * Elle a été modifiée par Jean-Pascal Milcent.
</span></span><span id="75" class="l"><a class="l" href="#75"> 75: </a><span class="php-comment"> *
</span></span><span id="76" class="l"><a class="l" href="#76"> 76: </a><span class="php-comment"> * @author Loic d'Anterroches
</span></span><span id="77" class="l"><a class="l" href="#77"> 77: </a><span class="php-comment"> * @author Jean-Pascal MILCENT &lt;jpm@tela-botanica.org&gt;
</span></span><span id="78" class="l"><a class="l" href="#78"> 78: </a><span class="php-comment"> *
</span></span><span id="79" class="l"><a class="l" href="#79"> 79: </a><span class="php-comment"> * @param int $indentation_origine l'indentation de base.
</span></span><span id="80" class="l"><a class="l" href="#80"> 80: </a><span class="php-comment"> * @param int $indentation le pas d'indentation.
</span></span><span id="81" class="l"><a class="l" href="#81"> 81: </a><span class="php-comment"> * @return string la chaine XHTML de mesure des temps.
</span></span><span id="82" class="l"><a class="l" href="#82"> 82: </a><span class="php-comment"> */</span>
</span><span id="83" class="l"><a class="l" href="#83"> 83: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_afficherChrono" href="#_afficherChrono">afficherChrono</a>(<span class="php-var">$indentation_origine</span> = <span class="php-num">8</span>, <span class="php-var">$indentation</span> = <span class="php-num">4</span>) {
</span><span id="84" class="l"><a class="l" href="#84"> 84: </a> self::verifierCreationInstance();
</span><span id="85" class="l"><a class="l" href="#85"> 85: </a> <span class="php-comment">// Création du chrono de fin</span>
</span><span id="86" class="l"><a class="l" href="#86"> 86: </a> self::setTemps(<span class="php-quote">'fin'</span>, <span class="php-keyword2">microtime</span>());
</span><span id="87" class="l"><a class="l" href="#87"> 87: </a>
</span><span id="88" class="l"><a class="l" href="#88"> 88: </a> <span class="php-comment">// Début création de l'affichage</span>
</span><span id="89" class="l"><a class="l" href="#89"> 89: </a> <span class="php-var">$sortie</span> = <span class="php-keyword2">str_repeat</span>(<span class="php-quote">' '</span>, <span class="php-var">$indentation_origine</span>) .
206,13 → 207,13
</span><span id="105" class="l"><a class="l" href="#105">105: </a> <span class="php-var">$total_tps_ecoule</span> = <span class="php-num">0</span>;
</span><span id="106" class="l"><a class="l" href="#106">106: </a>
</span><span id="107" class="l"><a class="l" href="#107">107: </a> <span class="php-comment">// Récupération de la premiére mesure</span>
</span><span id="108" class="l"><a class="l" href="#108">108: </a> <span class="php-var">$tab_depart</span> = &amp; <span class="php-var">$this</span>-&gt;getTemps(<span class="php-num">0</span>);
</span><span id="108" class="l"><a class="l" href="#108">108: </a> <span class="php-var">$tab_depart</span> = self::getTemps(<span class="php-num">0</span>);
</span><span id="109" class="l"><a class="l" href="#109">109: </a> <span class="php-keyword1">list</span> (<span class="php-var">$usec</span>, <span class="php-var">$sec</span>) = <span class="php-keyword2">explode</span>(<span class="php-quote">' '</span>, <span class="php-var">$tab_depart</span>[<span class="php-quote">'depart'</span>]);
</span><span id="110" class="l"><a class="l" href="#110">110: </a>
</span><span id="111" class="l"><a class="l" href="#111">111: </a> <span class="php-comment">// Ce temps correspond à tps_fin</span>
</span><span id="112" class="l"><a class="l" href="#112">112: </a> <span class="php-var">$tps_debut</span> = ((float) <span class="php-var">$usec</span> + (float) <span class="php-var">$sec</span>);
</span><span id="113" class="l"><a class="l" href="#113">113: </a>
</span><span id="114" class="l"><a class="l" href="#114">114: </a> <span class="php-keyword1">foreach</span> (<span class="php-var">$this</span>-&gt;getTemps() <span class="php-keyword1">as</span> <span class="php-var">$tab_temps</span>) {
</span><span id="114" class="l"><a class="l" href="#114">114: </a> <span class="php-keyword1">foreach</span> (self::getTemps() <span class="php-keyword1">as</span> <span class="php-var">$tab_temps</span>) {
</span><span id="115" class="l"><a class="l" href="#115">115: </a> <span class="php-keyword1">foreach</span> (<span class="php-var">$tab_temps</span> <span class="php-keyword1">as</span> <span class="php-var">$cle</span> =&gt; <span class="php-var">$valeur</span>) {
</span><span id="116" class="l"><a class="l" href="#116">116: </a> <span class="php-keyword1">list</span> (<span class="php-var">$usec</span>, <span class="php-var">$sec</span>) = <span class="php-keyword2">explode</span>(<span class="php-quote">' '</span>, <span class="php-var">$valeur</span>);
</span><span id="117" class="l"><a class="l" href="#117">117: </a> <span class="php-var">$tps_fin</span> = ((float) <span class="php-var">$usec</span> + (float) <span class="php-var">$sec</span>);
249,8 → 250,17
</span><span id="148" class="l"><a class="l" href="#148">148: </a>
</span><span id="149" class="l"><a class="l" href="#149">149: </a> <span class="php-keyword1">return</span> <span class="php-var">$sortie</span>;
</span><span id="150" class="l"><a class="l" href="#150">150: </a> }
</span><span id="151" class="l"><a class="l" href="#151">151: </a>}
</span><span id="152" class="l"><a class="l" href="#152">152: </a></span><span class="xlang">?&gt;</span></code></pre>
</span><span id="151" class="l"><a class="l" href="#151">151: </a>
</span><span id="152" class="l"><a class="l" href="#152">152: </a> <span class="php-comment">/**
</span></span><span id="153" class="l"><a class="l" href="#153">153: </a><span class="php-comment"> * Vérifie si l'instance de classe à été crée, si non la crée
</span></span><span id="154" class="l"><a class="l" href="#154">154: </a><span class="php-comment"> */</span>
</span><span id="155" class="l"><a class="l" href="#155">155: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> <a id="_verifierCreationInstance" href="#_verifierCreationInstance">verifierCreationInstance</a>() {
</span><span id="156" class="l"><a class="l" href="#156">156: </a> <span class="php-keyword1">if</span> (<span class="php-keyword1">empty</span>(self::<span class="php-var">$instance</span>)) {
</span><span id="157" class="l"><a class="l" href="#157">157: </a> self::<span class="php-var">$instance</span> = <span class="php-keyword1">new</span> Chronometre();
</span><span id="158" class="l"><a class="l" href="#158">158: </a> }
</span><span id="159" class="l"><a class="l" href="#159">159: </a> }
</span><span id="160" class="l"><a class="l" href="#160">160: </a>}
</span><span id="161" class="l"><a class="l" href="#161">161: </a></span><span class="xlang">?&gt;</span></code></pre>
 
<div id="footer">
TBFramework - v0.2 API documentation generated by <a href="http://apigen.org">ApiGen 2.8.0</a>
/branches/v0.2-buhl/doc/ApiGen/class-Chronometre.html
7,7 → 7,7
<title>Class Chronometre | TBFramework - v0.2</title>
 
<script type="text/javascript" src="resources/combined.js?4205936287"></script>
<script type="text/javascript" src="elementlist.js?117657638"></script>
<script type="text/javascript" src="elementlist.js?1835392179"></script>
<link rel="stylesheet" type="text/css" media="all" href="resources/style.css?3505392360">
 
</head>
40,6 → 40,7
<li><a href="class-Controleur.html">Controleur</a></li>
<li><a href="class-Debug.html">Debug</a></li>
<li><a href="class-GestionnaireException.html">GestionnaireException</a></li>
<li><a href="class-I18n.html">I18n</a></li>
<li><a href="class-Log.html">Log</a></li>
<li><a href="class-Modele.html">Modele</a></li>
<li><a href="class-Registre.html">Registre</a></li>
110,8 → 111,6
différents endroits d'un script. Ces mesures peuvent ensuite être affichées
au sein d'un tableau XHTML.</p>
 
<p>PHP Version 5</p>
 
</div>
 
 
129,19 → 128,18
<b>Package:</b> <a href="package-Framework.html">Framework</a><br>
 
<b>Category:</b>
PHP<br>
PHP 5.2<br>
<b>Copyright:</b>
2009 Tela-Botanica<br>
Copyright (c) 2009, Tela Botanica (<a
href="mailto:accueil&#64;tela-botanica.org">accueil&#64;<!-- -->tela-botanica.org</a>)<br>
<b>License:</b>
<a href="http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt">Licence CECILL</a><br>
<a href="GNU-GPL-v3">&lt;http://www.gnu.org/licenses/gpl.html&gt;</a><br>
<b>License:</b>
<a href="CECILL-v2">&lt;http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt&gt;</a><br>
<b>Author:</b>
Jean-Pascal MILCENT &lt;<a
href="mailto:jpm&#64;tela-botanica.org">jpm&#64;<!-- -->tela-botanica.org</a>&gt;<br>
<b>Version:</b>
Release: &lt;package_version&gt;<br>
<b>Link:</b>
/doc/framework/<br>
<b>Located at</b> <a href="source-class-Chronometre.html#3-151" title="Go to source code">Chronometre.php</a><br>
<b>Located at</b> <a href="source-class-Chronometre.html#3-160" title="Go to source code">Chronometre.php</a><br>
</div>
 
 
148,114 → 146,39
 
<table class="summary" id="methods">
<caption>Methods summary</caption>
<tr data-order="__construct" id="___construct">
<tr data-order="chrono" id="_chrono">
 
<td class="attributes"><code>
public
public static
null
</code>
</td>
 
<td class="name"><div>
<a class="anchor" href="#___construct">#</a>
<code><a href="source-class-Chronometre.html#27-30" title="Go to source code">__construct</a>( )</code>
<a class="anchor" href="#_chrono">#</a>
<code><a href="source-class-Chronometre.html#53-63" title="Go to source code">chrono</a>( <span>string <var>$cle</var></span> )</code>
 
<div class="description short">
<p>Constructeur : *</p>
<p>Effectue un chronometrage.</p>
 
</div>
 
<div class="description detailed hidden">
<p>Constructeur : *</p>
<p>Effectue un chronometrage.</p>
 
 
 
 
 
 
 
 
</div>
</div></td>
</tr>
<tr data-order="getTemps" id="_getTemps">
 
<td class="attributes"><code>
public
integer
</code>
</td>
 
<td class="name"><div>
<a class="anchor" href="#_getTemps">#</a>
<code><a href="source-class-Chronometre.html#32-46" title="Go to source code">getTemps</a>( <span>string <var>$cle</var> = <span class="php-keyword1">null</span></span> )</code>
 
<div class="description short">
<p>Accesseurs :</p>
 
</div>
 
<div class="description detailed hidden">
<p>Accesseurs :</p>
 
 
 
<h4>Parameters</h4>
<div class="list"><dl>
<dt><var>$cle</var></dt>
<dd><code>string</code><br>$cle la cle associée à un chronomètre particulier</dd>
<dd><code>string</code><br>le nom du point de chronométrage</dd>
</dl></div>
 
<h4>Returns</h4>
<div class="list">
<code>integer</code><br>le temps écoulé<br>
</div>
 
 
 
 
</div>
</div></td>
</tr>
<tr data-order="setTemps" id="_setTemps">
 
<td class="attributes"><code>
public
null
</code>
</td>
 
<td class="name"><div>
<a class="anchor" href="#_setTemps">#</a>
<code><a href="source-class-Chronometre.html#48-56" title="Go to source code">setTemps</a>( <span>array() <var>$moment</var> = <span class="php-keyword1">array</span> ()</span> )</code>
 
<div class="description short">
<p>Setteur pour la variable temps</p>
 
</div>
 
<div class="description detailed hidden">
<p>Setteur pour la variable temps</p>
 
 
 
<h4>Parameters</h4>
<div class="list"><dl>
<dt><var>$moment</var></dt>
<dd><code>array()</code><br>$moment ajoute des points de chronométrage au tableau _temps</dd>
</dl></div>
 
<h4>Returns</h4>
<div class="list">
<code>null</code><br>
</div>
 
268,7 → 191,7
<tr data-order="afficherChrono" id="_afficherChrono">
 
<td class="attributes"><code>
public
public static
string
</code>
276,19 → 199,19
 
<td class="name"><div>
<a class="anchor" href="#_afficherChrono">#</a>
<code><a href="source-class-Chronometre.html#60-150" title="Go to source code">afficherChrono</a>( <span>integer <var>$indentation_origine</var> = <span class="php-num">8</span></span>, <span>integer <var>$indentation</var> = <span class="php-num">4</span></span> )</code>
<code><a href="source-class-Chronometre.html#65-150" title="Go to source code">afficherChrono</a>( <span>integer <var>$indentation_origine</var> = <span class="php-num">8</span></span>, <span>integer <var>$indentation</var> = <span class="php-num">4</span></span> )</code>
 
<div class="description short">
<p>Méthode afficherChrono() - Permet d'afficher les temps d'éxécution de
différentes parties d'un script.</p>
<p>Permet d'afficher les temps d'éxécution de différentes parties d'un
script.</p>
 
</div>
 
<div class="description detailed hidden">
<p>Méthode afficherChrono() - Permet d'afficher les temps d'éxécution de
différentes parties d'un script.</p>
<p>Permet d'afficher les temps d'éxécution de différentes parties d'un
script.</p>
 
<p>Cette fonction permet d'afficher un ensemble de mesure de temps prises à
différents endroits d'un script. Ces mesures sont affichées au sein d'un
296,8 → 219,8
production, il suffit d'ajouter un style #chrono {display:none;} dans la css. De
cette façon, le tableau ne s'affichera pas. Le webmaster lui pourra rajouter sa
propre feuille de style affichant le tableau. Le développeur initial de cette
fonction est Loic d'Anterroches. Elle a été modifiée par Jean-Pascal Milcent.
Elle utilise une variable gobale : $_CHRONO_</p>
fonction est Loic d'Anterroches. Elle a été modifiée par Jean-Pascal
Milcent.</p>
 
 
 
/branches/v0.2-buhl/doc/ApiGen/source-class-Controleur.html
8,7 → 8,7
<title>File Controleur.php | TBFramework - v0.2</title>
 
<script type="text/javascript" src="resources/combined.js?4205936287"></script>
<script type="text/javascript" src="elementlist.js?117657638"></script>
<script type="text/javascript" src="elementlist.js?1835392179"></script>
<link rel="stylesheet" type="text/css" media="all" href="resources/style.css?3505392360">
 
</head>
41,6 → 41,7
<li class="active"><a href="class-Controleur.html">Controleur</a></li>
<li><a href="class-Debug.html">Debug</a></li>
<li><a href="class-GestionnaireException.html">GestionnaireException</a></li>
<li><a href="class-I18n.html">I18n</a></li>
<li><a href="class-Log.html">Log</a></li>
<li><a href="class-Modele.html">Modele</a></li>
<li><a href="class-Registre.html">Registre</a></li>
106,138 → 107,161
</span></span><span id="5" class="l"><a class="l" href="#5"> 5: </a><span class="php-comment"> * qui devrait être appelée de l'extérieur.
</span></span><span id="6" class="l"><a class="l" href="#6"> 6: </a><span class="php-comment"> * Elle est abstraite donc doit obligatoirement être étendue.
</span></span><span id="7" class="l"><a class="l" href="#7"> 7: </a><span class="php-comment"> *
</span></span><span id="8" class="l"><a class="l" href="#8"> 8: </a><span class="php-comment"> * @category php5
</span></span><span id="8" class="l"><a class="l" href="#8"> 8: </a><span class="php-comment"> * @category PHP 5.2
</span></span><span id="9" class="l"><a class="l" href="#9"> 9: </a><span class="php-comment"> * @package Framework
</span></span><span id="10" class="l"><a class="l" href="#10"> 10: </a><span class="php-comment"> * @author Aurélien PERONNET &lt;aurelien@tela-botanica.org&gt;
</span></span><span id="11" class="l"><a class="l" href="#11"> 11: </a><span class="php-comment"> * @author Jean-Pascal MILCENT &lt;jpm@tela-botanica.org&gt;
</span></span><span id="12" class="l"><a class="l" href="#12"> 12: </a><span class="php-comment"> * @copyright 2009 Tela-Botanica
</span></span><span id="13" class="l"><a class="l" href="#13"> 13: </a><span class="php-comment"> * @license http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
</span></span><span id="14" class="l"><a class="l" href="#14"> 14: </a><span class="php-comment"> * @license http://www.gnu.org/licenses/gpl.html Licence GNU-GPL
</span></span><span id="15" class="l"><a class="l" href="#15"> 15: </a><span class="php-comment"> * @version SVN: $Id: Controleur.php 191 2010-04-29 15:34:49Z jpm $
</span></span><span id="16" class="l"><a class="l" href="#16"> 16: </a><span class="php-comment"> * @link /doc/framework/
</span></span><span id="17" class="l"><a class="l" href="#17"> 17: </a><span class="php-comment"> *
</span></span><span id="18" class="l"><a class="l" href="#18"> 18: </a><span class="php-comment"> */</span>
</span><span id="19" class="l"><a class="l" href="#19"> 19: </a><span class="php-keyword1">abstract</span> <span class="php-keyword1">class</span> <a id="Controleur" href="#Controleur">Controleur</a> {
</span><span id="20" class="l"><a class="l" href="#20"> 20: </a> <span class="php-comment">/** Variable statique indiquant que les tableaux _GET et _POST ont déjà été encodé au format de l'appli. */</span>
</span><span id="21" class="l"><a class="l" href="#21"> 21: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-var"><a id="$encodage" href="#$encodage">$encodage</a></span> = <span class="php-keyword1">false</span>;
</span><span id="22" class="l"><a class="l" href="#22"> 22: </a>
</span><span id="23" class="l"><a class="l" href="#23"> 23: </a> <span class="php-comment">/** Registre global, normalement accessible partout */</span>
</span><span id="24" class="l"><a class="l" href="#24"> 24: </a> <span class="php-keyword1">private</span> <span class="php-var"><a id="$registre" href="#$registre">$registre</a></span>;
</span><span id="25" class="l"><a class="l" href="#25"> 25: </a>
</span><span id="26" class="l"><a class="l" href="#26"> 26: </a> <span class="php-comment">/**
</span></span><span id="27" class="l"><a class="l" href="#27"> 27: </a><span class="php-comment"> * Constructeur par défaut
</span></span><span id="28" class="l"><a class="l" href="#28"> 28: </a><span class="php-comment"> */</span>
</span><span id="29" class="l"><a class="l" href="#29"> 29: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="___construct" href="#___construct">__construct</a>() {
</span><span id="30" class="l"><a class="l" href="#30"> 30: </a> <span class="php-var">$this</span>-&gt;registre = Registre::getInstance();
</span><span id="31" class="l"><a class="l" href="#31"> 31: </a> <span class="php-var">$this</span>-&gt;registre-&gt;set(<span class="php-quote">'base_chemin_modele'</span>, Config::get(<span class="php-quote">'chemin_modeles'</span>));
</span><span id="32" class="l"><a class="l" href="#32"> 32: </a> <span class="php-var">$this</span>-&gt;registre-&gt;set(<span class="php-quote">'base_chemin_squelette'</span>, Config::get(<span class="php-quote">'chemin_squelettes'</span>));
</span><span id="33" class="l"><a class="l" href="#33"> 33: </a> <span class="php-var">$this</span>-&gt;registre-&gt;set(<span class="php-quote">'base_chemin_controleur'</span>, Config::get(<span class="php-quote">'chemin_controleurs'</span>));
</span><span id="34" class="l"><a class="l" href="#34"> 34: </a> <span class="php-var">$this</span>-&gt;registre-&gt;set(<span class="php-quote">'base_url_application'</span>, <span class="php-keyword1">new</span> Url(Config::get(<span class="php-quote">'url_base'</span>)));
</span><span id="35" class="l"><a class="l" href="#35"> 35: </a> <span class="php-var">$this</span>-&gt;verifierEtReencoderTableauRequete();
</span><span id="36" class="l"><a class="l" href="#36"> 36: </a> }
</span><span id="37" class="l"><a class="l" href="#37"> 37: </a>
</span><span id="38" class="l"><a class="l" href="#38"> 38: </a> <span class="php-comment">/**
</span></span><span id="39" class="l"><a class="l" href="#39"> 39: </a><span class="php-comment"> * Charge un modele donné et le rend disponible sous la forme $this-&gt;nom_modele
</span></span><span id="40" class="l"><a class="l" href="#40"> 40: </a><span class="php-comment"> *
</span></span><span id="41" class="l"><a class="l" href="#41"> 41: </a><span class="php-comment"> * @param string $nom_modele le nom du modèle à  charger
</span></span><span id="42" class="l"><a class="l" href="#42"> 42: </a><span class="php-comment"> *
</span></span><span id="43" class="l"><a class="l" href="#43"> 43: </a><span class="php-comment"> * @return boolean false si le chargement a échoué, sinon true.
</span></span><span id="44" class="l"><a class="l" href="#44"> 44: </a><span class="php-comment"> */</span>
</span><span id="45" class="l"><a class="l" href="#45"> 45: </a> <span class="php-keyword1">final</span> <span class="php-keyword1">protected</span> <span class="php-keyword1">function</span> <a id="_chargerModele" href="#_chargerModele">chargerModele</a>(<span class="php-var">$nom_modele</span>) {
</span><span id="46" class="l"><a class="l" href="#46"> 46: </a> <span class="php-var">$sortie</span> = <span class="php-keyword1">true</span>;
</span><span id="47" class="l"><a class="l" href="#47"> 47: </a> <span class="php-var">$modele</span> = <span class="php-var">$this</span>-&gt;getModele(<span class="php-var">$nom_modele</span>);
</span><span id="48" class="l"><a class="l" href="#48"> 48: </a> <span class="php-keyword1">if</span> (<span class="php-var">$modele</span> !== <span class="php-keyword1">false</span>) {
</span><span id="49" class="l"><a class="l" href="#49"> 49: </a> <span class="php-var">$this</span>-&gt;<span class="php-var">$nom_modele</span> = <span class="php-keyword1">new</span> <span class="php-var">$nom_modele</span>;
</span><span id="50" class="l"><a class="l" href="#50"> 50: </a> } <span class="php-keyword1">else</span> {
</span><span id="51" class="l"><a class="l" href="#51"> 51: </a> <span class="php-var">$sortie</span> = <span class="php-keyword1">false</span>;
</span><span id="52" class="l"><a class="l" href="#52"> 52: </a> }
</span><span id="53" class="l"><a class="l" href="#53"> 53: </a> <span class="php-keyword1">return</span> <span class="php-var">$sortie</span>;
</span><span id="54" class="l"><a class="l" href="#54"> 54: </a> }
</span><span id="55" class="l"><a class="l" href="#55"> 55: </a>
</span><span id="56" class="l"><a class="l" href="#56"> 56: </a> <span class="php-comment">/**
</span></span><span id="57" class="l"><a class="l" href="#57"> 57: </a><span class="php-comment"> * Retourne un modele donné
</span></span><span id="12" class="l"><a class="l" href="#12"> 12: </a><span class="php-comment"> * @copyright Copyright (c) 2009, Tela Botanica (accueil@tela-botanica.org)
</span></span><span id="13" class="l"><a class="l" href="#13"> 13: </a><span class="php-comment"> * @license GNU-GPL-v3 &lt;http://www.gnu.org/licenses/gpl.html&gt;
</span></span><span id="14" class="l"><a class="l" href="#14"> 14: </a><span class="php-comment"> * @license CECILL-v2 &lt;http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt&gt;
</span></span><span id="15" class="l"><a class="l" href="#15"> 15: </a><span class="php-comment"> */</span>
</span><span id="16" class="l"><a class="l" href="#16"> 16: </a><span class="php-keyword1">abstract</span> <span class="php-keyword1">class</span> <a id="Controleur" href="#Controleur">Controleur</a> {
</span><span id="17" class="l"><a class="l" href="#17"> 17: </a> <span class="php-comment">/** Variable statique indiquant que les tableaux _GET et _POST ont déjà été encodé au format de l'appli. */</span>
</span><span id="18" class="l"><a class="l" href="#18"> 18: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">static</span> <span class="php-var"><a id="$encodage" href="#$encodage">$encodage</a></span> = <span class="php-keyword1">false</span>;
</span><span id="19" class="l"><a class="l" href="#19"> 19: </a>
</span><span id="20" class="l"><a class="l" href="#20"> 20: </a> <span class="php-comment">/** Registre global, normalement accessible partout */</span>
</span><span id="21" class="l"><a class="l" href="#21"> 21: </a> <span class="php-keyword1">private</span> <span class="php-var"><a id="$registre" href="#$registre">$registre</a></span>;
</span><span id="22" class="l"><a class="l" href="#22"> 22: </a>
</span><span id="23" class="l"><a class="l" href="#23"> 23: </a> <span class="php-comment">/**
</span></span><span id="24" class="l"><a class="l" href="#24"> 24: </a><span class="php-comment"> * Constructeur par défaut
</span></span><span id="25" class="l"><a class="l" href="#25"> 25: </a><span class="php-comment"> */</span>
</span><span id="26" class="l"><a class="l" href="#26"> 26: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="___construct" href="#___construct">__construct</a>() {
</span><span id="27" class="l"><a class="l" href="#27"> 27: </a> <span class="php-var">$this</span>-&gt;registre = Registre::getInstance();
</span><span id="28" class="l"><a class="l" href="#28"> 28: </a> <span class="php-var">$this</span>-&gt;registre-&gt;set(<span class="php-quote">'base_chemin_modele'</span>, Config::get(<span class="php-quote">'chemin_modeles'</span>));
</span><span id="29" class="l"><a class="l" href="#29"> 29: </a> <span class="php-var">$this</span>-&gt;registre-&gt;set(<span class="php-quote">'base_chemin_squelette'</span>, Config::get(<span class="php-quote">'chemin_squelettes'</span>));
</span><span id="30" class="l"><a class="l" href="#30"> 30: </a> <span class="php-var">$this</span>-&gt;registre-&gt;set(<span class="php-quote">'base_chemin_controleur'</span>, Config::get(<span class="php-quote">'chemin_controleurs'</span>));
</span><span id="31" class="l"><a class="l" href="#31"> 31: </a> <span class="php-var">$this</span>-&gt;registre-&gt;set(<span class="php-quote">'base_url_application'</span>, <span class="php-keyword1">new</span> Url(Config::get(<span class="php-quote">'url_base'</span>)));
</span><span id="32" class="l"><a class="l" href="#32"> 32: </a> <span class="php-var">$this</span>-&gt;verifierEtReencoderTableauRequete();
</span><span id="33" class="l"><a class="l" href="#33"> 33: </a> }
</span><span id="34" class="l"><a class="l" href="#34"> 34: </a>
</span><span id="35" class="l"><a class="l" href="#35"> 35: </a> <span class="php-comment">/**
</span></span><span id="36" class="l"><a class="l" href="#36"> 36: </a><span class="php-comment"> * Charge un modele donné et le rend disponible sous la forme $this-&gt;nom_modele
</span></span><span id="37" class="l"><a class="l" href="#37"> 37: </a><span class="php-comment"> *
</span></span><span id="38" class="l"><a class="l" href="#38"> 38: </a><span class="php-comment"> * @param string $nom_modele le nom du modèle à  charger
</span></span><span id="39" class="l"><a class="l" href="#39"> 39: </a><span class="php-comment"> *
</span></span><span id="40" class="l"><a class="l" href="#40"> 40: </a><span class="php-comment"> * @return boolean false si le chargement a échoué, sinon true.
</span></span><span id="41" class="l"><a class="l" href="#41"> 41: </a><span class="php-comment"> */</span>
</span><span id="42" class="l"><a class="l" href="#42"> 42: </a> <span class="php-keyword1">final</span> <span class="php-keyword1">protected</span> <span class="php-keyword1">function</span> <a id="_chargerModele" href="#_chargerModele">chargerModele</a>(<span class="php-var">$nom_modele</span>) {
</span><span id="43" class="l"><a class="l" href="#43"> 43: </a> <span class="php-var">$sortie</span> = <span class="php-keyword1">true</span>;
</span><span id="44" class="l"><a class="l" href="#44"> 44: </a> <span class="php-var">$modele</span> = <span class="php-var">$this</span>-&gt;getModele(<span class="php-var">$nom_modele</span>);
</span><span id="45" class="l"><a class="l" href="#45"> 45: </a> <span class="php-keyword1">if</span> (<span class="php-var">$modele</span> !== <span class="php-keyword1">false</span>) {
</span><span id="46" class="l"><a class="l" href="#46"> 46: </a> <span class="php-var">$this</span>-&gt;<span class="php-var">$nom_modele</span> = <span class="php-keyword1">new</span> <span class="php-var">$nom_modele</span>;
</span><span id="47" class="l"><a class="l" href="#47"> 47: </a> } <span class="php-keyword1">else</span> {
</span><span id="48" class="l"><a class="l" href="#48"> 48: </a> <span class="php-var">$sortie</span> = <span class="php-keyword1">false</span>;
</span><span id="49" class="l"><a class="l" href="#49"> 49: </a> }
</span><span id="50" class="l"><a class="l" href="#50"> 50: </a> <span class="php-keyword1">return</span> <span class="php-var">$sortie</span>;
</span><span id="51" class="l"><a class="l" href="#51"> 51: </a> }
</span><span id="52" class="l"><a class="l" href="#52"> 52: </a>
</span><span id="53" class="l"><a class="l" href="#53"> 53: </a> <span class="php-comment">/**
</span></span><span id="54" class="l"><a class="l" href="#54"> 54: </a><span class="php-comment"> * Retourne un modele donné
</span></span><span id="55" class="l"><a class="l" href="#55"> 55: </a><span class="php-comment"> *
</span></span><span id="56" class="l"><a class="l" href="#56"> 56: </a><span class="php-comment"> * @param string $nom_modele le nom du fichier modèle à charger sans son extension
</span></span><span id="57" class="l"><a class="l" href="#57"> 57: </a><span class="php-comment"> * @param String $ext l'extension du fichier du modèel (par défaut : &quot;.php&quot;
</span></span><span id="58" class="l"><a class="l" href="#58"> 58: </a><span class="php-comment"> *
</span></span><span id="59" class="l"><a class="l" href="#59"> 59: </a><span class="php-comment"> * @param string $nom_modele le nom du fichier modèle à charger sans son extension
</span></span><span id="60" class="l"><a class="l" href="#60"> 60: </a><span class="php-comment"> * @param String $ext l'extension du fichier du modèel (par défaut : &quot;.php&quot;
</span></span><span id="61" class="l"><a class="l" href="#61"> 61: </a><span class="php-comment"> *
</span></span><span id="62" class="l"><a class="l" href="#62"> 62: </a><span class="php-comment"> * @return mixed false si le chargement a échoué, sinon l'objet du modèle demandé.
</span></span><span id="63" class="l"><a class="l" href="#63"> 63: </a><span class="php-comment"> */</span>
</span><span id="64" class="l"><a class="l" href="#64"> 64: </a> <span class="php-keyword1">final</span> <span class="php-keyword1">protected</span> <span class="php-keyword1">function</span> <a id="_getModele" href="#_getModele">getModele</a>(<span class="php-var">$nom_modele</span>, <span class="php-var">$ext</span> = <span class="php-quote">'.php'</span>) {
</span><span id="65" class="l"><a class="l" href="#65"> 65: </a> <span class="php-var">$sortie</span> = <span class="php-keyword1">false</span>;
</span><span id="66" class="l"><a class="l" href="#66"> 66: </a> <span class="php-var">$chemin_modele</span> = <span class="php-var">$this</span>-&gt;registre-&gt;get(<span class="php-quote">'base_chemin_modele'</span>).<span class="php-var">$nom_modele</span>.<span class="php-var">$ext</span>;
</span><span id="67" class="l"><a class="l" href="#67"> 67: </a> <span class="php-keyword1">if</span> (<span class="php-keyword2">file_exists</span>(<span class="php-var">$chemin_modele</span>)) {
</span><span id="68" class="l"><a class="l" href="#68"> 68: </a> <span class="php-keyword1">include_once</span> <span class="php-var">$chemin_modele</span>;
</span><span id="69" class="l"><a class="l" href="#69"> 69: </a> <span class="php-keyword1">if</span> (<span class="php-keyword2">class_exists</span>(<span class="php-var">$nom_modele</span>)) {
</span><span id="70" class="l"><a class="l" href="#70"> 70: </a> <span class="php-var">$sortie</span> = <span class="php-keyword1">new</span> <span class="php-var">$nom_modele</span>;
</span><span id="71" class="l"><a class="l" href="#71"> 71: </a> }
</span><span id="72" class="l"><a class="l" href="#72"> 72: </a> }
</span><span id="73" class="l"><a class="l" href="#73"> 73: </a> <span class="php-keyword1">return</span> <span class="php-var">$sortie</span>;
</span><span id="74" class="l"><a class="l" href="#74"> 74: </a> }
</span><span id="75" class="l"><a class="l" href="#75"> 75: </a>
</span><span id="76" class="l"><a class="l" href="#76"> 76: </a> <span class="php-comment">/**
</span></span><span id="77" class="l"><a class="l" href="#77"> 77: </a><span class="php-comment"> * Fonction prenant en paramètre le nom d'un squelette et un tableau associatif de données,
</span></span><span id="78" class="l"><a class="l" href="#78"> 78: </a><span class="php-comment"> * en extrait les variables, charge le squelette et retourne le résultat des deux combinés.
</span></span><span id="79" class="l"><a class="l" href="#79"> 79: </a><span class="php-comment"> *
</span></span><span id="80" class="l"><a class="l" href="#80"> 80: </a><span class="php-comment"> * @param String $nom_squelette le nom du squelette sans son extension
</span></span><span id="81" class="l"><a class="l" href="#81"> 81: </a><span class="php-comment"> * @param Array $donnees un tableau associatif contenant les variables a injecter dans la vue
</span></span><span id="82" class="l"><a class="l" href="#82"> 82: </a><span class="php-comment"> * @param String $ext l'extension du fichier du squelette (par défaut : &quot;.tpl.html&quot;
</span></span><span id="83" class="l"><a class="l" href="#83"> 83: </a><span class="php-comment"> *
</span></span><span id="84" class="l"><a class="l" href="#84"> 84: </a><span class="php-comment"> * @return boolean false si la vue n'existe pas, sinon la chaine résultat.
</span></span><span id="85" class="l"><a class="l" href="#85"> 85: </a><span class="php-comment"> */</span>
</span><span id="86" class="l"><a class="l" href="#86"> 86: </a> <span class="php-keyword1">final</span> <span class="php-keyword1">protected</span> <span class="php-keyword1">function</span> <a id="_getVue" href="#_getVue">getVue</a>(<span class="php-var">$nom_squelette</span>, <span class="php-var">$donnees</span> = <span class="php-keyword1">array</span>(), <span class="php-var">$ext</span> = <span class="php-quote">'.tpl.html'</span>) {
</span><span id="87" class="l"><a class="l" href="#87"> 87: </a> <span class="php-var">$donnees</span> = <span class="php-var">$this</span>-&gt;preTraiterDonnees(<span class="php-var">$donnees</span>);
</span><span id="88" class="l"><a class="l" href="#88"> 88: </a> <span class="php-var">$chemin_squelette</span> = (<span class="php-var">$this</span>-&gt;registre-&gt;get(<span class="php-quote">'base_chemin_squelette'</span>)).<span class="php-var">$nom_squelette</span>.<span class="php-var">$ext</span>;
</span><span id="89" class="l"><a class="l" href="#89"> 89: </a> <span class="php-var">$sortie</span> = SquelettePhp::analyser(<span class="php-var">$chemin_squelette</span>, <span class="php-var">$donnees</span>);
</span></span><span id="59" class="l"><a class="l" href="#59"> 59: </a><span class="php-comment"> * @return mixed false si le chargement a échoué, sinon l'objet du modèle demandé.
</span></span><span id="60" class="l"><a class="l" href="#60"> 60: </a><span class="php-comment"> */</span>
</span><span id="61" class="l"><a class="l" href="#61"> 61: </a> <span class="php-keyword1">final</span> <span class="php-keyword1">protected</span> <span class="php-keyword1">function</span> <a id="_getModele" href="#_getModele">getModele</a>(<span class="php-var">$nom_modele</span>, <span class="php-var">$ext</span> = <span class="php-quote">'.php'</span>) {
</span><span id="62" class="l"><a class="l" href="#62"> 62: </a> <span class="php-var">$sortie</span> = <span class="php-keyword1">false</span>;
</span><span id="63" class="l"><a class="l" href="#63"> 63: </a> <span class="php-var">$chemin_modele</span> = <span class="php-var">$this</span>-&gt;registre-&gt;get(<span class="php-quote">'base_chemin_modele'</span>).<span class="php-var">$nom_modele</span>.<span class="php-var">$ext</span>;
</span><span id="64" class="l"><a class="l" href="#64"> 64: </a> <span class="php-keyword1">if</span> (<span class="php-keyword2">file_exists</span>(<span class="php-var">$chemin_modele</span>)) {
</span><span id="65" class="l"><a class="l" href="#65"> 65: </a> <span class="php-keyword1">include_once</span> <span class="php-var">$chemin_modele</span>;
</span><span id="66" class="l"><a class="l" href="#66"> 66: </a> <span class="php-keyword1">if</span> (<span class="php-keyword2">class_exists</span>(<span class="php-var">$nom_modele</span>)) {
</span><span id="67" class="l"><a class="l" href="#67"> 67: </a> <span class="php-var">$sortie</span> = <span class="php-keyword1">new</span> <span class="php-var">$nom_modele</span>;
</span><span id="68" class="l"><a class="l" href="#68"> 68: </a> }
</span><span id="69" class="l"><a class="l" href="#69"> 69: </a> }
</span><span id="70" class="l"><a class="l" href="#70"> 70: </a> <span class="php-keyword1">return</span> <span class="php-var">$sortie</span>;
</span><span id="71" class="l"><a class="l" href="#71"> 71: </a> }
</span><span id="72" class="l"><a class="l" href="#72"> 72: </a>
</span><span id="73" class="l"><a class="l" href="#73"> 73: </a> <span class="php-comment">/**
</span></span><span id="74" class="l"><a class="l" href="#74"> 74: </a><span class="php-comment"> * Fonction prenant en paramètre le nom d'un squelette et un tableau associatif de données,
</span></span><span id="75" class="l"><a class="l" href="#75"> 75: </a><span class="php-comment"> * en extrait les variables, charge le squelette et retourne le résultat des deux combinés.
</span></span><span id="76" class="l"><a class="l" href="#76"> 76: </a><span class="php-comment"> *
</span></span><span id="77" class="l"><a class="l" href="#77"> 77: </a><span class="php-comment"> * @param String $nom_squelette le nom du squelette sans son extension
</span></span><span id="78" class="l"><a class="l" href="#78"> 78: </a><span class="php-comment"> * @param Array $donnees un tableau associatif contenant les variables a injecter dans la vue
</span></span><span id="79" class="l"><a class="l" href="#79"> 79: </a><span class="php-comment"> * @param String $ext l'extension du fichier du squelette (par défaut : &quot;.tpl.html&quot;
</span></span><span id="80" class="l"><a class="l" href="#80"> 80: </a><span class="php-comment"> *
</span></span><span id="81" class="l"><a class="l" href="#81"> 81: </a><span class="php-comment"> * @return boolean false si la vue n'existe pas, sinon la chaine résultat.
</span></span><span id="82" class="l"><a class="l" href="#82"> 82: </a><span class="php-comment"> */</span>
</span><span id="83" class="l"><a class="l" href="#83"> 83: </a> <span class="php-keyword1">final</span> <span class="php-keyword1">protected</span> <span class="php-keyword1">function</span> <a id="_getVue" href="#_getVue">getVue</a>(<span class="php-var">$nom_squelette</span>, <span class="php-var">$donnees</span> = <span class="php-keyword1">array</span>(), <span class="php-var">$ext</span> = <span class="php-quote">'.tpl.html'</span>) {
</span><span id="84" class="l"><a class="l" href="#84"> 84: </a> <span class="php-var">$donnees</span> = <span class="php-var">$this</span>-&gt;preTraiterDonnees(<span class="php-var">$donnees</span>);
</span><span id="85" class="l"><a class="l" href="#85"> 85: </a> <span class="php-var">$chemin_squelette</span> = (<span class="php-var">$this</span>-&gt;registre-&gt;get(<span class="php-quote">'base_chemin_squelette'</span>)).<span class="php-var">$nom_squelette</span>.<span class="php-var">$ext</span>;
</span><span id="86" class="l"><a class="l" href="#86"> 86: </a> <span class="php-var">$sortie</span> = SquelettePhp::analyser(<span class="php-var">$chemin_squelette</span>, <span class="php-var">$donnees</span>);
</span><span id="87" class="l"><a class="l" href="#87"> 87: </a>
</span><span id="88" class="l"><a class="l" href="#88"> 88: </a> <span class="php-keyword1">return</span> <span class="php-var">$sortie</span>;
</span><span id="89" class="l"><a class="l" href="#89"> 89: </a> }
</span><span id="90" class="l"><a class="l" href="#90"> 90: </a>
</span><span id="91" class="l"><a class="l" href="#91"> 91: </a> <span class="php-keyword1">return</span> <span class="php-var">$sortie</span>;
</span><span id="92" class="l"><a class="l" href="#92"> 92: </a> }
</span><span id="93" class="l"><a class="l" href="#93"> 93: </a>
</span><span id="94" class="l"><a class="l" href="#94"> 94: </a> <span class="php-comment">/**
</span></span><span id="95" class="l"><a class="l" href="#95"> 95: </a><span class="php-comment"> * Fonction prenant en paramètre un tableau de données et effectuant un traitement dessus.
</span></span><span id="96" class="l"><a class="l" href="#96"> 96: </a><span class="php-comment"> * Cette fonction est à surcharger dans les classes filles pour automatiser un traitement
</span></span><span id="97" class="l"><a class="l" href="#97"> 97: </a><span class="php-comment"> * avant chaque chargement de vue.
</span></span><span id="98" class="l"><a class="l" href="#98"> 98: </a><span class="php-comment"> *
</span></span><span id="99" class="l"><a class="l" href="#99"> 99: </a><span class="php-comment"> * @param Array $donnees Le tableau de données à traiter
</span></span><span id="100" class="l"><a class="l" href="#100">100: </a><span class="php-comment"> *
</span></span><span id="101" class="l"><a class="l" href="#101">101: </a><span class="php-comment"> * @return Array $donnees Le tableau de données traité
</span></span><span id="102" class="l"><a class="l" href="#102">102: </a><span class="php-comment"> */</span>
</span><span id="103" class="l"><a class="l" href="#103">103: </a> <span class="php-keyword1">protected</span> <span class="php-keyword1">function</span> <a id="_preTraiterDonnees" href="#_preTraiterDonnees">preTraiterDonnees</a>(<span class="php-var">$donnees</span>) {
</span><span id="104" class="l"><a class="l" href="#104">104: </a> <span class="php-keyword1">return</span> <span class="php-var">$donnees</span>;
</span><span id="105" class="l"><a class="l" href="#105">105: </a> }
</span><span id="106" class="l"><a class="l" href="#106">106: </a>
</span><span id="107" class="l"><a class="l" href="#107">107: </a> <span class="php-comment">/**
</span></span><span id="108" class="l"><a class="l" href="#108">108: </a><span class="php-comment"> * Procédure vérifiant l'encodage des tableaux $_GET et $_POST et les transcodant dans l'encodage de l'application
</span></span><span id="109" class="l"><a class="l" href="#109">109: </a><span class="php-comment"> */</span>
</span><span id="110" class="l"><a class="l" href="#110">110: </a> <span class="php-keyword1">protected</span> <span class="php-keyword1">function</span> <a id="_verifierEtReencoderTableauRequete" href="#_verifierEtReencoderTableauRequete">verifierEtReencoderTableauRequete</a>() {
</span><span id="111" class="l"><a class="l" href="#111">111: </a> <span class="php-keyword1">if</span> (self::<span class="php-var">$encodage</span> == <span class="php-keyword1">false</span> &amp;&amp; Config::get(<span class="php-quote">'sortie_encodage'</span>) != Config::get(<span class="php-quote">'appli_encodage'</span>)) {
</span><span id="112" class="l"><a class="l" href="#112">112: </a> <span class="php-var">$_POST</span> = <span class="php-var">$this</span>-&gt;encoderTableau(<span class="php-var">$_POST</span>, Config::get(<span class="php-quote">'appli_encodage'</span>), Config::get(<span class="php-quote">'sortie_encodage'</span>));
</span><span id="113" class="l"><a class="l" href="#113">113: </a> <span class="php-var">$_GET</span> = <span class="php-var">$this</span>-&gt;encoderTableau(<span class="php-var">$_GET</span>, Config::get(<span class="php-quote">'appli_encodage'</span>), Config::get(<span class="php-quote">'sortie_encodage'</span>));
</span><span id="114" class="l"><a class="l" href="#114">114: </a> self::<span class="php-var">$encodage</span> = <span class="php-keyword1">true</span>;
</span><span id="115" class="l"><a class="l" href="#115">115: </a> }
</span><span id="91" class="l"><a class="l" href="#91"> 91: </a> <span class="php-comment">/**
</span></span><span id="92" class="l"><a class="l" href="#92"> 92: </a><span class="php-comment"> * Fonction prenant en paramètre un tableau de données et effectuant un traitement dessus.
</span></span><span id="93" class="l"><a class="l" href="#93"> 93: </a><span class="php-comment"> * Cette fonction est à surcharger dans les classes filles pour automatiser un traitement
</span></span><span id="94" class="l"><a class="l" href="#94"> 94: </a><span class="php-comment"> * avant chaque chargement de vue.
</span></span><span id="95" class="l"><a class="l" href="#95"> 95: </a><span class="php-comment"> *
</span></span><span id="96" class="l"><a class="l" href="#96"> 96: </a><span class="php-comment"> * @param Array $donnees Le tableau de données à traiter
</span></span><span id="97" class="l"><a class="l" href="#97"> 97: </a><span class="php-comment"> *
</span></span><span id="98" class="l"><a class="l" href="#98"> 98: </a><span class="php-comment"> * @return Array $donnees Le tableau de données traité
</span></span><span id="99" class="l"><a class="l" href="#99"> 99: </a><span class="php-comment"> */</span>
</span><span id="100" class="l"><a class="l" href="#100">100: </a> <span class="php-keyword1">protected</span> <span class="php-keyword1">function</span> <a id="_preTraiterDonnees" href="#_preTraiterDonnees">preTraiterDonnees</a>(<span class="php-var">$donnees</span>) {
</span><span id="101" class="l"><a class="l" href="#101">101: </a> <span class="php-keyword1">return</span> <span class="php-var">$donnees</span>;
</span><span id="102" class="l"><a class="l" href="#102">102: </a> }
</span><span id="103" class="l"><a class="l" href="#103">103: </a>
</span><span id="104" class="l"><a class="l" href="#104">104: </a> <span class="php-comment">/**
</span></span><span id="105" class="l"><a class="l" href="#105">105: </a><span class="php-comment"> * Procédure vérifiant l'encodage des tableaux $_GET et $_POST et les transcodant dans l'encodage de l'application
</span></span><span id="106" class="l"><a class="l" href="#106">106: </a><span class="php-comment"> */</span>
</span><span id="107" class="l"><a class="l" href="#107">107: </a> <span class="php-keyword1">protected</span> <span class="php-keyword1">function</span> <a id="_verifierEtReencoderTableauRequete" href="#_verifierEtReencoderTableauRequete">verifierEtReencoderTableauRequete</a>() {
</span><span id="108" class="l"><a class="l" href="#108">108: </a> <span class="php-keyword1">if</span> (self::<span class="php-var">$encodage</span> == <span class="php-keyword1">false</span> &amp;&amp; Config::get(<span class="php-quote">'sortie_encodage'</span>) != Config::get(<span class="php-quote">'appli_encodage'</span>)) {
</span><span id="109" class="l"><a class="l" href="#109">109: </a> <span class="php-var">$_POST</span> = <span class="php-var">$this</span>-&gt;encoderTableau(<span class="php-var">$_POST</span>, Config::get(<span class="php-quote">'appli_encodage'</span>), Config::get(<span class="php-quote">'sortie_encodage'</span>));
</span><span id="110" class="l"><a class="l" href="#110">110: </a> <span class="php-var">$_GET</span> = <span class="php-var">$this</span>-&gt;encoderTableau(<span class="php-var">$_GET</span>, Config::get(<span class="php-quote">'appli_encodage'</span>), Config::get(<span class="php-quote">'sortie_encodage'</span>));
</span><span id="111" class="l"><a class="l" href="#111">111: </a> self::<span class="php-var">$encodage</span> = <span class="php-keyword1">true</span>;
</span><span id="112" class="l"><a class="l" href="#112">112: </a> }
</span><span id="113" class="l"><a class="l" href="#113">113: </a>
</span><span id="114" class="l"><a class="l" href="#114">114: </a> <span class="php-comment">// traitement des magic quotes</span>
</span><span id="115" class="l"><a class="l" href="#115">115: </a> <span class="php-var">$this</span>-&gt;verifierEtTraiterSlashTableauRequete();
</span><span id="116" class="l"><a class="l" href="#116">116: </a> }
</span><span id="117" class="l"><a class="l" href="#117">117: </a>
</span><span id="118" class="l"><a class="l" href="#118">118: </a> <span class="php-comment">/**
</span></span><span id="119" class="l"><a class="l" href="#119">119: </a><span class="php-comment"> * Fonction récursive transcodant toutes les valeurs d'un tableau de leur encodage d'entrée vers un encodage de sortie donné
</span></span><span id="120" class="l"><a class="l" href="#120">120: </a><span class="php-comment"> * @param $tableau Array Un tableau de données à encoder
</span></span><span id="121" class="l"><a class="l" href="#121">121: </a><span class="php-comment"> * @param $encodage_sortie String l'encodage vers lequel on doit transcoder
</span></span><span id="122" class="l"><a class="l" href="#122">122: </a><span class="php-comment"> * @param $encodage_entree String l'encodage original des chaines du tableau (optionnel)
</span></span><span id="123" class="l"><a class="l" href="#123">123: </a><span class="php-comment"> * @return Array Le tableau encodé dans l'encodage de sortie
</span></span><span id="124" class="l"><a class="l" href="#124">124: </a><span class="php-comment"> *
</span></span><span id="125" class="l"><a class="l" href="#125">125: </a><span class="php-comment"> */</span>
</span><span id="126" class="l"><a class="l" href="#126">126: </a> <span class="php-keyword1">final</span> <span class="php-keyword1">protected</span> <span class="php-keyword1">function</span> <a id="_encoderTableau" href="#_encoderTableau">encoderTableau</a>(<span class="php-var">$tableau</span>, <span class="php-var">$encodage_sortie</span>, <span class="php-var">$encodage_entree</span> = <span class="php-keyword1">null</span>) {
</span><span id="127" class="l"><a class="l" href="#127">127: </a> <span class="php-keyword1">if</span> (<span class="php-keyword2">is_array</span>(<span class="php-var">$tableau</span>)) {
</span><span id="128" class="l"><a class="l" href="#128">128: </a> <span class="php-keyword1">foreach</span> (<span class="php-var">$tableau</span> <span class="php-keyword1">as</span> <span class="php-var">$cle</span> =&gt; <span class="php-var">$valeur</span>) {
</span><span id="129" class="l"><a class="l" href="#129">129: </a> <span class="php-keyword1">if</span> (<span class="php-keyword2">is_array</span>(<span class="php-var">$valeur</span>)) {
</span><span id="130" class="l"><a class="l" href="#130">130: </a> <span class="php-var">$tableau</span>[<span class="php-var">$cle</span>] = <span class="php-var">$this</span>-&gt;encoderTableau(<span class="php-var">$valeur</span>, <span class="php-var">$encodage_sortie</span>, <span class="php-var">$encodage_entree</span>);
</span><span id="131" class="l"><a class="l" href="#131">131: </a> } <span class="php-keyword1">else</span> {
</span><span id="132" class="l"><a class="l" href="#132">132: </a> <span class="php-var">$tableau</span>[<span class="php-var">$cle</span>] = <span class="php-keyword2">mb_convert_encoding</span>(<span class="php-var">$valeur</span>, <span class="php-var">$encodage_sortie</span>, <span class="php-var">$encodage_entree</span>);
</span><span id="133" class="l"><a class="l" href="#133">133: </a> }
</span><span id="134" class="l"><a class="l" href="#134">134: </a> }
</span><span id="135" class="l"><a class="l" href="#135">135: </a> }
</span><span id="136" class="l"><a class="l" href="#136">136: </a> <span class="php-keyword1">return</span> <span class="php-var">$tableau</span>;
</span><span id="137" class="l"><a class="l" href="#137">137: </a> }
</span><span id="138" class="l"><a class="l" href="#138">138: </a>}
</span><span id="139" class="l"><a class="l" href="#139">139: </a></span><span class="xlang">?&gt;</span></code></pre>
</span></span><span id="119" class="l"><a class="l" href="#119">119: </a><span class="php-comment"> * Procédure vérifiant l'activation des magic quotes et remplace les slash dans les tableaux de requete
</span></span><span id="120" class="l"><a class="l" href="#120">120: </a><span class="php-comment"> */</span>
</span><span id="121" class="l"><a class="l" href="#121">121: </a> <span class="php-keyword1">private</span> <span class="php-keyword1">function</span> <a id="_verifierEtTraiterSlashTableauRequete" href="#_verifierEtTraiterSlashTableauRequete">verifierEtTraiterSlashTableauRequete</a>() {
</span><span id="122" class="l"><a class="l" href="#122">122: </a>
</span><span id="123" class="l"><a class="l" href="#123">123: </a> <span class="php-keyword1">if</span> ( <span class="php-keyword2">get_magic_quotes_gpc</span>() ) {
</span><span id="124" class="l"><a class="l" href="#124">124: </a>
</span><span id="125" class="l"><a class="l" href="#125">125: </a> <span class="php-keyword1">if</span> (!<span class="php-keyword2">function_exists</span>(<span class="php-quote">'stripslashes_deep'</span>)) {
</span><span id="126" class="l"><a class="l" href="#126">126: </a> <span class="php-keyword1">function</span> <a id="_stripslashes_deep" href="#_stripslashes_deep">stripslashes_deep</a>( <span class="php-var">$value</span> ) {
</span><span id="127" class="l"><a class="l" href="#127">127: </a>
</span><span id="128" class="l"><a class="l" href="#128">128: </a> <span class="php-keyword1">return</span> ( <span class="php-keyword2">is_array</span>(<span class="php-var">$value</span>) )
</span><span id="129" class="l"><a class="l" href="#129">129: </a> ? <span class="php-keyword2">array_map</span>(<span class="php-quote">'stripslashes_deep'</span>, <span class="php-var">$value</span>)
</span><span id="130" class="l"><a class="l" href="#130">130: </a> : <span class="php-keyword2">stripslashes</span>(<span class="php-var">$value</span>);
</span><span id="131" class="l"><a class="l" href="#131">131: </a>
</span><span id="132" class="l"><a class="l" href="#132">132: </a> } <span class="php-comment">// end of 'stripslashes_deep()'</span>
</span><span id="133" class="l"><a class="l" href="#133">133: </a>
</span><span id="134" class="l"><a class="l" href="#134">134: </a> <span class="php-var">$_GET</span> = <span class="php-keyword2">array_map</span>(<span class="php-quote">'stripslashes_deep'</span>, <span class="php-var">$_GET</span>);
</span><span id="135" class="l"><a class="l" href="#135">135: </a> <span class="php-var">$_POST</span> = <span class="php-keyword2">array_map</span>(<span class="php-quote">'stripslashes_deep'</span>, <span class="php-var">$_POST</span>);
</span><span id="136" class="l"><a class="l" href="#136">136: </a> <span class="php-var">$_COOKIE</span> = <span class="php-keyword2">array_map</span>(<span class="php-quote">'stripslashes_deep'</span>, <span class="php-var">$_COOKIE</span>);
</span><span id="137" class="l"><a class="l" href="#137">137: </a> }
</span><span id="138" class="l"><a class="l" href="#138">138: </a> }
</span><span id="139" class="l"><a class="l" href="#139">139: </a> }
</span><span id="140" class="l"><a class="l" href="#140">140: </a>
</span><span id="141" class="l"><a class="l" href="#141">141: </a> <span class="php-comment">/**
</span></span><span id="142" class="l"><a class="l" href="#142">142: </a><span class="php-comment"> * Fonction récursive transcodant toutes les valeurs d'un tableau de leur encodage d'entrée vers un encodage de sortie donné
</span></span><span id="143" class="l"><a class="l" href="#143">143: </a><span class="php-comment"> * @param $tableau Array Un tableau de données à encoder
</span></span><span id="144" class="l"><a class="l" href="#144">144: </a><span class="php-comment"> * @param $encodage_sortie String l'encodage vers lequel on doit transcoder
</span></span><span id="145" class="l"><a class="l" href="#145">145: </a><span class="php-comment"> * @param $encodage_entree String l'encodage original des chaines du tableau (optionnel)
</span></span><span id="146" class="l"><a class="l" href="#146">146: </a><span class="php-comment"> * @return Array Le tableau encodé dans l'encodage de sortie
</span></span><span id="147" class="l"><a class="l" href="#147">147: </a><span class="php-comment"> *
</span></span><span id="148" class="l"><a class="l" href="#148">148: </a><span class="php-comment"> */</span>
</span><span id="149" class="l"><a class="l" href="#149">149: </a> <span class="php-keyword1">final</span> <span class="php-keyword1">protected</span> <span class="php-keyword1">function</span> <a id="_encoderTableau" href="#_encoderTableau">encoderTableau</a>(<span class="php-var">$tableau</span>, <span class="php-var">$encodage_sortie</span>, <span class="php-var">$encodage_entree</span> = <span class="php-keyword1">null</span>) {
</span><span id="150" class="l"><a class="l" href="#150">150: </a> <span class="php-keyword1">if</span> (<span class="php-keyword2">is_array</span>(<span class="php-var">$tableau</span>)) {
</span><span id="151" class="l"><a class="l" href="#151">151: </a> <span class="php-keyword1">foreach</span> (<span class="php-var">$tableau</span> <span class="php-keyword1">as</span> <span class="php-var">$cle</span> =&gt; <span class="php-var">$valeur</span>) {
</span><span id="152" class="l"><a class="l" href="#152">152: </a> <span class="php-keyword1">if</span> (<span class="php-keyword2">is_array</span>(<span class="php-var">$valeur</span>)) {
</span><span id="153" class="l"><a class="l" href="#153">153: </a> <span class="php-var">$tableau</span>[<span class="php-var">$cle</span>] = <span class="php-var">$this</span>-&gt;encoderTableau(<span class="php-var">$valeur</span>, <span class="php-var">$encodage_sortie</span>, <span class="php-var">$encodage_entree</span>);
</span><span id="154" class="l"><a class="l" href="#154">154: </a> } <span class="php-keyword1">else</span> {
</span><span id="155" class="l"><a class="l" href="#155">155: </a> <span class="php-var">$tableau</span>[<span class="php-var">$cle</span>] = <span class="php-keyword2">mb_convert_encoding</span>(<span class="php-var">$valeur</span>, <span class="php-var">$encodage_sortie</span>, <span class="php-var">$encodage_entree</span>);
</span><span id="156" class="l"><a class="l" href="#156">156: </a> }
</span><span id="157" class="l"><a class="l" href="#157">157: </a> }
</span><span id="158" class="l"><a class="l" href="#158">158: </a> }
</span><span id="159" class="l"><a class="l" href="#159">159: </a> <span class="php-keyword1">return</span> <span class="php-var">$tableau</span>;
</span><span id="160" class="l"><a class="l" href="#160">160: </a> }
</span><span id="161" class="l"><a class="l" href="#161">161: </a>}
</span><span id="162" class="l"><a class="l" href="#162">162: </a></span><span class="xlang">?&gt;</span></code></pre>
 
<div id="footer">
TBFramework - v0.2 API documentation generated by <a href="http://apigen.org">ApiGen 2.8.0</a>
/branches/v0.2-buhl/doc/ApiGen/tree.html
7,7 → 7,7
<title>Tree | TBFramework - v0.2</title>
 
<script type="text/javascript" src="resources/combined.js?4205936287"></script>
<script type="text/javascript" src="elementlist.js?117657638"></script>
<script type="text/javascript" src="elementlist.js?1835392179"></script>
<link rel="stylesheet" type="text/css" media="all" href="resources/style.css?3505392360">
 
</head>
40,6 → 40,7
<li><a href="class-Controleur.html">Controleur</a></li>
<li><a href="class-Debug.html">Debug</a></li>
<li><a href="class-GestionnaireException.html">GestionnaireException</a></li>
<li><a href="class-I18n.html">I18n</a></li>
<li><a href="class-Log.html">Log</a></li>
<li><a href="class-Modele.html">Modele</a></li>
<li><a href="class-PDOStatement.html">PDOStatement</a></li>
153,6 → 154,13
 
</li>
 
<li><div class="notlast"><a href="class-I18n.html"><span>I18n</span></a>
</div>
 
</li>
 
<li><div class="notlast"><a href="class-Log.html"><span>Log</span></a>
/branches/v0.2-buhl/doc/ApiGen/class-Controleur.html
7,7 → 7,7
<title>Class Controleur | TBFramework - v0.2</title>
 
<script type="text/javascript" src="resources/combined.js?4205936287"></script>
<script type="text/javascript" src="elementlist.js?117657638"></script>
<script type="text/javascript" src="elementlist.js?1835392179"></script>
<link rel="stylesheet" type="text/css" media="all" href="resources/style.css?3505392360">
 
</head>
40,6 → 40,7
<li class="active"><a href="class-Controleur.html">Controleur</a></li>
<li><a href="class-Debug.html">Debug</a></li>
<li><a href="class-GestionnaireException.html">GestionnaireException</a></li>
<li><a href="class-I18n.html">I18n</a></li>
<li><a href="class-Log.html">Log</a></li>
<li><a href="class-Modele.html">Modele</a></li>
<li><a href="class-Registre.html">Registre</a></li>
124,13 → 125,14
<b>Package:</b> <a href="package-Framework.html">Framework</a><br>
 
<b>Category:</b>
php5<br>
PHP 5.2<br>
<b>Copyright:</b>
2009 Tela-Botanica<br>
Copyright (c) 2009, Tela Botanica (<a
href="mailto:accueil&#64;tela-botanica.org">accueil&#64;<!-- -->tela-botanica.org</a>)<br>
<b>License:</b>
<a href="http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt">Licence CECILL</a><br>
<a href="GNU-GPL-v3">&lt;http://www.gnu.org/licenses/gpl.html&gt;</a><br>
<b>License:</b>
<a href="http://www.gnu.org/licenses/gpl.html">Licence GNU-GPL</a><br>
<a href="CECILL-v2">&lt;http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt&gt;</a><br>
<b>Author:</b>
Aurélien PERONNET &lt;<a
href="mailto:aurelien&#64;tela-botanica.org">aurelien&#64;<!-- -->tela-botanica.org</a>&gt;<br>
137,11 → 139,7
<b>Author:</b>
Jean-Pascal MILCENT &lt;<a
href="mailto:jpm&#64;tela-botanica.org">jpm&#64;<!-- -->tela-botanica.org</a>&gt;<br>
<b>Version:</b>
SVN: $Id: Controleur.php 191 2010-04-29 15:34:49Z jpm $<br>
<b>Link:</b>
/doc/framework/<br>
<b>Located at</b> <a href="source-class-Controleur.html#3-138" title="Go to source code">Controleur.php</a><br>
<b>Located at</b> <a href="source-class-Controleur.html#3-161" title="Go to source code">Controleur.php</a><br>
</div>
 
 
159,7 → 157,7
 
<td class="name"><div>
<a class="anchor" href="#___construct">#</a>
<code><a href="source-class-Controleur.html#26-36" title="Go to source code">__construct</a>( )</code>
<code><a href="source-class-Controleur.html#23-33" title="Go to source code">__construct</a>( )</code>
 
<div class="description short">
192,7 → 190,7
 
<td class="name"><div>
<a class="anchor" href="#_chargerModele">#</a>
<code><a href="source-class-Controleur.html#38-54" title="Go to source code">chargerModele</a>( <span>string <var>$nom_modele</var></span> )</code>
<code><a href="source-class-Controleur.html#35-51" title="Go to source code">chargerModele</a>( <span>string <var>$nom_modele</var></span> )</code>
 
<div class="description short">
236,7 → 234,7
 
<td class="name"><div>
<a class="anchor" href="#_getModele">#</a>
<code><a href="source-class-Controleur.html#56-74" title="Go to source code">getModele</a>( <span>string <var>$nom_modele</var></span>, <span>String <var>$ext</var> = <span class="php-quote">'.php'</span></span> )</code>
<code><a href="source-class-Controleur.html#53-71" title="Go to source code">getModele</a>( <span>string <var>$nom_modele</var></span>, <span>String <var>$ext</var> = <span class="php-quote">'.php'</span></span> )</code>
 
<div class="description short">
280,7 → 278,7
 
<td class="name"><div>
<a class="anchor" href="#_getVue">#</a>
<code><a href="source-class-Controleur.html#76-92" title="Go to source code">getVue</a>( <span>String <var>$nom_squelette</var></span>, <span>Array <var>$donnees</var> = <span class="php-keyword1">array</span>()</span>, <span>String <var>$ext</var> = <span class="php-quote">'.tpl.html'</span></span> )</code>
<code><a href="source-class-Controleur.html#73-89" title="Go to source code">getVue</a>( <span>String <var>$nom_squelette</var></span>, <span>Array <var>$donnees</var> = <span class="php-keyword1">array</span>()</span>, <span>String <var>$ext</var> = <span class="php-quote">'.tpl.html'</span></span> )</code>
 
<div class="description short">
330,7 → 328,7
 
<td class="name"><div>
<a class="anchor" href="#_preTraiterDonnees">#</a>
<code><a href="source-class-Controleur.html#94-105" title="Go to source code">preTraiterDonnees</a>( <span>Array <var>$donnees</var></span> )</code>
<code><a href="source-class-Controleur.html#91-102" title="Go to source code">preTraiterDonnees</a>( <span>Array <var>$donnees</var></span> )</code>
 
<div class="description short">
376,7 → 374,7
 
<td class="name"><div>
<a class="anchor" href="#_verifierEtReencoderTableauRequete">#</a>
<code><a href="source-class-Controleur.html#107-116" title="Go to source code">verifierEtReencoderTableauRequete</a>( )</code>
<code><a href="source-class-Controleur.html#104-116" title="Go to source code">verifierEtReencoderTableauRequete</a>( )</code>
 
<div class="description short">
411,7 → 409,7
 
<td class="name"><div>
<a class="anchor" href="#_encoderTableau">#</a>
<code><a href="source-class-Controleur.html#118-137" title="Go to source code">encoderTableau</a>( <span>mixed <var>$tableau</var></span>, <span>mixed <var>$encodage_sortie</var></span>, <span>mixed <var>$encodage_entree</var> = <span class="php-keyword1">null</span></span> )</code>
<code><a href="source-class-Controleur.html#141-160" title="Go to source code">encoderTableau</a>( <span>mixed <var>$tableau</var></span>, <span>mixed <var>$encodage_sortie</var></span>, <span>mixed <var>$encodage_entree</var> = <span class="php-keyword1">null</span></span> )</code>
 
<div class="description short">
/branches/v0.2-buhl/doc/ApiGen/deprecated.html
7,7 → 7,7
<title>Deprecated | TBFramework - v0.2</title>
 
<script type="text/javascript" src="resources/combined.js?4205936287"></script>
<script type="text/javascript" src="elementlist.js?117657638"></script>
<script type="text/javascript" src="elementlist.js?1835392179"></script>
<link rel="stylesheet" type="text/css" media="all" href="resources/style.css?3505392360">
 
</head>
40,6 → 40,7
<li><a href="class-Controleur.html">Controleur</a></li>
<li><a href="class-Debug.html">Debug</a></li>
<li><a href="class-GestionnaireException.html">GestionnaireException</a></li>
<li><a href="class-I18n.html">I18n</a></li>
<li><a href="class-Log.html">Log</a></li>
<li><a href="class-Modele.html">Modele</a></li>
<li><a href="class-PDOStatement.html">PDOStatement</a></li>
112,15 → 113,6
 
 
 
<table class="summary" id="methods">
<caption>Methods summary</caption>
<tr>
<td class="name"><a href="class-GestionnaireException.html">GestionnaireException</a></td>
<td class="name"><code><a href="class-GestionnaireException.html#_getExceptions">getExceptions()</a></code></td>
<td>
</td>
</tr>
</table>