You are here

function _linkchecker_batch_import_single_node in Link checker 7

Same name and namespace in other branches
  1. 6.2 includes/linkchecker.batch.inc \_linkchecker_batch_import_single_node()

Recurring scans of a single node via batch API.

Parameters

int $nid: The unique node 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_node()
_linkchecker_add_node_links in ./linkchecker.module
Add node links to database.

File

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

Code

function _linkchecker_batch_import_single_node($nid, $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_node_import_op',
      array(
        $nid,
      ),
    );
  }
  $batch = array(
    'file' => drupal_get_path('module', 'linkchecker') . '/linkchecker.batch.inc',
    'finished' => '_linkchecker_batch_single_node_import_finished',
    'operations' => $operations,
    'title' => t('Scanning for links'),
    'progress_message' => t('Remaining @remaining of @total scans.'),
  );
  return $batch;
}