? .directory ? drupal-307756-104-D6.patch ? drupal-307756-133-D6.patch ? includes/.directory ? modules/.directory Index: includes/module.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/module.inc,v retrieving revision 1.115.2.3 diff -u -p -r1.115.2.3 module.inc --- includes/module.inc 16 Nov 2009 17:17:35 -0000 1.115.2.3 +++ includes/module.inc 5 Jun 2010 02:35:48 -0000 @@ -120,32 +120,39 @@ function module_rebuild_cache() { unset($files[$filename]); continue; } - // Merge in defaults and save. - $files[$filename]->info = $file->info + $defaults; // Invoke hook_system_info_alter() to give installed modules a chance to // modify the data in the .info files if necessary. drupal_alter('system_info', $files[$filename]->info, $files[$filename]); - // Log the critical hooks implemented by this module. - $bootstrap = 0; - foreach (bootstrap_hooks() as $hook) { - if (module_hook($file->name, $hook)) { - $bootstrap = 1; - break; + // Merge in defaults and save. + $files[$filename]->info = $file->info + $defaults; + } + + // If lock not acquired, return $files data without writing to database. + if (lock_acquire('module_rebuild_cache')) { + foreach ($files as $filename => $file) { + // Log the critical hooks implemented by this module. + $bootstrap = 0; + foreach (bootstrap_hooks() as $hook) { + if (module_hook($file->name, $hook)) { + $bootstrap = 1; + break; + } } - } - // Update the contents of the system table: - if (isset($file->status) || (isset($file->old_filename) && $file->old_filename != $file->filename)) { - db_query("UPDATE {system} SET info = '%s', name = '%s', filename = '%s', bootstrap = %d WHERE filename = '%s'", serialize($files[$filename]->info), $file->name, $file->filename, $bootstrap, $file->old_filename); - } - else { - // This is a new module. - $files[$filename]->status = 0; - $files[$filename]->throttle = 0; - db_query("INSERT INTO {system} (name, info, type, filename, status, throttle, bootstrap) VALUES ('%s', '%s', '%s', '%s', %d, %d, %d)", $file->name, serialize($files[$filename]->info), 'module', $file->filename, 0, 0, $bootstrap); + // Update the contents of the system table: + if (isset($file->status) || (isset($file->old_filename) && $file->old_filename != $file->filename)) { + db_query("UPDATE {system} SET info = '%s', name = '%s', filename = '%s', bootstrap = %d WHERE filename = '%s'", serialize($files[$filename]->info), $file->name, $file->filename, $bootstrap, $file->old_filename); + } + else { + // This is a new module. + $files[$filename]->status = 0; + $files[$filename]->throttle = 0; + db_query("INSERT INTO {system} (name, info, type, filename, status, throttle, bootstrap) VALUES ('%s', '%s', '%s', '%s', %d, %d, %d)", $file->name, serialize($files[$filename]->info), 'module', $file->filename, 0, 0, $bootstrap); + } } + lock_release('module_rebuild_cache'); } $files = _module_build_dependencies($files); return $files; @@ -243,15 +250,15 @@ function module_load_install($module) { /** * Load a module include file. - * + * * Examples: * @code * // Load node.admin.inc from the node module. * module_load_include('inc', 'node', 'node.admin'); * // Load content_types.inc from the node module. - * module_load_include('inc', 'node', 'content_types'); + * module_load_include('inc', 'node', 'content_types'); * @endcode - * + * * Do not use this function to load an install file. Use module_load_install() * instead. * @@ -260,7 +267,7 @@ function module_load_install($module) { * @param $module * The module to which the include file belongs. * @param $name - * Optionally, specify the base file name (without the $type extension). + * Optionally, specify the base file name (without the $type extension). * If not set, $module is used. */ function module_load_include($type, $module, $name = NULL) { Index: modules/system/system.module =================================================================== RCS file: /cvs/drupal/drupal/modules/system/system.module,v retrieving revision 1.585.2.53 diff -u -p -r1.585.2.53 system.module --- modules/system/system.module 2 Jun 2010 18:58:25 -0000 1.585.2.53 +++ modules/system/system.module 5 Jun 2010 02:35:53 -0000 @@ -806,22 +806,27 @@ function system_theme_default() { * Array of all available themes and their data. */ function system_theme_data() { + // Scan the installation theme .info files and their engines. $themes = _system_theme_data(); + foreach ($themes as $key => $theme) { + if (!isset($theme->owner)) { + $themes[$key]->owner = ''; + } + } // Extract current files from database. system_get_files_database($themes, 'theme'); - db_query("DELETE FROM {system} WHERE type = 'theme'"); + // If lock not acquired, return $themes data without writing to database. + if (lock_acquire('system_theme_data')) { + db_query("DELETE FROM {system} WHERE type = 'theme'"); - foreach ($themes as $theme) { - if (!isset($theme->owner)) { - $theme->owner = ''; + foreach ($themes as $theme) { + db_query("INSERT INTO {system} (name, owner, info, type, filename, status, throttle, bootstrap) VALUES ('%s', '%s', '%s', '%s', '%s', %d, %d, %d)", $theme->name, $theme->owner, serialize($theme->info), 'theme', $theme->filename, isset($theme->status) ? $theme->status : 0, 0, 0); } - - db_query("INSERT INTO {system} (name, owner, info, type, filename, status, throttle, bootstrap) VALUES ('%s', '%s', '%s', '%s', '%s', %d, %d, %d)", $theme->name, $theme->owner, serialize($theme->info), 'theme', $theme->filename, isset($theme->status) ? $theme->status : 0, 0, 0); + lock_release('system_theme_data'); } - return $themes; }