You are here

function recommender_drush_run in Recommender API 6.2

1 string reference to 'recommender_drush_run'
recommender_drush_command in ./recommender.drush.inc
Implementation of hook_drush_command().

File

./recommender.drush.inc, line 35
RecommenderAPI drush command. To use this, please install Drush at http://drupal.org/project/drush

Code

function recommender_drush_run() {
  $command = drush_get_command();
  $modules = $command['arguments'];
  if (count($modules) == 0) {
    $modules = module_implements("run_recommender");
  }

  // TODO: test whether users input valid modules that have hook_run_recommender()
  if (count($modules) == 0) {
    drush_print("No recommender modules enabled. Exit.");
  }
  drush_print("\n\nRecommender modules to run: " . implode(', ', $modules));
  drush_print("Process might take a long time. ***Please be patient. Thanks.***\n\n");
  foreach ($modules as $module) {
    drush_print("Running {$module} at " . date(DateTime::W3C) . " ..........");
    call_user_func($module . "_run_recommender");
    drush_print("Finish running {$module} at " . date(DateTime::W3C));
  }
  drush_print("\n\nAll recommender tasks complete.");
}