function recommender_run in Recommender API 6.2
Same name and namespace in other branches
- 7.6 recommender.module \recommender_run()
2 calls to recommender_run()
1 string reference to 'recommender_run'
File
- ./
recommender.module, line 331
Code
function recommender_run($selected = NULL) {
watchdog('recommender', "Invoking run_recommender. Might start a time-consuming process.");
// hook_run_recommender() doesn't take any args. args setting is the responsibility of caller modules.
//module_invoke_all('run_recommender');
$operations = array();
foreach (module_implements('run_recommender') as $module) {
if ($selected === NULL || in_array($module, $selected)) {
$operations[] = array(
"{$module}_run_recommender",
array(),
);
}
}
$batch = array(
'operations' => $operations,
//'finished' => 'recommender_run_finished', // post-operations, not needed.
'title' => t("Running recommender"),
'init_message' => t("The recommender engine is running. For medium to large site (users>100, nodes>1000), this could be very slow, and might cause PHP memory overload or execution timeout. Please be patient."),
'progress_message' => t("The recommender engine is running. Please be patient. Remaining @remaining out of @total"),
'error_message' => t("Running recommender encounter an internal error. If it is due to PHP out of memory, or timeout, please use Drush script instead. Otherwise, please file an issue to the http://drupal.org/project/recommender"),
);
batch_set($batch);
// FIXME: the batch mode needs to be more polished. e.g., create a summary page.
// we are settled for now.
batch_process('/admin/settings/recommender');
}