Skip to content

Commit bf4176f

Browse files
committed
#679 5.10 to 5.20 versioning changes
1 parent 70f147f commit bf4176f

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

web/install/update_510-520.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,20 @@
4141

4242
include(EASYWIDIR . '/stuff/keyphrasefile.php');
4343

44+
if (!isset($tables)) {
45+
46+
require_once(EASYWIDIR . '/stuff/methods/class_tables.php');
47+
48+
if (!isset($dbConnect['db'])) {
49+
50+
include(EASYWIDIR . '/stuff/config.php');
51+
52+
$dbConnect['db'] = $db;
53+
}
54+
55+
$tables = new Tables($dbConnect['db']);
56+
}
57+
4458
// Execute correct, so we can update game templates
4559
$tables->correctExistingTables();
4660

web/stuff/methods/class_tables.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ function __construct($dbName) {
5555
$this->dbName = $dbName;
5656
$this->sql = $sql;
5757

58+
$this->sql->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
59+
5860
$this->getTableDefinitions();
5961
$this->getTablesColumnConfigurations();
6062
}
@@ -124,8 +126,10 @@ private function executeChange($sqlStatement) {
124126
$this->executedSql[] = $sqlStatement;
125127

126128
try {
129+
127130
$query = $this->sql->prepare($sqlStatement);
128131
$query->execute();
132+
129133
} catch(PDOException $error) {
130134
$this->errors[] = 'Error Message: ' . $error->getMessage() . ' Executed SQL was: ' . $sqlStatement;
131135
}

0 commit comments

Comments
 (0)