Mercurial > hg > fapweb
diff managedb.php @ 1104:0a2117349f46
s/true/TRUE/g; s/false/FALSE/g;
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Tue, 14 May 2019 14:45:36 +0300 |
parents | 48e16e856646 |
children | 24e6915fc0fb |
line wrap: on
line diff
--- a/managedb.php Tue May 14 14:12:42 2019 +0300 +++ b/managedb.php Tue May 14 14:45:36 2019 +0300 @@ -95,7 +95,7 @@ foreach ($settings as $key => $data) { - $sql = false; + $sql = FALSE; // Get setting type switch ($data[0]) @@ -130,7 +130,7 @@ } } - if ($sql === false) + if ($sql === FALSE) { // Normal insertion of default data $sql = stDBPrepareSQL($outDB, $sqlFmt, @@ -165,7 +165,7 @@ "INSERT INTO ".$groupTable." (name,description) VALUES (%s,%s)", $groupData[$groupID][0], $groupData[$groupID][1]); - if (($gid = stDBExecSQLInsert($outDB, $sql)) === false) + if (($gid = stDBExecSQLInsert($outDB, $sql)) === FALSE) { echo "\nFailed to add group '".$groupID."'\n"; return FALSE; @@ -173,7 +173,7 @@ // Add settings to the group stDBBeginTransaction($outDB); - if (stDoAddSettings($inDB, $outDB, $settings, $table, $upgrade, $gid) === false) + if (stDoAddSettings($inDB, $outDB, $settings, $table, $upgrade, $gid) === FALSE) { echo "\nFailed to add settings to group '".$groupID."'\n"; return FALSE; @@ -219,9 +219,9 @@ $data[$n]); $sql = call_user_func_array('stDBPrepareSQL', $arr); - if (stDBExecSQL($outDB, $sql) === false) + if (stDBExecSQL($outDB, $sql) === FALSE) { - $status = false; + $status = FALSE; break; } } @@ -299,7 +299,7 @@ } $sql = "INSERT INTO ".$table." (".implode(",", $acols).") VALUES (".implode(",", $avals).")"; - if (stDBExecSQL($outDB, $sql) === false) + if (stDBExecSQL($outDB, $sql) === FALSE) { $status = FALSE; break; @@ -314,8 +314,8 @@ // For PostgreSQL we need to update sequences foreach ($sequences as $seq) { - if (($max_id = stDBFetchSQLColumn($outDB, "SELECT MAX(".$seq.") FROM ".$table)) !== false && - ($seq_id = stDBFetchSQLColumn($outDB, "SELECT nextval('".$table."_".$seq."_seq')")) !== false && + if (($max_id = stDBFetchSQLColumn($outDB, "SELECT MAX(".$seq.") FROM ".$table)) !== FALSE && + ($seq_id = stDBFetchSQLColumn($outDB, "SELECT nextval('".$table."_".$seq."_seq')")) !== FALSE && ($seq_id <= $max_id)) { echo "SEQFIX"; @@ -418,10 +418,10 @@ case "new": // Try to connect to database - if (($inSpec = stCArg(2)) === false) + if (($inSpec = stCArg(2)) === FALSE) die("No PDO database spec specified.\n"); - if (($inDB = stConnectSQLDBSpec($inSpec)) === false) + if (($inDB = stConnectSQLDBSpec($inSpec)) === FALSE) die("Could not connect to SQL database '".$inSpec."'.\n"); echo "Using database spec '".$inSpec."'.\n"; @@ -459,7 +459,7 @@ echo "Using INPUT database spec '".$inSpec."'.\n"; - if (($inDB = stConnectSQLDBSpec($inSpec)) === false) + if (($inDB = stConnectSQLDBSpec($inSpec)) === FALSE) die("Could not connect to SQL database '".$inSpec."'.\n"); // Check the current version first ... @@ -473,7 +473,7 @@ else { // Okay, we shall create an upgraded version .. - if (($outDB = stConnectSQLDBSpec($outSpec)) === false) + if (($outDB = stConnectSQLDBSpec($outSpec)) === FALSE) die("Could not connect to SQL database '".$outSpec."'.\n"); echo "Database at version ".$currVersion.", upgrading to ".$dbVersion."\n";