You are here

function drush_views_analyze in Views (for Drupal 7) 7.3

Same name and namespace in other branches
  1. 6.3 drush/views.drush.inc \drush_views_analyze()

Analyze all installed views.

File

drush/views.drush.inc, line 443
Drush integration for Views.

Code

function drush_views_analyze() {
  views_include('analyze');
  $messages_count = 0;
  $total = 0;
  foreach (views_get_all_views() as $view_name => $view) {
    $total++;
    if ($messages = views_analyze_view($view)) {
      drush_print($view_name);
      foreach ($messages as $message) {
        $messages_count++;
        drush_print($message['type'] . ': ' . $message['message'], 2);
      }
    }
  }
  drush_log(dt('A total of @total views were analyzed and @messages problems were found.', array(
    '@total' => $total,
    '@messages' => $messages_count,
  )), 'ok');
}