Révision 01dfd3b5
Ajouté par Assos Assos il y a plus de 3 ans
drupal7/includes/bootstrap.inc | ||
---|---|---|
8 | 8 |
/** |
9 | 9 |
* The current system version. |
10 | 10 |
*/ |
11 |
define('VERSION', '7.74');
|
|
11 |
define('VERSION', '7.77');
|
|
12 | 12 |
|
13 | 13 |
/** |
14 | 14 |
* Core API compatibility. |
... | ... | |
1189 | 1189 |
$variables = $cached->data; |
1190 | 1190 |
} |
1191 | 1191 |
else { |
1192 |
// Cache miss. Avoid a stampede. |
|
1192 |
// Cache miss. Avoid a stampede by acquiring a lock. If the lock fails to |
|
1193 |
// acquire, optionally just continue with uncached processing. |
|
1193 | 1194 |
$name = 'variable_init'; |
1194 |
if (!lock_acquire($name, 1)) { |
|
1195 |
// Another request is building the variable cache. |
|
1196 |
// Wait, then re-run this function. |
|
1195 |
$lock_acquired = lock_acquire($name, 1); |
|
1196 |
if (!$lock_acquired && variable_get('variable_initialize_wait_for_lock', FALSE)) { |
|
1197 | 1197 |
lock_wait($name); |
1198 | 1198 |
return variable_initialize($conf); |
1199 | 1199 |
} |
1200 | 1200 |
else { |
1201 |
// Proceed with variable rebuild.
|
|
1201 |
// Load the variables from the table.
|
|
1202 | 1202 |
$variables = array_map('unserialize', db_query('SELECT name, value FROM {variable}')->fetchAllKeyed()); |
1203 |
cache_set('variables', $variables, 'cache_bootstrap'); |
|
1204 |
lock_release($name); |
|
1203 |
if ($lock_acquired) { |
|
1204 |
cache_set('variables', $variables, 'cache_bootstrap'); |
|
1205 |
lock_release($name); |
|
1206 |
} |
|
1205 | 1207 |
} |
1206 | 1208 |
} |
1207 | 1209 |
|
Formats disponibles : Unified diff
Udpate to 7.77