Subversion Repositories eFlore/Archives.eflore-consultation-v2

Compare Revisions

Ignore whitespace Rev 32 → Rev 33

/trunk/serveur/configuration/eflore_config.php
1,7 → 1,7
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// | PHP version 5.0 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
21,7 → 21,7
// | along with Foobar; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: eflore_config.php,v 1.2 2004-12-16 16:40:59 jpm Exp $
// CVS : $Id: eflore_config.php,v 1.3 2004-12-16 22:07:53 fred Exp $
/**
* Fichier de configuration d'eFlore-Serveur
*
35,7 → 35,7
//Autres auteurs :
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org>
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.2 $ $Date: 2004-12-16 16:40:59 $
*@version $Revision: 1.3 $ $Date: 2004-12-16 22:07:53 $
// +------------------------------------------------------------------------------------------------------+
*/
 
66,7 → 66,7
 
// +------------------------------------------------------------------------------------------------------+
// Constante de chemin de dossier et fichier
$separateur = strstr( PHP_OS, "WIN") ? '\\' : '/';
$separateur = strstr( PHP_OS, "WIN") ? '\\' : '/';
/** Constante stockant le séparateur de dossier qui dépend de l'OS.*/
define('EFSE_SEP', $separateur);
/** Constante stockant la valeur de la racine des chemins.*/
108,31 → 108,34
/** Constante stockant la valeur de la racine des chemins.*/
define('EFSE_CHEMIN_GENERATEUR_RACINE', '..'.EFSE_SEP);
 
// Tableau stockant les différentes valeurs permettant de configurer l'appli.
// Tableau stockant les différentes valeurs permettant de configurer l'appli.
/*
$appConfig = array(
'mysql_host' => 'localhost',
'mysql_database' => 'eflore-test',
'mysql_user' => 'eflorete',
'mysql_password' => 'rcf8wvc',
'app_version' => 'Version 0.0.1',
'service_map' => ,
'def_groupes'=>'definitions\\groupesmacroelements\\',
'def_macro'=>'definitions\\macroelements\\',
'service_map'=>'definitions\\eflore_services.map',
'publi_html'=>'definitions\\publicationshtml\\',
'publi_xml'=>'definitions\\publicationsxml\\',
'auto_groupes'=>'phpautomatique\\groupesmacroelements\\',
'auto_macro'=>'phpautomatique\\macroelements\\'
$appConfig = array(
'mysql_host' => 'localhost',
'mysql_database' => 'eflore-test',
'mysql_user' => 'eflorete',
'mysql_password' => 'rcf8wvc',
'app_version' => 'Version 0.0.1',
'service_map' => ,
'def_groupes'=>'definitions\\groupesmacroelements\\',
'def_macro'=>'definitions\\macroelements\\',
'service_map'=>'definitions\\eflore_services.map',
'publi_html'=>'definitions\\publicationshtml\\',
'publi_xml'=>'definitions\\publicationsxml\\',
'auto_groupes'=>'phpautomatique\\groupesmacroelements\\',
'auto_macro'=>'phpautomatique\\macroelements\\'
);
*/
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.2 2004/12/16 16:40:59 jpm
* Ajout de chemin.
*
* Revision 1.1.1.1 2004/12/16 12:24:36 jpm
* Importation initiale eFlore v1.1 et serveur.
*
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
*/
?>
/trunk/serveur/eflore_serveur.php
1,119 → 1,122
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This file is part of eFlore-Serveur. |
// | |
// | Foobar is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation; either version 2 of the License, or |
// | (at your option) any later version. |
// | |
// | Foobar is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
// | GNU General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with Foobar; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: eflore_serveur.php,v 1.1.1.1 2004-12-16 12:24:36 jpm Exp $
/**
* Fichier principal d'eFlore-Serveur
*
* Ce fichier initialise le programme lance la recherche des infos et transfères les données
* à la vue demandée par l'action.
* Abréviation du programme : EFSE
*
*@package eFlore-Serveur
//Auteur original :
*@author Frédéric LEGENS <flegens@free.fr>
//Autres auteurs :
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org>
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.1.1.1 $ $Date: 2004-12-16 12:24:36 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
require_once 'configuration/eflore_config.php';
require_once EFSE_CHEMIN_INTERFACE.'eflore_model.interface.php';
require_once EFSE_CHEMIN_INTERFACE.'eflore_vue.interface.php';
require_once EFSE_CHEMIN_INTERFACE.'eflore_macro_element.interface.php';
require_once EFSE_CHEMIN_CLASSE.'eflore_block_de_donnees.class.php';
require_once EFSE_CHEMIN_CLASSE.'eflore_collection_block_de_donnees.class.php';
require_once EFSE_CHEMIN_CLASSE.'eflore_groupe_macro_element.class.php';
 
// +------------------------------------------------------------------------------------------------------+
// | CORPS du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
$key = $_REQUEST['key'];
/* Lecture du fichier donnant la carte des services disponibles */
$fichierServicesMap = fopen(EFSE_FICHIER_MAP,"r");
while($donnee = fscanf($fichierServicesMap, "%s\t%s\t%s\t%s\t%s\t%s", $keyName, $serviceName, $viewName, $schema, $ratio, $style)) {
if ($key == $keyName) {
runService($serviceName,$viewName,$schema,$ratio,$style);
}
}
fclose($fichierServicesMap);
 
// +------------------------------------------------------------------------------------------------------+
// | LISTE de FONCTIONS |
// +------------------------------------------------------------------------------------------------------+
 
function runService($serviceName, $viewName, $schema, $ratio, $style)
{
$aConn = '';
$dataBlock = '';
$aModel = fabriquerModel($serviceName);
if ($aModel != null) {
$aModel->construire();
$dataBlock = $aModel->recupererBlockDeDonnees();
}
$uneVue = fabriquerVue($viewName, $dataBlock);
if ($uneVue != null) {
$uneVue->serialiser();
}
}
 
function fabriquerModel($modelName)
{
require_once EFSE_CHEMIN_MV_MACRO_GROUPE.$modelName.'.php';
$aConn = donneConnexionBaseDeDonnees();
$aModel = new $modelName($aConn);
return $aModel;
}
 
function fabriquerVue($viewName,$block)
{
require_once EFSE_CHEMIN_MV_VUE.$viewName.'.php';
$uneVue = new $viewName($block);
return $uneVue;
}
 
function donneConnexionBaseDeDonnees() {
if (!$linkid = mysql_connect(EFSE_BDD_SERVEUR, EFSE_BDD_UTILISATEUR, EFSE_BDD_MOT_DE_PASSE)) {
echo '<ERREUR>';
echo 'Impossible d\'établir de connexion à'.EFSE_BDD_SERVEUR;
echo '</ERREUR>';
exit(0);
}
mysql_select_db(EFSE_BDD_NOM, $linkid);
return $linkid;
}
 
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 5.0 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This file is part of eFlore-Serveur. |
// | |
// | Foobar is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation; either version 2 of the License, or |
// | (at your option) any later version. |
// | |
// | Foobar is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
// | GNU General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with Foobar; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: eflore_serveur.php,v 1.2 2004-12-16 22:07:35 fred Exp $
/**
* Fichier principal d'eFlore-Serveur
*
* Ce fichier initialise le programme lance la recherche des infos et transfères les données
* à la vue demandée par l'action.
* Abréviation du programme : EFSE
*
*@package eFlore-Serveur
//Auteur original :
*@author Frédéric LEGENS <flegens@free.fr>
//Autres auteurs :
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org>
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.2 $ $Date: 2004-12-16 22:07:35 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
require_once 'configuration/eflore_config.php';
require_once EFSE_CHEMIN_INTERFACE.'eflore_model.interface.php';
require_once EFSE_CHEMIN_INTERFACE.'eflore_vue.interface.php';
require_once EFSE_CHEMIN_INTERFACE.'eflore_macro_element.interface.php';
require_once EFSE_CHEMIN_CLASSE.'eflore_block_de_donnees.class.php';
require_once EFSE_CHEMIN_CLASSE.'eflore_collection_block_de_donnees.class.php';
require_once EFSE_CHEMIN_CLASSE.'eflore_groupe_macro_element.class.php';
 
// +------------------------------------------------------------------------------------------------------+
// | CORPS du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
$key = $_REQUEST['key'];
/* Lecture du fichier donnant la carte des services disponibles */
$fichierServicesMap = fopen(EFSE_FICHIER_MAP,"r");
while($donnee = fscanf($fichierServicesMap, "%s\t%s\t%s\t%s\t%s\t%s", $keyName, $serviceName, $viewName, $schema, $ratio, $style)) {
if ($key == $keyName) {
runService($serviceName,$viewName,$schema,$ratio,$style);
}
}
fclose($fichierServicesMap);
 
// +------------------------------------------------------------------------------------------------------+
// | LISTE de FONCTIONS |
// +------------------------------------------------------------------------------------------------------+
 
function runService($serviceName, $viewName, $schema, $ratio, $style)
{
$aConn = '';
$dataBlock = '';
$aModel = fabriquerModel($serviceName);
if ($aModel != null) {
$aModel->construire();
$dataBlock = $aModel->recupererBlockDeDonnees();
}
$uneVue = fabriquerVue($viewName, $dataBlock);
if ($uneVue != null) {
$uneVue->serialiser();
}
}
 
function fabriquerModel($modelName)
{
require_once EFSE_CHEMIN_MV_MACRO_GROUPE.$modelName.'.php';
$aConn = donneConnexionBaseDeDonnees();
$aModel = new $modelName($aConn);
return $aModel;
}
 
function fabriquerVue($viewName,$block)
{
require_once EFSE_CHEMIN_MV_VUE.$viewName.'.php';
$uneVue = new $viewName($block);
return $uneVue;
}
 
function donneConnexionBaseDeDonnees() {
if (!$linkid = mysql_connect(EFSE_BDD_SERVEUR, EFSE_BDD_UTILISATEUR, EFSE_BDD_MOT_DE_PASSE)) {
echo '<ERREUR>';
echo 'Impossible d\'établir de connexion à'.EFSE_BDD_SERVEUR;
echo '</ERREUR>';
exit(0);
}
mysql_select_db(EFSE_BDD_NOM, $linkid);
return $linkid;
}
 
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.1.1.1 2004/12/16 12:24:36 jpm
* Importation initiale eFlore v1.1 et serveur.
*
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>