Projet

Général

Profil

Révision b4adf10d

Ajouté par Assos Assos il y a plus de 9 ans

Udpate to 7.33

Voir les différences:

drupal7/modules/field/field.info.class.inc
146 146

  
147 147
    // Save in "static" and persistent caches.
148 148
    $this->fieldMap = $map;
149
    cache_set('field_info:field_map', $map, 'cache_field');
149
    if (lock_acquire('field_info:field_map')) {
150
      cache_set('field_info:field_map', $map, 'cache_field');
151
      lock_release('field_info:field_map');
152
    }
150 153

  
151 154
    return $map;
152 155
  }
......
174 177
      }
175 178

  
176 179
      // Store in persistent cache.
177
      cache_set('field_info:fields', $this->fieldsById, 'cache_field');
180
      if (lock_acquire('field_info:fields')) {
181
        cache_set('field_info:fields', $this->fieldsById, 'cache_field');
182
        lock_release('field_info:fields');
183
      }
178 184
    }
179 185

  
180 186
    // Fill the name/ID map.
......
231 237
        }
232 238

  
233 239
        // Store in persistent cache.
234
        cache_set('field_info:instances', $this->bundleInstances, 'cache_field');
240
        if (lock_acquire('field_info:instances')) {
241
          cache_set('field_info:instances', $this->bundleInstances, 'cache_field');
242
          lock_release('field_info:instances');
243
        }
235 244
      }
236 245

  
237 246
      $this->loadedAllInstances = TRUE;
......
419 428
    foreach ($instances as $instance) {
420 429
      $cache['fields'][] = $this->fieldsById[$instance['field_id']];
421 430
    }
422
    cache_set("field_info:bundle:$entity_type:$bundle", $cache, 'cache_field');
431

  
432
    if (lock_acquire("field_info:bundle:$entity_type:$bundle")) {
433
      cache_set("field_info:bundle:$entity_type:$bundle", $cache, 'cache_field');
434
      lock_release("field_info:bundle:$entity_type:$bundle");
435
    }
423 436

  
424 437
    return $instances;
425 438
  }
......
460 473

  
461 474
    // Store in the 'static' and persistent caches.
462 475
    $this->bundleExtraFields[$entity_type][$bundle] = $info;
463
    cache_set("field_info:bundle_extra:$entity_type:$bundle", $info, 'cache_field');
476
    if (lock_acquire("field_info:bundle_extra:$entity_type:$bundle")) {
477
      cache_set("field_info:bundle_extra:$entity_type:$bundle", $info, 'cache_field');
478
      lock_release("field_info:bundle_extra:$entity_type:$bundle");
479
    }
464 480

  
465 481
    return $this->bundleExtraFields[$entity_type][$bundle];
466 482
  }

Formats disponibles : Unified diff