Update schema.php for PHP 8.1
This commit is contained in:
@@ -77,7 +77,7 @@ if (!class_exists('schema')) {
|
|||||||
$sql = "CREATE TABLE " . $row['table']['name'] . " (\n";
|
$sql = "CREATE TABLE " . $row['table']['name'] . " (\n";
|
||||||
$field_count = 0;
|
$field_count = 0;
|
||||||
foreach ($row['fields'] as $field) {
|
foreach ($row['fields'] as $field) {
|
||||||
if (isset($field['deprecated']) and ($field['deprecated'] == "true")) {
|
if (!empty($field['deprecated']) and ($field['deprecated'] == "true")) {
|
||||||
//skip this field
|
//skip this field
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -368,7 +368,7 @@ if (!class_exists('schema')) {
|
|||||||
$sql = "CREATE TABLE " . $table_name . " (\n";
|
$sql = "CREATE TABLE " . $table_name . " (\n";
|
||||||
$field_count = 0;
|
$field_count = 0;
|
||||||
if (is_array($row['fields'])) foreach ($row['fields'] as $field) {
|
if (is_array($row['fields'])) foreach ($row['fields'] as $field) {
|
||||||
if ($field['deprecated'] == "true") {
|
if (!empty($field['deprecated']) && $field['deprecated'] == "true") {
|
||||||
//skip this row
|
//skip this row
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -407,7 +407,7 @@ if (!class_exists('schema')) {
|
|||||||
$sql = "INSERT INTO " . $row['table']['name'] . " (";
|
$sql = "INSERT INTO " . $row['table']['name'] . " (";
|
||||||
$field_count = 0;
|
$field_count = 0;
|
||||||
foreach ($row['fields'] as $field) {
|
foreach ($row['fields'] as $field) {
|
||||||
if ($field['deprecated'] == "true") {
|
if (!empty($field['deprecated']) && $field['deprecated'] == "true") {
|
||||||
//skip this field
|
//skip this field
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -425,7 +425,7 @@ if (!class_exists('schema')) {
|
|||||||
$sql .= "SELECT ";
|
$sql .= "SELECT ";
|
||||||
$field_count = 0;
|
$field_count = 0;
|
||||||
foreach ($row['fields'] as $field) {
|
foreach ($row['fields'] as $field) {
|
||||||
if ($field['deprecated'] == "true") {
|
if (!empty($field['deprecated']) && $field['deprecated'] == "true") {
|
||||||
//skip this field
|
//skip this field
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -575,7 +575,7 @@ if (!class_exists('schema')) {
|
|||||||
}
|
}
|
||||||
//check if the column exists
|
//check if the column exists
|
||||||
foreach ($row['fields'] as $z => $field) {
|
foreach ($row['fields'] as $z => $field) {
|
||||||
if ($field['deprecated'] == "true") {
|
if (!empty($field['deprecated']) && $field['deprecated'] == "true") {
|
||||||
//skip this field
|
//skip this field
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -605,7 +605,7 @@ if (!class_exists('schema')) {
|
|||||||
|
|
||||||
//prepare the variables
|
//prepare the variables
|
||||||
$sql_update = '';
|
$sql_update = '';
|
||||||
$var_uuid = $_GET["id"];
|
$var_uuid = $_GET["id"] ?? '';
|
||||||
|
|
||||||
//add missing tables and fields
|
//add missing tables and fields
|
||||||
foreach ($apps as $x => &$app) {
|
foreach ($apps as $x => &$app) {
|
||||||
@@ -641,7 +641,7 @@ if (!class_exists('schema')) {
|
|||||||
if ($row['exists'] == "true") {
|
if ($row['exists'] == "true") {
|
||||||
if (count($row['fields']) > 0) {
|
if (count($row['fields']) > 0) {
|
||||||
foreach ($row['fields'] as $z => $field) {
|
foreach ($row['fields'] as $z => $field) {
|
||||||
if ($field['deprecated'] == "true") {
|
if (!empty($field['deprecated']) && $field['deprecated'] == "true") {
|
||||||
//skip this field
|
//skip this field
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -761,7 +761,7 @@ if (!class_exists('schema')) {
|
|||||||
else {
|
else {
|
||||||
$table_name = $row['table']['name'];
|
$table_name = $row['table']['name'];
|
||||||
}
|
}
|
||||||
if ($row['rebuild'] == "true") {
|
if (!empty($field['rebuild']) && $row['rebuild'] == "true") {
|
||||||
if ($db_type == "sqlite") {
|
if ($db_type == "sqlite") {
|
||||||
//start the transaction
|
//start the transaction
|
||||||
//$sql_update .= "BEGIN TRANSACTION;\n";
|
//$sql_update .= "BEGIN TRANSACTION;\n";
|
||||||
@@ -835,7 +835,7 @@ if (!class_exists('schema')) {
|
|||||||
$response .= "<th>".$text['label-exists']."</th>\n";
|
$response .= "<th>".$text['label-exists']."</th>\n";
|
||||||
$response .= "</tr>\n";
|
$response .= "</tr>\n";
|
||||||
foreach ($row['fields'] as $field) {
|
foreach ($row['fields'] as $field) {
|
||||||
if ($field['deprecated'] == "true") {
|
if (!empty($field['deprecated']) && $field['deprecated'] == "true") {
|
||||||
//skip this field
|
//skip this field
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
Reference in New Issue
Block a user