diff --git a/core/includes/bootstrap.inc b/core/includes/bootstrap.inc index 1568f45..f33d22b 100644 --- a/core/includes/bootstrap.inc +++ b/core/includes/bootstrap.inc @@ -816,124 +816,6 @@ function settings() { } /** - * Loads the persistent variable table. - * - * The variable table is composed of values that have been saved in the table - * with variable_set() as well as those explicitly specified in the - * configuration file. - */ -function variable_initialize($conf = array()) { - // NOTE: caching the variables improves performance by 20% when serving - // cached pages. - if ($cached = cache('bootstrap')->get('variables')) { - $variables = $cached->data; - } - else { - // Cache miss. Avoid a stampede. - $name = 'variable_init'; - $lock = \Drupal::lock(); - if (!$lock->acquire($name, 1)) { - // Another request is building the variable cache. - // Wait, then re-run this function. - $lock->wait($name); - return variable_initialize($conf); - } - else { - // Proceed with variable rebuild. - $variables = array_map('unserialize', db_query('SELECT name, value FROM {variable}')->fetchAllKeyed()); - cache('bootstrap')->set('variables', $variables); - $lock->release($name); - } - } - - foreach ($conf as $name => $value) { - $variables[$name] = $value; - } - - return $variables; -} - -/** - * Returns a persistent variable. - * - * Case-sensitivity of the variable_* functions depends on the database - * collation used. To avoid problems, always use lower case for persistent - * variable names. - * - * @param $name - * The name of the variable to return. - * @param $default - * The default value to use if this variable has never been set. - * - * @return - * The value of the variable. Unserialization is taken care of as necessary. - * - * @deprecated This will be removed in Drupal 8.0. Instead, use the - * configuration API. - * - * @see \Drupal\Core\Config::get() - */ -function variable_get($name, $default = NULL) { - global $conf; - - return isset($conf[$name]) ? $conf[$name] : $default; -} - -/** - * Sets a persistent variable. - * - * Case-sensitivity of the variable_* functions depends on the database - * collation used. To avoid problems, always use lower case for persistent - * variable names. - * - * @param $name - * The name of the variable to set. - * @param $value - * The value to set. This can be any PHP data type; these functions take care - * of serialization as necessary. - * - * @deprecated This will be removed in Drupal 8.0. Instead, use the - * configuration API. - * - * @see \Drupal\Core\Config::set() - */ -function variable_set($name, $value) { - global $conf; - - db_merge('variable')->key(array('name' => $name))->fields(array('value' => serialize($value)))->execute(); - - cache('bootstrap')->delete('variables'); - - $conf[$name] = $value; -} - -/** - * Unsets a persistent variable. - * - * Case-sensitivity of the variable_* functions depends on the database - * collation used. To avoid problems, always use lower case for persistent - * variable names. - * - * @param $name - * The name of the variable to undefine. - * - * @deprecated This will be removed in Drupal 8.0. Instead, use the - * configuration API. - * - * @see \Drupal\Core\Config::clear() - */ -function variable_del($name) { - global $conf; - - db_delete('variable') - ->condition('name', $name) - ->execute(); - cache('bootstrap')->delete('variables'); - - unset($conf[$name]); -} - -/** * Gets the page cache cid for this request. * * @param \Symfony\Component\HttpFoundation\Request $request