| 3 | jpm | 1 | <?php
 | 
        
           |  |  | 2 | /**
 | 
        
           |  |  | 3 | * Description :
 | 
        
           |  |  | 4 | * Classe principale de chargement des services d'eFlore.
 | 
        
           |  |  | 5 | *
 | 
        
           |  |  | 6 | * Encodage en entrée : utf8
 | 
        
           |  |  | 7 | * Encodage en sortie : utf8
 | 
        
           |  |  | 8 | * @package eflore-projets
 | 
        
           |  |  | 9 | * @author Jennifer DHÉ <jennifer.dhe@tela-botanica.org>
 | 
        
           |  |  | 10 | * @author Delphine CAUQUIL <delphine@tela-botanica.org>
 | 
        
           |  |  | 11 | * @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
 | 
        
           |  |  | 12 | * @license GPL v3 <http://www.gnu.org/licenses/gpl.txt>
 | 
        
           |  |  | 13 | * @license CECILL v2 <http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt>
 | 
        
           |  |  | 14 | * @version 0.1
 | 
        
           |  |  | 15 | * @copyright 1999-2011 Tela Botanica (accueil@tela-botanica.org)
 | 
        
           |  |  | 16 | */
 | 
        
           |  |  | 17 | class Projets extends RestService {
 | 
        
           |  |  | 18 |   | 
        
           |  |  | 19 | 	/** Contients les paramètres.*/
 | 
        
           |  |  | 20 | 	private $parametres = array();
 | 
        
           |  |  | 21 | 	/** Contients les ressources.*/
 | 
        
           |  |  | 22 | 	private $ressources = array();
 | 
        
           |  |  | 23 |   | 
        
           |  |  | 24 | 	/** Nom du projet courrant. */
 | 
        
           |  |  | 25 | 	private $projetNom = array();
 | 
        
           |  |  | 26 | 	/** Nom du service demandé. */
 | 
        
           |  |  | 27 | 	private $serviceNom = array();
 | 
        
           |  |  | 28 | 	/** Chemin vers le dossier courrant. */
 | 
        
           |  |  | 29 | 	private $cheminCourrant = null;
 | 
        
           | 791 | raphael | 30 | 	private $classe = null;
 | 
        
           | 653 | jpm | 31 |   | 
        
           | 536 | gduche | 32 | 	private $cache;
 | 
        
           | 653 | jpm | 33 |   | 
        
           | 3 | jpm | 34 | 	/** Indique si oui (true) ou non (false), on veut utiliser les paramètres brutes. */
 | 
        
           |  |  | 35 | 	protected $utilisationParametresBruts = true;
 | 
        
           |  |  | 36 |   | 
        
           |  |  | 37 | 	public function __construct() {
 | 
        
           |  |  | 38 | 		$this->cheminCourrant = dirname(__FILE__).DS;
 | 
        
           |  |  | 39 | 	}
 | 
        
           |  |  | 40 |   | 
        
           |  |  | 41 | 	public function consulter($ressources, $parametres) {
 | 
        
           |  |  | 42 | 		$resultat = '';
 | 
        
           | 110 | jpm | 43 | 		$reponseHttp = new ReponseHttp();
 | 
        
           | 3 | jpm | 44 | 		try {
 | 
        
           |  |  | 45 | 			$this->initialiserRessourcesEtParametres($ressources, $parametres);
 | 
        
           |  |  | 46 | 			$resultat = $this->traiterRessources();
 | 
        
           | 110 | jpm | 47 | 			$reponseHttp->setResultatService($resultat);
 | 
        
           | 3 | jpm | 48 | 		} catch (Exception $e) {
 | 
        
           | 110 | jpm | 49 | 			$reponseHttp->ajouterErreur($e);
 | 
        
           | 3 | jpm | 50 | 		}
 | 
        
           | 945 | raphael | 51 | 		if(strpos($_SERVER['SCRIPT_NAME'], 'phpunit') === FALSE) $reponseHttp->emettreLesEntetes();
 | 
        
           | 110 | jpm | 52 | 		$corps = $reponseHttp->getCorps();
 | 
        
           | 3 | jpm | 53 | 		return $corps;
 | 
        
           |  |  | 54 | 	}
 | 
        
           |  |  | 55 |   | 
        
           |  |  | 56 | 	private function initialiserRessourcesEtParametres($ressources, $parametres) {
 | 
        
           |  |  | 57 | 		$this->ressources = $ressources;
 | 
        
           |  |  | 58 | 		$this->parametres = $parametres;
 | 
        
           |  |  | 59 | 	}
 | 
        
           |  |  | 60 |   | 
        
           |  |  | 61 | 	private function traiterRessources() {
 | 
        
           |  |  | 62 | 		$retour = '';
 | 
        
           |  |  | 63 | 		if ($this->avoirRessources()) {
 | 
        
           |  |  | 64 | 			if ($this->avoirRessourceProjet()) {
 | 
        
           | 791 | raphael | 65 | 				$this->chargerNomDuService(); // défini $this->serviceNom
 | 
        
           |  |  | 66 | 				$this->initialiserProjet(); // autoload defined here
 | 
        
           | 3 | jpm | 67 | 				if ($this->avoirRessourceService()) {
 | 
        
           | 792 | raphael | 68 | 					$this->classe = self::debusquerClasse($this->projetNom, $this->serviceNom);
 | 
        
           | 3 | jpm | 69 | 					$retour = $this->initialiserService();
 | 
        
           |  |  | 70 | 				}
 | 
        
           |  |  | 71 | 			}
 | 
        
           |  |  | 72 | 		}
 | 
        
           |  |  | 73 | 		return $retour;
 | 
        
           |  |  | 74 | 	}
 | 
        
           |  |  | 75 |   | 
        
           |  |  | 76 | 	private function avoirRessources() {
 | 
        
           |  |  | 77 | 		$presenceDeRessources = false;
 | 
        
           |  |  | 78 | 		if (isset($this->ressources) && count($this->ressources) > 0) {
 | 
        
           |  |  | 79 | 			$presenceDeRessources = true;
 | 
        
           |  |  | 80 | 		} else {
 | 
        
           |  |  | 81 | 			$message = "Aucune ressource n'a été indiquée.\n".
 | 
        
           |  |  | 82 | 				"Veuillez indiquer au moins un code de projet et un type de service.";
 | 
        
           |  |  | 83 | 			$code = RestServeur::HTTP_CODE_MAUVAISE_REQUETE;
 | 
        
           |  |  | 84 | 			throw new Exception($message, $code);
 | 
        
           |  |  | 85 | 		}
 | 
        
           |  |  | 86 | 		return $presenceDeRessources;
 | 
        
           |  |  | 87 | 	}
 | 
        
           |  |  | 88 |   | 
        
           |  |  | 89 | 	private function avoirRessourceProjet() {
 | 
        
           |  |  | 90 | 		$presenceRessourceProjet = false;
 | 
        
           |  |  | 91 | 		$projet = $this->ressources[0];
 | 
        
           |  |  | 92 | 		$projetsDispo = Outils::recupererTableauConfig('projetsDispo');
 | 
        
           |  |  | 93 | 		if (in_array($projet, $projetsDispo)) {
 | 
        
           |  |  | 94 | 			$presenceRessourceProjet = true;
 | 
        
           |  |  | 95 | 		} else {
 | 
        
           |  |  | 96 | 			$message = "La ressource '$projet' n'indique pas un projet existant.\n".
 | 
        
           |  |  | 97 | 				"Les projets existant sont :\n".implode(', ', $projetsDispo);
 | 
        
           |  |  | 98 | 			$code = RestServeur::HTTP_CODE_MAUVAISE_REQUETE;
 | 
        
           |  |  | 99 | 			throw new Exception($message, $code);
 | 
        
           |  |  | 100 | 		}
 | 
        
           |  |  | 101 | 		return $presenceRessourceProjet;
 | 
        
           |  |  | 102 | 	}
 | 
        
           |  |  | 103 |   | 
        
           |  |  | 104 | 	private function initialiserProjet() {
 | 
        
           |  |  | 105 | 		$this->chargerNomDuProjet();
 | 
        
           |  |  | 106 | 		$this->chargerConfigProjet();
 | 
        
           | 145 | jpm | 107 |   | 
        
           |  |  | 108 | 		// php5.3 : Enregistrement en première position des autoload de la méthode gérant les classes des services
 | 
        
           | 146 | jpm | 109 | 		if (phpversion() < 5.3) {
 | 
        
           |  |  | 110 | 			spl_autoload_register(array($this, 'chargerClasseProjet'));
 | 
        
           |  |  | 111 | 		} else {
 | 
        
           |  |  | 112 | 			spl_autoload_register(array($this, 'chargerClasseProjet'), true , true);
 | 
        
           |  |  | 113 | 		}
 | 
        
           | 3 | jpm | 114 | 	}
 | 
        
           |  |  | 115 |   | 
        
           |  |  | 116 | 	private function chargerNomDuProjet() {
 | 
        
           |  |  | 117 | 		$this->projetNom = $this->ressources[0];
 | 
        
           |  |  | 118 | 	}
 | 
        
           |  |  | 119 |   | 
        
           |  |  | 120 | 	private function chargerConfigProjet() {
 | 
        
           |  |  | 121 | 		$projet = $this->projetNom;
 | 
        
           |  |  | 122 | 		$chemin = Config::get('chemin_configurations')."config_$projet.ini";
 | 
        
           |  |  | 123 | 		Config::charger($chemin);
 | 
        
           |  |  | 124 | 	}
 | 
        
           |  |  | 125 |   | 
        
           | 791 | raphael | 126 | 	/*
 | 
        
           |  |  | 127 | 	  1) jusqu'à présent:
 | 
        
           |  |  | 128 | 	  * le principe pour URL = a/b est: de charger
 | 
        
           |  |  | 129 | 	  * require_once($chemin/a/ucfirst(c).php)
 | 
        
           |  |  | 130 | 	  * new ucfirst(c); ucfirst(c)->consulter()
 | 
        
           |  |  | 131 | 	  * sachant que ucfirst(c).php et la classe ucfirst(c) apparaîssent à de multiples emplacements (selon a)
 | 
        
           |  |  | 132 |   | 
        
           |  |  | 133 | 	  1") Beurk... (php-className conflicts en PHP 5.2)
 | 
        
           |  |  | 134 |   | 
        
           |  |  | 135 | 	  Ici nous faisons des cas particuliers pour Ontologies, mais en suivant ce principe, sont affectés:
 | 
        
           | 811 | raphael | 136 | 	  Images, Informations, InformationsTaxonsSup,
 | 
        
           | 791 | raphael | 137 | 	  LegendeCartes, NomCommune, Noms, NomsVernaculaires, Projets, Statuts,
 | 
        
           |  |  | 138 | 	  Taxons, TaxonsCartes, Textes, ZoneGeo
 | 
        
           |  |  | 139 |   | 
        
           |  |  | 140 | 	  cf:
 | 
        
           |  |  | 141 | 	  $ grep -r '^[cC]lass '|grep -F '.php:'|egrep -w " \($(grep -rh '^[cC]lass '|awk '{print $2}'|sort|uniq -d|tr "\n" '|')\) " \
 | 
        
           |  |  | 142 | 	  |sort -k2
 | 
        
           |  |  | 143 |   | 
        
           |  |  | 144 | 	  PS: "Using two class with the same name"
 | 
        
           |  |  | 145 | 	  http://stackoverflow.com/questions/4555186/using-two-class-with-the-same-name
 | 
        
           |  |  | 146 | 	  > Stop.
 | 
        
           |  |  | 147 | 	  > Whatever you are doing is wrong. Backup. Re-evaluate what you are doing and why.
 | 
        
           |  |  | 148 | 	*/
 | 
        
           | 792 | raphael | 149 | 	private static function debusquerClasse($p, $s) {
 | 
        
           | 811 | raphael | 150 | 		if($s == 'ontologies') {
 | 
        
           |  |  | 151 | 			switch($p) {
 | 
        
           |  |  | 152 | 			case 'baseflor':
 | 
        
           |  |  | 153 | 				return 'BaseFloreOntologies';
 | 
        
           |  |  | 154 | 			case 'eflore':
 | 
        
           |  |  | 155 | 				return 'EfloreOntologies';
 | 
        
           |  |  | 156 | 			case 'chorodep':
 | 
        
           |  |  | 157 | 				return 'ChorodepOntologies';
 | 
        
           |  |  | 158 | 			case 'baseveg':
 | 
        
           |  |  | 159 | 				return 'BasevegOntologies';
 | 
        
           |  |  | 160 | 			case 'moissonnage':
 | 
        
           | 814 | raphael | 161 | 				return 'MoissonnageOntologies';
 | 
        
           | 811 | raphael | 162 | 			case 'commun':
 | 
        
           |  |  | 163 | 				return 'Ontologies';
 | 
        
           |  |  | 164 | 			}
 | 
        
           |  |  | 165 | 		}
 | 
        
           | 791 | raphael | 166 |   | 
        
           | 811 | raphael | 167 | 		if($s == 'cartes') {
 | 
        
           |  |  | 168 | 			switch($p) {
 | 
        
           |  |  | 169 | 			case 'bdtxa':
 | 
        
           |  |  | 170 | 				return 'BdtxaCartes';
 | 
        
           |  |  | 171 | 			case 'eflore':
 | 
        
           |  |  | 172 | 				return 'EfloreCartes';
 | 
        
           |  |  | 173 | 			case 'chorodep':
 | 
        
           |  |  | 174 | 				return 'ChorodepCartes';
 | 
        
           |  |  | 175 | 			case 'moissonnage':
 | 
        
           | 814 | raphael | 176 | 				return 'MoissonnageCartes';
 | 
        
           | 1012 | aurelien | 177 | 			case 'sophy':
 | 
        
           |  |  | 178 | 				return 'SophyCartes';
 | 
        
           | 811 | raphael | 179 | 			}
 | 
        
           | 791 | raphael | 180 | 		}
 | 
        
           | 811 | raphael | 181 |   | 
        
           | 791 | raphael | 182 | 		return NULL;
 | 
        
           |  |  | 183 | 	}
 | 
        
           |  |  | 184 |   | 
        
           | 3 | jpm | 185 | 	private function chargerClasseProjet($classe) {
 | 
        
           |  |  | 186 | 		if (class_exists($classe)) {
 | 
        
           |  |  | 187 | 			return null;
 | 
        
           |  |  | 188 | 		}
 | 
        
           |  |  | 189 |   | 
        
           | 791 | raphael | 190 | 		if($this->serviceNom == 'ontologies') {
 | 
        
           |  |  | 191 | 			$c = NULL;
 | 
        
           |  |  | 192 | 			switch($this->projetNom) {
 | 
        
           |  |  | 193 | 			case 'baseflor':
 | 
        
           |  |  | 194 | 				$c = 'BaseFloreOntologies';
 | 
        
           |  |  | 195 | 				break;
 | 
        
           |  |  | 196 | 			case 'eflore':
 | 
        
           |  |  | 197 | 				$c = 'EfloreOntologies';
 | 
        
           |  |  | 198 | 				break;
 | 
        
           |  |  | 199 | 			case 'chorodep':
 | 
        
           |  |  | 200 | 				$c = 'ChorodepOntologies';
 | 
        
           |  |  | 201 | 				break;
 | 
        
           |  |  | 202 | 			case 'baseveg':
 | 
        
           |  |  | 203 | 				$c = 'BasevegOntologies';
 | 
        
           |  |  | 204 | 				break;
 | 
        
           |  |  | 205 | 			case 'moissonnage':
 | 
        
           | 814 | raphael | 206 | 				$c = 'MoissonnageOntologies';
 | 
        
           | 791 | raphael | 207 | 				break;
 | 
        
           |  |  | 208 | 			case 'commun':
 | 
        
           |  |  | 209 | 				$c = 'Ontologies';
 | 
        
           |  |  | 210 | 				break;
 | 
        
           |  |  | 211 | 			}
 | 
        
           |  |  | 212 | 			if($c) {
 | 
        
           |  |  | 213 | 				require_once($this->cheminCourrant . 'commun' . DS . 'Commun.php');
 | 
        
           |  |  | 214 | 				require_once($this->cheminCourrant . $this->projetNom . DS . $this->obtenirNomClasseService($this->serviceNom) . '.php');
 | 
        
           |  |  | 215 | 				return;
 | 
        
           |  |  | 216 | 			}
 | 
        
           |  |  | 217 | 		}
 | 
        
           |  |  | 218 |   | 
        
           | 811 | raphael | 219 | 		// problème de class-name conflict. Exemple:
 | 
        
           |  |  | 220 | 		// phpunit --verbose --debug --filter 'ChorodepCartesTest::testCarteGenerique|EfloreCartesTest::testCarteGenerale'
 | 
        
           |  |  | 221 | 		if($this->serviceNom == 'cartes') {
 | 
        
           |  |  | 222 | 			$c = NULL;
 | 
        
           |  |  | 223 | 			switch($this->projetNom) {
 | 
        
           |  |  | 224 | 			case 'bdtxa':
 | 
        
           |  |  | 225 | 				$c = 'BdtxaCartes';
 | 
        
           |  |  | 226 | 				break;
 | 
        
           |  |  | 227 | 			case 'eflore':
 | 
        
           |  |  | 228 | 				$c = 'EfloreCartes';
 | 
        
           |  |  | 229 | 				break;
 | 
        
           |  |  | 230 | 			case 'chorodep':
 | 
        
           |  |  | 231 | 				$c = 'ChorodepCartes';
 | 
        
           |  |  | 232 | 				break;
 | 
        
           | 815 | raphael | 233 | 			case 'moissonnage':
 | 
        
           | 814 | raphael | 234 | 				$c = 'MoissonnageCartes';
 | 
        
           | 811 | raphael | 235 | 				break;
 | 
        
           | 1012 | aurelien | 236 | 			case 'sophy':
 | 
        
           |  |  | 237 | 				$c = 'SophyCartes';
 | 
        
           |  |  | 238 | 				break;
 | 
        
           | 811 | raphael | 239 | 			}
 | 
        
           |  |  | 240 | 			if($c) {
 | 
        
           |  |  | 241 | 				require_once($this->cheminCourrant . 'commun' . DS . 'Commun.php');
 | 
        
           |  |  | 242 | 				require_once($this->cheminCourrant . $this->projetNom . DS . $this->obtenirNomClasseService($this->serviceNom) . '.php');
 | 
        
           |  |  | 243 | 				return;
 | 
        
           |  |  | 244 | 			}
 | 
        
           |  |  | 245 | 		}
 | 
        
           |  |  | 246 |   | 
        
           | 274 | jpm | 247 | 		$cheminBiblio = Config::get('chemin_bibliotheque');
 | 
        
           | 3 | jpm | 248 | 		$chemins = array();
 | 
        
           |  |  | 249 | 		$chemins[] = $this->cheminCourrant.$this->projetNom.DS;
 | 
        
           |  |  | 250 | 		$chemins[] = $this->cheminCourrant.'commun'.DS;
 | 
        
           | 274 | jpm | 251 | 		$chemins[] = $cheminBiblio;
 | 
        
           |  |  | 252 | 		$chemins[] = $cheminBiblio.'robots'.DS;
 | 
        
           | 3 | jpm | 253 |   | 
        
           |  |  | 254 | 		foreach ($chemins as $chemin) {
 | 
        
           |  |  | 255 | 			$chemin = $chemin.$classe.'.php';
 | 
        
           |  |  | 256 | 			if (file_exists($chemin)) {
 | 
        
           |  |  | 257 | 				require_once $chemin;
 | 
        
           | 245 | jpm | 258 | 				break;
 | 
        
           | 3 | jpm | 259 | 			}
 | 
        
           |  |  | 260 | 		}
 | 
        
           |  |  | 261 | 	}
 | 
        
           |  |  | 262 |   | 
        
           |  |  | 263 | 	private function avoirRessourceService() {
 | 
        
           |  |  | 264 | 		$presenceRessourceService = false;
 | 
        
           |  |  | 265 | 		$servicesDispo = Outils::recupererTableauConfig('servicesDispo');
 | 
        
           | 145 | jpm | 266 | 		if (isset($this->ressources[1])) {
 | 
        
           |  |  | 267 | 			$service = $this->ressources[1];
 | 
        
           |  |  | 268 | 			if (in_array($service, $servicesDispo)) {
 | 
        
           |  |  | 269 | 				$presenceRessourceService = true;
 | 
        
           |  |  | 270 | 			} else {
 | 
        
           | 957 | aurelien | 271 | 				$message = "Le service demandé '$service' n'est pas disponible pour le projet {$this->projetNom} !\n".
 | 
        
           | 145 | jpm | 272 | 					"Les services disponibles sont : ".implode(', ', $servicesDispo);
 | 
        
           |  |  | 273 | 				$code = RestServeur::HTTP_CODE_RESSOURCE_INTROUVABLE;
 | 
        
           |  |  | 274 | 				throw new Exception($message, $code);
 | 
        
           |  |  | 275 | 			}
 | 
        
           | 3 | jpm | 276 | 		} else {
 | 
        
           | 145 | jpm | 277 | 			$message = "Vous n'avez pas indiqué de service pour le projet {$this->projetNom} !\n".
 | 
        
           | 3 | jpm | 278 | 				"Les services disponibles sont : ".implode(', ', $servicesDispo);
 | 
        
           | 145 | jpm | 279 | 			$code = RestServeur::HTTP_CODE_MAUVAISE_REQUETE;
 | 
        
           | 3 | jpm | 280 | 			throw new Exception($message, $code);
 | 
        
           |  |  | 281 | 		}
 | 
        
           |  |  | 282 | 		return $presenceRessourceService;
 | 
        
           |  |  | 283 | 	}
 | 
        
           |  |  | 284 |   | 
        
           |  |  | 285 | 	private function initialiserService() {
 | 
        
           | 791 | raphael | 286 | 		if($this->classe) {
 | 
        
           |  |  | 287 | 			$classe = $this->classe;
 | 
        
           |  |  | 288 | 			$service = new $classe($this->getBdd());
 | 
        
           | 852 | raphael | 289 | 			return $service->consulter($this->filtrerRessourcesPourService(), $this->parametres, $this->getBdd());
 | 
        
           | 791 | raphael | 290 | 		}
 | 
        
           | 110 | jpm | 291 | 		$classe = $this->obtenirNomClasseService($this->serviceNom);
 | 
        
           | 3 | jpm | 292 | 		$chemins = array();
 | 
        
           |  |  | 293 | 		$chemins[] = $this->cheminCourrant.$this->projetNom.DS.$classe.'.php';
 | 
        
           |  |  | 294 | 		$chemins[] = $this->cheminCourrant.'commun'.DS.$classe.'.php';
 | 
        
           |  |  | 295 |   | 
        
           |  |  | 296 | 		$service = null;
 | 
        
           |  |  | 297 | 		foreach ($chemins as $chemin) {
 | 
        
           |  |  | 298 | 			if (file_exists($chemin)) {
 | 
        
           |  |  | 299 | 				$service = new $classe($this->getBdd());
 | 
        
           | 811 | raphael | 300 | 				// Affichage utile lors de PHPUnit pour détecter les conflits d'autoload de classes de même nom
 | 
        
           |  |  | 301 | 				// $reflector = new ReflectionClass($classe);
 | 
        
           |  |  | 302 | 				// printf("===> Projets init classe '%s' depuis '%s', mais provenant de '%s'\n", $classe, $chemin, $reflector->getFileName());
 | 
        
           | 3 | jpm | 303 | 				$ressourcesPourService = $this->filtrerRessourcesPourService();
 | 
        
           | 929 | raphael | 304 | 				return $service->consulter($ressourcesPourService, $this->parametres, $this->getBdd());
 | 
        
           | 3 | jpm | 305 | 			}
 | 
        
           |  |  | 306 | 		}
 | 
        
           |  |  | 307 | 		if (is_null($service)) {
 | 
        
           | 957 | aurelien | 308 | 			$message = "Le service demandé '{$this->serviceNom}' n'existe pas dans le projet {$this->projetNom} !";
 | 
        
           | 3 | jpm | 309 | 			$code = RestServeur::HTTP_CODE_RESSOURCE_INTROUVABLE;
 | 
        
           |  |  | 310 | 			throw new Exception($message, $code);
 | 
        
           |  |  | 311 | 		}
 | 
        
           | 791 | raphael | 312 | 		return NULL;
 | 
        
           | 3 | jpm | 313 | 	}
 | 
        
           |  |  | 314 |   | 
        
           |  |  | 315 | 	private function chargerNomDuService() {
 | 
        
           |  |  | 316 | 		$this->serviceNom = $this->ressources[1];
 | 
        
           |  |  | 317 | 	}
 | 
        
           |  |  | 318 |   | 
        
           | 110 | jpm | 319 | 	private function obtenirNomClasseService($mot) {
 | 
        
           | 791 | raphael | 320 | 		return str_replace(' ', '', ucwords(strtolower(str_replace('-', ' ', $mot))));
 | 
        
           | 3 | jpm | 321 | 	}
 | 
        
           |  |  | 322 |   | 
        
           |  |  | 323 | 	private function filtrerRessourcesPourService() {
 | 
        
           |  |  | 324 | 		$ressourcesPourService = array();
 | 
        
           |  |  | 325 | 		$nbreDeRessources = count($this->ressources);
 | 
        
           |  |  | 326 | 		for ($i = 2; $i < $nbreDeRessources; $i++) {
 | 
        
           |  |  | 327 | 			$ressourcesPourService[] = $this->ressources[$i];
 | 
        
           |  |  | 328 | 		}
 | 
        
           |  |  | 329 | 		return $ressourcesPourService;
 | 
        
           |  |  | 330 | 	}
 | 
        
           |  |  | 331 | }
 | 
        
           |  |  | 332 | ?>
 |