$records = []; //these are the DMRecords (CISOPTRs, POINTERS, all the same thing) $iiif_recs = []; if ($flags['--add-item']) { $total = 1; $records[0] = ['pointer' => $flags['--add-item']]; echo " Getting specific dmrecord: {$flags['--add-item']}"; } else { $start = 0; $pager = 512; # can be up to 1024, but this return size seems to be a sweet spot for contentdm/furry wrt processing speed $total = json_decode($payload, true)['pager']['total']; // get all records in this index echo " Getting all 'dmrecords': "; while ($start < $total) { $ingester->debugMessage("..", $verbose); $payload = $ingester->query($index, $pager, $start); $recs = json_decode($payload, true)['records']; foreach ($recs as $rec) { $records[] = $rec; } $start += $pager; } echo " done!\n"; // end get all dmrecords } echo "\n\n ========================================================================================\n Number of records to process: {$total}\n\n"; sleep(1); echo "Alert: need to stop? You have 5s to cancel... processing in: "; foreach (["5..", "4..", "3..", "2..", "1..", "starting!\n"] as $num) { sleep(1);