$local = strtolower($argv[2]) == 'local' ? true : false; $verbose = $argv[3] == true ? true : false; if ($verbose) { echo $predb->log->info("Clearing import table"); } // Truncate to clear any old data $predb->executeTruncate(); // Import file into predb_imports $predb->executeLoadData(['fields' => '\\t\\t', 'lines' => '\\r\\n', 'local' => $local, 'path' => $dumpFile]); // Remove any titles where length <=8 if ($verbose === true) { echo $predb->log->info("Deleting any records where title <=8 from Temporary Table"); } $predb->executeDeleteShort(); // Add any groups that do not currently exist $predb->executeAddGroups(); // Fill the group_id $predb->executeUpdateGroupID(); echo $predb->log->info("Inserting records from temporary table into predb table"); $predb->executeInsert(); // Delete the dump. unlink($dumpFile); $progress = $predb->progress(settings_array($match[2] + 1, $progress), ['read' => false]); echo "Successfully imported PreDB dump {$match[2]}, " . --$total . ' dumps remaining.' . PHP_EOL; } else { echo "Ignoring: {$file['download_url']}\n"; } } else { if (nZEDb_DEBUG) { echo "^https://raw.githubusercontent.com/nZEDb/nZEDbPre_Dumps/master/dumps/{$filePattern}\$\n {$file['download_url']}\n"; }