Mercurial > hg > rc2
comparison program/include/rcmail_install.php @ 28:6e8e57ef139f default tip
merge
| author | Charlie Root |
|---|---|
| date | Sun, 18 Jan 2026 14:25:54 -0500 |
| parents | c4ade3f35fb2 |
| children |
comparison
equal
deleted
inserted
replaced
| 27:c32b53434b47 | 28:6e8e57ef139f |
|---|---|
| 449 | 449 |
| 450 // read reference schema from mysql.initial.sql | 450 // read reference schema from mysql.initial.sql |
| 451 $engine = $db->db_provider; | 451 $engine = $db->db_provider; |
| 452 $db_schema = $this->db_read_schema(INSTALL_PATH . "SQL/$engine.initial.sql"); | 452 $db_schema = $this->db_read_schema(INSTALL_PATH . "SQL/$engine.initial.sql"); |
| 453 $errors = array(); | 453 $errors = array(); |
| 454 | 454 echo "<p style='color: red'>engin: $engine</p>"; |
| 455 // check list of tables | 455 // check list of tables |
| 456 $existing_tables = $db->list_tables(); | 456 $existing_tables = $db->list_tables(); |
| 457 | 457 |
| 458 foreach ($db_schema as $table => $cols) { | 458 foreach ($db_schema as $table => $cols) { |
| 459 | |
| 460 | |
| 459 $table = $this->config['db_prefix'] . $table; | 461 $table = $this->config['db_prefix'] . $table; |
| 460 | 462 |
| 461 if (!in_array($table, $existing_tables)) { | 463 if (!in_array($table, $existing_tables)) { |
| 462 $errors[] = "Missing table '".$table."'"; | 464 $errors[] = "Missing table '".$table."'"; |
| 463 } | 465 } |
| 464 else { // compare cols | 466 else { // compare cols |
| 465 $db_cols = $db->list_cols($table); | 467 $db_cols = $db->list_cols($table); |
| 468 echo "<p style='color: red'>table: $table, cols: ".print_r($cols,TRUE)."\ndb_cols:".print_r($db_cols,TRUE)."</p>"; | |
| 466 $diff = array_diff(array_keys($cols), $db_cols); | 469 $diff = array_diff(array_keys($cols), $db_cols); |
| 467 | 470 |
| 468 if (!empty($diff)) { | 471 if (!empty($diff)) { |
| 469 $errors[] = "Missing columns in table '$table': " . join(',', $diff); | 472 $errors[] = "Missing columns in table '$table': " . join(',', $diff); |
| 470 } | 473 } |
