function drush_views_analyze

3.x views.drush.inc drush_views_analyze()

File

drush/views.drush.inc, line 418
Drush integration of 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');
}