You are here

function _linkchecker_batch_import_single_comment in Link checker 6.2

Same name and namespace in other branches
  1. 7 linkchecker.batch.inc \_linkchecker_batch_import_single_comment()

Recurring scans of a single comment via batch API.

Parameters

int $cid: The unique comment 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

The batch task definition.

1 call to _linkchecker_batch_import_single_comment()
_linkchecker_add_comment_links in ./linkchecker.module
Add comment links to database.

File

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

Code

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