Subversion Repositories Applications.papyrus

Rev

Rev 119 | Rev 986 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
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
// +------------------------------------------------------------------------------------------------------+
458 florian 22
// CVS : $Id: installateur.php,v 1.10 2005-09-23 14:20:23 florian 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
458 florian 35
*@version       $Revision: 1.10 $ $Date: 2005-09-23 14:20:23 $
6 jpm 36
// +------------------------------------------------------------------------------------------------------+
37
**/
38
 
39
// +------------------------------------------------------------------------------------------------------+
40
// |                                            ENTÊTE du PROGRAMME                                       |
41
// +------------------------------------------------------------------------------------------------------+
458 florian 42
// Constante de l'application Installateur. On devrait créer un fichier de config et un de langue pour rendre l'appli portable...
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.*/
56
define('INSTAL_VERSION_NOUVELLE_NOM', 'PAP_VERSION');
57
/** Numéro de la nouvelle version de l'application Papyrus.*/
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
}
64
/** Nombre d'étapes totale de l'installation.*/
65
define('INSTAL_NBRE_ETAPE', 3);
6 jpm 66
 
458 florian 67
// Fichiers à inclure
68
require_once INSTAL_DOSSIER_BIBLIO.'instal_installation.fonct.php';
69
 
6 jpm 70
// +------------------------------------------------------------------------------------------------------+
71
// |                                          CORPS du PROGRAMME                                          |
72
// +------------------------------------------------------------------------------------------------------+
458 florian 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 .= '    <link rel="stylesheet" type="text/css" media="screen" title="Installateur" href="papyrus/applications/installateur/presentations/styles/installateur.css" />'."\n";
82
    $sortie .= '    <title>Installation de Papyrus</title>'."\n";
83
    $sortie .= '  </head>'."\n";
84
    $sortie .= '  <body>'."\n";
85
    $sortie .= '  <div id="container">'."\n";
86
    $sortie .= '      <div id="zone_bandeau" >'."\n";
87
    $sortie .= '        <div id="logo">'."\n";
88
    $sortie .= '          <a href="/" title="Retour en page d\'accueil">'."\n";
89
    $sortie .= '              <img src="papyrus/applications/installateur/presentations/images/logo_papyrus.png" width="183" height="63" alt="Logo Papyrus" />'."\n";
90
    $sortie .= '          </a>'."\n";
91
    $sortie .= '        </div>'."\n";
92
    $sortie .= '        <div id="site_nom">'."\n";
93
    $sortie .= '          <h1>Installation de Papyrus</h1>'."\n";
94
    $sortie .= '        </div>'."\n";
95
    $sortie .= '      </div>'."\n";
96
    $sortie .= '      <div id="zone_contenu">'."\n";
97
    // Message situation de l'installation
98
    if (defined('PAP_VERSION')) {
99
        $sortie .=  '<p>Votre syst&egrave;me Papyrus existant a &eacute;t&eacute; reconnu comme &eacute;tant la version '.
100
                    INSTAL_VERSION_ANCIENNE.'.<br />'.
101
                    'Vous &ecirc;tes sur le point de <b>mettre &agrave; jour</b> Papyrus pour la version '.
102
                    INSTAL_VERSION_NOUVELLE.'.<br />'.
103
                    'Veuillez revoir vos informations de configuration ci-dessous.</p>'."\n";
104
    } else {
105
        $sortie .=  '<p>Vous &ecirc;tes sur le point d\'installer Papyrus '.INSTAL_VERSION_NOUVELLE.'.<br />'.
106
                    'Veuillez configurer votre Papyrus en remplissant les formulaires étape par étape.</p>'."\n";
107
    }
108
 
109
    if(!isset($_GET['installation']) || ($_GET['installation'] == 'form_pref' || $_GET['installation'] == 'verif_pref')) {
110
        include_once GEN_CHEMIN_APPLICATION.'installateur/instal_preference.inc.php';
111
    } else if($_GET['installation'] == 'form_bdd' || $_GET['installation'] == 'verif_bdd') {
112
        include_once GEN_CHEMIN_APPLICATION.'installateur/instal_base_de_donnees.inc.php';
113
    } else if($_GET['installation'] == 'form_fichier' || $_GET['installation'] == 'verif_fichier') {
114
        include_once GEN_CHEMIN_APPLICATION.'installateur/instal_fichier.inc.php';
115
    }
116
 
117
    // Pied XHTML des pages de l'installation de Papyrus
118
    $sortie .= '    </div>'."\n";
119
    $sortie .= '      <div id="zone_pied">'."\n";
120
    $sortie .= '        <a href="http://frenchmozilla.org"><img src="papyrus/applications/installateur/presentations/images/logo-firefox.png" alt="Logo Firefox" /></a>&nbsp;'."\n";
121
    $sortie .= '        <a href="http://validator.w3.org/check?uri=referer"><img src="papyrus/applications/installateur/presentations/images/logo-xhtml11.png" alt="Logo XHTML" /></a>&nbsp;'."\n";
122
    $sortie .= '        <a href="http://jigsaw.w3.org/css-validator/check/referer"><img src="papyrus/applications/installateur/presentations/images/logo-css.png" alt="Logo CSS" /></a><br />'."\n";
123
    $sortie .= '        &copy;<a href="http://www.tela-botanica.org/">Tela Botanica</a> et  <a href="http://www.ecole-et-nature.org/">Réseau Ecole et Nature</a> / 2004-2006'."\n";
124
    $sortie .= '      </div>'."\n";
125
    $sortie .= '  </div>'."\n";
126
    $sortie .= ' </body>'."\n";
127
    $sortie .= '</html>';
128
 
129
    return $sortie;
130
}
6 jpm 131
// +------------------------------------------------------------------------------------------------------+
132
// |                                            PIED du PROGRAMME                                         |
458 florian 133
// +------------------------------------------------------------------------------------------------------+
6 jpm 134
 
135
/* +--Fin du code ----------------------------------------------------------------------------------------+
136
*
458 florian 137
* $Log: not supported by cvs2svn $
138
* Revision 1.9  2004/10/27 11:43:32  jpm
139
* Correction bogues diff mise à jour / installation.
6 jpm 140
*
458 florian 141
* Revision 1.8  2004/10/25 10:22:48  jpm
142
* Correction de quelques bogues, ajouts d'explications pour l'utilisateur et modification des styles CSS.
143
*
144
* Revision 1.7  2004/10/22 17:23:04  jpm
145
* Simplification del'installation de Papyrus.
146
*
147
* Revision 1.6  2004/10/19 17:01:12  jpm
148
* Correction bogues.
149
*
150
* Revision 1.5  2004/10/19 16:47:28  jpm
151
* Transformation en fonction de l'appel de l'application.
152
*
153
* Revision 1.4  2004/10/19 15:59:18  jpm
154
* Ajout de la gestion des valeurs propre à Papyrus à insérer dans la base de données.
155
* Ajout des constantes FTP.
156
*
157
* Revision 1.3  2004/10/18 09:12:09  jpm
158
* Changement de nom d'un fichier.
159
*
160
* Revision 1.2  2004/10/15 18:28:59  jpm
161
* Début appli installateur de Papyrus.
162
*
163
* Revision 1.1  2004/06/16 14:33:13  jpm
164
* Changement de nom de Génésia en Papyrus.
165
* Changement de l'arborescence.
166
*
167
* Revision 1.6  2004/04/22 08:25:48  jpm
168
* Transformation de $GS_GLOBAL en $_GEN_commun.
169
*
6 jpm 170
* Revision 1.5  2004/04/08 13:21:05  jpm
171
* Le code pour l'installation uniquement.
172
*
173
* Revision 1.4  2004/04/08 12:25:16  jpm
174
* 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.
175
*
176
* Revision 1.3  2004/04/02 16:37:51  jpm
177
* Modification des commentaires.
178
*
179
* Revision 1.2  2004/03/31 16:57:16  jpm
180
* Ajout de la gestion des erreur de base de données, de la connexion à celle-ci et des extenssions php disponibles.
181
*
182
* Revision 1.1  2004/03/29 11:00:12  jpm
183
* Transfert d'un morceau de code gérant les erreurs et l'installation mais qui a actuellement aucun effet sur Génésia.
184
*
185
*
186
* +-- Fin du code ----------------------------------------------------------------------------------------+
187
*/
188
?>