Skip to content
GitLab
Explorer
Connexion
Navigation principale
Rechercher ou aller à…
Projet
P
PlayBot
Gestion
Activité
Membres
Labels
Programmation
Tickets
Tableaux des tickets
Jalons
Wiki
Wiki externe
Code
Requêtes de fusion
Dépôt
Branches
Validations
Étiquettes
Graphe du dépôt
Comparer les révisions
Déploiement
Releases
Registre de modèles
Surveillance
Incidents
Analyse
Données d'analyse des chaînes de valeur
Analyse des contributeurs
Données d'analyse du dépôt
Expériences du modèle
Aide
Aide
Support
Documentation de GitLab
Comparer les forfaits GitLab
Forum de la communauté GitLab
Contribuer à GitLab
Donner votre avis
Raccourcis clavier
?
Extraits de code
Groupes
Projets
Afficher davantage de fils d'Ariane
Alexandre MORIGNOT
PlayBot
Validations
33407b16
Valider
33407b16
rédigé
Il y a 10 ans
par
Alexandre Morignot
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
utils::db::get_session() becomes utils::db::get_new_session()
parent
212494d2
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Modifications
2
Afficher les modifications d'espaces
En ligne
Côte à côte
Affichage de
2 fichiers modifiés
lib/commands/get.pm
+3
-3
3 ajouts, 3 suppressions
lib/commands/get.pm
lib/utils/db.pm
+1
-1
1 ajout, 1 suppression
lib/utils/db.pm
avec
4 ajouts
et
4 suppressions
lib/commands/get.pm
+
3
−
3
Voir le fichier @
33407b16
...
@@ -30,7 +30,7 @@ sub exec {
...
@@ -30,7 +30,7 @@ sub exec {
my
@words
=
(
$msg
=~
/(?:^| )([^#\s]+)/g
);
my
@words
=
(
$msg
=~
/(?:^| )([^#\s]+)/g
);
if
(
not
defined
$last_req
or
$msg
ne
$last_req
)
{
if
(
not
defined
$last_req
or
$msg
ne
$last_req
)
{
my
$dbh
=
utils::db::
get_session
;
my
$dbh
=
utils::db::
get_
new_
session
;
my
@words_param
;
my
@words_param
;
foreach
(
@words
)
{
foreach
(
@words
)
{
...
@@ -129,7 +129,7 @@ sub exec {
...
@@ -129,7 +129,7 @@ sub exec {
# this is specific to the mysql driver
# this is specific to the mysql driver
$rows
=
$sth
->
rows
;
$rows
=
$sth
->
rows
;
my
$sth2
=
utils::db::
get_session
()
->
prepare
("
select tag
my
$sth2
=
utils::db::
get_
new_
session
()
->
prepare
("
select tag
from playbot_tags
from playbot_tags
where id = ?
where id = ?
");
");
...
@@ -157,7 +157,7 @@ sub exec {
...
@@ -157,7 +157,7 @@ sub exec {
$irc
->
yield
(
privmsg
=>
$chan
=>
$irc_msg
);
$irc
->
yield
(
privmsg
=>
$chan
=>
$irc_msg
);
# we save the get like a post
# we save the get like a post
$sth2
=
utils::db::
get_session
()
->
prepare_cached
('
$sth2
=
utils::db::
get_
new_
session
()
->
prepare_cached
('
INSERT INTO playbot_chan (content, chan, sender_irc)
INSERT INTO playbot_chan (content, chan, sender_irc)
VALUES (?,?,?)
');
VALUES (?,?,?)
');
$log
->
error
("
Couldn't prepare querie; aborting
")
unless
(
defined
$sth2
);
$log
->
error
("
Couldn't prepare querie; aborting
")
unless
(
defined
$sth2
);
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
lib/utils/db.pm
+
1
−
1
Voir le fichier @
33407b16
...
@@ -19,7 +19,7 @@ BEGIN {
...
@@ -19,7 +19,7 @@ BEGIN {
}
}
sub
get_session
{
sub
get_
new_
session
{
my
$dbh
=
DBI
->
connect
('
DBI:mysql:
'
.
$conf
->
{'
bdd
'}
.
'
;host=
'
.
$conf
->
{'
host
'},
$conf
->
{'
user
'},
$conf
->
{'
passwd
'},
{
my
$dbh
=
DBI
->
connect
('
DBI:mysql:
'
.
$conf
->
{'
bdd
'}
.
'
;host=
'
.
$conf
->
{'
host
'},
$conf
->
{'
user
'},
$conf
->
{'
passwd
'},
{
PrintError
=>
0
,
PrintError
=>
0
,
AutoCommit
=>
1
,
AutoCommit
=>
1
,
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
Aperçu
0%
Chargement en cours
Veuillez réessayer
ou
joindre un nouveau fichier
.
Annuler
You are about to add
0
people
to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Enregistrer le commentaire
Annuler
Veuillez vous
inscrire
ou vous
se connecter
pour commenter