/trunk/papyrus/applications/installateur/instal_preference.inc.php |
---|
New file |
0,0 → 1,145 |
<?php |
/*vim: set expandtab tabstop=4 shiftwidth=4: */ |
// +------------------------------------------------------------------------------------------------------+ |
// | PHP version 4.1 | |
// +------------------------------------------------------------------------------------------------------+ |
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) | |
// +------------------------------------------------------------------------------------------------------+ |
// | Copyright (c) 2002, Hendrik Mans <hendrik@mans.de> | |
// | Copyright 2002, 2003 David DELON | |
// | Copyright 2002 Patrick PAUL | |
// | All rights reserved. | |
// | Redistribution and use in source and binary forms, with or without | |
// | modification, are permitted provided that the following conditions | |
// | are met: | |
// | 1. Redistributions of source code must retain the above copyright | |
// | notice, this list of conditions and the following disclaimer. | |
// | 2. Redistributions in binary form must reproduce the above copyright | |
// | notice, this list of conditions and the following disclaimer in the | |
// | documentation and/or other materials provided with the distribution. | |
// | 3. The name of the author may not be used to endorse or promote products | |
// | derived from this software without specific prior written permission. | |
// | | |
// | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR | |
// | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |
// | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | |
// | IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | |
// | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | |
// | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
// | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
// | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
// | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | |
// | THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
// +------------------------------------------------------------------------------------------------------+ |
// CVS : $Id: instal_preference.inc.php,v 1.1 2004-10-15 18:28:59 jpm Exp $ |
/** |
* Page d'initialisation de l'installation de Papyrus. |
* |
* Contenu de la page par défaut de l'installation de Papyrus. |
* |
*@package Installateur |
//Auteur original : |
*@author Hendrik MANS <hendrik@mans.de> |
//Autres auteurs : |
*@author David DELON |
*@author Patrick PAUL |
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org> |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.1 $ $Date: 2004-10-15 18:28:59 $ |
// +------------------------------------------------------------------------------------------------------+ |
**/ |
// +------------------------------------------------------------------------------------------------------+ |
// | ENTÊTE du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
$config['PAP_BDD_SERVEUR'] = ''; |
if (defined('PAP_BDD_SERVEUR')) { |
$config['PAP_BDD_SERVEUR'] = PAP_BDD_SERVEUR; |
} |
$config['PAP_BDD_NOM'] = ''; |
if (defined('PAP_BDD_NOM')) { |
$config['PAP_BDD_NOM'] = PAP_BDD_NOM; |
} |
$config['PAP_BDD_UTILISATEUR'] = ''; |
if (defined('PAP_BDD_UTILISATEUR')) { |
$config['PAP_BDD_UTILISATEUR'] = PAP_BDD_UTILISATEUR; |
} |
$config['PAP_BDD_MOT_DE_PASSE'] = ''; |
if (defined('PAP_BDD_MOT_DE_PASSE')) { |
$config['PAP_BDD_MOT_DE_PASSE'] = PAP_BDD_MOT_DE_PASSE; |
} |
$config['PAP_URL_REECRITURE'] = ''; |
if (defined('PAP_URL_REECRITURE')) { |
$config['PAP_URL_REECRITURE'] = PAP_URL_REECRITURE; |
} |
// +------------------------------------------------------------------------------------------------------+ |
// | CORPS du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
$sortie .= ' <h1>Installation de Papyrus</h1></h1>'."\n"; |
if (defined('PAP_VERSION')) { |
$sortie .= '<p>Votre système Papyrus existant a été reconnu comme étant la version '. |
INSTAL_VERSION_ANCIENNE.'.<br />'. |
'Vous êtes sur le point de <b>mettre à jour</b> Papyrus pour la version '. |
INSTAL_VERSION_NOUVELLE.'.<br />'. |
'Veuillez revoir vos informations de configuration ci-dessous.</p>'."\n"; |
} else { |
$sortie .= '<p>Vous êtes sur le point d\'installer Papyrus '.INSTAL_VERSION_NOUVELLE.'.<br />'. |
'Veuillez configurer votre Papyrus en utilisant le formulaire suivant.</p>'."\n"; |
} |
$sortie .= ' <form action="'.donnerUrlCourante().'?installation=bdd" method="POST">'; |
$sortie .= ' <ul>'."\n"; |
$sortie .= '<li>NOTE: Ce programme d\'installation va essayer de modifier les options de configurations dans le '. |
'fichier <tt>pap_config.inc.php</tt>, situé dans le répertoire <tt>configuration</tt> du réportoire '. |
'<tt>papyrus</tt>. Pour que cela fonctionne, veuillez vous assurez que votre serveur a les droits d\'accès '. |
'en écriture pour ce fichier. Si pour une raison quelconque vous ne pouvez pas faire ça vous '. |
'devrez modifier ce fichier manuellement (ce programme d\'installation vous dira comment).</li>'."\n"; |
$sortie .= '<h2>Configuration de la base de données</h2>'."\n"; |
$sortie .= '<li>La machine sur laquelle se trouve votre serveur MySQL. En général c\'est "localhost" (ie, la même machine que celle où se trouve les pages de Papyrus.).</li>'."\n"; |
$sortie .= '<li></li>'."\n"; |
$sortie .= '<li>'."\n". |
'<label for="mysql_serveur">Machine MySQL :</label>'. |
'<input id="mysql_serveur" type="text" size="50" name="config[PAP_BDD_SERVEUR]" value="'.$config['PAP_BDD_SERVEUR'].'" />'. |
'</li>'."\n"; |
$sortie .= '<li>La base de données MySQL à utiliser pour Papyrus. Cette base de données doit déjà '. |
'exister avant de pouvoir continuer.</li>'."\n"; |
$sortie .= '<li>'."\n". |
'<label for="mysql_database">Base de données MySQL :</label>'. |
'<input id="mysql_database" type="text" size="50" name="config[PAP_BDD_NOM]" value="'.$config['PAP_BDD_NOM'].'" />'. |
'</li>'."\n"; |
$sortie .= '<li>Nom et mot de passe de l\'utilisateur MySQL qui sera utilisé pour se connecter à votre base de données.</li>'."\n"; |
$sortie .= '<li>'."\n". |
'<label for="mysql_user">Non de l\'utilisateur MySQL :</label>'. |
'<input id="mysql_user" type="text" size="50" name="config[PAP_BDD_UTILISATEUR]" value="'.$config['PAP_BDD_UTILISATEUR'].'" />'. |
'</li>'."\n"; |
$sortie .= '<li>'."\n". |
'<label for="mysql_password">Mot de passe MySQL :</label>'. |
'<input id="mysql_password" type="password" size="50" name="config[PAP_BDD_MOT_DE_PASSE]" value="'.$config['PAP_BDD_MOT_DE_PASSE'].'" />'. |
'</li>'."\n"; |
$sortie .= '<h2>Configuration de la ré-écriture d\'URL</h2>'."\n"; |
$sortie .= '<li>Le mode "redirection automatique" doit être sélectionné uniquement si vous utilisez WikiNi avec la redirection d\'URL (si vous ne savez pas ce qu\'est la redirection d\'URL n\'activez pas cette option).</li>'."\n"; |
$sortie .= '<li>'."\n". |
'<label for="rewrite_mode">Mode "redirection" :</label>'. |
'<input id="rewrite_mode" type="checkbox" value="1" name="config[PAP_URL_REECRITURE]" value="'.$config['PAP_URL_REECRITURE'].'" />'. |
'Activation'. |
'<input type="hidden" name="config[PAP_URL_REECRITURE]" value="0" />'. |
'</li>'."\n"; |
$sortie .= '<li>'."\n". |
'<input type="submit" value="Continuer" />'. |
'</li>'."\n"; |
$sortie .= ' </ul>'."\n"; |
$sortie .= ' </form>'; |
// +------------------------------------------------------------------------------------------------------+ |
// | PIED du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: not supported by cvs2svn $ |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
?> |
/trunk/papyrus/applications/installateur/installateur.php |
---|
19,7 → 19,7 |
// | License along with this library; if not, write to the Free Software | |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
// +------------------------------------------------------------------------------------------------------+ |
// CVS : $Id: installateur.php,v 1.1 2004-06-16 14:33:13 jpm Exp $ |
// CVS : $Id: installateur.php,v 1.2 2004-10-15 18:28:59 jpm Exp $ |
/** |
* Application Installateur de Papyrus. |
* |
32,7 → 32,7 |
//Autres auteurs : |
*@author Aucun |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.1 $ $Date: 2004-06-16 14:33:13 $ |
*@version $Revision: 1.2 $ $Date: 2004-10-15 18:28:59 $ |
// +------------------------------------------------------------------------------------------------------+ |
**/ |
39,45 → 39,77 |
// +------------------------------------------------------------------------------------------------------+ |
// | ENTÊTE du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
/*Mettre ici les inclusions de fichiers*/ |
// Constante de l'application Installateur. On devrait créer un fichier de config et un de langue pour rendre l'appli portable... |
/** <br> Nom du dossier contenant l'application Installateur.*/ |
define('INSTAL_DOSSIER_APPLI', GEN_CHEMIN_APPLICATION.'installateur/'); |
/** <br> Nom du dossier contenant la bibliothèque de code de l'application Installateur.*/ |
define('INSTAL_DOSSIER_BIBLIO', INSTAL_DOSSIER_APPLI.'bibliotheque/'); |
/** <br> Chemin vers le fichier de configuration de base de l'application Papyrus.*/ |
define('INSTAL_CHEMIN_CONFIG', GEN_CHEMIN_CONFIG.'pap_config.inc.php'); |
/** <br> Chemin vers le fichier de configuration de base de l'application Papyrus.*/ |
define('INSTAL_CHEMIN_SQL', GEN_CHEMIN_INSTAL); |
/** <br> Nom de la constante stockant le numéro de la nouvelle version de l'application Papyrus.*/ |
define('INSTAL_VERSION_NOUVELLE_NOM', 'PAP_VERSION'); |
/** <br> Numéro de la nouvelle version de l'application Papyrus.*/ |
define('INSTAL_VERSION_NOUVELLE', GEN_VERSION); |
if (defined('PAP_VERSION')) { |
define('INSTAL_VERSION_ANCIENNE', PAP_VERSION); |
} else { |
define('INSTAL_VERSION_ANCIENNE', ''); |
} |
// Fichiers à inclure |
require_once INSTAL_DOSSIER_BIBLIO.'instal_installation.fonct.php'; |
// Entêtre XHTML des pages de l'installation de Papyrus |
$sortie = ''; |
$sortie .= '<html>'; |
$sortie .= ' <head>'; |
$sortie .= ' <title>Installation de Papyrus</title>'; |
$sortie .= ' <style>'; |
$sortie .= ' p, body, td, li, input, select, textarea { font-family: Verdana; font-size: 13px; }'; |
$sortie .= ' h1 { font-size: 1.8em; text-align: center; color: #880000; }'; |
$sortie .= ' h2 { font-size: 1.2em; text-align: left; color: #880000; }'; |
$sortie .= ' input { color: #880000; }'; |
$sortie .= ' form ul { list-style-type: none; padding : 0px; }'; |
$sortie .= ' form ul li { text-align: left; padding-left: 0px; margin-left: 0px; }'; |
$sortie .= ' form label { float: left; width: 175px; text-align: left; }'; |
$sortie .= ' li { margin: 5px 5px 5px 5px; }'; |
$sortie .= ' a { color: #0000FF; }'; |
$sortie .= ' .ok { color: #008800; font-weight: bold; }'; |
$sortie .= ' .failed { color: #880000; font-weight: bold; }'; |
$sortie .= ' </style>'; |
$sortie .= ' </head>'; |
$sortie .= ' <body>'; |
// +------------------------------------------------------------------------------------------------------+ |
// | CORPS du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
// A retravailler complétement!!! |
if ($_GEN_commun['erreur_site_introuvable']) { |
projectForm($_GEN_commun['message_erreur_bd']); |
exit; |
} |
else { |
if ($_GEN_commun['erreur_config'] || $_GEN_commun['erreur_bd']) { |
installForm($_GEN_commun['message_erreur_bd']); |
exit; |
} |
else { |
exit ( |
'<html>'. |
"\n".' <head>'. |
"\n".' <title>Error</title>'. |
"\n".' <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">'. |
"\n".' </head>'. |
"\n".' <body>'. |
"\n".' <br /><br />'. |
"\n".' <p align="center"><b>'.$_GEN_commun['message_erreur_bd'].'</b></p>'. |
"\n".' </body>'. |
"\n".'</html>'); |
} |
} |
if(!isset($_GET['installation'])) { |
include_once GEN_CHEMIN_APPLICATION.'installateur/instal_defaut.inc.php'; |
} else if($_GET['installation'] == 'bdd') { |
include_once GEN_CHEMIN_APPLICATION.'installateur/instal_base_de_donnees.inc.php'; |
} else if($_GET['installation'] == 'config') { |
include_once GEN_CHEMIN_APPLICATION.'installateur/instal_configuration.inc.php'; |
} |
// +------------------------------------------------------------------------------------------------------+ |
// | PIED du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
/*Partie non obligatoire*/ |
// +------------------------------------------------------------------------------------------------------+ |
// Pied XHTML des pages de l'installation de Papyrus |
$sortie .= ' </body>'; |
$sortie .= '</html>'; |
// Attribution à la variable globale de sortie de Papyrus du texte XHTML de l'installation |
$GLOBALS['_GEN_commun']['sortie'] = $sortie; |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: not supported by cvs2svn $ |
* Revision 1.1 2004/06/16 14:33:13 jpm |
* Changement de nom de Génésia en Papyrus. |
* Changement de l'arborescence. |
* |
* Revision 1.6 2004/04/22 08:25:48 jpm |
* Transformation de $GS_GLOBAL en $_GEN_commun. |
* |
/trunk/papyrus/applications/installateur/instal_configuration.inc.php |
---|
New file |
0,0 → 1,116 |
<?php |
/*vim: set expandtab tabstop=4 shiftwidth=4: */ |
// +------------------------------------------------------------------------------------------------------+ |
// | PHP version 4.1 | |
// +------------------------------------------------------------------------------------------------------+ |
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) | |
// +------------------------------------------------------------------------------------------------------+ |
// | Copyright (c) 2002, Hendrik Mans <hendrik@mans.de> | |
// | Copyright 2002, 2003 David DELON | |
// | Copyright 2002 Patrick PAUL | |
// | Copyright 2003 Jean-Pascal MILCENT | |
// | All rights reserved. | |
// | Redistribution and use in source and binary forms, with or without | |
// | modification, are permitted provided that the following conditions | |
// | are met: | |
// | 1. Redistributions of source code must retain the above copyright | |
// | notice, this list of conditions and the following disclaimer. | |
// | 2. Redistributions in binary form must reproduce the above copyright | |
// | notice, this list of conditions and the following disclaimer in the | |
// | documentation and/or other materials provided with the distribution. | |
// | 3. The name of the author may not be used to endorse or promote products | |
// | derived from this software without specific prior written permission. | |
// | | |
// | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR | |
// | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |
// | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | |
// | IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | |
// | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | |
// | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
// | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
// | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
// | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | |
// | THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
// +------------------------------------------------------------------------------------------------------+ |
// CVS : $Id: instal_configuration.inc.php,v 1.1 2004-10-15 18:28:59 jpm Exp $ |
/** |
* Page de création du fichier de configuration de Papyrus. |
* |
* Page permettant de créer le fichier de configuration de Papyrus. |
* |
*@package Installateur |
//Auteur original : |
*@author Hendrik MANS <hendrik@mans.de> |
//Autres auteurs : |
*@author David DELON |
*@author Patrick PAUL |
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org> |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.1 $ $Date: 2004-10-15 18:28:59 $ |
// +------------------------------------------------------------------------------------------------------+ |
**/ |
// +------------------------------------------------------------------------------------------------------+ |
// | ENTÊTE du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
// Récupération des paramêtres de configuration du formulaire précédent |
if (isset($_POST['config'])) { |
$config = unserialize(stripslashes($_POST['config'])); |
} else if (isset($_POST['config_serial'])) { |
$config = unserialize(stripslashes($_POST['config_serial'])); |
} |
// +------------------------------------------------------------------------------------------------------+ |
// | CORPS du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
$configCode = "<?php\n// pap_config.inc.php construit le ".strftime("%c")."\n// ne changez pas la version de Papyrus manuellement!\n\n"; |
$entries[] = 'define(\''.INSTAL_VERSION_NOUVELLE_NOM.'\',\''.INSTAL_VERSION_NOUVELLE.'\');'."\n"; |
foreach ($config as $k => $v) { |
$entries[] = 'define(\''.$k.'\',\''.$v.'\');'."\n"; |
} |
$entries[] = "define('PAP_DSN', 'mysql://'.PAP_BDD_UTILISATEUR.':'.PAP_BDD_MOT_DE_PASSE.'@'.PAP_BDD_SERVEUR.'/'.PAP_BDD_NOM);"."\n"; |
$configCode .= implode("\n", $entries)."\n\n?>"; |
$sortie .= ' <h1>Installation de Papyrus</h1></h1>'."\n"; |
// Tentative d'écriture du fichier de config |
$sortie .= "<b>Création du fichier de configuration en cours...</b><br>\n"; |
$erreur = testerConfig('Écriture du fichier de configuration <tt>'.INSTAL_CHEMIN_CONFIG.'</tt>...', |
$fp = @fopen(INSTAL_CHEMIN_CONFIG, 'w'), '', 0, 0); |
if ($fp) { |
// Ecriture du fichier... |
fwrite($fp, $configCode); |
fclose($fp); |
$sortie .= '<p>Voila c\'est terminé ! Vous pouvez <a href="'.donnerUrlCourante().'">retourner sur votre site '. |
'Papyrus</a>. Il est conseillé de retirer l\'accès en écriture au fichier '. |
'<tt>pap_config.inc.php</tt>. Ceci peut être une faille dans la sécurité.</p>'; |
} else { |
// Problème... |
$sortie .= '<p><span class="failed">AVERTISSEMENT:</span> Le fichier de configuration <tt>'.INSTAL_CHEMIN_CONFIG. |
'</tt> n\'a pu être créé. Veuillez vous assurez que votre serveur a les droits '. |
'd\'accès en écriture pour ce fichier. Si pour une raison quelconque vous ne pouvez pas '. |
'faire ça vous devez copier les informations suivantes dans un fichier et les transférer '. |
'au moyen d\'un logiciel de transfert de fichier (ftp) sur le serveur dans un fichier '. |
'<tt>pap_config.inc.php</tt> directement dans le répertoire <tt>configuration</tt> du répertoire'. |
'<tt>papyrus</tt> de Papyrus. Une fois que vous aurez fait cela, votre site Papyrus devrait fonctionner '. |
'correctement.</p>'."\n"; |
$sortie .= ' <form action="'.donnerUrlCourante().'?installation=config" method="POST" />'."\n"; |
$sortie .= ' <input type="hidden" name="config_serial" value="'.htmlentities(serialize($config)).'" />'."\n"; |
$sortie .= ' <input type="submit" value="Essayer à nouveau" />'."\n"; |
$sortie .= ' </form>'."\n"; |
$sortie .= '<div style="background-color: #EEEEEE; padding: 10px 10px;">'."\n"; |
$sortie .= '<xmp>'.$configCode.'</xmp>'."\n"; |
$sortie .= '</div>'."\n"; |
} |
// +------------------------------------------------------------------------------------------------------+ |
// | PIED du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: not supported by cvs2svn $ |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
?> |
/trunk/papyrus/applications/installateur/instal_base_de_donnees.inc.php |
---|
New file |
0,0 → 1,131 |
<?php |
/*vim: set expandtab tabstop=4 shiftwidth=4: */ |
// +------------------------------------------------------------------------------------------------------+ |
// | PHP version 4.1 | |
// +------------------------------------------------------------------------------------------------------+ |
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) | |
// +------------------------------------------------------------------------------------------------------+ |
// | Copyright (c) 2002, Hendrik Mans <hendrik@mans.de> | |
// | Copyright 2002, 2003 David DELON | |
// | Copyright 2002 Patrick PAUL | |
// | Copyright 2003 Eric FELDSTEIN | |
// | All rights reserved. | |
// | Redistribution and use in source and binary forms, with or without | |
// | modification, are permitted provided that the following conditions | |
// | are met: | |
// | 1. Redistributions of source code must retain the above copyright | |
// | notice, this list of conditions and the following disclaimer. | |
// | 2. Redistributions in binary form must reproduce the above copyright | |
// | notice, this list of conditions and the following disclaimer in the | |
// | documentation and/or other materials provided with the distribution. | |
// | 3. The name of the author may not be used to endorse or promote products | |
// | derived from this software without specific prior written permission. | |
// | | |
// | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR | |
// | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |
// | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | |
// | IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | |
// | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | |
// | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
// | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
// | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
// | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | |
// | THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
// +------------------------------------------------------------------------------------------------------+ |
// CVS : $Id: instal_base_de_donnees.inc.php,v 1.1 2004-10-15 18:28:59 jpm Exp $ |
/** |
* Page de création de la base de données de Papyrus. |
* |
* Page permettant de créer la base de données de Papyrus. |
* |
*@package Installateur |
//Auteur original : |
*@author Hendrik MANS <hendrik@mans.de> |
//Autres auteurs : |
*@author David DELON |
*@author Patrick PAUL |
*@author Eric FELDSTEIN |
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org> |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.1 $ $Date: 2004-10-15 18:28:59 $ |
// +------------------------------------------------------------------------------------------------------+ |
**/ |
// +------------------------------------------------------------------------------------------------------+ |
// | ENTÊTE du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
// Récupération des paramêtres de configuration du formulaire précédent |
if (isset($_POST['config'])) { |
$config = $_POST['config']; |
} else if (isset($_POST['config_serial'])) { |
$config = unserialize(stripslashes($_POST['config_serial'])); |
} |
// +------------------------------------------------------------------------------------------------------+ |
// | CORPS du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
$sortie .= ' <h1>Installation de Papyrus</h1></h1>'."\n"; |
// Test de la configuration |
$sortie .= ' <h2>Test de la configuration</h2>'."\n"; |
$erreur = testerConfig('Test connexion MySQL ...', $dblink = @mysql_connect($config['PAP_BDD_SERVEUR'], $config['PAP_BDD_UTILISATEUR'], $config['PAP_BDD_MOT_DE_PASSE']), '', 1, 0); |
$erreur = testerConfig('Recherche base de données ...', @mysql_select_db($config['PAP_BDD_NOM'], $dblink), |
'La base de données que vous avez choisie n\'existe pas, vous devez la créer avant d\'installer Papyrus !', 1, $erreur); |
$sortie .= '<br />'."\n"; |
if (!$version = GEN_VERSION) $version = '0.1'; |
switch ($version) { |
case '0.1':// Nouvelle installation de Papyrus 0.1 |
$sql_contenu = PMA_readFile(INSTAL_CHEMIN_SQL.'papyrus_v'.$version.'.sql'); |
$tab_requete_sql = array(); |
PMA_splitSqlFile($tab_requete_sql, $sql_contenu, ''); |
foreach ($tab_requete_sql as $value) { |
//$sortie .= $value['query'].'<br />'.$value['type'].'-'.$value['table_nom'].'<br /><br /><br />'; |
$table_nom = ''; |
if (!empty($value['table_nom'])) { |
$table_nom = $value['table_nom']; |
} |
$requete_type = ''; |
if (!empty($value['type'])) { |
$requete_type = $value['type']; |
} |
if ($requete_type == 'create') { |
$erreur = testerConfig( 'Creation table '.$table_nom.'...', @mysql_query($value['query'], $dblink), |
'Déjà créée ?', 0, $erreur); |
} else if ($requete_type == 'insert') { |
$erreur = testerConfig( 'Insertion table '.$table_nom.'...', @mysql_query($value['query'], $dblink), |
'Données déjà présente ?', 0, $erreur); |
} |
} |
break; |
case '0.2':// Installation de Papyrus 0.2 |
break; |
} |
if ($erreur == 0 || $erreur == 1) { |
$sortie .= ' <p>A l\'étape suivante, le programme d\'installation va essayer d\'écrire le fichier de '. |
'configuration <tt>'.INSTAL_CHEMIN_CONFIG.'</tt>. Assurez vous que le serveur web a bien le '. |
'droit d\'écrire dans ce fichier, sinon vous devrez le modifier manuellement.</p>'."\n"; |
$sortie .= ' <form action="'.donnerUrlCourante().'?installation=config" method="POST" />'."\n"; |
$sortie .= ' <input type="hidden" name="config" value="'.htmlentities(serialize($config)).'" />'."\n"; |
$sortie .= ' <input type="submit" value="Continuer" />'."\n"; |
$sortie .= ' </form>'."\n"; |
} else { |
$sortie .= ' <form action="'.donnerUrlCourante().'?installation=bdd" method="POST" />'."\n"; |
$sortie .= ' <input type="hidden" name="config_serial" value="'.htmlentities(serialize($config)).'" />'."\n"; |
$sortie .= ' <input type="submit" value="Essayer à nouveau" />'."\n"; |
$sortie .= ' </form>'."\n"; |
} |
// +------------------------------------------------------------------------------------------------------+ |
// | PIED du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: not supported by cvs2svn $ |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
?> |