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: |
Images, Informations, InformationsTaxonsSup, |
Cartes, EfloreOntologiesTest, Images, Informations, InformationsTaxonsSup, |
LegendeCartes, NomCommune, Noms, NomsVernaculaires, Projets, Statuts, |
Taxons, TaxonsCartes, Textes, ZoneGeo |
|
147,36 → 147,22 |
> Whatever you are doing is wrong. Backup. Re-evaluate what you are doing and why. |
*/ |
private static function debusquerClasse($p, $s) { |
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'; |
} |
} |
if($s != 'ontologies') return NULL; |
|
if($s == 'cartes') { |
switch($p) { |
case 'bdtxa': |
return 'BdtxaCartes'; |
case 'eflore': |
return 'EfloreCartes'; |
case 'chorodep': |
return 'ChorodepCartes'; |
case 'moissonnage': |
return 'MoissonnnageCartes'; |
} |
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'; |
} |
|
return NULL; |
} |
|
214,31 → 200,6 |
} |
} |
|
// 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; |
292,9 → 253,6 |
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); |