You are here

function _linkchecker_batch_import_single_block_custom in Link checker 7

Recurring scans of a single block via batch API.

Parameters

int $bid: The unique block id to scan for links.

int $missing_links_count: The number of links not yet added to linkchecker_links table. By this number the re-scan rounds are calulated.

Return value

array The batch task definition.

1 call to _linkchecker_batch_import_single_block_custom()
_linkchecker_add_block_custom_links in ./linkchecker.module
Add custom block links to database.

File

./linkchecker.batch.inc, line 313
Batch API callbacks for the linkchecker module.

Code

function _linkchecker_batch_import_single_block_custom($bid, $missing_links_count) {
  $operations = array();
  for ($i = 0; $i <= $missing_links_count; $i = $i + LINKCHECKER_SCAN_MAX_LINKS_PER_RUN) {
    $operations[] = array(
      '_linkchecker_batch_single_block_custom_import_op',
      array(
        $bid,
      ),
    );
  }
  $batch = array(
    'file' => drupal_get_path('module', 'linkchecker') . '/linkchecker.batch.inc',
    'finished' => '_linkchecker_batch_single_block_custom_import_finished',
    'operations' => $operations,
    'title' => t('Scanning for links'),
    'progress_message' => t('Remaining @remaining of @total scans.'),
  );
  return $batch;
}