mirror of
https://github.com/standardebooks/web.git
synced 2025-07-06 06:40:33 -04:00
Disable emulate prepares in DB
This commit is contained in:
parent
4ff5512544
commit
1c055d3e6f
2 changed files with 12 additions and 11 deletions
|
@ -42,8 +42,7 @@ class DbConnection{
|
||||||
$connectionString .= ';dbname=' . $defaultDatabase;
|
$connectionString .= ';dbname=' . $defaultDatabase;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Have to use ATTR_EMULATE_PREPARES = true, otherwise transactions don't work for some reason.
|
$params = [\PDO::ATTR_EMULATE_PREPARES => false, \PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION, \PDO::ATTR_PERSISTENT => false];
|
||||||
$params = [\PDO::ATTR_EMULATE_PREPARES => true, \PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION, \PDO::ATTR_PERSISTENT => false];
|
|
||||||
|
|
||||||
if($forceUtf8){
|
if($forceUtf8){
|
||||||
$params[\PDO::MYSQL_ATTR_INIT_COMMAND] = 'set names utf8mb4 collate utf8mb4_unicode_ci;';
|
$params[\PDO::MYSQL_ATTR_INIT_COMMAND] = 'set names utf8mb4 collate utf8mb4_unicode_ci;';
|
||||||
|
|
|
@ -44,20 +44,22 @@ $faPassword = get_cfg_var('se.secrets.fractured_atlas.password');
|
||||||
// 946554ca-ffc0-4259-bcc6-be6c844fbbdc Regular donation, patrons, private, recurring
|
// 946554ca-ffc0-4259-bcc6-be6c844fbbdc Regular donation, patrons, private, recurring
|
||||||
// 416608c6-cbf5-4153-8956-cb9051bb849e Regular donation, patrons, public, one time, in memory of
|
// 416608c6-cbf5-4153-8956-cb9051bb849e Regular donation, patrons, public, one time, in memory of
|
||||||
|
|
||||||
$pendingPayments = Db::Query('
|
Db::Query('start transaction');
|
||||||
start transaction;
|
|
||||||
|
|
||||||
|
$pendingPayments = Db::Query('
|
||||||
SELECT *
|
SELECT *
|
||||||
from PendingPayments
|
from PendingPayments
|
||||||
where ProcessedOn is null;
|
where ProcessedOn is null
|
||||||
|
');
|
||||||
|
|
||||||
|
Db::Query('
|
||||||
UPDATE PendingPayments
|
UPDATE PendingPayments
|
||||||
set ProcessedOn = utc_timestamp()
|
set ProcessedOn = utc_timestamp()
|
||||||
where ProcessedOn is null;
|
where ProcessedOn is null
|
||||||
|
|
||||||
commit;
|
|
||||||
');
|
');
|
||||||
|
|
||||||
|
Db::Query('commit');
|
||||||
|
|
||||||
if(sizeof($pendingPayments) == 0){
|
if(sizeof($pendingPayments) == 0){
|
||||||
// Don't start the very slow Selenium driver if we have nothing to process
|
// Don't start the very slow Selenium driver if we have nothing to process
|
||||||
exit();
|
exit();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue