Conjunto de cambios d7a822e en sipes para cord/includes/module.inc


Ignorar:
Fecha y hora:
23/05/2016 15:48:25 (hace 8 años)
Autor:
José Gregorio Puentes <jpuentes@…>
Branches:
stable, version-3.0
Children:
6f9ddf1
Parents:
b354002
Mensaje:

se agrego el directorio del cord

Fichero:
1 editado

Leyenda

No modificado
Añadido
Eliminado
  • cord/includes/module.inc

    rb354002 rd7a822e  
    9494 */
    9595function module_rebuild_cache() {
     96  $write_database = TRUE;
     97  // If lock not acquired, return $files data without writing to database.
     98  if (!lock_acquire('module_rebuild_cache')) {
     99    $write_database = FALSE;
     100    // Wait for the parallel thread to be done so we are more likely
     101    // to get updated and consistent data.
     102    lock_wait('module_rebuild_cache');
     103  }
    96104  // Get current list of modules
    97105  $files = drupal_system_listing('\.module$', 'modules', 'name', 0);
     
    120128      continue;
    121129    }
    122     // Merge in defaults and save.
    123     $files[$filename]->info = $file->info + $defaults;
    124130
    125131    // Invoke hook_system_info_alter() to give installed modules a chance to
     
    127133    drupal_alter('system_info', $files[$filename]->info, $files[$filename]);
    128134
    129     // Log the critical hooks implemented by this module.
    130     $bootstrap = 0;
    131     foreach (bootstrap_hooks() as $hook) {
    132       if (module_hook($file->name, $hook)) {
    133         $bootstrap = 1;
    134         break;
    135       }
    136     }
    137 
    138     // Update the contents of the system table:
    139     if (isset($file->status) || (isset($file->old_filename) && $file->old_filename != $file->filename)) {
    140       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);
    141     }
    142     else {
    143       // This is a new module.
    144       $files[$filename]->status = 0;
    145       $files[$filename]->throttle = 0;
    146       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);
    147     }
     135    // Merge in defaults and save.
     136    $files[$filename]->info = $file->info + $defaults;
     137  }
     138
     139  // If lock not acquired, return $files data without writing to database.
     140  if ($write_database) {
     141    foreach ($files as $filename => $file) {
     142      // Log the critical hooks implemented by this module.
     143      $bootstrap = 0;
     144      foreach (bootstrap_hooks() as $hook) {
     145        if (module_hook($file->name, $hook)) {
     146          $bootstrap = 1;
     147          break;
     148        }
     149      }
     150
     151      // Update the contents of the system table:
     152      if (isset($file->status)) {
     153        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);
     154      }
     155      else {
     156        // This is a new module.
     157        $files[$filename]->status = 0;
     158        $files[$filename]->throttle = 0;
     159        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);
     160      }
     161    }
     162    lock_release('module_rebuild_cache');
    148163  }
    149164  $files = _module_build_dependencies($files);
Nota: Vea TracChangeset para ayuda en el uso del visor de conjuntos de cambios.