From 498cca8941d3a835f7efdd47306b41df7fdb4cbc Mon Sep 17 00:00:00 2001
From: Alexandre Morignot <erdnaxeli@cervoi.se>
Date: Thu, 12 Feb 2015 00:53:53 +0100
Subject: [PATCH] no more prepare_cached

---
 lib/commands/fav.pm   |  4 ++--
 lib/commands/get.pm   |  2 +-
 lib/commands/later.pm |  2 +-
 lib/commands/tag.pm   |  2 +-
 lib/sessions/irc.pm   | 10 +++++-----
 lib/sites/parser.pm   |  6 +++---
 6 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/lib/commands/fav.pm b/lib/commands/fav.pm
index 8a8d134..e272864 100644
--- a/lib/commands/fav.pm
+++ b/lib/commands/fav.pm
@@ -7,7 +7,7 @@ our $irc;
 sub exec {
     my ($nick, $id) = @_;
 
-    my $sth = $dbh->prepare_cached('SELECT user FROM playbot_codes WHERE nick = ?');
+    my $sth = $dbh->prepare('SELECT user FROM playbot_codes WHERE nick = ?');
     $sth->execute($nick)
 	    or $log->error("Couldn't finish transaction: " . $dbh->errstr);
 
@@ -15,7 +15,7 @@ sub exec {
 	    $irc->yield(privmsg => $nick => "Ce nick n'est associé à aucun login arise. Va sur http://nightiies.iiens.net/links/fav pour obtenir ton code personel.");
     }
     else {
-        my $sth2 = $dbh->prepare_cached('INSERT INTO playbot_fav (id, user) VALUES (?, ?)');
+        my $sth2 = $dbh->prepare('INSERT INTO playbot_fav (id, user) VALUES (?, ?)');
 	    $sth2->execute($id, $sth->fetch->[0])
 	        or $log->error("Couldn't finish transaction: " . $dbh->errstr);
     }
diff --git a/lib/commands/get.pm b/lib/commands/get.pm
index b7ec425..8b7945a 100644
--- a/lib/commands/get.pm
+++ b/lib/commands/get.pm
@@ -89,7 +89,7 @@ sub exec {
     $irc->yield(privmsg => $chan => $irc_msg);
 
     # we save the get like a post
-    $sth = $dbh->prepare_cached('
+    $sth = $dbh->prepare('
         INSERT INTO playbot_chan (content, chan, sender_irc)
         VALUES (?,?,?)');
     $log->error("Couldn't prepare querie; aborting") unless (defined $sth);
diff --git a/lib/commands/later.pm b/lib/commands/later.pm
index cc8cd2c..e9675ba 100644
--- a/lib/commands/later.pm
+++ b/lib/commands/later.pm
@@ -9,7 +9,7 @@ sub exec {
 	$time = 6 if (!$time);
 	$time *= ($unit eq 's') ? 1 : ($unit eq 'm') ? 60 : 3600;
 
-    my $sth = $dbh->prepare_cached('INSERT INTO playbot_later (content, nick, date) VALUES (?, ?, ?)');
+    my $sth = $dbh->prepare('INSERT INTO playbot_later (content, nick, date) VALUES (?, ?, ?)');
 	unless (defined $sth) {
         $log->error("Couldn't prepare querie; aborting");
         return;
diff --git a/lib/commands/tag.pm b/lib/commands/tag.pm
index 9660d66..c345def 100644
--- a/lib/commands/tag.pm
+++ b/lib/commands/tag.pm
@@ -17,7 +17,7 @@ sub addTag
 
     my $sth;
 
-    $sth = $dbh->prepare_cached('INSERT INTO playbot_tags (id, tag) VALUES (?, ?)');
+    $sth = $dbh->prepare('INSERT INTO playbot_tags (id, tag) VALUES (?, ?)');
     $log->error("Couldn't prepare querie; aborting") unless (defined $sth);
 
     eval {
diff --git a/lib/sessions/irc.pm b/lib/sessions/irc.pm
index b203c8d..13815d0 100644
--- a/lib/sessions/irc.pm
+++ b/lib/sessions/irc.pm
@@ -80,7 +80,7 @@ sub flux
 	my $date = strftime ("%Y-%m-%d", localtime(time - 3600*24));
 
     foreach (@channels) {
-	    my $sth = $dbh->prepare_cached('
+	    my $sth = $dbh->prepare('
             SELECT COUNT(*)
             FROM playbot p
             JOIN playbot_chan pc ON p.id = pc.content
@@ -103,7 +103,7 @@ sub later
 {
 	my ($nick, $id) = @_[ARG0,ARG1];
 
-	my $sth = $dbh->prepare_cached('SELECT url, sender, title FROM playbot WHERE id = ?');
+	my $sth = $dbh->prepare('SELECT url, sender, title FROM playbot WHERE id = ?');
 	$log->error("Couldn't prepare querie; aborting") unless (defined $sth);
 
 	$sth->execute($id)
@@ -116,7 +116,7 @@ sub later
 		$irc->yield(privmsg => $nick => $donnees[0]);
     
         # save the content in the history
-        my $sth2 = $dbh->prepare_cached('
+        my $sth2 = $dbh->prepare('
             INSERT INTO playbot_chan (content, chan, sender_irc)
             VALUES (?,?,?)');
         $log->error("Couldn't prepare querie; aborting") unless (defined $sth2);
@@ -243,12 +243,12 @@ sub on_notice
 		$irc->yield(privmsg => $nickToVerify => "Il faut que ton pseudo soit enregistré auprès de NickServ");
 	}
 	else {
-		my $sth = $dbh->prepare_cached('SELECT user FROM playbot_codes WHERE code = ?');
+		my $sth = $dbh->prepare('SELECT user FROM playbot_codes WHERE code = ?');
 		$log->error("Counldn't prepare querie; aborting") unless (defined $sth);
 		$sth->execute($code);
 
 		if ($sth->rows) {
-			my $sth = $dbh->prepare_cached('UPDATE playbot_codes SET nick = ? WHERE code = ?');
+			my $sth = $dbh->prepare('UPDATE playbot_codes SET nick = ? WHERE code = ?');
 			$log->error("Couldn't prepare querie; aborting") unless (defined $sth);
 
 			$sth->execute($nickToVerify, $code)
diff --git a/lib/sites/parser.pm b/lib/sites/parser.pm
index 639d860..12d744f 100644
--- a/lib/sites/parser.pm
+++ b/lib/sites/parser.pm
@@ -66,7 +66,7 @@ sub parse {
 	    else {
 		    # insertion de la vidéo dans la bdd
             eval {
-                my $sth = $dbh->prepare_cached('
+                my $sth = $dbh->prepare('
                     INSERT INTO playbot (type, url, sender, title, duration)
                     VALUES (?,?,?,?,?)');
 		        $log->error("Couldn't prepare querie; aborting") unless (defined $sth);
@@ -89,7 +89,7 @@ sub parse {
             # on peut commiter.
             $dbh->commit;
 
-		    my $sth = $dbh->prepare_cached('SELECT id FROM playbot WHERE url = ?');
+		    my $sth = $dbh->prepare('SELECT id FROM playbot WHERE url = ?');
 		    $log->error("Couldn't prepare querie; aborting") unless (defined $sth);
 
 		    $sth->execute($content{'url'})
@@ -99,7 +99,7 @@ sub parse {
 	    }
 
         # insertion du chan
-        my $sth = $dbh->prepare_cached('
+        my $sth = $dbh->prepare('
             INSERT INTO playbot_chan (content, chan, sender_irc)
             VALUES (?,?,?)');
 		$log->error("Couldn't prepare querie; aborting") unless (defined $sth);
-- 
GitLab