Advertisement
tripinva

PHP 7.4->8.4 Breakage

Sep 9th, 2024 (edited)
308
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.10 KB | None | 0 0
  1. Code from constants.php:
  2.  
  3. /**
  4. * TableDef class
  5. */
  6. class TableDef {
  7. public $name;
  8. public $display_name;
  9. public $notify_insert;
  10. public $fields = array();
  11. public $indexes = array();
  12. public $primary_keys = array();
  13. public $auto_increment = "";
  14. public $connection = 1;
  15.  
  16. /**
  17. * Constructor
  18. *
  19. * @param string $name Name
  20. * @param string $display_name Display name
  21. * @param bool $notify_insert Notify on an Insert?
  22. */
  23. public function TableDef($name, $display_name, $notify_insert) {
  24. $this->name = $name;
  25. $this->display_name = $display_name;
  26. $this->notify_insert = $notify_insert;
  27. }
  28.  
  29. =====
  30.  
  31. Code from tabledef.php:
  32.  
  33. function load_table_definitions()
  34. {
  35. global $tabledefs;
  36.  
  37. $tabledefs = array();
  38.  
  39.  
  40. // table_a table
  41.  
  42. $tabledef = new TableDef("table_a", "Table A", false);
  43.  
  44. // (CODE REMOVED ACTUALLY DEFINING TABLE FIELDS)
  45.  
  46. $tabledefs[$tabledef->name] = $tabledef;
  47.  
  48. =====
  49.  
  50. Code from import.php:
  51.  
  52. /**
  53. * Import one table
  54. *
  55. * @param string $subdir Subdirectory data is in.
  56. * @param string $tablename Table name
  57. * @param string $qualifier Optional record qualifier, return true to include the record.
  58. * @param string $seqno File sequence number.
  59. * @param int $update_cnt Update count
  60. * @param int $insert_cnt Insert count
  61. * @param bool $display_progress Display progress messages.
  62. * @param string $lookup_sql Only process record if sql finds a related record. Must SELECT COUNT(*) as the only value.
  63. * @param int $lookup_field Field offset to do a ? substitution for in $lookup_sql.
  64. * @param int $conn SQL connection
  65. */
  66. function import_table($subdir, $tablename, $qualifier, $seqno, &$update_cnt, &$insert_cnt, $display_progress, $lookup_sql,
  67. $lookup_field, $conn)
  68. {
  69. global $tabledefs;
  70.  
  71. $tabledef = $tabledefs[$tablename];
  72.  
  73. =====
  74.  
  75. Code snippets from importtables.php:
  76.  
  77. load_table_definitions();
  78.  
  79. echo "\nStarting table_a\n";
  80. import_table("tabledata/", "table_a", '', "", $update_cnt, $insert_cnt, true, "", 0, $conn);
  81. echo "table_a imported Adds = {$insert_cnt} Updates = {$update_cnt}\n";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement