6 |
jpm |
1 |
<?php
|
|
|
2 |
/*vim: set expandtab tabstop=4 shiftwidth=4: */
|
|
|
3 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
4 |
// | PHP version 4.1 |
|
|
|
5 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
6 |
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
|
|
|
7 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
8 |
// | This library is free software; you can redistribute it and/or |
|
|
|
9 |
// | modify it under the terms of the GNU Lesser General Public |
|
|
|
10 |
// | License as published by the Free Software Foundation; either |
|
|
|
11 |
// | version 2.1 of the License, or (at your option) any later version. |
|
|
|
12 |
// | |
|
|
|
13 |
// | This library is distributed in the hope that it will be useful, |
|
|
|
14 |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
|
|
15 |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
|
|
16 |
// | Lesser General Public License for more details. |
|
|
|
17 |
// | |
|
|
|
18 |
// | You should have received a copy of the GNU Lesser General Public |
|
|
|
19 |
// | License along with this library; if not, write to the Free Software |
|
|
|
20 |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
|
|
21 |
// +------------------------------------------------------------------------------------------------------+
|
119 |
jpm |
22 |
// CVS : $Id: installateur.php,v 1.9 2004-10-27 11:43:32 jpm Exp $
|
6 |
jpm |
23 |
/**
|
|
|
24 |
* Application Installateur de Papyrus.
|
|
|
25 |
*
|
|
|
26 |
* Application permettant de gérer l'installation et les erreurs liés à l'abscence de base de données,
|
|
|
27 |
* d'extenssin PHP...
|
|
|
28 |
*
|
|
|
29 |
*@package Installateur
|
|
|
30 |
//Auteur original :
|
|
|
31 |
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org>
|
|
|
32 |
//Autres auteurs :
|
|
|
33 |
*@author Aucun
|
|
|
34 |
*@copyright Tela-Botanica 2000-2004
|
119 |
jpm |
35 |
*@version $Revision: 1.9 $ $Date: 2004-10-27 11:43:32 $
|
6 |
jpm |
36 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
37 |
**/
|
|
|
38 |
|
|
|
39 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
40 |
// | ENTÊTE du PROGRAMME |
|
|
|
41 |
// +------------------------------------------------------------------------------------------------------+
|
66 |
jpm |
42 |
// Constante de l'application Installateur. On devrait créer un fichier de config et un de langue pour rendre l'appli portable...
|
91 |
jpm |
43 |
preg_match('/^(.*)papyrus.php/', $_SERVER['SCRIPT_FILENAME'], $instal_tab_txt);
|
|
|
44 |
define('INSTAL_CHEMIN_ABSOLU', $instal_tab_txt[1]);
|
|
|
45 |
/** Nom du dossier contenant l'application Installateur.*/
|
|
|
46 |
define('INSTAL_DOSSIER_APPLI', INSTAL_CHEMIN_ABSOLU.GEN_CHEMIN_APPLICATION.'installateur'.GEN_SEP);
|
|
|
47 |
/** Nom du dossier contenant la bibliothèque de code de l'application Installateur.*/
|
|
|
48 |
define('INSTAL_DOSSIER_BIBLIO', INSTAL_DOSSIER_APPLI.'bibliotheque'.GEN_SEP);
|
|
|
49 |
/** Chemin vers le fichier de configuration de base de l'application Papyrus.*/
|
|
|
50 |
define('INSTAL_CHEMIN_CONFIG', GEN_CHEMIN_CONFIG.GEN_FICHIER_CONFIG);
|
|
|
51 |
/** Nom du fichier de configuration de Papyrus à créer.*/
|
|
|
52 |
define('INSTAL_FICHIER_CONFIG', GEN_FICHIER_CONFIG);
|
|
|
53 |
/** Chemin vers le fichier de configuration de base de l'application Papyrus.*/
|
|
|
54 |
define('INSTAL_CHEMIN_SQL', INSTAL_CHEMIN_ABSOLU.GEN_CHEMIN_INSTAL);
|
|
|
55 |
/** Nom de la constante stockant le numéro de la nouvelle version de l'application Papyrus.*/
|
66 |
jpm |
56 |
define('INSTAL_VERSION_NOUVELLE_NOM', 'PAP_VERSION');
|
91 |
jpm |
57 |
/** Numéro de la nouvelle version de l'application Papyrus.*/
|
66 |
jpm |
58 |
define('INSTAL_VERSION_NOUVELLE', GEN_VERSION);
|
|
|
59 |
if (defined('PAP_VERSION')) {
|
|
|
60 |
define('INSTAL_VERSION_ANCIENNE', PAP_VERSION);
|
|
|
61 |
} else {
|
|
|
62 |
define('INSTAL_VERSION_ANCIENNE', '');
|
|
|
63 |
}
|
91 |
jpm |
64 |
/** Nombre d'étapes totale de l'installation.*/
|
|
|
65 |
define('INSTAL_NBRE_ETAPE', 3);
|
66 |
jpm |
66 |
|
|
|
67 |
// Fichiers à inclure
|
|
|
68 |
require_once INSTAL_DOSSIER_BIBLIO.'instal_installation.fonct.php';
|
6 |
jpm |
69 |
|
|
|
70 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
71 |
// | CORPS du PROGRAMME |
|
|
|
72 |
// +------------------------------------------------------------------------------------------------------+
|
79 |
jpm |
73 |
function afficherContenuCorps()
|
|
|
74 |
{
|
|
|
75 |
// Entêtre XHTML des pages de l'installation de Papyrus
|
|
|
76 |
$sortie = '';
|
|
|
77 |
$sortie .= '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"'."\n";
|
|
|
78 |
$sortie .= '"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'."\n";
|
|
|
79 |
$sortie .= '<html xmlns="http://www.w3.org/1999/xhtml" lang="fr-FR" xml:lang="fr-FR">'."\n";
|
|
|
80 |
$sortie .= ' <head>'."\n";
|
|
|
81 |
$sortie .= ' <title>Installation de Papyrus</title>'."\n";
|
80 |
jpm |
82 |
$sortie .= ' <style type="text/css">'."\n";
|
79 |
jpm |
83 |
$sortie .= ' p, body, td, li, input, select, textarea { font-family: Verdana; font-size: 13px; }'."\n";
|
100 |
jpm |
84 |
$sortie .= ' h1 { font-size: 1.8em; text-align: center; color: #0C6628; }'."\n";
|
|
|
85 |
$sortie .= ' h2 { font-size: 1.2em; text-align: left; color: #0C6628; }'."\n";
|
|
|
86 |
$sortie .= ' input { color: #0C6628; }'."\n";
|
79 |
jpm |
87 |
$sortie .= ' form ul { list-style-type: none; padding : 0px; }'."\n";
|
|
|
88 |
$sortie .= ' form ul li { clear:both;text-align: left; padding-left: 0px; margin-left: 0px; }'."\n";
|
|
|
89 |
$sortie .= ' form ul li label { float: left; width: 175px; text-align: left; }'."\n";
|
|
|
90 |
$sortie .= ' li { margin: 5px 5px 5px 5px; }'."\n";
|
|
|
91 |
$sortie .= ' a { color: #0000FF; }'."\n";
|
|
|
92 |
$sortie .= ' .ok { color: #008800; font-weight: bold; }'."\n";
|
|
|
93 |
$sortie .= ' .failed { color: #880000; font-weight: bold; }'."\n";
|
|
|
94 |
$sortie .= ' .erreur { color: red; font-weight: bold;}'."\n";
|
119 |
jpm |
95 |
$sortie .= ' .zone_requete { height: 300px; width: 550px; overflow: scroll;}'."\n";
|
100 |
jpm |
96 |
$sortie .= ' .etape_info { margin: 5px 10% 5px 10%; padding: 3px; text-align: center; background-color: #92C492; border: 1px dashed black; }'."\n";
|
|
|
97 |
$sortie .= ' .etape_numero { width: 200px; text-align: center; padding: 3px; font-size: 1.2em; border: 1px dotted black; color: #0C6628;}'."\n";
|
91 |
jpm |
98 |
$sortie .= ' #fichier_config { background-color: #EEEEEE; padding: 10px 10px;}'."\n";
|
79 |
jpm |
99 |
$sortie .= ' </style>'."\n";
|
|
|
100 |
$sortie .= ' </head>'."\n";
|
|
|
101 |
$sortie .= ' <body>'."\n";
|
91 |
jpm |
102 |
$sortie .= ' <h1>Installation de Papyrus</h1></h1>'."\n";
|
79 |
jpm |
103 |
|
91 |
jpm |
104 |
// Message situation de l'installation
|
|
|
105 |
if (defined('PAP_VERSION')) {
|
|
|
106 |
$sortie .= '<p>Votre système Papyrus existant a été reconnu comme étant la version '.
|
|
|
107 |
INSTAL_VERSION_ANCIENNE.'.<br />'.
|
|
|
108 |
'Vous êtes sur le point de <b>mettre à jour</b> Papyrus pour la version '.
|
|
|
109 |
INSTAL_VERSION_NOUVELLE.'.<br />'.
|
|
|
110 |
'Veuillez revoir vos informations de configuration ci-dessous.</p>'."\n";
|
|
|
111 |
} else {
|
|
|
112 |
$sortie .= '<p>Vous êtes sur le point d\'installer Papyrus '.INSTAL_VERSION_NOUVELLE.'.<br />'.
|
|
|
113 |
'Veuillez configurer votre Papyrus en remplissant les formulaires étape par étape.</p>'."\n";
|
|
|
114 |
}
|
|
|
115 |
|
|
|
116 |
if(!isset($_GET['installation']) || ($_GET['installation'] == 'form_pref' || $_GET['installation'] == 'verif_pref')) {
|
|
|
117 |
include_once GEN_CHEMIN_APPLICATION.'installateur/instal_preference.inc.php';
|
|
|
118 |
} else if($_GET['installation'] == 'form_bdd' || $_GET['installation'] == 'verif_bdd') {
|
79 |
jpm |
119 |
include_once GEN_CHEMIN_APPLICATION.'installateur/instal_base_de_donnees.inc.php';
|
91 |
jpm |
120 |
} else if($_GET['installation'] == 'form_fichier' || $_GET['installation'] == 'verif_fichier') {
|
79 |
jpm |
121 |
include_once GEN_CHEMIN_APPLICATION.'installateur/instal_fichier.inc.php';
|
|
|
122 |
}
|
91 |
jpm |
123 |
|
79 |
jpm |
124 |
// Pied XHTML des pages de l'installation de Papyrus
|
|
|
125 |
$sortie .= ' </body>'."\n";
|
|
|
126 |
$sortie .= '</html>';
|
|
|
127 |
|
|
|
128 |
return $sortie;
|
66 |
jpm |
129 |
}
|
6 |
jpm |
130 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
131 |
// | PIED du PROGRAMME |
|
66 |
jpm |
132 |
// +------------------------------------------------------------------------------------------------------+
|
6 |
jpm |
133 |
|
|
|
134 |
/* +--Fin du code ----------------------------------------------------------------------------------------+
|
|
|
135 |
*
|
|
|
136 |
* $Log: not supported by cvs2svn $
|
119 |
jpm |
137 |
* Revision 1.8 2004/10/25 10:22:48 jpm
|
|
|
138 |
* Correction de quelques bogues, ajouts d'explications pour l'utilisateur et modification des styles CSS.
|
|
|
139 |
*
|
100 |
jpm |
140 |
* Revision 1.7 2004/10/22 17:23:04 jpm
|
|
|
141 |
* Simplification del'installation de Papyrus.
|
|
|
142 |
*
|
91 |
jpm |
143 |
* Revision 1.6 2004/10/19 17:01:12 jpm
|
|
|
144 |
* Correction bogues.
|
|
|
145 |
*
|
80 |
jpm |
146 |
* Revision 1.5 2004/10/19 16:47:28 jpm
|
|
|
147 |
* Transformation en fonction de l'appel de l'application.
|
|
|
148 |
*
|
79 |
jpm |
149 |
* Revision 1.4 2004/10/19 15:59:18 jpm
|
|
|
150 |
* Ajout de la gestion des valeurs propre à Papyrus à insérer dans la base de données.
|
|
|
151 |
* Ajout des constantes FTP.
|
|
|
152 |
*
|
76 |
jpm |
153 |
* Revision 1.3 2004/10/18 09:12:09 jpm
|
|
|
154 |
* Changement de nom d'un fichier.
|
|
|
155 |
*
|
69 |
jpm |
156 |
* Revision 1.2 2004/10/15 18:28:59 jpm
|
|
|
157 |
* Début appli installateur de Papyrus.
|
|
|
158 |
*
|
66 |
jpm |
159 |
* Revision 1.1 2004/06/16 14:33:13 jpm
|
|
|
160 |
* Changement de nom de Génésia en Papyrus.
|
|
|
161 |
* Changement de l'arborescence.
|
|
|
162 |
*
|
6 |
jpm |
163 |
* Revision 1.6 2004/04/22 08:25:48 jpm
|
|
|
164 |
* Transformation de $GS_GLOBAL en $_GEN_commun.
|
|
|
165 |
*
|
|
|
166 |
* Revision 1.5 2004/04/08 13:21:05 jpm
|
|
|
167 |
* Le code pour l'installation uniquement.
|
|
|
168 |
*
|
|
|
169 |
* Revision 1.4 2004/04/08 12:25:16 jpm
|
|
|
170 |
* Suppression de tous le code réalisant les vérifications. L'application Installateur ne fera qu'installer Génésia et non vérifier son bon fonctionnement.
|
|
|
171 |
*
|
|
|
172 |
* Revision 1.3 2004/04/02 16:37:51 jpm
|
|
|
173 |
* Modification des commentaires.
|
|
|
174 |
*
|
|
|
175 |
* Revision 1.2 2004/03/31 16:57:16 jpm
|
|
|
176 |
* Ajout de la gestion des erreur de base de données, de la connexion à celle-ci et des extenssions php disponibles.
|
|
|
177 |
*
|
|
|
178 |
* Revision 1.1 2004/03/29 11:00:12 jpm
|
|
|
179 |
* Transfert d'un morceau de code gérant les erreurs et l'installation mais qui a actuellement aucun effet sur Génésia.
|
|
|
180 |
*
|
|
|
181 |
*
|
|
|
182 |
* +-- Fin du code ----------------------------------------------------------------------------------------+
|
|
|
183 |
*/
|
|
|
184 |
?>
|