Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Code from constants.php:
- /**
- * TableDef class
- */
- class TableDef {
- public $name;
- public $display_name;
- public $notify_insert;
- public $fields = array();
- public $indexes = array();
- public $primary_keys = array();
- public $auto_increment = "";
- public $connection = 1;
- /**
- * Constructor
- *
- * @param string $name Name
- * @param string $display_name Display name
- * @param bool $notify_insert Notify on an Insert?
- */
- public function TableDef($name, $display_name, $notify_insert) {
- $this->name = $name;
- $this->display_name = $display_name;
- $this->notify_insert = $notify_insert;
- }
- =====
- Code from tabledef.php:
- function load_table_definitions()
- {
- global $tabledefs;
- $tabledefs = array();
- // table_a table
- $tabledef = new TableDef("table_a", "Table A", false);
- // (CODE REMOVED ACTUALLY DEFINING TABLE FIELDS)
- $tabledefs[$tabledef->name] = $tabledef;
- =====
- Code from import.php:
- /**
- * Import one table
- *
- * @param string $subdir Subdirectory data is in.
- * @param string $tablename Table name
- * @param string $qualifier Optional record qualifier, return true to include the record.
- * @param string $seqno File sequence number.
- * @param int $update_cnt Update count
- * @param int $insert_cnt Insert count
- * @param bool $display_progress Display progress messages.
- * @param string $lookup_sql Only process record if sql finds a related record. Must SELECT COUNT(*) as the only value.
- * @param int $lookup_field Field offset to do a ? substitution for in $lookup_sql.
- * @param int $conn SQL connection
- */
- function import_table($subdir, $tablename, $qualifier, $seqno, &$update_cnt, &$insert_cnt, $display_progress, $lookup_sql,
- $lookup_field, $conn)
- {
- global $tabledefs;
- $tabledef = $tabledefs[$tablename];
- =====
- Code snippets from importtables.php:
- load_table_definitions();
- echo "\nStarting table_a\n";
- import_table("tabledata/", "table_a", '', "", $update_cnt, $insert_cnt, true, "", 0, $conn);
- echo "table_a imported Adds = {$insert_cnt} Updates = {$update_cnt}\n";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement