Qual: Quelques commentaires dans le code

This commit is contained in:
Laurent Destailleur 2005-03-26 12:15:11 +00:00
parent bafa177b34
commit 001bc0c0c4

View File

@ -39,17 +39,18 @@ pHeader($langs->trans("DolibarrWelcome"), "licence"); // Etape suivante = lice
print $langs->trans("InstallEasy")."<br>"; print $langs->trans("InstallEasy")."<br>";
// Si fichier présent et lisible
if (is_readable($conffile)) if (is_readable($conffile))
{ {
$confexists=1; $confexists=1;
include_once($conffile); include_once($conffile);
} }
else else
{ {
$confexists=0; // Si non on le crée
$fp = @fopen("$conffile", "w"); $confexists=0;
if($fp) $fp = @fopen("$conffile", "w");
if($fp)
{ {
@fwrite($fp, '<?php'); @fwrite($fp, '<?php');
@fputs($fp,"\n"); @fputs($fp,"\n");
@ -58,12 +59,13 @@ else
} }
} }
// Si fichier absent et n'a pu etre créé
if (!file_exists($conffile)) if (!file_exists($conffile))
{ {
print "<br /><br />"; print "<br /><br />";
print "Le fichier de configuration <b>conf.php</b> n'existe pas !"; print "Le fichier de configuration <b>conf.php</b> n'existe pas !";
print "<br />"; print "<br />";
print "Vous devez créer un fichier <b>htdocs/conf/conf.php</b> et donner les droits d'écriture dans celui-ci au serveur Apache."; print "Vous devez créer un fichier <b>htdocs/conf/conf.php</b> et donner les droits d'écriture dans celui-ci au serveur web durant le processus d'installation.";
print "<br /><br />"; print "<br /><br />";
print 'Corrigez le problème et <a href="index.php">rechargez la page</a>.'; print 'Corrigez le problème et <a href="index.php">rechargez la page</a>.';
@ -72,35 +74,36 @@ if (!file_exists($conffile))
} }
else else
{ {
if (!is_writable($conffile)) print "<br /><br />";
// Si ficiher présent mais ne peut etre modifié
if (!is_writable($conffile))
{ {
print "<br /><br />"; if ($confexists) {
if ($confexists) { print $langs->trans("ConfFileExists");
print $langs->trans("ConfFileExists"); }
} else {
else { print $langs->trans("ConfFileCouldBeCreated");
print $langs->trans("ConfFileCouldBeCreated"); }
} print "<br />";
print "<br />"; print $langs->trans("ConfFileIsNotWritable");
print $langs->trans("ConfFileIsNotWritable"); print "<br />";
print "<br />";
$err++;
$err++;
} }
else // Si fichier présent et peut etre modifié
else
{ {
print "<br /><br />"; if ($confexists) {
if ($confexists) { print $langs->trans("ConfFileExists");
print $langs->trans("ConfFileExists"); }
} else {
else { print $langs->trans("ConfFileCouldBeCreated");
print $langs->trans("ConfFileCouldBeCreated"); }
} print "<br />";
print "<br />"; print $langs->trans("ConfFileIsWritable");
print $langs->trans("ConfFileIsWritable"); print "<br /><br />";
print "<br /><br />"; print $langs->trans("YouCanContinue");
print $langs->trans("YouCanContinue");
} }
} }