Subversion Repositories Sites.tela-botanica.org

Rev

Rev 267 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 267 Rev 271
Line 44... Line 44...
44
$GLOBALS['_NETTOYAGE_']['sites'] = array('http://www.tela-botanica.org', 'http://www.outils-reseaux.org');
44
$GLOBALS['_NETTOYAGE_']['sites'] = array('http://www.tela-botanica.org', 'http://www.outils-reseaux.org');
Line 45... Line 45...
45
 
45
 
46
// +------------------------------------------------------------------------------------------------------+
46
// +------------------------------------------------------------------------------------------------------+
47
// |                                            CORPS du PROGRAMME                                        |
47
// |                                            CORPS du PROGRAMME                                        |
-
 
48
// +------------------------------------------------------------------------------------------------------+
48
// +------------------------------------------------------------------------------------------------------+
49
echo '<h1>'.'Nettoyage des wikini de tela_prod_wikini'.'</h1>';
-
 
50
$Nettoyage = new Nettoyage();
49
$Nettoyage = new Nettoyage();
51
echo '<pre>';
50
$Nettoyage->nettoyageGlobal();
52
$Nettoyage->nettoyageGlobal();
51
 
53
echo '</pre>';
52
// +------------------------------------------------------------------------------------------------------+
54
// +------------------------------------------------------------------------------------------------------+
53
// |                                           CLASSES du PROGRAMME                                       |
55
// |                                           CLASSES du PROGRAMME                                       |
54
// +------------------------------------------------------------------------------------------------------+
56
// +------------------------------------------------------------------------------------------------------+
-
 
57
class Nettoyage {
-
 
58
	private $bdd_principale = "tela_prod_wikini";
-
 
59
	private $bdd_options = array('debug' => 3);
Line 55... Line 60...
55
class Nettoyage {
60
	private $bdd_dsn = "mysql://utilisateur:mdp@localhost/tela_prod_wikini";
56
	
61
	
57
	public function __construct()
62
	public function __construct()
58
	{
63
	{
-
 
64
//		$fichier_ini = 'bdd.ini';
59
		$fichier_ini = 'bdd.ini';
65
//		$ok = $this->parserFichierIni($fichier_ini);
-
 
66
//		if (!$ok) {
-
 
67
//			$e = 'Impossible de parser le fichier : '.$fichier_ini;
60
		if (file_exists($fichier_ini)) {
68
//			trigger_error($e, E_USER_ERROR);
61
			$this->parserFichierIni($fichier_ini);
69
//		} else {
62
			require_once CHEMIN_PEAR.'DB.php';
70
			require_once CHEMIN_PEAR.'DB.php';
63
			$this->connexion = DB::connect($this->bdd_dsn, $this->bdd_options);
71
			$this->connexion = DB::connect($this->bdd_dsn, $this->bdd_options);
64
			if (PEAR::isError($this->connexion)) {
72
			if (PEAR::isError($this->connexion)) {
65
				$e = $this->connexion->getMessage();
73
				$e = $this->connexion->getMessage();
66
				trigger_error($e, E_USER_ERROR);
74
				trigger_error($e, E_USER_ERROR);
67
			}
75
			}
Line 68... Line 76...
68
		}
76
//		}
69
	}
77
	}
70
	
78
	
Line 78... Line 86...
78
		$ligne = '';
86
		$ligne = '';
79
		while ($res->fetchInto($ligne)) {
87
		while ($res->fetchInto($ligne)) {
80
			$tab_tables[] = $ligne[0];
88
			$tab_tables[] = $ligne[0];
81
		}
89
		}
Line 82... Line -...
82
 
-
 
83
		echo '<pre>';
90
 
84
		foreach ($tab_tables as $table) {
91
		foreach ($tab_tables as $table) {
Line 85... Line 92...
85
			echo "\n".$table."\n";
92
			echo "\n".$table."\n";
86
 
93
 
Line 129... Line 136...
129
				if (PEAR::isError($res)) {
136
				if (PEAR::isError($res)) {
130
					die($res->getMessage());
137
					die($res->getMessage());
131
				}
138
				}
132
			}
139
			}
133
		}
140
		}
134
		echo '</pre>';
-
 
135
	}
141
	}
Line 136... Line 142...
136
	
142
	
137
	private function parserFichierIni($fichier_ini)
143
	function parserFichierIni($fichier_ini)
138
	{
144
	{
139
		if (file_exists($fichier_ini)) {
145
		if (file_exists($fichier_ini)) {
140
			$aso_ini = parse_ini_file($fichier_ini);
146
			$aso_ini = parse_ini_file($fichier_ini);
141
	    	foreach ($aso_ini as $cle => $val) {
147
	    	foreach ($aso_ini as $cle => $val) {