function menu_rebuild_cache

7.x menu.inc menu_rebuild_cache($bool_display_message = TRUE)
6.x menu.inc menu_rebuild_cache($bool_display_message = TRUE)
4.x menu.inc menu_rebuild_cache($bool_display_message = TRUE)
5.x menu.inc menu_rebuild_cache($bool_display_message = TRUE)

Go through all installed modules and rebuild the menu_router table, based on each module's hook_menu function.

3 calls to menu_rebuild_cache()
system_clear_cache in modules/system/system.module
Implements hook_clear_cache Take care of clearing caches managed by this module
system_display_install_finished_page in modules/system/system.module
This page is displayed to the user once FlightPath has been installed.
system_perform_clear_menu_cache in modules/system/system.module
Clears only the menu cache

File

includes/menu.inc, line 32

Code

function menu_rebuild_cache($bool_display_message = TRUE) {


  // Begin by wiping out the menu_router table
  db_query("TRUNCATE TABLE menu_router ");

  $modules = modules_implement_hook("menu");

  foreach ($modules as $module) {
    $items = call_user_func($module . "_menu");

    // Invoke hook_menu_alter() to see if we need to alter these items or not.
    invoke_hook('menu_alter', array(&$items));

    // Okay, now go through the $items array, and write the needed information
    // to the menu_router array.
    foreach ($items as $path => $item) {
      if (is_numeric($path)) {
        continue; // problem, so skip.
      }

      // Update our menu_router table.
      // Now, insert the new one.
      db_query("INSERT INTO menu_router
                  (path, access_callback, access_arguments, page_callback, page_arguments, title, description, type, weight, icon, page_settings, tab_family, tab_parent, file)
                  VALUES
                  (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
                  ", $path, @$item ["access_callback"], @serialize($item ["access_arguments"]), @$item ["page_callback"], 
      @serialize($item ['page_arguments']), @$item ['title'], @$item ['description'], @$item ['type'], @$item ['weight'], @$item ['icon'], 
      @serialize($item ['page_settings']), @$item ['tab_family'], @$item ['tab_parent'], @$item ['file']);
    }
  }

  if ($bool_display_message) {
    fp_add_message(t("The menu router has been rebuilt"));
  }

}