4 |
david |
1 |
<?php
|
|
|
2 |
|
|
|
3 |
/***************************************************************************\
|
|
|
4 |
* SPIP, Systeme de publication pour l'internet *
|
|
|
5 |
* *
|
|
|
6 |
* Copyright (c) 2001-2005 *
|
|
|
7 |
* Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James *
|
|
|
8 |
* *
|
|
|
9 |
* Ce programme est un logiciel libre distribue sous licence GNU/GPL. *
|
|
|
10 |
* Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. *
|
|
|
11 |
\***************************************************************************/
|
|
|
12 |
|
|
|
13 |
|
|
|
14 |
include ("inc_version.php3");
|
|
|
15 |
|
|
|
16 |
include_ecrire ("inc_admin.php3");
|
|
|
17 |
include_ecrire ("inc_texte.php3");
|
|
|
18 |
include_ecrire ("inc_presentation.php3");
|
|
|
19 |
|
|
|
20 |
|
|
|
21 |
/*
|
|
|
22 |
* REMARQUE IMPORTANTE : SECURITE
|
|
|
23 |
* Ce systeme de reparation doit pouvoir fonctionner meme si
|
|
|
24 |
* la table spip_auteurs est en panne : on n'appelle donc pas
|
|
|
25 |
* inc_auth ; seule l'authentification ftp est exigee
|
|
|
26 |
*
|
|
|
27 |
*/
|
|
|
28 |
|
|
|
29 |
// include_ecrire ("inc_auth.php3");
|
|
|
30 |
$connect_statut = '0minirezo';
|
|
|
31 |
|
|
|
32 |
|
|
|
33 |
function verifier_base() {
|
|
|
34 |
if (! $res1= spip_query("SHOW TABLES"))
|
|
|
35 |
return false;
|
|
|
36 |
|
|
|
37 |
while ($tab = spip_fetch_array($res1)) {
|
|
|
38 |
echo "<p><b>".$tab[0]."</b> ";
|
|
|
39 |
|
|
|
40 |
if (!($result_repair = spip_query("REPAIR TABLE ".$tab[0])))
|
|
|
41 |
return false;
|
|
|
42 |
|
|
|
43 |
if (!($result = spip_query("SELECT COUNT(*) FROM ".$tab[0])))
|
|
|
44 |
return false;
|
|
|
45 |
|
|
|
46 |
list($count) = spip_fetch_array($result);
|
|
|
47 |
if ($count>1)
|
|
|
48 |
echo "("._T('texte_compte_elements', array('count' => $count)).")\n";
|
|
|
49 |
else if ($count==1)
|
|
|
50 |
echo "("._T('texte_compte_element', array('count' => $count)).")\n";
|
|
|
51 |
else
|
|
|
52 |
echo "("._T('texte_vide').")\n";
|
|
|
53 |
|
|
|
54 |
$row = spip_fetch_array($result_repair);
|
|
|
55 |
$ok = ($row[3] == 'OK');
|
|
|
56 |
|
|
|
57 |
if (!$ok)
|
|
|
58 |
echo "<pre><font color='red'><b>".htmlentities(join("\n", $row))."</b></font></pre>\n";
|
|
|
59 |
else
|
|
|
60 |
echo " "._T('texte_table_ok')."<br>\n";
|
|
|
61 |
|
|
|
62 |
}
|
|
|
63 |
|
|
|
64 |
return true;
|
|
|
65 |
}
|
|
|
66 |
|
|
|
67 |
// verifier version MySQL
|
|
|
68 |
if (! $res1= spip_query("SELECT version()"))
|
|
|
69 |
$message = _T('avis_erreur_connexion_mysql');
|
|
|
70 |
else {
|
|
|
71 |
$tab = spip_fetch_array($res1);
|
|
|
72 |
$version_mysql = $tab[0];
|
|
|
73 |
if ($version_mysql < '3.23.14')
|
|
|
74 |
$message = _T('avis_version_mysql', array('version_mysql' => $version_mysql));
|
|
|
75 |
else {
|
|
|
76 |
$message = _T('texte_requetes_echouent');
|
|
|
77 |
$ok = true;
|
|
|
78 |
}
|
|
|
79 |
}
|
|
|
80 |
|
|
|
81 |
$action = _T('texte_tenter_reparation');
|
|
|
82 |
|
|
|
83 |
if ($ok) {
|
|
|
84 |
debut_admin($action, $message);
|
|
|
85 |
|
|
|
86 |
install_debut_html(_T('texte_tentative_recuperation'));
|
|
|
87 |
|
|
|
88 |
|
|
|
89 |
debut_cadre_relief();
|
|
|
90 |
if (! verifier_base())
|
|
|
91 |
echo "<br><br><font color='red'><b><tt>"._T('avis_erreur_mysql').' '.spip_sql_errno().': '.spip_sql_error() ."</tt></b></font><br><br>\n";
|
|
|
92 |
fin_cadre_relief();
|
|
|
93 |
echo "<br>";
|
|
|
94 |
|
|
|
95 |
install_fin_html();
|
|
|
96 |
|
|
|
97 |
fin_admin($action);
|
|
|
98 |
}
|
|
|
99 |
else {
|
|
|
100 |
install_debut_html(_T('titre_reparation'));
|
|
|
101 |
echo "<p>$message";
|
|
|
102 |
install_fin_html();
|
|
|
103 |
}
|
|
|
104 |
|
|
|
105 |
|
|
|
106 |
?>
|