Subversion Repositories Sites.tela-botanica.org

Rev

Rev 271 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 271 Rev 275
Line 55... Line 55...
55
// |                                           CLASSES du PROGRAMME                                       |
55
// |                                           CLASSES du PROGRAMME                                       |
56
// +------------------------------------------------------------------------------------------------------+
56
// +------------------------------------------------------------------------------------------------------+
57
class Nettoyage {
57
class Nettoyage {
58
	private $bdd_principale = "tela_prod_wikini";
58
	private $bdd_principale = "tela_prod_wikini";
59
	private $bdd_options = array('debug' => 3);
59
	private $bdd_options = array('debug' => 3);
60
	private $bdd_dsn = "mysql://utilisateur:mdp@localhost/tela_prod_wikini";
60
	private $bdd_dsn = "mysql://telabotap:ppo50cvb@localhost/tela_prod_wikini";
Line 61... Line 61...
61
	
61
	
62
	public function __construct()
62
	public function __construct()
63
	{
63
	{
64
//		$fichier_ini = 'bdd.ini';
64
//		$fichier_ini = 'bdd.ini';
Line 107... Line 107...
107
				}
107
				}
108
			}
108
			}
Line 109... Line 109...
109
 
109
 
110
			// Pages : commentaires
110
			// Pages : commentaires
111
			if (preg_match('/_pages$/', $table)) {
111
			if (preg_match('/_pages$/', $table)) {
112
				$requete = 	'DELETE FROM '.$table.' '.
112
				$requete = 	'SELECT tag FROM '.$table.' '.
113
							'WHERE tag LIKE "Comment%" ';
113
							'WHERE tag LIKE "Comment%" ';
-
 
114
				echo $requete."\n";
-
 
115
				$aso_pages = $this->connexion->getAll($requete, null, DB_FETCHMODE_ASSOC);
-
 
116
				if (PEAR::isError($aso_pages)) {
-
 
117
					die($aso_pages->getMessage());
-
 
118
				}
-
 
119
				if (count($aso_pages) > 0) {
-
 
120
					$tab_pages = array();
-
 
121
					foreach ($aso_pages as $page) {
-
 
122
						if (preg_match('/^Comment\d+$/', $page['tag'])){
-
 
123
							$tab_pages[] = $page['tag'];
-
 
124
						}
-
 
125
					}
-
 
126
					if (count($tab_pages) > 0) {
-
 
127
						$requete = 	'DELETE FROM '.$table.' '.
-
 
128
									'WHERE tag IN ("'.implode('","', $tab_pages).'") ';
114
				echo $requete."\n";
129
						echo $requete."\n";
115
				$res = $this->connexion->query($requete);
130
						$res = $this->connexion->query($requete);
116
				if (PEAR::isError($res)) {
131
						if (PEAR::isError($res)) {
-
 
132
							die($res->getMessage());
-
 
133
						}
117
					die($res->getMessage());
134
					}
118
				}
135
				}
Line 119... Line 136...
119
			}
136
			}
120
			
137