Created
December 15, 2015 22:04
-
-
Save bnchdrff/8d4a1e71a94207a74cb0 to your computer and use it in GitHub Desktop.
summarize all views on a drupal site
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$views = [ | |
[ | |
'view machine name', | |
'view name', | |
'view desc', | |
'base table', | |
'display machine name', | |
'display title', | |
'display plugin', | |
] | |
]; | |
foreach (views_get_all_views() as $view) { | |
foreach ($view->display as $display => $data) { | |
$views[] = [ | |
// 'view machine name' | |
$view->name, | |
// 'view name' | |
$view->human_name, | |
// 'view desc' | |
$view->description, | |
// 'base table' | |
$view->base_table, | |
// 'display machine name' | |
$display, | |
// 'display title' | |
$data->display_title, | |
// 'display plugin' | |
$data->display_plugin, | |
]; | |
} | |
} | |
$fp = fopen('views-summary.csv', 'w'); | |
foreach ($views as $fields) { | |
fputcsv($fp, $fields); | |
} | |
fclose($fp); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Can you also show the initial command to display the structure of the view object...