Subversion Repositories eFlore/Projets.eflore-projets

Compare Revisions

Ignore whitespace Rev 810 → Rev 811

/trunk/services/modules/0.1/bdtxa/Cartes.php
13,7 → 13,7
* @copyright 1999-2012 Tela Botanica (accueil@tela-botanica.org)
*/
// TODO : Config et Outils sont des classes statiques qui doivent poser des pb pour les tests...
class Cartes {
class BdtxaCartes {
 
private $parametres = array();
private $ressources = array();
/trunk/services/modules/0.1/chorodep/Cartes.php
13,7 → 13,7
* @copyright 1999-2012 Tela Botanica (accueil@tela-botanica.org)
*/
// TODO : Config et Outils sont des classes statiques qui doivent poser des pb pour les tests...
class Cartes {
class ChorodepCartes {
 
private $parametres = array();
private $ressources = array();
/trunk/services/modules/0.1/Projets.php
133,7 → 133,7
1") Beurk... (php-className conflicts en PHP 5.2)
 
Ici nous faisons des cas particuliers pour Ontologies, mais en suivant ce principe, sont affectés:
Cartes, EfloreOntologiesTest, Images, Informations, InformationsTaxonsSup,
Images, Informations, InformationsTaxonsSup,
LegendeCartes, NomCommune, Noms, NomsVernaculaires, Projets, Statuts,
Taxons, TaxonsCartes, Textes, ZoneGeo
 
147,22 → 147,36
> Whatever you are doing is wrong. Backup. Re-evaluate what you are doing and why.
*/
private static function debusquerClasse($p, $s) {
if($s != 'ontologies') return NULL;
if($s == 'ontologies') {
switch($p) {
case 'baseflor':
return 'BaseFloreOntologies';
case 'eflore':
return 'EfloreOntologies';
case 'chorodep':
return 'ChorodepOntologies';
case 'baseveg':
return 'BasevegOntologies';
case 'moissonnage':
return 'MoissonnnageOntologies';
case 'commun':
return 'Ontologies';
}
}
 
switch($p) {
case 'baseflor':
return 'BaseFloreOntologies';
case 'eflore':
return 'EfloreOntologies';
case 'chorodep':
return 'ChorodepOntologies';
case 'baseveg':
return 'BasevegOntologies';
case 'moissonnage':
return 'MoissonnnageOntologies';
case 'commun':
return 'Ontologies';
if($s == 'cartes') {
switch($p) {
case 'bdtxa':
return 'BdtxaCartes';
case 'eflore':
return 'EfloreCartes';
case 'chorodep':
return 'ChorodepCartes';
case 'moissonnage':
return 'MoissonnnageCartes';
}
}
 
return NULL;
}
 
200,6 → 214,31
}
}
 
// problème de class-name conflict. Exemple:
// phpunit --verbose --debug --filter 'ChorodepCartesTest::testCarteGenerique|EfloreCartesTest::testCarteGenerale'
if($this->serviceNom == 'cartes') {
$c = NULL;
switch($this->projetNom) {
case 'bdtxa':
$c = 'BdtxaCartes';
break;
case 'eflore':
$c = 'EfloreCartes';
break;
case 'chorodep':
$c = 'ChorodepCartes';
break;
case 'moissonnage':
$c = 'MoissonnnageCartes';
break;
}
if($c) {
require_once($this->cheminCourrant . 'commun' . DS . 'Commun.php');
require_once($this->cheminCourrant . $this->projetNom . DS . $this->obtenirNomClasseService($this->serviceNom) . '.php');
return;
}
}
 
$cheminBiblio = Config::get('chemin_bibliotheque');
$chemins = array();
$chemins[] = $this->cheminCourrant.$this->projetNom.DS;
253,6 → 292,9
foreach ($chemins as $chemin) {
if (file_exists($chemin)) {
$service = new $classe($this->getBdd());
// Affichage utile lors de PHPUnit pour détecter les conflits d'autoload de classes de même nom
// $reflector = new ReflectionClass($classe);
// printf("===> Projets init classe '%s' depuis '%s', mais provenant de '%s'\n", $classe, $chemin, $reflector->getFileName());
$ressourcesPourService = $this->filtrerRessourcesPourService();
$this->cache = new CacheEflore($service, $this->projetNom, $this->serviceNom, Config::get('cache'));
return $this->cache->consulter($ressourcesPourService, $this->parametres);
/trunk/services/modules/0.1/eflore/Cartes.php
51,7 → 51,7
 
// TODO : CSS specifique (id)
 
class Cartes {
class EfloreCartes {
private $tab_code_insee = array();
public $src_map;
private $cartesFormateur = null;
/trunk/services/modules/0.1/moissonnage/Cartes.php
30,7 → 30,7
*
*/
 
class Cartes {
class MoissonnageCartes {
 
const MIME_MAP = "text/html";
const MIME_PNG = "image/png";