diff --git a/core/includes/ajax.inc b/core/includes/ajax.inc index 1bced4475beb98449487641d193ceacb92152c4d..ac1d4cbc869f9c9bd232c7ba03dc66ee16f85abd 100644 --- a/core/includes/ajax.inc +++ b/core/includes/ajax.inc @@ -332,7 +332,7 @@ function ajax_base_page_theme() { // to see the default theme, token validation isn't required for that, and // bypassing it allows most use-cases to work even when accessed from the // page cache. - if ($theme === config('system.theme')->get('default') || drupal_valid_token($token, $theme)) { + if ($theme === Drupal::config('system.theme')->get('default') || drupal_valid_token($token, $theme)) { return $theme; } } @@ -368,7 +368,7 @@ function ajax_prepare_response($page_callback_result) { break; case MENU_SITE_OFFLINE: - $commands[] = ajax_command_alert(filter_xss_admin(t(config('system.maintenance')->get('message'), array('@site' => config('system.site')->get('name'))))); + $commands[] = ajax_command_alert(filter_xss_admin(t(Drupal::config('system.maintenance')->get('message'), array('@site' => Drupal::config('system.site')->get('name'))))); break; } } diff --git a/core/includes/authorize.inc b/core/includes/authorize.inc index 96d77d66c74cb664359def6e373686da0e05f537..8b6ef01c3ea34afbccb2ff891cc5befe41e17bb5 100644 --- a/core/includes/authorize.inc +++ b/core/includes/authorize.inc @@ -39,7 +39,7 @@ function authorize_filetransfer_form($form, &$form_state) { if (isset($form_state['values']['connection_settings']['authorize_filetransfer_default'])) { $authorize_filetransfer_default = $form_state['values']['connection_settings']['authorize_filetransfer_default']; } - elseif ($authorize_filetransfer_default = config('system.authorize')->get('filetransfer_default')); + elseif ($authorize_filetransfer_default = Drupal::config('system.authorize')->get('filetransfer_default')); else { $authorize_filetransfer_default = key($available_backends); } @@ -138,7 +138,7 @@ function authorize_filetransfer_form($form, &$form_state) { * @see hook_filetransfer_backends() */ function _authorize_filetransfer_connection_settings($backend) { - $auth_connection_config = config('system.authorize')->get('filetransfer_connection_settings_' . $backend); + $auth_connection_config = Drupal::config('system.authorize')->get('filetransfer_connection_settings_' . $backend); $defaults = $auth_connection_config ? $auth_connection_config : array(); $form = array(); @@ -253,9 +253,9 @@ function authorize_filetransfer_form_submit($form, &$form_state) { } } // Set this one as the default authorize method. - config('system.authorize')->set('filetransfer_default', $filetransfer_backend); + Drupal::config('system.authorize')->set('filetransfer_default', $filetransfer_backend); // Save the connection settings minus the password. - config('system.authorize')->set('filetransfer_connection_settings_' . $filetransfer_backend, $connection_settings); + Drupal::config('system.authorize')->set('filetransfer_connection_settings_' . $filetransfer_backend, $connection_settings); $filetransfer = authorize_get_filetransfer($filetransfer_backend, $form_state['values']['connection_settings'][$filetransfer_backend]); diff --git a/core/includes/bootstrap.inc b/core/includes/bootstrap.inc index 086e26cadedc0292131c7525bfa14f9e7b63d668..71425e8b7323de5d15df6f076e151a8b3e8459da 100644 --- a/core/includes/bootstrap.inc +++ b/core/includes/bootstrap.inc @@ -1220,7 +1220,7 @@ function drupal_page_header() { * response is sent. */ function drupal_serve_page_from_cache(stdClass $cache, Response $response, Request $request) { - $config = config('system.performance'); + $config = Drupal::config('system.performance'); // First half: we must determine if we should be returning a 304. @@ -1878,7 +1878,7 @@ function drupal_handle_request($test_only = FALSE) { */ function drupal_get_user_timezone() { global $user; - $config = config('system.date'); + $config = Drupal::config('system.date'); if ($user && $config->get('timezone.user.configurable') && $user->isAuthenticated() && $user->getTimezone()) { return $user->getTimezone(); @@ -1975,7 +1975,7 @@ function _drupal_bootstrap_configuration() { // Load the procedural configuration system helper functions. require_once __DIR__ . '/config.inc'; - // Set the Drupal custom error handler. (requires config()) + // Set the Drupal custom error handler. (requires Drupal::config()) set_error_handler('_drupal_error_handler'); set_exception_handler('_drupal_exception_handler'); @@ -2013,7 +2013,7 @@ function _drupal_bootstrap_page_cache() { } else { drupal_bootstrap(DRUPAL_BOOTSTRAP_VARIABLES, FALSE); - $config = config('system.performance'); + $config = Drupal::config('system.performance'); $cache_enabled = $config->get('cache.page.use_internal'); } @@ -2382,7 +2382,7 @@ function language($type) { * name and its value is its configurability (TRUE/FALSE). */ function language_types_get_all() { - $types = \Drupal::config('system.language.types')->get('all'); + $types = Drupal::config('system.language.types')->get('all'); return $types ? $types : array_keys(language_types_get_default()); } @@ -2442,7 +2442,7 @@ function language_list($flags = Language::STATE_CONFIGURABLE) { // save the same object without data loss. foreach ($language_entities as $langcode_config_name) { $langcode = substr($langcode_config_name, strlen('language.entity.')); - $info = config($langcode_config_name)->get(); + $info = Drupal::config($langcode_config_name)->get(); $languages[$langcode] = new Language(array( 'default' => ($info['id'] == $default->id), 'name' => $info['label'], diff --git a/core/includes/common.inc b/core/includes/common.inc index 1931f0b326b2df1d2032bb4ef3e61b6c05cdd7ec..90b941266960894f0765220cd1c7da81787147f3 100644 --- a/core/includes/common.inc +++ b/core/includes/common.inc @@ -1860,7 +1860,7 @@ function drupal_pre_render_styles($elements) { $css_assets = $elements['#items']; // Aggregate the CSS if necessary, but only during normal site operation. - if (!defined('MAINTENANCE_MODE') && config('system.performance')->get('css.preprocess')) { + if (!defined('MAINTENANCE_MODE') && Drupal::config('system.performance')->get('css.preprocess')) { $css_assets = \Drupal::service('asset.css.collection_optimizer')->optimize($css_assets); } return \Drupal::service('asset.css.collection_renderer')->render($css_assets); @@ -1883,7 +1883,7 @@ function drupal_clear_css_cache() { */ function drupal_delete_file_if_stale($uri) { // Default stale file threshold is 30 days. - if (REQUEST_TIME - filemtime($uri) > config('system.performance')->get('stale_file_threshold')) { + if (REQUEST_TIME - filemtime($uri) > Drupal::config('system.performance')->get('stale_file_threshold')) { file_unmanaged_delete($uri); } } @@ -2487,7 +2487,7 @@ function drupal_pre_render_scripts($elements) { // Aggregate the JavaScript if necessary, but only during normal site // operation. - if (!defined('MAINTENANCE_MODE') && config('system.performance')->get('js.preprocess')) { + if (!defined('MAINTENANCE_MODE') && Drupal::config('system.performance')->get('js.preprocess')) { $js_assets = \Drupal::service('asset.js.collection_optimizer')->optimize($js_assets); } return \Drupal::service('asset.js.collection_renderer')->render($js_assets); @@ -3119,7 +3119,7 @@ function _drupal_bootstrap_code() { } // Set the allowed protocols once we have the config available. - $allowed_protocols = \Drupal::config('system.filter')->get('protocols'); + $allowed_protocols = Drupal::config('system.filter')->get('protocols'); if (!isset($allowed_protocols)) { // filter_xss_admin() is called by the installer and update.php, in which // case the configuration may not exist (yet). Provide a minimal default set diff --git a/core/includes/config.inc b/core/includes/config.inc index 9e2b6dd256b66cac36441fec189ba7d259686b50..cede3bca42aca5c3275ec9eea85cfac4424ca9b4 100644 --- a/core/includes/config.inc +++ b/core/includes/config.inc @@ -52,7 +52,7 @@ function config_uninstall_default_config($type, $name) { $storage = drupal_container()->get('config.storage'); $config_names = $storage->listAll($name . '.'); foreach ($config_names as $config_name) { - config($config_name)->delete(); + Drupal::config($config_name)->delete(); } } @@ -72,8 +72,7 @@ function config_get_storage_names_with_prefix($prefix = '') { * @code config('book.admin') @endcode will return a configuration object in * which the book module can store its administrative settings. * - * @deprecated This function has been replaced by the \Drupal::config() method. - * Use that instead. + * @deprecated as of Drupal 8.0. Use \Drupal::config() instead. * * @param string $name * The name of the configuration object to retrieve. The name corresponds to @@ -84,7 +83,7 @@ function config_get_storage_names_with_prefix($prefix = '') { * A configuration object. */ function config($name) { - return drupal_container()->get('config.factory')->get($name); + return Drupal::config($name); } /** @@ -92,7 +91,7 @@ function config($name) { * * This allows configuration objects to be created using special configuration * contexts eg. global override free or locale using a user preferred language. - * Calling this function affects all subsequent calls to config() until + * Calling this function affects all subsequent calls to Drupal::config() until * config_context_leave() is called. * * @see config_context_leave() diff --git a/core/includes/entity.api.php b/core/includes/entity.api.php index 8b97b74a3d535e5121307715c90818bc595b8ea6..05175681b252ee992f6ec351ee9573bf8ce237f1 100644 --- a/core/includes/entity.api.php +++ b/core/includes/entity.api.php @@ -108,7 +108,7 @@ function hook_entity_bundle_create($entity_type, $bundle) { */ function hook_entity_bundle_rename($entity_type, $bundle_old, $bundle_new) { // Update the settings associated with the bundle in my_module.settings. - $config = config('my_module.settings'); + $config = Drupal::config('my_module.settings'); $bundle_settings = $config->get('bundle_settings'); if (isset($bundle_settings[$entity_type][$bundle_old])) { $bundle_settings[$entity_type][$bundle_new] = $bundle_settings[$entity_type][$bundle_old]; @@ -129,7 +129,7 @@ function hook_entity_bundle_rename($entity_type, $bundle_old, $bundle_new) { */ function hook_entity_bundle_delete($entity_type, $bundle) { // Remove the settings associated with the bundle in my_module.settings. - $config = config('my_module.settings'); + $config = Drupal::config('my_module.settings'); $bundle_settings = $config->get('bundle_settings'); if (isset($bundle_settings[$entity_type][$bundle])) { unset($bundle_settings[$entity_type][$bundle]); diff --git a/core/includes/file.inc b/core/includes/file.inc index ec329e1270bd4e888c1f01bb53549a4fa9494b48..9319755bac8051eff537aff7019756b3de5a524f 100644 --- a/core/includes/file.inc +++ b/core/includes/file.inc @@ -312,7 +312,7 @@ function file_uri_target($uri) { * 'public', 'private' or any other file scheme defined as the default. */ function file_default_scheme() { - return config('system.file')->get('default_scheme'); + return Drupal::config('system.file')->get('default_scheme'); } /** @@ -514,7 +514,7 @@ function file_prepare_directory(&$directory, $options = FILE_MODIFY_PERMISSIONS) */ function file_ensure_htaccess() { file_save_htaccess('public://', FALSE); - $private_path = config('system.file')->get('path.private'); + $private_path = Drupal::config('system.file')->get('path.private'); if (!empty($private_path)) { file_save_htaccess('private://', TRUE); } @@ -801,7 +801,7 @@ function file_munge_filename($filename, $extensions, $alerts = TRUE) { $original = $filename; // Allow potentially insecure uploads for very savvy users and admin - if (!config('system.file')->get('allow_insecure_uploads')) { + if (!Drupal::config('system.file')->get('allow_insecure_uploads')) { // Remove any null bytes. See http://php.net/manual/en/security.filesystem.nullbytes.php $filename = str_replace(chr(0), '', $filename); @@ -1271,13 +1271,13 @@ function drupal_chmod($uri, $mode = NULL) { // that the octal permission numbers can be expressed as integers or strings // and will be converted correctly in both cases. if (is_dir($uri)) { - $mode = octdec(config('system.file')->get('chmod.directory')); + $mode = octdec(Drupal::config('system.file')->get('chmod.directory')); if (!$mode) { $mode = 0775; } } else { - $mode = octdec(config('system.file')->get('chmod.file')); + $mode = octdec(Drupal::config('system.file')->get('chmod.file')); if (!$mode) { $mode = 0664; } @@ -1455,7 +1455,7 @@ function drupal_mkdir($uri, $mode = NULL, $recursive = FALSE, $context = NULL) { $mode = FALSE; // During early update there's no container. if (is_object(Drupal::getContainer())) { - $mode = octdec(config('system.file')->get('chmod.directory')); + $mode = octdec(Drupal::config('system.file')->get('chmod.directory')); } if (!$mode) { $mode = 0775; @@ -1607,7 +1607,7 @@ function drupal_tempnam($directory, $prefix) { * A string containing the path to the temporary directory. */ function file_directory_temp() { - $config = config('system.file'); + $config = Drupal::config('system.file'); $temporary_directory = $config->get('path.temporary'); if (empty($temporary_directory)) { $temporary_directory = file_directory_os_temp(); diff --git a/core/includes/form.inc b/core/includes/form.inc index d63596ec268b071a7ce4949326a4d13c78a96109..c793f11338637f840be2a345e0326ff17d2087b3 100644 --- a/core/includes/form.inc +++ b/core/includes/form.inc @@ -4574,7 +4574,7 @@ function form_process_weight($element) { $element['#is_weight'] = TRUE; // If the number of options is small enough, use a select field. - $max_elements = config('system.site')->get('weight_select_max'); + $max_elements = Drupal::config('system.site')->get('weight_select_max'); if ($element['#delta'] <= $max_elements) { $element['#type'] = 'select'; for ($n = (-1 * $element['#delta']); $n <= $element['#delta']; $n++) { diff --git a/core/includes/install.core.inc b/core/includes/install.core.inc index 87893665e4a29b95fed1beeddda018c1ec166c43..8e4b66e2b1b96a2687958ea184a1591194cc2e2d 100644 --- a/core/includes/install.core.inc +++ b/core/includes/install.core.inc @@ -2442,7 +2442,7 @@ function _install_configure_form($form, &$form_state, &$install_state) { '#type' => 'select', '#title' => t('Default country'), '#empty_value' => '', - '#default_value' => config('system.date')->get('country.default'), + '#default_value' => Drupal::config('system.date')->get('country.default'), '#options' => $countries, '#description' => t('Select the default country for the site.'), '#weight' => 0, @@ -2509,13 +2509,13 @@ function install_configure_form_validate($form, &$form_state) { function install_configure_form_submit($form, &$form_state) { global $user; - config('system.site') + Drupal::config('system.site') ->set('name', $form_state['values']['site_name']) ->set('mail', $form_state['values']['site_mail']) ->set('langcode', language_default()->id) ->save(); - config('system.date') + Drupal::config('system.date') ->set('timezone.default', $form_state['values']['date_default_timezone']) ->set('country.default', $form_state['values']['site_default_country']) ->save(); @@ -2527,7 +2527,7 @@ function install_configure_form_submit($form, &$form_state) { // Add the site maintenance account's email address to the list of // addresses to be notified when updates are available, if selected. if ($form_state['values']['update_status_module'][2]) { - config('update.settings')->set('notification.emails', array($form_state['values']['account']['mail']))->save(); + Drupal::config('update.settings')->set('notification.emails', array($form_state['values']['account']['mail']))->save(); } } diff --git a/core/includes/install.inc b/core/includes/install.inc index 8acddc2358305c0778c2c40fc1a397ead1eafabb..c308a2da2673021517c046e83784cadceec458a1 100644 --- a/core/includes/install.inc +++ b/core/includes/install.inc @@ -633,7 +633,7 @@ function drupal_install_system() { // reset first in order to allow config_install_default_config() to invoke // config import callbacks. // @todo Installation profiles may override the system.module config object. - config('system.module') + Drupal::config('system.module') ->set('enabled.system', 0) ->save(); diff --git a/core/includes/language.inc b/core/includes/language.inc index a3ee24da5167e7a2f68797dbdc22efd087b332d9..44e91c1b2aec3be19d5ffd092da25ee553a5e414 100644 --- a/core/includes/language.inc +++ b/core/includes/language.inc @@ -192,7 +192,7 @@ function language_types_get_configurable() { */ function language_types_disable($types) { $configurable = language_types_get_configurable(); - config('system.language.types')->set('configurable', array_diff($configurable, $types))->save(); + Drupal::config('system.language.types')->set('configurable', array_diff($configurable, $types))->save(); } /** @@ -252,7 +252,7 @@ function language_types_set(array $configurable_language_types) { } // Store the language type configuration. - $config = config('system.language.types'); + $config = Drupal::config('system.language.types'); $config->set('configurable', array_keys(array_filter($language_types)))->save(); $config->set('all', array_keys($language_types))->save(); @@ -493,7 +493,7 @@ function language_negotiation_method_invoke($method_id, $method = NULL, $request * A valid language code on success, FALSE otherwise. */ function language_from_selected($languages) { - $langcode = (string) config('language.negotiation')->get('selected_langcode'); + $langcode = (string) Drupal::config('language.negotiation')->get('selected_langcode'); // Replace the site's default langcode by its real value. if ($langcode == 'site_default') { $langcode = language_default()->id; diff --git a/core/includes/mail.inc b/core/includes/mail.inc index c9ff601952fa481ff58b5b735850fa1a673e8b84..ce1df77170d7c07554d801c07fb0e6031d539496 100644 --- a/core/includes/mail.inc +++ b/core/includes/mail.inc @@ -119,7 +119,7 @@ * accepted at php-level, which still doesn't guarantee it to be delivered.) */ function drupal_mail($module, $key, $to, $langcode, $params = array(), $from = NULL, $send = TRUE) { - $site_config = config('system.site'); + $site_config = Drupal::config('system.site'); $site_mail = $site_config->get('mail'); if (empty($site_mail)) { $site_mail = ini_get('sendmail_from'); @@ -268,7 +268,7 @@ function drupal_mail_system($module, $key) { $id = $module . '_' . $key; - $configuration = config('system.mail')->get('interface'); + $configuration = Drupal::config('system.mail')->get('interface'); // Look for overrides for the default class, starting from the most specific // id, and falling back to the module name. diff --git a/core/includes/menu.inc b/core/includes/menu.inc index f6188cd79389cc2ecac16fb04bdc8e37b2f781bc..915f809044756316afb4e546e728e5b3c4b6dd32 100644 --- a/core/includes/menu.inc +++ b/core/includes/menu.inc @@ -1821,7 +1821,7 @@ function menu_list_system_menus() { * Returns an array of links to be rendered as the Main menu. */ function menu_main_menu() { - $config = config('menu.settings'); + $config = Drupal::config('menu.settings'); $menu_enabled = module_exists('menu'); // When menu module is not enabled, we need a hardcoded default value. $main_links_source = $menu_enabled ? $config->get('main_links') : 'main'; @@ -1832,7 +1832,7 @@ function menu_main_menu() { * Returns an array of links to be rendered as the Secondary links. */ function menu_secondary_menu() { - $config = config('menu.settings'); + $config = Drupal::config('menu.settings'); $menu_enabled = module_exists('menu'); // When menu module is not enabled, we need a hardcoded default value. $main_links_source = $menu_enabled ? $config->get('main_links') : 'main'; @@ -2376,7 +2376,7 @@ function menu_set_active_menu_names($menu_names = NULL) { $active = $menu_names; } elseif (!isset($active)) { - $config = config('system.menu'); + $config = Drupal::config('system.menu'); $active = $config->get('active_menus_default') ?: array_keys(menu_list_system_menus()); } return $active; @@ -3398,7 +3398,7 @@ function _menu_router_save($menu, $masks) { */ function _menu_site_is_offline($check_only = FALSE) { // Check if site is in maintenance mode. - if (config('system.maintenance')->get('enabled')) { + if (Drupal::config('system.maintenance')->get('enabled')) { if (user_access('access site in maintenance mode')) { // Ensure that the maintenance mode message is displayed only once // (allowing for page redirects) and specifically suppress its display on diff --git a/core/includes/module.inc b/core/includes/module.inc index cdd3ddd278cf4e7e0abd2715910d2cf3507b7ea3..1a32c09ff48c2ae064b44f4414572407ffbd1a6c 100644 --- a/core/includes/module.inc +++ b/core/includes/module.inc @@ -24,7 +24,7 @@ * @see list_themes() * * @todo There are too many layers/levels of caching involved for system_list() - * data. Consider to add a config($name, $cache = TRUE) argument to allow + * data. Consider to add a Drupal::config($name, $cache = TRUE) argument to allow * callers like system_list() to force-disable a possible configuration * storage controller cache or some other way to circumvent it/take it over. */ @@ -39,7 +39,7 @@ function system_list($type) { 'filepaths' => array(), ); // Build a list of themes. - $enabled_themes = (array) config('system.theme')->get('enabled'); + $enabled_themes = (array) Drupal::config('system.theme')->get('enabled'); // @todo Themes include all themes, including disabled/uninstalled. This // system.theme.data state will go away entirely as soon as themes have // a proper installation status. @@ -324,7 +324,7 @@ function drupal_required_modules() { */ function module_set_weight($module, $weight) { // Update the module weight in the config file that contains it. - $module_config = config('system.module'); + $module_config = Drupal::config('system.module'); if ($module_config->get("enabled.$module") !== NULL) { $module_config ->set("enabled.$module", $weight) @@ -345,7 +345,7 @@ function module_set_weight($module, $weight) { $module_handler->setModuleList($module_filenames); return; } - $disabled_config = config('system.module.disabled'); + $disabled_config = Drupal::config('system.module.disabled'); if ($disabled_config->get($module) !== NULL) { $disabled_config ->set($module, $weight) diff --git a/core/includes/path.inc b/core/includes/path.inc index 9a48f47cf36d1b7b4d06a2307f7060187da47726..ba1da88d9c5968e6a08f37a3a2d8c887cd1a5f70 100644 --- a/core/includes/path.inc +++ b/core/includes/path.inc @@ -22,7 +22,7 @@ function drupal_is_front_page() { $is_front_page = &$drupal_static_fast['is_front_page']; if (!isset($is_front_page)) { - $is_front_page = (current_path() == config('system.site')->get('page.front')); + $is_front_page = (current_path() == Drupal::config('system.site')->get('page.front')); } return $is_front_page; @@ -53,7 +53,7 @@ function drupal_match_path($path, $patterns) { $replacements = array( '|', '.*', - '\1' . preg_quote(config('system.site')->get('page.front'), '/') . '\2' + '\1' . preg_quote(Drupal::config('system.site')->get('page.front'), '/') . '\2' ); $patterns_quoted = preg_quote($patterns, '/'); $regexps[$patterns] = '/^(' . preg_replace($to_replace, $replacements, $patterns_quoted) . ')$/'; diff --git a/core/includes/theme.inc b/core/includes/theme.inc index 5296b087f3486445b1985806a91410924cfe58dd..d0161abdea1c77f583ff5a49e997626a957e0d7d 100644 --- a/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -96,7 +96,7 @@ function drupal_theme_initialize() { // Only select the user selected theme if it is available in the // list of themes that can be accessed. - $theme = !empty($user->theme) && drupal_theme_access($user->theme) ? $user->theme : config('system.theme')->get('default'); + $theme = !empty($user->theme) && drupal_theme_access($user->theme) ? $user->theme : Drupal::config('system.theme')->get('default'); // Allow modules to override the theme. Validation has already been performed // inside menu_get_custom_theme(), so we do not need to check it again here. @@ -1463,8 +1463,8 @@ function theme_settings_convert_to_config(array $theme_settings, Config $config) */ function theme_enable($theme_list) { drupal_clear_css_cache(); - $theme_config = config('system.theme'); - $disabled_themes = config('system.theme.disabled'); + $theme_config = Drupal::config('system.theme'); + $disabled_themes = Drupal::config('system.theme.disabled'); foreach ($theme_list as $key) { // Throw an exception if the theme name is too long. if (strlen($key) > DRUPAL_EXTENSION_NAME_MAX_LENGTH) { @@ -1500,7 +1500,7 @@ function theme_enable($theme_list) { */ function theme_disable($theme_list) { // Don't disable the default theme. - if ($pos = array_search(config('system.theme')->get('default'), $theme_list) !== FALSE) { + if ($pos = array_search(Drupal::config('system.theme')->get('default'), $theme_list) !== FALSE) { unset($theme_list[$pos]); if (empty($theme_list)) { return; @@ -1509,8 +1509,8 @@ function theme_disable($theme_list) { drupal_clear_css_cache(); - $theme_config = config('system.theme'); - $disabled_themes = config('system.theme.disabled'); + $theme_config = Drupal::config('system.theme'); + $disabled_themes = Drupal::config('system.theme.disabled'); foreach ($theme_list as $key) { // The value is not used; the weight is ignored for themes currently. $theme_config->clear("enabled.$key"); @@ -2551,7 +2551,7 @@ function template_preprocess_html(&$variables) { drupal_add_html_head_link(array('rel' => 'shortcut icon', 'href' => drupal_strip_dangerous_protocols($favicon), 'type' => $type)); } - $site_config = config('system.site'); + $site_config = Drupal::config('system.site'); // Construct page title. if (drupal_get_title()) { $head_title = array( @@ -2643,7 +2643,7 @@ function template_preprocess_html(&$variables) { */ function template_preprocess_page(&$variables) { $language_interface = language(Language::TYPE_INTERFACE); - $site_config = config('system.site'); + $site_config = Drupal::config('system.site'); // Move some variables to the top level for themer convenience and template cleanliness. $variables['show_messages'] = $variables['page']['#show_messages']; @@ -2840,7 +2840,7 @@ function template_preprocess_maintenance_page(&$variables) { $variables['layout'] = ($variables['layout'] == 'first') ? 'both' : 'second'; } - $site_config = config('system.site'); + $site_config = Drupal::config('system.site'); $site_name = $site_config->get('name'); $site_slogan = $site_config->get('slogan'); diff --git a/core/includes/update.inc b/core/includes/update.inc index b106258258c73b9b9bbdbed3621ea6530fbafb0a..5e8ff4e1b07a8bf9d62e0c67ed712491594a0952 100644 --- a/core/includes/update.inc +++ b/core/includes/update.inc @@ -32,7 +32,7 @@ */ function update_fix_compatibility() { foreach (array('module', 'theme') as $type) { - $config = config("system.$type"); + $config = Drupal::config("system.$type"); $save = FALSE; foreach ($config->get('enabled') as $name => $weight) { if (update_check_incompatibility($name, $type)) { @@ -334,10 +334,10 @@ function update_prepare_d8_bootstrap() { variable_set('language_default', (array) $language_default); } - $module_config = config('system.module'); - $disabled_modules = config('system.module.disabled'); - $theme_config = config('system.theme'); - $disabled_themes = config('system.theme.disabled'); + $module_config = Drupal::config('system.module'); + $disabled_modules = Drupal::config('system.module.disabled'); + $theme_config = Drupal::config('system.theme'); + $disabled_themes = Drupal::config('system.theme.disabled'); $schema_store = Drupal::keyValue('system.schema'); // Load system.module, because update_prepare_d8_bootstrap() is called in @@ -494,7 +494,7 @@ function update_prepare_d8_language() { } Drupal::state()->set('locale.translation.plurals', $plurals); Drupal::state()->set('locale.translation.javascript', $javascript); - config('language.negotiation') + Drupal::config('language.negotiation') ->set('url.prefixes', $prefixes) ->set('url.domains', $domains) ->save(); @@ -573,7 +573,7 @@ function update_prepare_d8_language() { $result = db_query('SELECT * FROM {language}'); $uuid = new Uuid(); foreach ($result as $language) { - config('language.entity.' . $language->langcode) + Drupal::config('language.entity.' . $language->langcode) ->set('id', $language->langcode) ->set('uuid', $uuid->generate()) ->set('label', $language->name) @@ -710,7 +710,7 @@ function update_fix_d8_requirements() { // views configurations. // Like any other module APIs and services, Views' services are not available // in update.php. Existing listings are migrated into configuration, using - // the limited standard tools of raw database queries and config(). + // the limited standard tools of raw database queries and Drupal::config(). module_enable(array('views')); update_variable_set('update_d8_requirements', TRUE); @@ -858,7 +858,7 @@ function update_do_one($module, $number, $dependency_map, &$context) { function update_batch($start, $redirect = NULL, $url = NULL, $batch = array(), $redirect_callback = NULL) { // During the update, bring the site offline so that schema changes do not // affect visiting users. - $maintenance_mode = config('system.maintenance')->get('enabled'); + $maintenance_mode = Drupal::config('system.maintenance')->get('enabled'); if (isset($maintenance_mode)) { $_SESSION['maintenance_mode'] = $maintenance_mode; } @@ -867,7 +867,7 @@ function update_batch($start, $redirect = NULL, $url = NULL, $batch = array(), $ // @todo This is borderline state, not config. Or a global system // "maintenance lock". if (db_table_exists('config')) { - config('system.maintenance')->set('enabled', TRUE)->save(); + Drupal::config('system.maintenance')->set('enabled', TRUE)->save(); } } @@ -941,7 +941,7 @@ function update_finished($success, $results, $operations) { if (isset($_SESSION['maintenance_mode'])) { $GLOBALS['conf']['system.maintenance']['enabled'] = FALSE; // At this point, the configuration system should exist. - config('system.maintenance')->set('enabled', FALSE)->save(); + Drupal::config('system.maintenance')->set('enabled', FALSE)->save(); unset($_SESSION['maintenance_mode']); } } @@ -1405,7 +1405,7 @@ function update_variables_to_config($config_name, array $variable_map) { // Build the new configuration object. // This potentially loads an existing configuration object, in case another // update function migrated configuration values into $config_name already. - $config = config($config_name); + $config = Drupal::config($config_name); $original_data = $config->get(); // Extract the module namespace/owner from the configuration object name. @@ -1435,7 +1435,7 @@ function update_variables_to_config($config_name, array $variable_map) { // This function migrates variables regardless of their value, including // NULL values. Any possibly required customizations need to be performed // manually, either via variable_set() before calling this function or via - // config() after calling this function. + // Drupal::config() after calling this function. if (isset($variables[$variable_name])) { $value = unserialize($variables[$variable_name]); $config->set($config_key, $value); @@ -1636,7 +1636,7 @@ function update_language_list($flags = Language::STATE_CONFIGURABLE) { // save the same object without data loss. foreach ($language_entities as $langcode_config_name) { $langcode = substr($langcode_config_name, strlen('language.entity.')); - $info = config($langcode_config_name)->get(); + $info = Drupal::config($langcode_config_name)->get(); $languages[$langcode] = new Language(array( 'default' => ($info['id'] == $default->id), 'name' => $info['label'], diff --git a/core/lib/Drupal.php b/core/lib/Drupal.php index e2996a35c48074d929afaa78ba4c9099d13235fd..6034a57a331f671f745a668541c6638f55773ed5 100644 --- a/core/lib/Drupal.php +++ b/core/lib/Drupal.php @@ -207,12 +207,12 @@ public static function lock() { * Retrieves a configuration object. * * This is the main entry point to the configuration API. Calling - * @code Drupal::config('book.admin') @endcode will return a configuration + * @code \Drupal::config('book.admin') @endcode will return a configuration * object in which the book module can store its administrative settings. * * @param string $name * The name of the configuration object to retrieve. The name corresponds to - * a configuration file. For @code config('book.admin') @endcode, the config + * a configuration file. For @code \Drupal::config('book.admin') @endcode, the config * object returned will contain the contents of book.admin configuration file. * * @return \Drupal\Core\Config\Config @@ -267,7 +267,7 @@ public static function keyValue($collection) { * that does not need deploying and does not need human editing; for example, * the last time cron was run. Data which needs to be edited by humans and * needs to be the same across development, production, etc. environments - * (for example, the system maintenance message) should use config() instead. + * (for example, the system maintenance message) should use \Drupal::config() instead. * * @return \Drupal\Core\KeyValueStore\KeyValueStoreInterface */ diff --git a/core/lib/Drupal/Core/Asset/AssetDumper.php b/core/lib/Drupal/Core/Asset/AssetDumper.php index b21beda9f6883a43698544c8bd29b6b2a8490aba..7ff85ed887d6053c7830e17c4de694140391c444 100644 --- a/core/lib/Drupal/Core/Asset/AssetDumper.php +++ b/core/lib/Drupal/Core/Asset/AssetDumper.php @@ -41,7 +41,7 @@ public function dump($data, $file_extension) { // file) in generating the file anyway. Sites on servers where rewrite rules // aren't working can set css.gzip to FALSE in order to skip // generating a file that won't be used. - if (config('system.performance')->get($file_extension . '.gzip') && extension_loaded('zlib')) { + if (\Drupal::config('system.performance')->get($file_extension . '.gzip') && extension_loaded('zlib')) { if (!file_exists($uri . '.gz') && !file_unmanaged_save_data(gzencode($data, 9, FORCE_GZIP), $uri . '.gz', FILE_EXISTS_REPLACE)) { return FALSE; } diff --git a/core/lib/Drupal/Core/Config/Context/ContextInterface.php b/core/lib/Drupal/Core/Config/Context/ContextInterface.php index 46dbcbb383f55474d9e395f2b3735dd0ad0a050a..e7e4904e20bcb7f254ea3a887230bc5bc0c4e310 100644 --- a/core/lib/Drupal/Core/Config/Context/ContextInterface.php +++ b/core/lib/Drupal/Core/Config/Context/ContextInterface.php @@ -18,7 +18,7 @@ * * @see Drupal\Core\Config\Config * @see Drupal\Core\Config\ConfigFactory - * @see config() + * @see \Drupal::config() */ interface ContextInterface { diff --git a/core/lib/Drupal/Core/Config/Entity/Query/Query.php b/core/lib/Drupal/Core/Config/Entity/Query/Query.php index c6320f3a7d627b68cb79e8a81196592eec311608..7d1a020d7b8f3fef25e1ee85f62dfc062aa635cb 100644 --- a/core/lib/Drupal/Core/Config/Entity/Query/Query.php +++ b/core/lib/Drupal/Core/Config/Entity/Query/Query.php @@ -88,7 +88,7 @@ public function execute() { $names = $this->configStorage->listAll($prefix); $configs = array(); foreach ($names as $name) { - $configs[substr($name, $prefix_length)] = config($name)->get(); + $configs[substr($name, $prefix_length)] = \Drupal::config($name)->get(); } $result = $this->condition->compile($configs); diff --git a/core/lib/Drupal/Core/Controller/ExceptionController.php b/core/lib/Drupal/Core/Controller/ExceptionController.php index fee12941a31e9b5deda80f74a4fa36108d6297f1..8515af0446ff53aa3f0c14453148e3437f98e194 100644 --- a/core/lib/Drupal/Core/Controller/ExceptionController.php +++ b/core/lib/Drupal/Core/Controller/ExceptionController.php @@ -84,7 +84,7 @@ public function on403Html(FlattenException $exception, Request $request) { $system_path = $request->attributes->get('_system_path'); watchdog('access denied', $system_path, NULL, WATCHDOG_WARNING); - $path = $this->container->get('path.alias_manager')->getSystemPath(config('system.site')->get('page.403')); + $path = $this->container->get('path.alias_manager')->getSystemPath(\Drupal::config('system.site')->get('page.403')); if ($path && $path != $system_path) { // Keep old path for reference, and to allow forms to redirect to it. if (!isset($_GET['destination'])) { @@ -139,7 +139,7 @@ public function on404Html(FlattenException $exception, Request $request) { watchdog('page not found', check_plain($request->attributes->get('_system_path')), NULL, WATCHDOG_WARNING); // Check for and return a fast 404 page if configured. - $config = config('system.performance'); + $config = \Drupal::config('system.performance'); $exclude_paths = $config->get('fast_404.exclude_paths'); if ($config->get('fast_404.enabled') && $exclude_paths && !preg_match($exclude_paths, $request->getPathInfo())) { @@ -158,7 +158,7 @@ public function on404Html(FlattenException $exception, Request $request) { $_GET['destination'] = $system_path; } - $path = $this->container->get('path.alias_manager')->getSystemPath(config('system.site')->get('page.404')); + $path = $this->container->get('path.alias_manager')->getSystemPath(\Drupal::config('system.site')->get('page.404')); if ($path && $path != $system_path) { // @todo Um, how do I specify an override URL again? Totally not clear. Do // that and sub-call the kernel rather than using meah(). diff --git a/core/lib/Drupal/Core/Datetime/DrupalDateTime.php b/core/lib/Drupal/Core/Datetime/DrupalDateTime.php index 18545b4ff7263e5811116dd3d1c6d82212e03e51..de6c0f8c5a119416f387b1a80a800585688b7953 100644 --- a/core/lib/Drupal/Core/Datetime/DrupalDateTime.php +++ b/core/lib/Drupal/Core/Datetime/DrupalDateTime.php @@ -57,7 +57,7 @@ public function __construct($time = 'now', $timezone = NULL, $settings = array() } if (!isset($settings['country'])) { - $settings['country'] = config('system.date')->get('country.default'); + $settings['country'] = \Drupal::config('system.date')->get('country.default'); } // Instantiate the parent class. diff --git a/core/lib/Drupal/Core/EventSubscriber/FinishResponseSubscriber.php b/core/lib/Drupal/Core/EventSubscriber/FinishResponseSubscriber.php index 0c7307ee494d953aa189e5ca0da0e213887c8b34..112644f560335f5814d0223eb63ab9d4aa193c84 100644 --- a/core/lib/Drupal/Core/EventSubscriber/FinishResponseSubscriber.php +++ b/core/lib/Drupal/Core/EventSubscriber/FinishResponseSubscriber.php @@ -100,7 +100,7 @@ public function onRespond(FilterResponseEvent $event) { $response->headers->set($name, $value, FALSE); } - $max_age = config('system.performance')->get('cache.page.max_age'); + $max_age = \Drupal::config('system.performance')->get('cache.page.max_age'); if ($max_age > 0 && ($cache = drupal_page_set_cache($response, $request))) { drupal_serve_page_from_cache($cache, $response, $request); } diff --git a/core/lib/Drupal/Core/EventSubscriber/MaintenanceModeSubscriber.php b/core/lib/Drupal/Core/EventSubscriber/MaintenanceModeSubscriber.php index c4d2f7494be7665946fac8f417a7ebbc87c13e5e..39aad117d0d8d0626a59507f3a40e33267ee7d2b 100644 --- a/core/lib/Drupal/Core/EventSubscriber/MaintenanceModeSubscriber.php +++ b/core/lib/Drupal/Core/EventSubscriber/MaintenanceModeSubscriber.php @@ -48,7 +48,7 @@ public function onKernelRequestMaintenance(GetResponseEvent $event) { $maintenance_page = array( '#theme' => 'maintenance_page', '#content' => filter_xss_admin( - t(config('system.maintenance')->get('message'), array('@site' => config('system.site')->get('name'))) + t(\Drupal::config('system.maintenance')->get('message'), array('@site' => \Drupal::config('system.site')->get('name'))) ), ); $content = drupal_render($maintenance_page); diff --git a/core/lib/Drupal/Core/Executable/ExecutablePluginBase.php b/core/lib/Drupal/Core/Executable/ExecutablePluginBase.php index 4cd50ddccc885cff7a93b8d716b57f52d8e539ce..36b11c4cfa9778791f8a60e8108c78bf942242be 100644 --- a/core/lib/Drupal/Core/Executable/ExecutablePluginBase.php +++ b/core/lib/Drupal/Core/Executable/ExecutablePluginBase.php @@ -88,7 +88,7 @@ public function getConfig() { * * @todo This doesn't belong here. Move this into a new base class in * http://drupal.org/node/1764380. - * @todo This does not set a value in config(), so the name is confusing. + * @todo This does not set a value in \Drupal::config(), so the name is confusing. * * @return \Drupal\Core\Executable\ExecutablePluginBase. * The executable object for chaining. diff --git a/core/lib/Drupal/Core/Extension/ModuleHandler.php b/core/lib/Drupal/Core/Extension/ModuleHandler.php index a2ffc367cffb59cb917a79ff19092a421f76cb3d..b9e57247e05cea22e8fc2bb81fcd8b9ee6f63290 100644 --- a/core/lib/Drupal/Core/Extension/ModuleHandler.php +++ b/core/lib/Drupal/Core/Extension/ModuleHandler.php @@ -555,8 +555,8 @@ public function enable($module_list, $enable_dependencies = TRUE) { $modules_installed = array(); $modules_enabled = array(); - $module_config = config('system.module'); - $disabled_config = config('system.module.disabled'); + $module_config = \Drupal::config('system.module'); + $disabled_config = \Drupal::config('system.module.disabled'); foreach ($module_list as $module) { // Only process modules that are not already enabled. // A module is only enabled if it is configured as enabled. Custom or @@ -720,8 +720,8 @@ function disable($module_list, $disable_dependents = TRUE) { $invoke_modules = array(); - $module_config = config('system.module'); - $disabled_config = config('system.module.disabled'); + $module_config = \Drupal::config('system.module'); + $disabled_config = \Drupal::config('system.module.disabled'); foreach ($module_list as $module) { // Only process modules that are enabled. // A module is only enabled if it is configured as enabled. Custom or @@ -811,7 +811,7 @@ public function uninstall($module_list = array(), $uninstall_dependents = TRUE) } $schema_store = \Drupal::keyValue('system.schema'); - $disabled_config = config('system.module.disabled'); + $disabled_config = \Drupal::config('system.module.disabled'); foreach ($module_list as $module) { // Uninstall the module. module_load_install($module); diff --git a/core/lib/Drupal/Core/Extension/UpdateModuleHandler.php b/core/lib/Drupal/Core/Extension/UpdateModuleHandler.php index 0e5a57b50dbcfe2383e9f5f2b7b9ebef2fcc80c4..78553d95a5d019fcf7eb814e8b423b63821776cf 100644 --- a/core/lib/Drupal/Core/Extension/UpdateModuleHandler.php +++ b/core/lib/Drupal/Core/Extension/UpdateModuleHandler.php @@ -75,13 +75,13 @@ public function enable($module_list, $enable_dependencies = TRUE) { } } // Enable the module with a weight of 0. - $module_config = config('system.module'); + $module_config = \Drupal::config('system.module'); $module_config ->set("enabled.$module", 0) ->set('enabled', module_config_sort($module_config->get('enabled'))) ->save(); // Ensure the module is not contained in disabled modules. - config('system.module.disabled') + \Drupal::config('system.module.disabled') ->clear($module) ->save(); diff --git a/core/lib/Drupal/Core/StreamWrapper/PrivateStream.php b/core/lib/Drupal/Core/StreamWrapper/PrivateStream.php index 833580fd20c9d636bca5aad35af9962615dd6452..39b3f28d97f81d4f8373e3900eb21f8b40dfb2bb 100644 --- a/core/lib/Drupal/Core/StreamWrapper/PrivateStream.php +++ b/core/lib/Drupal/Core/StreamWrapper/PrivateStream.php @@ -19,7 +19,7 @@ class PrivateStream extends LocalStream { * Implements Drupal\Core\StreamWrapper\LocalStream::getDirectoryPath() */ public function getDirectoryPath() { - return config('system.file')->get('path.private'); + return \Drupal::config('system.file')->get('path.private'); } /** diff --git a/core/lib/Drupal/Core/SystemListingInfo.php b/core/lib/Drupal/Core/SystemListingInfo.php index 989b0f2b133ac11baaa4b732d8d8dd39d5589149..3c34a5ec5d430b561d9d275ef8c772b253c645bb 100644 --- a/core/lib/Drupal/Core/SystemListingInfo.php +++ b/core/lib/Drupal/Core/SystemListingInfo.php @@ -29,7 +29,7 @@ protected function profiles($directory) { // distribution we need to include the profile of the parent site (in // which test runs are triggered). if (drupal_valid_test_ua() && !drupal_installation_attempted()) { - $testing_profile = config('simpletest.settings')->get('parent_profile'); + $testing_profile = \Drupal::config('simpletest.settings')->get('parent_profile'); if ($testing_profile && $testing_profile != $profile) { $searchdir[] = drupal_get_path('profile', $testing_profile) . '/' . $directory; } diff --git a/core/modules/aggregator/aggregator.module b/core/modules/aggregator/aggregator.module index 416571d08ef84717a7994856578d33d08456ea4e..b52abd8a80a8a0f62ce27dc1f92fe8554329875c 100644 --- a/core/modules/aggregator/aggregator.module +++ b/core/modules/aggregator/aggregator.module @@ -360,7 +360,7 @@ function aggregator_refresh(Feed $feed) { // Store feed URL to track changes. $feed_url = $feed->url->value; - $config = config('aggregator.settings'); + $config = Drupal::config('aggregator.settings'); // Fetch the feed. $fetcher_manager = Drupal::service('plugin.manager.aggregator.fetcher'); try { @@ -492,7 +492,7 @@ function theme_aggregator_block_item($variables) { * The filtered content. */ function aggregator_filter_xss($value) { - return filter_xss($value, preg_split('/\s+|<|>/', config('aggregator.settings')->get('items.allowed_html'), -1, PREG_SPLIT_NO_EMPTY)); + return filter_xss($value, preg_split('/\s+|<|>/', Drupal::config('aggregator.settings')->get('items.allowed_html'), -1, PREG_SPLIT_NO_EMPTY)); } /** diff --git a/core/modules/aggregator/aggregator.pages.inc b/core/modules/aggregator/aggregator.pages.inc index 0fa2bd84ea5d32639cae1be2b1e90a25db3740be..6579703d1a8810ea296522b9ac4662c3fce8d8fd 100644 --- a/core/modules/aggregator/aggregator.pages.inc +++ b/core/modules/aggregator/aggregator.pages.inc @@ -59,7 +59,7 @@ function aggregator_page_source_form($form, $form_state, $feed) { * @ingroup forms */ function aggregator_page_category($category) { - drupal_add_feed('aggregator/rss/' . $category->cid, config('system.site')->get('name') . ' ' . t('aggregator - @title', array('@title' => $category->title))); + drupal_add_feed('aggregator/rss/' . $category->cid, Drupal::config('system.site')->get('name') . ' ' . t('aggregator - @title', array('@title' => $category->title))); // It is safe to include the cid in the query because it's loaded from the // database by aggregator_category_load(). @@ -206,7 +206,7 @@ function aggregator_categorize_items($items, $feed_source = '') { $done = TRUE; $form['items'][$iid]['item'] = $form_items[$iid]; $form['items'][$iid]['categories'] = array( - '#type' => config('aggregator.settings')->get('source.category_selector'), + '#type' => Drupal::config('aggregator.settings')->get('source.category_selector'), '#default_value' => $selected, '#options' => $categories, '#size' => 10, @@ -349,7 +349,7 @@ function theme_aggregator_page_opml($variables) { $output = "\n"; $output .= "\n"; $output .= "\n"; - $output .= '' . check_plain(config('system.site')->get('name')) . "\n"; + $output .= '' . check_plain(Drupal::config('system.site')->get('name')) . "\n"; $output .= '' . gmdate(DATE_RFC2822, REQUEST_TIME) . "\n"; $output .= "\n"; $output .= "\n"; diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Plugin/Core/Entity/Feed.php b/core/modules/aggregator/lib/Drupal/aggregator/Plugin/Core/Entity/Feed.php index 73c015d84a5181ceab15fbba6f5628f9084e79a4..bf2ecc3ba11b493ecfc44054073db20707b24129 100644 --- a/core/modules/aggregator/lib/Drupal/aggregator/Plugin/Core/Entity/Feed.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/Plugin/Core/Entity/Feed.php @@ -230,7 +230,7 @@ public static function postDelete(EntityStorageControllerInterface $storage_cont // Make sure there is no active block for this feed. $block_configs = config_get_storage_names_with_prefix('plugin.core.block'); foreach ($block_configs as $config_id) { - $config = config($config_id); + $config = \Drupal::config($config_id); if ($config->get('id') == 'aggregator_feed_block:' . $entity->id()) { $config->delete(); } diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Plugin/aggregator/processor/DefaultProcessor.php b/core/modules/aggregator/lib/Drupal/aggregator/Plugin/aggregator/processor/DefaultProcessor.php index 8373fa918e08bf8012a9e1f3398b7c0be1fb7088..9085fc193d52b6cc1345f9e302fc19315125b744 100644 --- a/core/modules/aggregator/lib/Drupal/aggregator/Plugin/aggregator/processor/DefaultProcessor.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/Plugin/aggregator/processor/DefaultProcessor.php @@ -31,7 +31,7 @@ class DefaultProcessor extends PluginBase implements ProcessorInterface { * Implements \Drupal\aggregator\Plugin\ProcessorInterface::settingsForm(). */ public function settingsForm(array $form, array &$form_state) { - $config = config('aggregator.settings'); + $config = \Drupal::config('aggregator.settings'); $processors = $config->get('processors'); $info = $this->getPluginDefinition(); $items = drupal_map_assoc(array(3, 5, 10, 15, 20, 25), array($this, 'formatItems')); @@ -87,7 +87,7 @@ public function settingsForm(array $form, array &$form_state) { * Implements \Drupal\aggregator\Plugin\ProcessorInterface::settingsSubmit(). */ public function settingsSubmit(array $form, array &$form_state) { - $config = config('aggregator.settings'); + $config = \Drupal::config('aggregator.settings'); $config->set('items.expire', $form_state['values']['aggregator_clear']) ->set('items.teaser_length', $form_state['values']['aggregator_teaser_length']) ->set('source.list_max', $form_state['values']['aggregator_summary_items']) @@ -164,7 +164,7 @@ public function remove(Feed $feed) { * Expires items from a feed depending on expiration settings. */ public function postProcess(Feed $feed) { - $aggregator_clear = config('aggregator.settings')->get('items.expire'); + $aggregator_clear = \Drupal::config('aggregator.settings')->get('items.expire'); if ($aggregator_clear != AGGREGATOR_CLEAR_NEVER) { // Remove all items that are older than flush item timer. diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Tests/AggregatorTestBase.php b/core/modules/aggregator/lib/Drupal/aggregator/Tests/AggregatorTestBase.php index 6450975f3f8668beff7dff1f213ea18153d9422d..ae2d1984ec50ddf4ba650a5477c7c5fd25da911c 100644 --- a/core/modules/aggregator/lib/Drupal/aggregator/Tests/AggregatorTestBase.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/Tests/AggregatorTestBase.php @@ -137,7 +137,7 @@ function getFeedEditObject($feed_url = NULL, array $values = array()) { */ function getDefaultFeedItemCount() { // Our tests are based off of rss.xml, so let's find out how many elements should be related. - $feed_count = db_query_range('SELECT COUNT(DISTINCT nid) FROM {node_field_data} n WHERE n.promote = 1 AND n.status = 1', 0, config('system.rss')->get('items.limit'))->fetchField(); + $feed_count = db_query_range('SELECT COUNT(DISTINCT nid) FROM {node_field_data} n WHERE n.promote = 1 AND n.status = 1', 0, \Drupal::config('system.rss')->get('items.limit'))->fetchField(); return $feed_count > 10 ? 10 : $feed_count; } @@ -370,7 +370,7 @@ function createSampleNodes($count = 5) { * Enable the plugins coming with aggregator_test module. */ function enableTestPlugins() { - config('aggregator.settings') + \Drupal::config('aggregator.settings') ->set('fetcher', 'aggregator_test_fetcher') ->set('parser', 'aggregator_test_parser') ->set('processors', array( diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Tests/FeedParserTest.php b/core/modules/aggregator/lib/Drupal/aggregator/Tests/FeedParserTest.php index bdbe11fcc49e4ca8ea0bf430738ed7e4601cd695..0b36708e4a415a0346a174490d161a91d517b04f 100644 --- a/core/modules/aggregator/lib/Drupal/aggregator/Tests/FeedParserTest.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/Tests/FeedParserTest.php @@ -26,7 +26,7 @@ function setUp() { // Do not remove old aggregator items during these tests, since our sample // feeds have hardcoded dates in them (which may be expired when this test // is run). - config('aggregator.settings')->set('items.expire', AGGREGATOR_CLEAR_NEVER)->save(); + \Drupal::config('aggregator.settings')->set('items.expire', AGGREGATOR_CLEAR_NEVER)->save(); // Reset any reader cache between tests. Reader::reset(); // Set our bridge extension manager to Zend Feed. diff --git a/core/modules/aggregator/tests/modules/aggregator_test/lib/Drupal/aggregator_test/Plugin/aggregator/processor/TestProcessor.php b/core/modules/aggregator/tests/modules/aggregator_test/lib/Drupal/aggregator_test/Plugin/aggregator/processor/TestProcessor.php index d08a2721e8258fc9867a6c2f867a0d7b8f6dea98..85738b8220ebcd80c31ce9b4445c07cac15154e6 100644 --- a/core/modules/aggregator/tests/modules/aggregator_test/lib/Drupal/aggregator_test/Plugin/aggregator/processor/TestProcessor.php +++ b/core/modules/aggregator/tests/modules/aggregator_test/lib/Drupal/aggregator_test/Plugin/aggregator/processor/TestProcessor.php @@ -30,7 +30,7 @@ class TestProcessor extends PluginBase implements ProcessorInterface { * Implements \Drupal\aggregator\Plugin\ProcessorInterface::settingsForm(). */ public function settingsForm(array $form, array &$form_state) { - $config = config('aggregator.settings'); + $config = \Drupal::config('aggregator.settings'); $processors = $config->get('processors'); $info = $this->getPluginDefinition(); @@ -46,7 +46,7 @@ public function settingsForm(array $form, array &$form_state) { '#type' => 'number', '#min' => 1, '#max' => 1000, - '#default_value' => config('aggregator_test.settings')->get('items.dummy_length'), + '#default_value' => \Drupal::config('aggregator_test.settings')->get('items.dummy_length'), ); return $form; } @@ -55,7 +55,7 @@ public function settingsForm(array $form, array &$form_state) { * Implements \Drupal\aggregator\Plugin\ProcessorInterface::settingsSubmit(). */ public function settingsSubmit(array $form, array &$form_state) { - config('aggregator_test.settings') + \Drupal::config('aggregator_test.settings') ->set('items.dummy_length', $form_state['values']['dummy_length']) ->save(); } diff --git a/core/modules/block/block.module b/core/modules/block/block.module index b78729ffa0d068b66b6c91cb59d3e72581555652..db3a82a73681961007ebc80da602bd0928b36857 100644 --- a/core/modules/block/block.module +++ b/core/modules/block/block.module @@ -61,7 +61,7 @@ function block_help($path, $arg) { $output .= '
' . t('Blocks can be configured to be visible only on certain pages, only to users of certain roles, or only on pages displaying certain content types. Some dynamic blocks, such as those generated by modules, will be displayed only on certain pages.', array('@content-type' => url('admin/structure/types'), '@user' => url('user'))) . '
'; if (module_exists('custom_block')) { $output .= '
' . t('Creating custom blocks') . '
'; - $output .= '
' . t('Users with the Administer blocks permission can add custom blocks, which are then listed on the Blocks administration page. Once created, custom blocks behave just like default and module-generated blocks.', array('@blocks' => url('admin/structure/block'), '@block-add' => url('admin/structure/block/list/' . config('system.theme')->get('default') . '/add/custom_blocks'))) . '
'; + $output .= '
' . t('Users with the Administer blocks permission can add custom blocks, which are then listed on the Blocks administration page. Once created, custom blocks behave just like default and module-generated blocks.', array('@blocks' => url('admin/structure/block'), '@block-add' => url('admin/structure/block/list/' . Drupal::config('system.theme')->get('default') . '/add/custom_blocks'))) . '
'; } $output .= ''; return $output; @@ -71,7 +71,7 @@ function block_help($path, $arg) { $demo_theme = $arg[4]; } else { - $demo_theme = config('system.theme')->get('default'); + $demo_theme = Drupal::config('system.theme')->get('default'); } $themes = list_themes(); $output = '

' . t('This page provides a drag-and-drop interface for assigning a block to a region, and for controlling the order of blocks within regions. Since not all themes implement the same regions, or display regions in the same way, blocks are positioned on a per-theme basis. Remember that your changes will not be saved until you click the Save blocks button at the bottom of the page. Click the configure link next to each block to configure its specific title and visibility settings.') . '

'; @@ -109,7 +109,7 @@ function block_permission() { * @todo Clarify the documentation for the per-plugin block admin links. */ function block_menu() { - $default_theme = config('system.theme')->get('default'); + $default_theme = Drupal::config('system.theme')->get('default'); $items['admin/structure/block'] = array( 'title' => 'Blocks', 'description' => 'Configure what block content appears in your site\'s sidebars and other regions.', @@ -248,7 +248,7 @@ function block_page_build(&$page) { $page['page_top']['backlink'] = array( '#type' => 'link', '#title' => t('Exit block region demonstration'), - '#href' => 'admin/structure/block' . (config('system.theme')->get('default') == $theme ? '' : '/list/' . $theme), + '#href' => 'admin/structure/block' . (Drupal::config('system.theme')->get('default') == $theme ? '' : '/list/' . $theme), // Add the "overlay-restore" class to indicate this link should restore // the context in which the region demonstration page was opened. '#options' => array('attributes' => array('class' => array('block-demo-backlink', 'overlay-restore'))), @@ -348,7 +348,7 @@ function _block_get_renderable_region($list = array()) { * Blocks currently exported by modules. */ function _block_rehash($theme = NULL) { - $theme = $theme ? $theme : config('system.theme')->get('default'); + $theme = $theme ? $theme : Drupal::config('system.theme')->get('default'); $regions = system_region_list($theme); $blocks = entity_load_multiple_by_properties('block', array('theme' => $theme)); foreach ($blocks as $block_id => $block) { @@ -397,7 +397,7 @@ function block_theme_initialize($theme) { // Initialize theme's blocks if none already registered. $has_blocks = entity_load_multiple_by_properties('block', array('theme' => $theme)); if (!$has_blocks) { - $default_theme = config('system.theme')->get('default'); + $default_theme = Drupal::config('system.theme')->get('default'); // Apply only to new theme's visible regions. $regions = system_region_list($theme, REGIONS_VISIBLE); $default_theme_blocks = entity_load_multiple_by_properties('block', array('theme' => $default_theme)); diff --git a/core/modules/block/custom_block/custom_block.module b/core/modules/block/custom_block/custom_block.module index 318796dcf0e54f34d47209cd57476f03ae2df5c0..e7d96f444570bf46906f83908793412a25959ad6 100644 --- a/core/modules/block/custom_block/custom_block.module +++ b/core/modules/block/custom_block/custom_block.module @@ -188,7 +188,7 @@ function custom_block_entity_info_alter(&$types) { function custom_block_entity_bundle_info() { $bundles = array(); foreach (config_get_storage_names_with_prefix('custom_block.type.') as $config_name) { - $config = config($config_name); + $config = Drupal::config($config_name); $bundles['custom_block'][$config->get('id')]['label'] = $config->get('label'); } return $bundles; diff --git a/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockFormController.php b/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockFormController.php index 20d748dc7adac77b41674850222999e41065df88..eb58dd6737dc55140d87de0cf2bdfa14d4921d08 100644 --- a/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockFormController.php +++ b/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockFormController.php @@ -187,7 +187,7 @@ public function save(array $form, array &$form_state) { $form_state['redirect'] = 'admin/structure/block/add/custom_block:' . $block->uuid->value . '/' . $theme; } else { - $form_state['redirect'] = 'admin/structure/block/add/custom_block:' . $block->uuid->value . '/' . config('system.theme')->get('default'); + $form_state['redirect'] = 'admin/structure/block/add/custom_block:' . $block->uuid->value . '/' . \Drupal::config('system.theme')->get('default'); } } else { diff --git a/core/modules/block/lib/Drupal/block/BlockPluginInterface.php b/core/modules/block/lib/Drupal/block/BlockPluginInterface.php index 5f353a4a3dece62c6ca3e07350813d924a9808c8..d94d9348f8f85bebf764a5e628c193b032243349 100644 --- a/core/modules/block/lib/Drupal/block/BlockPluginInterface.php +++ b/core/modules/block/lib/Drupal/block/BlockPluginInterface.php @@ -66,7 +66,7 @@ public function build(); * * @todo This doesn't belong here. Move this into a new base class in * http://drupal.org/node/1764380. - * @todo This does not set a value in config(), so the name is confusing. + * @todo This does not set a value in \Drupal::config(), so the name is confusing. * * @see \Drupal\Component\Plugin\PluginBase::$configuration */ diff --git a/core/modules/block/lib/Drupal/block/Tests/BlockHiddenRegionTest.php b/core/modules/block/lib/Drupal/block/Tests/BlockHiddenRegionTest.php index 710c53f1d6036f2925a6fa8b8d2e4a8f9a475822..208710e72f00ed294348eb6f0909654b429b8152 100644 --- a/core/modules/block/lib/Drupal/block/Tests/BlockHiddenRegionTest.php +++ b/core/modules/block/lib/Drupal/block/Tests/BlockHiddenRegionTest.php @@ -61,7 +61,7 @@ public function testBlockNotInHiddenRegion() { // Enable "block_test_theme" and set it as the default theme. $theme = 'block_test_theme'; theme_enable(array($theme)); - config('system.theme') + \Drupal::config('system.theme') ->set('default', $theme) ->save(); \Drupal::service('router.builder')->rebuild(); diff --git a/core/modules/block/lib/Drupal/block/Tests/BlockLanguageTest.php b/core/modules/block/lib/Drupal/block/Tests/BlockLanguageTest.php index 69d5ccd545f9c62e72dd4c33ed3803ae3ce6a9a2..a07882164e593a966302ab05603bdc031bad74a0 100644 --- a/core/modules/block/lib/Drupal/block/Tests/BlockLanguageTest.php +++ b/core/modules/block/lib/Drupal/block/Tests/BlockLanguageTest.php @@ -54,7 +54,7 @@ function setUp() { */ public function testLanguageBlockVisibility() { // Check if the visibility setting is available. - $default_theme = config('system.theme')->get('default'); + $default_theme = \Drupal::config('system.theme')->get('default'); $this->drupalGet('admin/structure/block/add/system_powered_by_block' . '/' . $default_theme); $this->assertField('visibility[language][langcodes][en]', 'Language visibility field is visible.'); diff --git a/core/modules/block/lib/Drupal/block/Tests/BlockStorageUnitTest.php b/core/modules/block/lib/Drupal/block/Tests/BlockStorageUnitTest.php index 41b5f4d1ed2387435d59e1fec67e79c3bd385926..d787a3d48f30f8408f436a5287c0c83e7844693a 100644 --- a/core/modules/block/lib/Drupal/block/Tests/BlockStorageUnitTest.php +++ b/core/modules/block/lib/Drupal/block/Tests/BlockStorageUnitTest.php @@ -88,7 +88,7 @@ protected function createTests() { $this->assertTrue($entity instanceof Block, 'The newly created entity is a Block.'); // Verify all of the block properties. - $actual_properties = config('block.block.stark.test_block')->get(); + $actual_properties = \Drupal::config('block.block.stark.test_block')->get(); $this->assertTrue(!empty($actual_properties['uuid']), 'The block UUID is set.'); unset($actual_properties['uuid']); diff --git a/core/modules/block/lib/Drupal/block/Tests/BlockTemplateSuggestionsUnitTest.php b/core/modules/block/lib/Drupal/block/Tests/BlockTemplateSuggestionsUnitTest.php index 3042b5b71485f8bc3468cca553a1abfefb47254e..9c2966f05d441b7fb619b96f74e3765b6e0a5890 100644 --- a/core/modules/block/lib/Drupal/block/Tests/BlockTemplateSuggestionsUnitTest.php +++ b/core/modules/block/lib/Drupal/block/Tests/BlockTemplateSuggestionsUnitTest.php @@ -40,7 +40,7 @@ function testBlockThemeHookSuggestions() { $block = entity_create('block', array( 'plugin' => 'system_menu_block:menu-admin', 'region' => 'footer', - 'id' => config('system.theme')->get('default') . '.machinename', + 'id' => \Drupal::config('system.theme')->get('default') . '.machinename', )); $variables = array(); diff --git a/core/modules/block/lib/Drupal/block/Tests/BlockTest.php b/core/modules/block/lib/Drupal/block/Tests/BlockTest.php index c766053042e9c170ba862874a2c29a4224ca6d9c..9ed99f1aeb60b2d25af6adcd5906a90f5805e27d 100644 --- a/core/modules/block/lib/Drupal/block/Tests/BlockTest.php +++ b/core/modules/block/lib/Drupal/block/Tests/BlockTest.php @@ -30,7 +30,7 @@ function testBlockVisibility() { // Create a random title for the block. $title = $this->randomName(8); // Enable a standard block. - $default_theme = config('system.theme')->get('default'); + $default_theme = \Drupal::config('system.theme')->get('default'); $edit = array( 'machine_name' => strtolower($this->randomName(8)), 'region' => 'sidebar_first', @@ -71,7 +71,7 @@ function testBlockVisibilityListedEmpty() { // Create a random title for the block. $title = $this->randomName(8); // Enable a standard block. - $default_theme = config('system.theme')->get('default'); + $default_theme = \Drupal::config('system.theme')->get('default'); $edit = array( 'machine_name' => strtolower($this->randomName(8)), 'region' => 'sidebar_first', @@ -104,7 +104,7 @@ function testBlock() { $block['id'] = 'system_powered_by_block'; $block['settings[label]'] = $this->randomName(8); $block['machine_name'] = strtolower($this->randomName(8)); - $block['theme'] = config('system.theme')->get('default'); + $block['theme'] = \Drupal::config('system.theme')->get('default'); $block['region'] = 'header'; // Set block title to confirm that interface works and override any custom titles. @@ -182,7 +182,7 @@ function testHideBlockTitle() { */ function moveBlockToRegion(array $block, $region) { // Set the created block to a specific region. - $block += array('theme' => config('system.theme')->get('default')); + $block += array('theme' => \Drupal::config('system.theme')->get('default')); $edit = array(); $edit['blocks[' . $block['theme'] . '.' . $block['machine_name'] . '][region]'] = $region; $this->drupalPost('admin/structure/block', $edit, t('Save blocks')); @@ -216,7 +216,7 @@ function testBlockRehash() { $block = array(); $block['id'] = 'test_cache'; $block['machine_name'] = strtolower($this->randomName(8)); - $block['theme'] = config('system.theme')->get('default'); + $block['theme'] = \Drupal::config('system.theme')->get('default'); $block['region'] = 'header'; $block = $this->drupalPlaceBlock('test_cache', array('region' => 'header')); @@ -274,7 +274,7 @@ function testBlockModuleDisable() { } // Ensure that the disabled module's block plugin is no longer available. - $this->drupalGet('admin/structure/block/list/' . config('system.theme')->get('default') . '/add'); + $this->drupalGet('admin/structure/block/list/' . \Drupal::config('system.theme')->get('default') . '/add'); $this->assertNoText(t('Test block caching')); // Confirm that the block is no longer displayed on the front page. diff --git a/core/modules/block/lib/Drupal/block/Tests/BlockTestBase.php b/core/modules/block/lib/Drupal/block/Tests/BlockTestBase.php index 1f8a4e985a4336e2f6421920207b40f9306b61b8..01fb6c996b1da3cdc2f5ea101ce146e81b2e4982 100644 --- a/core/modules/block/lib/Drupal/block/Tests/BlockTestBase.php +++ b/core/modules/block/lib/Drupal/block/Tests/BlockTestBase.php @@ -39,7 +39,7 @@ function setUp() { parent::setUp(); // Use the test page as the front page. - config('system.site')->set('page.front', 'test-page')->save(); + \Drupal::config('system.site')->set('page.front', 'test-page')->save(); // Create Full HTML text format. $full_html_format = entity_create('filter_format', array( @@ -71,7 +71,7 @@ function setUp() { $manager = $this->container->get('plugin.manager.block'); $instances = config_get_storage_names_with_prefix('plugin.core.block.' . $default_theme); foreach ($instances as $plugin_id) { - config($plugin_id)->delete(); + \Drupal::config($plugin_id)->delete(); } } diff --git a/core/modules/block/lib/Drupal/block/Tests/BlockTitleXSSTest.php b/core/modules/block/lib/Drupal/block/Tests/BlockTitleXSSTest.php index 3036ecd81ea05627736ff99dab5aeb86f626d68e..c17de30199c47cd7285ba62ae0ab1b87c887b414 100644 --- a/core/modules/block/lib/Drupal/block/Tests/BlockTitleXSSTest.php +++ b/core/modules/block/lib/Drupal/block/Tests/BlockTitleXSSTest.php @@ -44,7 +44,7 @@ function testXSSInTitle() { $this->assertNoRaw('', 'The block title was properly sanitized when rendered.'); $this->drupalLogin($this->drupalCreateUser(array('administer blocks', 'access administration pages'))); - $default_theme = config('system.theme')->get('default'); + $default_theme = \Drupal::config('system.theme')->get('default'); $this->drupalGet('admin/structure/block/list/' . $default_theme . '/add'); $this->assertNoRaw("", 'The block title was properly sanitized in Block Plugin UI Admin page.'); } diff --git a/core/modules/block/lib/Drupal/block/Tests/NewDefaultThemeBlocksTest.php b/core/modules/block/lib/Drupal/block/Tests/NewDefaultThemeBlocksTest.php index f9a77923779cf67eba0507dd158a7ece1ada648e..00fccc31bcf4572a56c4b2a7e0493627b95d4f30 100644 --- a/core/modules/block/lib/Drupal/block/Tests/NewDefaultThemeBlocksTest.php +++ b/core/modules/block/lib/Drupal/block/Tests/NewDefaultThemeBlocksTest.php @@ -33,7 +33,7 @@ public static function getInfo() { * Check the enabled Bartik blocks are correctly copied over. */ function testNewDefaultThemeBlocks() { - $default_theme = config('system.theme')->get('default'); + $default_theme = \Drupal::config('system.theme')->get('default'); // Add several block instances. $this->adminUser = $this->drupalCreateUser(array('administer blocks')); @@ -51,7 +51,7 @@ function testNewDefaultThemeBlocks() { $new_theme = 'bartik'; $this->assertFalse($new_theme == $default_theme, 'The new theme is different from the previous default theme.'); theme_enable(array($new_theme)); - config('system.theme') + \Drupal::config('system.theme') ->set('default', $new_theme) ->save(); diff --git a/core/modules/block/lib/Drupal/block/Tests/Views/DisplayBlockTest.php b/core/modules/block/lib/Drupal/block/Tests/Views/DisplayBlockTest.php index 5213b5761349b0231336e9d81b81026f2af3b57c..8da0d69aabeae2c8247d1f9212ec1aca381e3546 100644 --- a/core/modules/block/lib/Drupal/block/Tests/Views/DisplayBlockTest.php +++ b/core/modules/block/lib/Drupal/block/Tests/Views/DisplayBlockTest.php @@ -104,7 +104,7 @@ protected function testDeleteBlockDisplay() { */ public function testViewsBlockForm() { $this->drupalLogin($this->drupalCreateUser(array('administer blocks'))); - $default_theme = config('system.theme')->get('default'); + $default_theme = \Drupal::config('system.theme')->get('default'); $this->drupalGet('admin/structure/block/add/views_block:test_view_block-block_1/' . $default_theme); $elements = $this->xpath('//input[@name="label"]'); $this->assertTrue(empty($elements), 'The label field is not found for Views blocks.'); diff --git a/core/modules/book/book.install b/core/modules/book/book.install index 610808bebb74f78e876fac5a013e558f7f0bbee3..786a1cffacfe82941f66037bbb37ad11c7232437 100644 --- a/core/modules/book/book.install +++ b/core/modules/book/book.install @@ -73,7 +73,7 @@ function book_update_8000() { // @see book_admin_settings_submit() sort($allowed_types); - config('book.settings') + Drupal::config('book.settings') ->set('allowed_types', $allowed_types) ->save(); } diff --git a/core/modules/book/book.module b/core/modules/book/book.module index e11366112998fd909457bfcc316c31c43703cc8c..ac26714b7465c669a9ec264cdf9ae59937f7babd 100644 --- a/core/modules/book/book.module +++ b/core/modules/book/book.module @@ -125,7 +125,7 @@ function book_node_view_link(EntityInterface $node, $view_mode) { if (isset($node->book['depth'])) { if ($view_mode == 'full' && node_is_page($node)) { - $child_type = config('book.settings')->get('child_type'); + $child_type = Drupal::config('book.settings')->get('child_type'); if ((user_access('add content to books') || user_access('administer book outlines')) && node_access('create', $child_type) && $node->status == 1 && $node->book['depth'] < MENU_MAX_DEPTH) { $links['book_add_child'] = array( 'title' => t('Add child page'), @@ -362,7 +362,7 @@ function book_pick_book_nojs_submit($form, &$form_state) { * A parent selection form element. */ function _book_parent_select($book_link) { - if (config('menu.settings')->get('override_parent_selector')) { + if (Drupal::config('menu.settings')->get('override_parent_selector')) { return array(); } // Offer a message or a drop-down to choose a different parent page. @@ -1223,7 +1223,7 @@ function template_preprocess_book_node_export_html(&$variables) { * A Boolean TRUE if the node type can be included in books; otherwise, FALSE. */ function book_type_is_allowed($type) { - return in_array($type, config('book.settings')->get('allowed_types')); + return in_array($type, Drupal::config('book.settings')->get('allowed_types')); } /** @@ -1234,7 +1234,7 @@ function book_type_is_allowed($type) { */ function book_node_type_update(NodeTypeInterface $type) { if ($type->getOriginalID() != $type->id()) { - $config = config('book.settings'); + $config = Drupal::config('book.settings'); // Update the list of node types that are allowed to be added to books. $allowed_types = $config->get('allowed_types'); $old_key = array_search($type->getOriginalID(), $allowed_types); diff --git a/core/modules/book/lib/Drupal/book/Tests/BookTest.php b/core/modules/book/lib/Drupal/book/Tests/BookTest.php index c1ed99d28609cf9a1076745c00ce91b6dbc454ff..85c8c85e357ca74592abccb0e4a488afd9bd3123 100644 --- a/core/modules/book/lib/Drupal/book/Tests/BookTest.php +++ b/core/modules/book/lib/Drupal/book/Tests/BookTest.php @@ -435,9 +435,9 @@ function testBookNodeTypeChange() { // 'page', // ); // @endcode - $current_config = config('book.settings')->init()->get(); + $current_config = \Drupal::config('book.settings')->init()->get(); $this->drupalPost('admin/structure/book/settings', array(), t('Save configuration')); - $this->assertIdentical($current_config, config('book.settings')->init()->get()); + $this->assertIdentical($current_config, \Drupal::config('book.settings')->init()->get()); // Change the name, machine name and description. $edit = array( @@ -456,9 +456,9 @@ function testBookNodeTypeChange() { // 'zebra', // ); // @endcode - $current_config = config('book.settings')->init()->get(); + $current_config = \Drupal::config('book.settings')->init()->get(); $this->drupalPost('admin/structure/book/settings', array(), t('Save configuration')); - $this->assertIdentical($current_config, config('book.settings')->init()->get()); + $this->assertIdentical($current_config, \Drupal::config('book.settings')->init()->get()); $edit = array( 'name' => 'Animal book', @@ -474,13 +474,13 @@ function testBookNodeTypeChange() { // 'zebra', // ); // @endcode - $current_config = config('book.settings')->init()->get(); + $current_config = \Drupal::config('book.settings')->init()->get(); $this->drupalPost('admin/structure/book/settings', array(), t('Save configuration')); - $this->assertIdentical($current_config, config('book.settings')->init()->get()); + $this->assertIdentical($current_config, \Drupal::config('book.settings')->init()->get()); // Ensure that after all the node type changes book.settings:child_type has // the expected value. - $this->assertEqual(config('book.settings')->get('child_type'), 'zebra'); + $this->assertEqual(\Drupal::config('book.settings')->get('child_type'), 'zebra'); } /** diff --git a/core/modules/breakpoint/breakpoint.module b/core/modules/breakpoint/breakpoint.module index 2b819afa0e09bd06594d0f2538c65fc7e18193f1..6cda5e9a9e3153af242e19ab2c374446f6b7b553 100644 --- a/core/modules/breakpoint/breakpoint.module +++ b/core/modules/breakpoint/breakpoint.module @@ -156,7 +156,7 @@ function _breakpoint_import_media_queries($group_name, $label, $source_type, $me * Either Breakpoint::SOURCE_TYPE_THEME or Breakpoint::SOURCE_TYPE_MODULE. */ function _breakpoint_import_breakpoint_groups($source, $source_type) { - $breakpoint_groups = config($source . '.breakpoint_groups'); + $breakpoint_groups = Drupal::config($source . '.breakpoint_groups'); if ($breakpoint_groups) { foreach ($breakpoint_groups->get() as $group_name => $data) { // Breakpoints is mandatory, extra check since this is coming from config. @@ -260,7 +260,7 @@ function breakpoint_get_theme_media_queries($theme_key) { throw new \Exception('Illegal theme_key passed.'); } - $config = config($theme_key . '.breakpoints'); + $config = Drupal::config($theme_key . '.breakpoints'); if ($config) { return $config->get(); } @@ -281,7 +281,7 @@ function breakpoint_get_module_media_queries($module) { throw new \Exception('Illegal module name passed.'); } - $config = config($module . '.breakpoints'); + $config = Drupal::config($module . '.breakpoints'); if ($config) { return $config->get(); } diff --git a/core/modules/ckeditor/ckeditor.module b/core/modules/ckeditor/ckeditor.module index 62f2e8552f69890a9a9f84b5abda75781e83c005..f13d307bdbf7f6bb6e3534b1cefae4e8e32639b2 100644 --- a/core/modules/ckeditor/ckeditor.module +++ b/core/modules/ckeditor/ckeditor.module @@ -109,7 +109,7 @@ function ckeditor_theme() { function _ckeditor_theme_css($theme = NULL) { $css = array(); if (!isset($theme)) { - $theme = config('system.theme')->get('default'); + $theme = Drupal::config('system.theme')->get('default'); } if ($theme_path = drupal_get_path('theme', $theme)) { $info = system_get_info('theme', $theme); diff --git a/core/modules/color/color.install b/core/modules/color/color.install index 5a2c3d17a9b13734e834bf562c207b5cb4384dbc..f896938c3ae6b98963ac30884cc4603af0b8e50c 100644 --- a/core/modules/color/color.install +++ b/core/modules/color/color.install @@ -52,7 +52,7 @@ function color_update_8001() { // Get theme name from color palette variable. preg_match('/color_(.*)_palette/', $theme_palette, $matches); $theme_key = $matches[1]; - $config = config('color.' . $theme_key); + $config = Drupal::config('color.' . $theme_key); $config->set('palette', update_variable_get('color_' . $theme_key . '_palette')); $config->set('logo', update_variable_get('color_' . $theme_key . '_logo')); $config->set('stylesheets', update_variable_get('color_' . $theme_key . '_stylesheets')); diff --git a/core/modules/color/color.module b/core/modules/color/color.module index dc8be4a783250bc5f8d4df882dd1798cc80d5ee6..233c5c58e21ae8e761903193e675285b7d250d10 100644 --- a/core/modules/color/color.module +++ b/core/modules/color/color.module @@ -64,7 +64,7 @@ function color_css_alter(&$css) { $themes = list_themes(); // Override stylesheets. - $color_paths = config('color.' . $theme_key)->get('stylesheets'); + $color_paths = Drupal::config('color.' . $theme_key)->get('stylesheets'); if (!empty($color_paths) && !empty($themes[$theme_key]->stylesheets['all'])) { @@ -93,7 +93,7 @@ function color_preprocess_page(&$variables) { global $theme_key; // Override logo. - $logo = config('color.' . $theme_key)->get('logo'); + $logo = Drupal::config('color.' . $theme_key)->get('logo'); if ($logo && $variables['logo'] && preg_match('!' . $theme_key . '/logo.png$!', $variables['logo'])) { $variables['logo'] = file_create_url($logo); } @@ -132,7 +132,7 @@ function color_get_palette($theme, $default = FALSE) { // Load variable. // @todo Default color config should be moved to yaml in the theme. - return config('color.' . $theme)->get('palette') ?: $palette; + return Drupal::config('color.' . $theme)->get('palette') ?: $palette; } /** @@ -160,7 +160,7 @@ function color_scheme_form($complete_form, &$form_state, $theme) { // See if we're using a predefined scheme. // Note: we use the original theme when the default scheme is chosen. - $current_scheme = config('color.' . $theme)->get('palette'); + $current_scheme = Drupal::config('color.' . $theme)->get('palette'); foreach ($schemes as $key => $scheme) { if ($current_scheme == $scheme) { $scheme_name = $key; @@ -281,7 +281,7 @@ function color_scheme_form_submit($form, &$form_state) { $theme = $form_state['values']['theme']; $info = $form_state['values']['info']; - $config = config('color.' . $theme); + $config = Drupal::config('color.' . $theme); // Resolve palette. $palette = $form_state['values']['palette']; @@ -544,7 +544,7 @@ function _color_render_images($theme, &$info, &$paths, $palette) { if ($file == 'screenshot.png') { $slice = imagecreatetruecolor(150, 90); imagecopyresampled($slice, $target, 0, 0, $x, $y, 150, 90, $width, $height); - config('color.' . $theme) + Drupal::config('color.' . $theme) ->set('screenshot', $image) ->save(); } diff --git a/core/modules/color/lib/Drupal/color/Tests/ColorTest.php b/core/modules/color/lib/Drupal/color/Tests/ColorTest.php index 13627ccce55c821e609f4df96d6c454fbbb83c47..897943c27d14a2a68924122cdfecaf9fcd4a799f 100644 --- a/core/modules/color/lib/Drupal/color/Tests/ColorTest.php +++ b/core/modules/color/lib/Drupal/color/Tests/ColorTest.php @@ -78,7 +78,7 @@ function testColor() { * Tests the Color module functionality using the given theme. */ function _testColor($theme, $test_values) { - config('system.theme') + \Drupal::config('system.theme') ->set('default', $theme) ->save(); $settings_path = 'admin/appearance/settings/' . $theme; @@ -91,7 +91,7 @@ function _testColor($theme, $test_values) { $this->drupalPost($settings_path, $edit, t('Save configuration')); $this->drupalGet(''); - $stylesheets = config('color.' . $theme)->get('stylesheets'); + $stylesheets = \Drupal::config('color.' . $theme)->get('stylesheets'); $this->assertPattern('|' . file_create_url($stylesheets[0]) . '|', 'Make sure the color stylesheet is included in the content. (' . $theme . ')'); $stylesheet_content = join("\n", file($stylesheets[0])); @@ -103,12 +103,12 @@ function _testColor($theme, $test_values) { $this->drupalPost($settings_path, $edit, t('Save configuration')); $this->drupalGet(''); - $stylesheets = config('color.' . $theme)->get('stylesheets'); + $stylesheets = \Drupal::config('color.' . $theme)->get('stylesheets'); $stylesheet_content = join("\n", file($stylesheets[0])); $this->assertTrue(strpos($stylesheet_content, 'color: ' . $test_values['scheme_color']) !== FALSE, 'Make sure the color we changed is in the color stylesheet. (' . $theme . ')'); // Test with aggregated CSS turned on. - $config = config('system.performance'); + $config = \Drupal::config('system.performance'); $config->set('css.preprocess', 1); $config->save(); $this->drupalGet(''); @@ -126,7 +126,7 @@ function _testColor($theme, $test_values) { * Tests whether the provided color is valid. */ function testValidColor() { - config('system.theme') + \Drupal::config('system.theme') ->set('default', 'bartik') ->save(); $settings_path = 'admin/appearance/settings/bartik'; diff --git a/core/modules/comment/comment.module b/core/modules/comment/comment.module index b38892d70cb48b40553d8857cec8cacd8b8aa006..a68f39b39660b8fbb37c25bc328d626fa03a0d0e 100644 --- a/core/modules/comment/comment.module +++ b/core/modules/comment/comment.module @@ -1432,7 +1432,7 @@ function comment_preview(Comment $comment) { $comment->name->value = check_plain($account->getUsername()); } elseif (empty($comment->name->value)) { - $comment->name->value = config('user.settings')->get('anonymous'); + $comment->name->value = Drupal::config('user.settings')->get('anonymous'); } $comment->created->value = !empty($comment->created->value) ? $comment->created->value : REQUEST_TIME; @@ -1530,7 +1530,7 @@ function template_preprocess_comment(&$variables) { $variables['user_picture'] = array(); } - if (config('user.settings')->get('signatures') && $account->getSignature()) { + if (Drupal::config('user.settings')->get('signatures') && $account->getSignature()) { $variables['signature'] = check_markup($account->getSignature(), $account->getSignatureFormat(), '', TRUE) ; } else { @@ -1658,7 +1658,7 @@ function theme_comment_post_forbidden($variables) { $destination = array('destination' => 'node/' . $node->id() . '#comment-form'); } - if (config('user.settings')->get('register') != USER_REGISTER_ADMINISTRATORS_ONLY) { + if (Drupal::config('user.settings')->get('register') != USER_REGISTER_ADMINISTRATORS_ONLY) { // Users can register themselves. return t('Log in or register to post comments', array('@login' => url('user/login', array('query' => $destination)), '@register' => url('user/register', array('query' => $destination)))); } diff --git a/core/modules/comment/comment.tokens.inc b/core/modules/comment/comment.tokens.inc index d5a3badcf4903e8d5f3b0eb39b1ca3512230c901..80021628f5fe6e9abfd39a43d0ce323fac0ac631 100644 --- a/core/modules/comment/comment.tokens.inc +++ b/core/modules/comment/comment.tokens.inc @@ -133,7 +133,7 @@ function comment_tokens($type, $tokens, array $data = array(), array $options = break; case 'name': - $name = ($comment->uid->target_id == 0) ? config('user.settings')->get('anonymous') : $comment->name->value; + $name = ($comment->uid->target_id == 0) ? Drupal::config('user.settings')->get('anonymous') : $comment->name->value; $replacements[$original] = $sanitize ? filter_xss($name) : $name; break; diff --git a/core/modules/comment/lib/Drupal/comment/CommentFormController.php b/core/modules/comment/lib/Drupal/comment/CommentFormController.php index 6d7c39beba5162f653b7a06fa0d66543f0865b34..d5a4a508edf263ec15c76d27b28a09b014da0d97 100644 --- a/core/modules/comment/lib/Drupal/comment/CommentFormController.php +++ b/core/modules/comment/lib/Drupal/comment/CommentFormController.php @@ -86,7 +86,7 @@ public function form(array $form, array &$form_state) { ); if ($is_admin) { $form['author']['name']['#title'] = t('Authored by'); - $form['author']['name']['#description'] = t('Leave blank for %anonymous.', array('%anonymous' => config('user.settings')->get('anonymous'))); + $form['author']['name']['#description'] = t('Leave blank for %anonymous.', array('%anonymous' => \Drupal::config('user.settings')->get('anonymous'))); $form['author']['name']['#autocomplete_path'] = 'user/autocomplete'; } elseif ($user->isAuthenticated()) { @@ -274,7 +274,7 @@ public function submit(array $form, array &$form_state) { // If the comment was posted by an anonymous user and no author name was // required, use "Anonymous" by default. if ($comment->is_anonymous && (!isset($comment->name->value) || $comment->name->value === '')) { - $comment->name->value = config('user.settings')->get('anonymous'); + $comment->name->value = \Drupal::config('user.settings')->get('anonymous'); } // Validate the comment's subject. If not specified, extract from comment diff --git a/core/modules/comment/lib/Drupal/comment/Plugin/views/argument/UserUid.php b/core/modules/comment/lib/Drupal/comment/Plugin/views/argument/UserUid.php index 0b10dcaa14788c16458a6aedd301b96ff7c2e111..be6c4c33fbe4ba4191a490fe454d62d75a1d9f06 100644 --- a/core/modules/comment/lib/Drupal/comment/Plugin/views/argument/UserUid.php +++ b/core/modules/comment/lib/Drupal/comment/Plugin/views/argument/UserUid.php @@ -56,7 +56,7 @@ public static function create(ContainerInterface $container, array $configuratio function title() { if (!$this->argument) { - $title = config('user.settings')->get('anonymous'); + $title = \Drupal::config('user.settings')->get('anonymous'); } else { $title = $this->database->query('SELECT u.name FROM {users} u WHERE u.uid = :uid', array(':uid' => $this->argument))->fetchField(); diff --git a/core/modules/comment/lib/Drupal/comment/Plugin/views/row/Rss.php b/core/modules/comment/lib/Drupal/comment/Plugin/views/row/Rss.php index eeaec0b096d992581e2544a3c7af5e3cdbc0a616..6cc187c52eecab0e659ca3c83924eec9c0cc7741 100644 --- a/core/modules/comment/lib/Drupal/comment/Plugin/views/row/Rss.php +++ b/core/modules/comment/lib/Drupal/comment/Plugin/views/row/Rss.php @@ -97,7 +97,7 @@ public function render($row) { $item_length = $this->options['item_length']; if ($item_length == 'default') { - $item_length = config('system.rss')->get('items.view_mode'); + $item_length = \Drupal::config('system.rss')->get('items.view_mode'); } // Load the specified comment and its associated node: diff --git a/core/modules/comment/lib/Drupal/comment/Tests/CommentLinksTest.php b/core/modules/comment/lib/Drupal/comment/Tests/CommentLinksTest.php index 4f11307df8822d5febc91d31f91e45ed684a5d62..5e40a7b62f14d466aea04422119b5c0a82fd4ed7 100644 --- a/core/modules/comment/lib/Drupal/comment/Tests/CommentLinksTest.php +++ b/core/modules/comment/lib/Drupal/comment/Tests/CommentLinksTest.php @@ -46,7 +46,7 @@ public static function getInfo() { function testCommentLinks() { // Bartik theme alters comment links, so use a different theme. theme_enable(array('stark')); - config('system.theme') + \Drupal::config('system.theme') ->set('default', 'stark') ->save(); @@ -175,7 +175,7 @@ function setEnvironment(array $info) { } // Change user settings. - config('user.settings')->set('register', $info['user_register'])->save(); + \Drupal::config('user.settings')->set('register', $info['user_register'])->save(); // Change user permissions. $rid = ($this->loggedInUser ? DRUPAL_AUTHENTICATED_RID : DRUPAL_ANONYMOUS_RID); diff --git a/core/modules/comment/lib/Drupal/comment/Tests/CommentPreviewTest.php b/core/modules/comment/lib/Drupal/comment/Tests/CommentPreviewTest.php index c82ee511d09e0b5a9c50f6d681805fc442794eb9..88a0d7c1ee1204b271f3360ae373aab65394f78d 100644 --- a/core/modules/comment/lib/Drupal/comment/Tests/CommentPreviewTest.php +++ b/core/modules/comment/lib/Drupal/comment/Tests/CommentPreviewTest.php @@ -73,7 +73,7 @@ function testCommentPreview() { // Login as web user and add a signature and a user picture. $this->drupalLogin($this->web_user); - config('user.settings')->set('signatures', 1)->save(); + \Drupal::config('user.settings')->set('signatures', 1)->save(); $test_signature = $this->randomName(); $edit['signature[value]'] = '' . $test_signature. ''; $image = current($this->drupalGetTestFiles('image')); diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigCRUDTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigCRUDTest.php index d4c170c15fa5e3e92cc450da7064422deb7e741f..a8ca042917e7e40c7c168dba3209dca849186f98 100644 --- a/core/modules/config/lib/Drupal/config/Tests/ConfigCRUDTest.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigCRUDTest.php @@ -37,7 +37,7 @@ function testCRUD() { $storage = $this->container->get('config.storage'); $name = 'config_test.crud'; - $config = config($name); + $config = \Drupal::config($name); $this->assertIdentical($config->isNew(), TRUE); // Create a new configuration object. @@ -58,8 +58,8 @@ function testCRUD() { $actual_data = $storage->read($name); $this->assertIdentical($actual_data, array('value' => 'instance-update')); - // Verify a call to config() immediately returns the updated value. - $new_config = config($name); + // Verify a call to \Drupal::config() immediately returns the updated value. + $new_config = \Drupal::config($name); $this->assertIdentical($new_config->get(), $config->get()); $this->assertIdentical($config->isNew(), FALSE); @@ -74,8 +74,8 @@ function testCRUD() { $actual_data = $storage->read($name); $this->assertIdentical($actual_data, FALSE); - // Verify config() returns no data. - $new_config = config($name); + // Verify \Drupal::config() returns no data. + $new_config = \Drupal::config($name); $this->assertIdentical($new_config->get(), $config->get()); $this->assertIdentical($config->isNew(), TRUE); @@ -88,36 +88,36 @@ function testCRUD() { $actual_data = $storage->read($name); $this->assertIdentical($actual_data, array('value' => 're-created')); - // Verify a call to config() immediately returns the updated value. - $new_config = config($name); + // Verify a call to \Drupal::config() immediately returns the updated value. + $new_config = \Drupal::config($name); $this->assertIdentical($new_config->get(), $config->get()); $this->assertIdentical($config->isNew(), FALSE); // Rename the configuration object. $new_name = 'config_test.crud_rename'; $this->container->get('config.factory')->rename($name, $new_name); - $renamed_config = config($new_name); + $renamed_config = \Drupal::config($new_name); $this->assertIdentical($renamed_config->get(), $config->get()); $this->assertIdentical($renamed_config->isNew(), FALSE); // Ensure that the old configuration object is removed from both the cache // and the configuration storage. - $config = config($name); + $config = \Drupal::config($name); $this->assertIdentical($config->get(), array()); $this->assertIdentical($config->isNew(), TRUE); // Test renaming when config.factory does not have the object in its static // cache. $name = 'config_test.crud_rename'; - $config = config($name); + $config = \Drupal::config($name); $new_name = 'config_test.crud_rename_no_cache'; $this->container->get('config.factory')->clearStaticCache()->rename($name, $new_name); - $renamed_config = config($new_name); + $renamed_config = \Drupal::config($new_name); $this->assertIdentical($renamed_config->get(), $config->get()); $this->assertIdentical($renamed_config->isNew(), FALSE); // Merge data into the configuration object. - $new_config = config($new_name); + $new_config = \Drupal::config($new_name); $expected_values = array( 'value' => 'herp', '404' => 'derp', @@ -136,7 +136,7 @@ function testNameValidation() { $name = 'nonamespace'; $message = 'Expected ConfigNameException was thrown for a name without a namespace.'; try { - config($name)->save(); + \Drupal::config($name)->save(); $this->fail($message); } catch (ConfigNameException $e) { @@ -147,7 +147,7 @@ function testNameValidation() { $name = 'config_test.herman_melville.moby_dick_or_the_whale.harper_1851.now_small_fowls_flew_screaming_over_the_yet_yawning_gulf_a_sullen_white_surf_beat_against_its_steep_sides_then_all_collapsed_and_the_great_shroud_of_the_sea_rolled_on_as_it_rolled_five_thousand_years_ago'; $message = 'Expected ConfigNameException was thrown for a name longer than Config::MAX_NAME_LENGTH.'; try { - config($name)->save(); + \Drupal::config($name)->save(); $this->fail($message); } catch (ConfigNameException $e) { @@ -159,7 +159,7 @@ function testNameValidation() { foreach ($test_characters as $i => $c) { try { $name = 'namespace.object' . $c; - $config = config($name); + $config = \Drupal::config($name); $config->save(); } catch (ConfigNameException $e) { @@ -174,7 +174,7 @@ function testNameValidation() { $name = 'namespace.object'; $message = 'ConfigNameException was not thrown for a valid object name.'; try { - $config = config($name); + $config = \Drupal::config($name); $config->save(); $this->pass($message); } diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigFileContentTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigFileContentTest.php index f2e7965a07403a260324d57ef85aa3d6e4946df6..ef840b38995fedea1ebb513208690e50fd69b054 100644 --- a/core/modules/config/lib/Drupal/config/Tests/ConfigFileContentTest.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigFileContentTest.php @@ -52,7 +52,7 @@ function testReadWriteConfig() { $false_key = 'false'; // Attempt to read non-existing configuration. - $config = config($name); + $config = \Drupal::config($name); // Verify an configuration object is returned. $this->assertEqual($config->getName(), $name); @@ -66,7 +66,7 @@ function testReadWriteConfig() { $this->assertIdentical($data, FALSE); // Add a top level value - $config = config($name); + $config = \Drupal::config($name); $config->set($key, $value); // Add a nested value @@ -96,7 +96,7 @@ function testReadWriteConfig() { $this->assertTrue($data); // Read top level value - $config = config($name); + $config = \Drupal::config($name); $this->assertEqual($config->getName(), $name); $this->assertTrue($config, 'Config object created.'); $this->assertEqual($config->get($key), 'bar', 'Top level configuration value found.'); @@ -134,7 +134,7 @@ function testReadWriteConfig() { // Unset a nested value $config->clear($nested_key); $config->save(); - $config = config($name); + $config = \Drupal::config($name); // Read unset top level value $this->assertNull($config->get($key), 'Top level value unset.'); @@ -143,13 +143,13 @@ function testReadWriteConfig() { $this->assertNull($config->get($nested_key), 'Nested value unset.'); // Create two new configuration files to test listing - $config = config('foo.baz'); + $config = \Drupal::config('foo.baz'); $config->set($key, $value); $config->save(); // Test chained set()->save() $chained_name = 'biff.bang'; - $config = config($chained_name); + $config = \Drupal::config($chained_name); $config->set($key, $value)->save(); // Verify the database entry exists from a chained save. @@ -177,7 +177,7 @@ function testReadWriteConfig() { $this->assertEqual($files, array(), 'No files listed with the prefix \'bar\'.'); // Delete the configuration. - $config = config($name); + $config = \Drupal::config($name); $config->delete(); // Verify the database entry no longer exists. diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigImportUITest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigImportUITest.php index 9184bfb89f095806fab12fdbe341bedbac53914e..59cd19c038aa8a9a8718baa11d1dd50b1f0c04a7 100644 --- a/core/modules/config/lib/Drupal/config/Tests/ConfigImportUITest.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigImportUITest.php @@ -80,10 +80,10 @@ function testImport() { $this->assertText(t('There are no configuration changes.')); // Verify site name has changed. - $this->assertIdentical($new_site_name, config('system.site')->get('name')); + $this->assertIdentical($new_site_name, \Drupal::config('system.site')->get('name')); // Verify that new config entity exists. - $this->assertIdentical($original_dynamic_data, config($dynamic_name)->get()); + $this->assertIdentical($original_dynamic_data, \Drupal::config($dynamic_name)->get()); // Verify the cache got cleared. $this->assertTrue(isset($GLOBALS['hook_cache_flush'])); @@ -113,7 +113,7 @@ function testImportLock() { $this->container->get('lock')->release($config_importer_lock); // Verify site name has not changed. - $this->assertNotEqual($new_site_name, config('system.site')->get('name')); + $this->assertNotEqual($new_site_name, \Drupal::config('system.site')->get('name')); } /** @@ -163,7 +163,7 @@ function testImportDiff() { function prepareSiteNameUpdate($new_site_name) { $staging = $this->container->get('config.storage.staging'); // Create updated configuration object. - $config_data = config('system.site')->get(); + $config_data = \Drupal::config('system.site')->get(); $config_data['name'] = $new_site_name; $staging->write('system.site', $config_data); } diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigImporterTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigImporterTest.php index 05d89199ad3ae730f570fd3f590c62b628f93b9c..f51e221ac6332ce028d0fd13e42de570575d0887 100644 --- a/core/modules/config/lib/Drupal/config/Tests/ConfigImporterTest.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigImporterTest.php @@ -72,10 +72,10 @@ function testNoImport() { $dynamic_name = 'config_test.dynamic.dotted.default'; // Verify the default configuration values exist. - $config = config($dynamic_name); + $config = \Drupal::config($dynamic_name); $this->assertIdentical($config->get('id'), 'dotted.default'); - // Verify that a bare config() does not involve module APIs. + // Verify that a bare \Drupal::config() does not involve module APIs. $this->assertFalse(isset($GLOBALS['hook_config_test'])); } @@ -103,7 +103,7 @@ function testDeleted() { $staging = $this->container->get('config.storage.staging'); // Verify the default configuration values exist. - $config = config($dynamic_name); + $config = \Drupal::config($dynamic_name); $this->assertIdentical($config->get('id'), 'dotted.default'); // Delete the file from the staging directory. @@ -115,7 +115,7 @@ function testDeleted() { // Verify the file has been removed. $this->assertIdentical($storage->read($dynamic_name), FALSE); - $config = config($dynamic_name); + $config = \Drupal::config($dynamic_name); $this->assertIdentical($config->get('id'), NULL); // Verify that appropriate module API hooks have been invoked. @@ -160,7 +160,7 @@ function testNew() { $this->configImporter->reset()->import(); // Verify the values appeared. - $config = config($dynamic_name); + $config = \Drupal::config($dynamic_name); $this->assertIdentical($config->get('label'), $original_dynamic_data['label']); // Verify that appropriate module API hooks have been invoked. @@ -199,18 +199,18 @@ function testUpdated() { $staging->write($dynamic_name, $original_dynamic_data); // Verify the active configuration still returns the default values. - $config = config($name); + $config = \Drupal::config($name); $this->assertIdentical($config->get('foo'), 'bar'); - $config = config($dynamic_name); + $config = \Drupal::config($dynamic_name); $this->assertIdentical($config->get('label'), 'Default'); // Import. $this->configImporter->reset()->import(); // Verify the values were updated. - $config = config($name); + $config = \Drupal::config($name); $this->assertIdentical($config->get('foo'), 'beer'); - $config = config($dynamic_name); + $config = \Drupal::config($dynamic_name); $this->assertIdentical($config->get('label'), 'Updated'); // Verify that the original file content is still the same. diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigInstallTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigInstallTest.php index 3d4093d087113dcc3d9dff9ae4fce77a299b000b..f9c79e3807628d36c141250a97375e301f64c518 100644 --- a/core/modules/config/lib/Drupal/config/Tests/ConfigInstallTest.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigInstallTest.php @@ -37,9 +37,9 @@ function testModuleInstallation() { $default_configuration_entity = 'config_test.dynamic.dotted.default'; // Verify that default module config does not exist before installation yet. - $config = config($default_config); + $config = \Drupal::config($default_config); $this->assertIdentical($config->isNew(), TRUE); - $config = config($default_configuration_entity); + $config = \Drupal::config($default_configuration_entity); $this->assertIdentical($config->isNew(), TRUE); // Install the test module. @@ -47,9 +47,9 @@ function testModuleInstallation() { $this->installConfig(array('config_test')); // Verify that default module config exists. - $config = config($default_config); + $config = \Drupal::config($default_config); $this->assertIdentical($config->isNew(), FALSE); - $config = config($default_configuration_entity); + $config = \Drupal::config($default_configuration_entity); $this->assertIdentical($config->isNew(), FALSE); // Verify that configuration import callback was invoked for the dynamic diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigInstallWebTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigInstallWebTest.php index ff48bf4b0d84f3cf4b5262dc9ad45d962a9c57c0..5431a96e09735f5a0459d842f0368146b7685245 100644 --- a/core/modules/config/lib/Drupal/config/Tests/ConfigInstallWebTest.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigInstallWebTest.php @@ -40,19 +40,19 @@ function testIntegrationModuleReinstallation() { module_enable(array('config_test')); // Verify the configuration does not exist prior to installation. - $config_static = config($default_config); + $config_static = \Drupal::config($default_config); $this->assertIdentical($config_static->isNew(), TRUE); - $config_entity = config($default_configuration_entity); + $config_entity = \Drupal::config($default_configuration_entity); $this->assertIdentical($config_entity->isNew(), TRUE); // Install the integration module. module_enable(array('config_integration_test')); // Verify that default module config exists. - $config_static = config($default_config); + $config_static = \Drupal::config($default_config); $this->assertIdentical($config_static->isNew(), FALSE); $this->assertIdentical($config_static->get('foo'), 'default setting'); - $config_entity = config($default_configuration_entity); + $config_entity = \Drupal::config($default_configuration_entity); $this->assertIdentical($config_entity->isNew(), FALSE); $this->assertIdentical($config_entity->get('label'), 'Default integration config label'); @@ -61,7 +61,7 @@ function testIntegrationModuleReinstallation() { $config_entity->set('label', 'Customized integration config label')->save(); // @todo FIXME: Setting config keys WITHOUT SAVING retains the changed config - // object in memory. Every new call to config() MUST revert in-memory changes + // object in memory. Every new call to \Drupal::config() MUST revert in-memory changes // that haven't been saved! // In other words: This test passes even without this reset, but it shouldn't. $this->container->get('config.factory')->reset(); @@ -71,10 +71,10 @@ function testIntegrationModuleReinstallation() { module_enable(array('config_integration_test')); // Verify that customized config exists. - $config_static = config($default_config); + $config_static = \Drupal::config($default_config); $this->assertIdentical($config_static->isNew(), FALSE); $this->assertIdentical($config_static->get('foo'), 'customized setting'); - $config_entity = config($default_configuration_entity); + $config_entity = \Drupal::config($default_configuration_entity); $this->assertIdentical($config_entity->isNew(), FALSE); $this->assertIdentical($config_entity->get('label'), 'Customized integration config label'); @@ -83,11 +83,11 @@ function testIntegrationModuleReinstallation() { module_uninstall(array('config_integration_test')); // Verify the integration module's config was uninstalled. - $config_static = config($default_config); + $config_static = \Drupal::config($default_config); $this->assertIdentical($config_static->isNew(), TRUE); // Verify the integration config still exists. - $config_entity = config($default_configuration_entity); + $config_entity = \Drupal::config($default_configuration_entity); $this->assertIdentical($config_entity->isNew(), FALSE); $this->assertIdentical($config_entity->get('label'), 'Customized integration config label'); @@ -95,12 +95,12 @@ function testIntegrationModuleReinstallation() { module_enable(array('config_integration_test')); // Verify the integration module's config was re-installed. - $config_static = config($default_config); + $config_static = \Drupal::config($default_config); $this->assertIdentical($config_static->isNew(), FALSE); $this->assertIdentical($config_static->get('foo'), 'default setting'); // Verify the customized integration config still exists. - $config_entity = config($default_configuration_entity); + $config_entity = \Drupal::config($default_configuration_entity); $this->assertIdentical($config_entity->isNew(), FALSE); $this->assertIdentical($config_entity->get('label'), 'Customized integration config label'); } diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigLocaleOverride.php b/core/modules/config/lib/Drupal/config/Tests/ConfigLocaleOverride.php index 79f22a96c6ec5c04f17b34fe52858c13bfdce6cc..224340c2d49f077c98a4efb73b2cadf94084f5e7 100644 --- a/core/modules/config/lib/Drupal/config/Tests/ConfigLocaleOverride.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigLocaleOverride.php @@ -42,19 +42,19 @@ public function setUp() { function testConfigLocaleOverride() { $name = 'config_test.system'; // The default language is en so the config key should be localised. - $config = config($name); + $config = \Drupal::config($name); $this->assertIdentical($config->get('foo'), 'en bar'); $this->assertIdentical($config->get('404'), 'herp'); // Ensure that we get the expected value when we avoid overrides. config_context_enter('config.context.free'); - $config_admin = config($name); + $config_admin = \Drupal::config($name); $this->assertIdentical($config_admin->get('foo'), 'bar'); $this->assertIdentical($config_admin->get('404'), 'herp'); // Leave the non override context. config_context_leave(); - $config = config($name); + $config = \Drupal::config($name); $this->assertIdentical($config->get('foo'), 'en bar'); $this->assertIdentical($config->get('404'), 'herp'); } @@ -89,7 +89,7 @@ function testConfigLocaleUserOverride() { $user_config_context = config_context_enter('Drupal\user\UserConfigContext'); $user_config_context->setAccount($account); - $config = config('config_test.system'); + $config = \Drupal::config('config_test.system'); $this->assertIdentical($config->get('foo'), 'fr bar'); // Ensure the non-overriden value is still the same. $this->assertIdentical($config->get('404'), 'herp'); @@ -99,7 +99,7 @@ function testConfigLocaleUserOverride() { // in a user based language override context, the English language override // applies due to the negotiated language for the page. config_context_leave(); - $config = config('config_test.system'); + $config = \Drupal::config('config_test.system'); $this->assertIdentical($config->get('foo'), 'en bar'); $account = entity_create('user', array( @@ -114,7 +114,7 @@ function testConfigLocaleUserOverride() { $config_factory->enterContext($user_config_context->setAccount($account)); // Should not have to re-initialize the configuration object to get new // overrides as the new context will have a different uuid. - $config = config('config_test.system'); + $config = \Drupal::config('config_test.system'); $this->assertIdentical($config->get('foo'), 'de bar'); // Enter an english context on top of the german context. @@ -128,24 +128,24 @@ function testConfigLocaleUserOverride() { // Create a new user config context to stack on top of the existign one. $en_user_config_context = config_context_enter('Drupal\user\UserConfigContext'); $en_user_config_context->setAccount($account); - $config = config('config_test.system'); + $config = \Drupal::config('config_test.system'); $this->assertIdentical($config->get('foo'), 'en bar'); // Ensure that we get the expected value when we leave the english user // context. config_context_leave(); - $config = config('config_test.system'); + $config = \Drupal::config('config_test.system'); $this->assertIdentical($config->get('foo'), 'de bar'); // Ensure that we get the expected value when we leave the german user // context. config_context_leave(); - $config = config('config_test.system'); + $config = \Drupal::config('config_test.system'); $this->assertIdentical($config->get('foo'), 'en bar'); // Ensure that we cannot leave the default context. config_context_leave(); - $config = config('config_test.system'); + $config = \Drupal::config('config_test.system'); $this->assertIdentical($config->get('foo'), 'en bar'); } @@ -171,7 +171,7 @@ function testConfigLocaleLanguageOverride() { $language = language_load('fr'); $language_config_context = config_context_enter('Drupal\language\LanguageConfigContext'); $language_config_context->setLanguage($language); - $config = config('config_test.system'); + $config = \Drupal::config('config_test.system'); $this->assertIdentical($config->get('foo'), 'fr bar'); // Ensure the non-overridden value is still the same. $this->assertIdentical($config->get('404'), 'herp'); @@ -181,7 +181,7 @@ function testConfigLocaleLanguageOverride() { // in a language override context, the English language override // applies due to the negotiated language for the page. config_context_leave(); - $config = config('config_test.system'); + $config = \Drupal::config('config_test.system'); $this->assertIdentical($config->get('foo'), 'en bar'); $config_factory = \Drupal::service('config.factory'); @@ -189,7 +189,7 @@ function testConfigLocaleLanguageOverride() { $config_factory->enterContext($language_config_context->setLanguage($language)); // Should not have to re-initialize the configuration object to get new // overrides as the new context will have a different uuid. - $config = config('config_test.system'); + $config = \Drupal::config('config_test.system'); $this->assertIdentical($config->get('foo'), 'de bar'); // Enter an english context on top of the german context. @@ -197,24 +197,24 @@ function testConfigLocaleLanguageOverride() { // Create a new language config context to stack on top of the existing one. $en_language_config_context = config_context_enter('Drupal\language\LanguageConfigContext'); $en_language_config_context->setLanguage($language); - $config = config('config_test.system'); + $config = \Drupal::config('config_test.system'); $this->assertIdentical($config->get('foo'), 'en bar'); // Ensure that we get the expected value when we leave the english // language context. config_context_leave(); - $config = config('config_test.system'); + $config = \Drupal::config('config_test.system'); $this->assertIdentical($config->get('foo'), 'de bar'); // Ensure that we get the expected value when we leave the german // language context. config_context_leave(); - $config = config('config_test.system'); + $config = \Drupal::config('config_test.system'); $this->assertIdentical($config->get('foo'), 'en bar'); // Ensure that we cannot leave the default context. config_context_leave(); - $config = config('config_test.system'); + $config = \Drupal::config('config_test.system'); $this->assertIdentical($config->get('foo'), 'en bar'); } @@ -248,7 +248,7 @@ function testConfigLocaleUserAndGlobalOverride() { $user_config_context = config_context_enter('Drupal\user\UserConfigContext'); $user_config_context->setAccount($account); - $config = config('config_test.system'); + $config = \Drupal::config('config_test.system'); $this->assertIdentical($config->get('foo'), 'fr bar'); // Ensure the value overriden from global $conf works. $this->assertIdentical($config->get('404'), 'global herp'); @@ -258,21 +258,21 @@ function testConfigLocaleUserAndGlobalOverride() { // in a user based language override context, the English language override // applies due to the negotiated language for the page. config_context_leave(); - $config = config('config_test.system'); + $config = \Drupal::config('config_test.system'); $this->assertIdentical($config->get('foo'), 'en bar'); // Global override should still apply. $this->assertIdentical($config->get('404'), 'global herp'); // Ensure that we cannot leave the default context. config_context_leave(); - $config = config('config_test.system'); + $config = \Drupal::config('config_test.system'); $this->assertIdentical($config->get('foo'), 'en bar'); // Global override should still apply. $this->assertIdentical($config->get('404'), 'global herp'); // Ensure that we get the expected value when we avoid overrides. config_context_enter('config.context.free'); - $config_admin = config('config_test.system'); + $config_admin = \Drupal::config('config_test.system'); // Language override should not apply anymore. $this->assertIdentical($config_admin->get('foo'), 'bar'); // Global override should not apply. diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigLocaleOverrideWebTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigLocaleOverrideWebTest.php index 204e2749ecff0ac47e0919eb58fd3ce4c27b2334..99bee0719b076c7594c74c99412fca1e513681da 100644 --- a/core/modules/config/lib/Drupal/config/Tests/ConfigLocaleOverrideWebTest.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigLocaleOverrideWebTest.php @@ -47,7 +47,7 @@ function testSiteNameTranslation() { $this->drupalPost('admin/config/regional/language/add', $edit, t('Add custom language')); // Save an override for the XX language. - config('locale.config.xx.system.site')->set('name', 'XX site name')->save(); + \Drupal::config('locale.config.xx.system.site')->set('name', 'XX site name')->save(); $this->drupalLogout(); diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigOverrideTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigOverrideTest.php index e0748a7207b306fb9f623e66f3633dab77d54292..a6016c3589598c8f73858fcb350a456b7d0865ad 100644 --- a/core/modules/config/lib/Drupal/config/Tests/ConfigOverrideTest.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigOverrideTest.php @@ -63,7 +63,7 @@ function testConfOverride() { // Enter an override-free context to ensure the original data remains. config_context_enter('config.context.free'); - $config = config('config_test.system'); + $config = \Drupal::config('config_test.system'); $this->assertIdentical($config->get('foo'), $expected_original_data['foo']); $this->assertIdentical($config->get('baz'), $expected_original_data['baz']); $this->assertIdentical($config->get('404'), $expected_original_data['404']); @@ -71,7 +71,7 @@ function testConfOverride() { // Get the configuration object in an overriden context (the one set by // default). - $config = config('config_test.system'); + $config = \Drupal::config('config_test.system'); // Verify that it contains the overridden data from $conf. $this->assertIdentical($config->get('foo'), $conf['config_test.system']['foo']); @@ -95,14 +95,14 @@ function testConfOverride() { $config->save(); // Reload it and verify that it still contains overridden data from $conf. - $config = config('config_test.system'); + $config = \Drupal::config('config_test.system'); $this->assertIdentical($config->get('foo'), $conf['config_test.system']['foo']); $this->assertIdentical($config->get('baz'), $conf['config_test.system']['baz']); $this->assertIdentical($config->get('404'), $conf['config_test.system']['404']); // Enter an override-free context to ensure the original data remains saved. config_context_enter('config.context.free'); - $config = config('config_test.system'); + $config = \Drupal::config('config_test.system'); $this->assertIdentical($config->get('foo'), $expected_original_data['foo']); $this->assertIdentical($config->get('baz'), $expected_original_data['baz']); $this->assertIdentical($config->get('404'), $expected_original_data['404']); @@ -127,7 +127,7 @@ function testConfOverride() { $this->assertIdentical($data['404'], $expected_new_data['404']); // Verifiy the overrides are still working. - $config = config('config_test.system'); + $config = \Drupal::config('config_test.system'); $this->assertIdentical($config->get('foo'), $conf['config_test.system']['foo']); $this->assertIdentical($config->get('baz'), $conf['config_test.system']['baz']); $this->assertIdentical($config->get('404'), $conf['config_test.system']['404']); diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigSnapshotTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigSnapshotTest.php index 7315c53cb3551cfb1e871d8bb9df0073ed9d9f50..d9504b2a9c8a90844557770c73739696aa574748 100644 --- a/core/modules/config/lib/Drupal/config/Tests/ConfigSnapshotTest.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigSnapshotTest.php @@ -66,7 +66,7 @@ function testSnapshot() { $this->assertFalse($active_snapshot_comparer->reset()->hasChanges()); // Change a configuration value in staging. - $staging_data = config($config_name)->get(); + $staging_data = \Drupal::config($config_name)->get(); $staging_data[$config_key] = $new_data; $staging->write($config_name, $staging_data); @@ -79,7 +79,7 @@ function testSnapshot() { $this->configImporter()->import(); // Verify changed config was properly imported. - $this->assertIdentical(config($config_name)->get($config_key), $new_data); + $this->assertIdentical(\Drupal::config($config_name)->get($config_key), $new_data); // Verify that a new snapshot was created which and that it matches // the active config. diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigUpgradeTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigUpgradeTest.php index f55921e5a5c6c993392b21182d8f3b5b3913f79c..e95f134690d0c220564141b6070c48b97a686165 100644 --- a/core/modules/config/lib/Drupal/config/Tests/ConfigUpgradeTest.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigUpgradeTest.php @@ -59,7 +59,7 @@ function testConfigurationUpdate() { )); // Verify that variables have been converted and default values exist. - $config = config('config_upgrade.test'); + $config = \Drupal::config('config_upgrade.test'); $this->assertIdentical($config->get('foo'), $this->testContent); $this->assertIdentical($config->get('parent.bar'), $this->testContent); $this->assertIdentical($config->get('parent.baz'), 'Baz'); @@ -80,7 +80,7 @@ function testConfigurationUpdate() { )); // Verify that new variables have been converted and existing still exist. - $config = config('config_upgrade.test'); + $config = \Drupal::config('config_upgrade.test'); $this->assertIdentical($config->get('foo'), $this->testContent); $this->assertIdentical($config->get('parent.bar'), $this->testContent); $this->assertIdentical($config->get('parent.baz'), 'Baz'); @@ -101,7 +101,7 @@ function testConfigurationUpdate() { // For this test it is essential that update_variables_to_config has already // run on the config object. - config('config_upgrade.test') + \Drupal::config('config_upgrade.test') ->set('numeric_keys.403', '') ->set('numeric_keys.404', '') ->save(); @@ -118,6 +118,6 @@ function testConfigurationUpdate() { 'config_upgrade_404' => 'numeric_keys.404', )); - $this->assertIdentical(config('config_upgrade.test')->get('numeric_keys'), array(403 => 'custom403', 404 => 'custom404')); + $this->assertIdentical(\Drupal::config('config_upgrade.test')->get('numeric_keys'), array(403 => 'custom403', 404 => 'custom404')); } } diff --git a/core/modules/config/lib/Drupal/config/Tests/Storage/FileStorageTest.php b/core/modules/config/lib/Drupal/config/Tests/Storage/FileStorageTest.php index d4d492a40d459c45839a8ed77123d64208b582b0..60ce43390fc36e3ab166e1b059e68fb2cf202f5b 100644 --- a/core/modules/config/lib/Drupal/config/Tests/Storage/FileStorageTest.php +++ b/core/modules/config/lib/Drupal/config/Tests/Storage/FileStorageTest.php @@ -28,7 +28,7 @@ function setUp() { $this->invalidStorage = new FileStorage($this->configDirectories[CONFIG_ACTIVE_DIRECTORY] . '/nonexisting'); // FileStorage::listAll() requires other configuration data to exist. - $this->storage->write('system.performance', config('system.performance')->get()); + $this->storage->write('system.performance', \Drupal::config('system.performance')->get()); } protected function read($name) { diff --git a/core/modules/contact/contact.install b/core/modules/contact/contact.install index eaac51cfe366e889797d78334352a7a935854e54..60b51b01713cd571826009e688d683dfe689f320 100644 --- a/core/modules/contact/contact.install +++ b/core/modules/contact/contact.install @@ -12,11 +12,11 @@ * Implements hook_install(). */ function contact_install() { - $site_mail = config('system.site')->get('mail'); + $site_mail = Drupal::config('system.site')->get('mail'); if (empty($site_mail)) { $site_mail = ini_get('sendmail_from'); } - config('contact.category.feedback')->set('recipients', array($site_mail))->save(); + Drupal::config('contact.category.feedback')->set('recipients', array($site_mail))->save(); } /** @@ -61,12 +61,12 @@ function contact_update_8001() { $category->id = $category->cid; // Save default category setting. if ($category->selected) { - config('contact.settings') + Drupal::config('contact.settings') ->set('default_category', $category->id) ->save(); } // Save the config object. - config('contact.category.' . $category->id) + Drupal::config('contact.category.' . $category->id) ->set('id', $category->id) ->set('uuid', $uuid->generate()) ->set('label', $category->category) diff --git a/core/modules/contact/contact.module b/core/modules/contact/contact.module index d8984e8a06c9d3ff5f83cd5446837ea29aa8ee89..74cfb1e22458eb0c9b961eb2f4dc24251344a1ae 100644 --- a/core/modules/contact/contact.module +++ b/core/modules/contact/contact.module @@ -154,7 +154,7 @@ function _contact_personal_tab_access(UserInterface $account) { } // If the requested user did not save a preference yet, deny access if the // configured default is disabled. - elseif (!config('contact.settings')->get('user_default_enabled')) { + elseif (!Drupal::config('contact.settings')->get('user_default_enabled')) { return FALSE; } @@ -167,7 +167,7 @@ function _contact_personal_tab_access(UserInterface $account) { function contact_entity_bundle_info() { $bundles = array(); foreach (config_get_storage_names_with_prefix('contact.category.') as $config_name) { - $config = config($config_name); + $config = Drupal::config($config_name); $bundles['contact_message'][$config->get('id')]['label'] = $config->get('label'); } return $bundles; @@ -264,7 +264,7 @@ function contact_mail($key, &$message, $params) { $language = language_load($message['langcode']); $variables = array( - '!site-name' => config('system.site')->get('name'), + '!site-name' => Drupal::config('system.site')->get('name'), '!subject' => $contact_message->getSubject(), '!category' => !empty($params['contact_category']) ? $params['contact_category']->label() : NULL, '!form-url' => url(current_path(), array('absolute' => TRUE, 'language' => $language)), @@ -328,7 +328,7 @@ function contact_form_user_form_alter(&$form, &$form_state) { $form['contact']['contact'] = array( '#type' => 'checkbox', '#title' => t('Personal contact form'), - '#default_value' => isset($account_data) ? $account_data : config('contact.settings')->get('user_default_enabled'), + '#default_value' => isset($account_data) ? $account_data : Drupal::config('contact.settings')->get('user_default_enabled'), '#description' => t('Allow other users to contact you via a personal contact form which keeps your e-mail address hidden. Note that some privileged users such as site administrators are still able to contact you even if you choose to disable this feature.'), ); $form['actions']['submit']['#submit'][] = 'contact_user_profile_form_submit'; @@ -361,7 +361,7 @@ function contact_form_user_admin_settings_alter(&$form, &$form_state) { '#type' => 'checkbox', '#title' => t('Enable the personal contact form by default for new users.'), '#description' => t('Changing this setting will not affect existing users.'), - '#default_value' => config('contact.settings')->get('user_default_enabled'), + '#default_value' => Drupal::config('contact.settings')->get('user_default_enabled'), ); // Add submit handler to save contact configuration. $form['#submit'][] = 'contact_form_user_admin_settings_submit'; @@ -373,7 +373,7 @@ function contact_form_user_admin_settings_alter(&$form, &$form_state) { * @see contact_form_user_admin_settings_alter() */ function contact_form_user_admin_settings_submit($form, &$form_state) { - config('contact.settings') + Drupal::config('contact.settings') ->set('user_default_enabled', $form_state['values']['contact_default_status']) ->save(); } diff --git a/core/modules/contact/contact.pages.inc b/core/modules/contact/contact.pages.inc index 52afd289b70421f0387d38b4e278f5bcdda31cc8..c7b7539fc18f32d17f26a917739618a9051b8b5a 100644 --- a/core/modules/contact/contact.pages.inc +++ b/core/modules/contact/contact.pages.inc @@ -30,7 +30,7 @@ function contact_site_page(Category $category = NULL) { if (!isset($category)) { $categories = entity_load_multiple('contact_category'); - $default_category = config('contact.settings')->get('default_category'); + $default_category = Drupal::config('contact.settings')->get('default_category'); if (isset($categories[$default_category])) { $category = $categories[$default_category]; } @@ -93,7 +93,7 @@ function contact_personal_page($recipient) { * @see contact_personal_page() */ function contact_flood_control() { - $config = config('contact.settings'); + $config = Drupal::config('contact.settings'); $limit = $config->get('flood.limit'); $interval = $config->get('flood.interval'); if (!Drupal::service('flood')->isAllowed('contact', $limit, $interval)) { diff --git a/core/modules/contact/lib/Drupal/contact/CategoryFormController.php b/core/modules/contact/lib/Drupal/contact/CategoryFormController.php index 5f2e78c1284f87eb7122da94dc3b58d188857b9e..bd12a6637fa8706778514a31d69f1391272ecc8a 100644 --- a/core/modules/contact/lib/Drupal/contact/CategoryFormController.php +++ b/core/modules/contact/lib/Drupal/contact/CategoryFormController.php @@ -21,7 +21,7 @@ public function form(array $form, array &$form_state) { $form = parent::form($form, $form_state); $category = $this->entity; - $default_category = config('contact.settings')->get('default_category'); + $default_category = \Drupal::config('contact.settings')->get('default_category'); $form['label'] = array( '#type' => 'textfield', @@ -108,7 +108,7 @@ public function save(array $form, array &$form_state) { } // Update the default category. - $contact_config = config('contact.settings'); + $contact_config = \Drupal::config('contact.settings'); if ($form_state['values']['selected']) { $contact_config ->set('default_category', $category->id()) diff --git a/core/modules/contact/lib/Drupal/contact/CategoryListController.php b/core/modules/contact/lib/Drupal/contact/CategoryListController.php index 820010f807189df6bf17433b47a6aa2d9df158cd..7a6a5134f8ed0aee25923dc72840226b424f8e23 100644 --- a/core/modules/contact/lib/Drupal/contact/CategoryListController.php +++ b/core/modules/contact/lib/Drupal/contact/CategoryListController.php @@ -66,7 +66,7 @@ public function buildRow(EntityInterface $entity) { } else { $row['recipients'] = check_plain(implode(', ', $entity->recipients)); - $default_category = config('contact.settings')->get('default_category'); + $default_category = \Drupal::config('contact.settings')->get('default_category'); $row['selected'] = ($default_category == $entity->id() ? t('Yes') : t('No')); } $row['operations']['data'] = $this->buildOperations($entity); diff --git a/core/modules/contact/lib/Drupal/contact/MessageFormController.php b/core/modules/contact/lib/Drupal/contact/MessageFormController.php index 5f2ede7657be499577347170ec4051d364aa9ca9..d41c9598fd5aca80e1a394b2c024beacdb13063b 100644 --- a/core/modules/contact/lib/Drupal/contact/MessageFormController.php +++ b/core/modules/contact/lib/Drupal/contact/MessageFormController.php @@ -187,7 +187,7 @@ public function save(array $form, array &$form_state) { drupal_mail('contact', 'page_autoreply', $sender->getEmail(), $language_interface->id, $params); } - \Drupal::service('flood')->register('contact', config('contact.settings')->get('flood.interval')); + \Drupal::service('flood')->register('contact', \Drupal::config('contact.settings')->get('flood.interval')); if (!$message->isPersonal()) { watchdog('contact', '%sender-name (@sender-from) sent an e-mail regarding %category.', array( '%sender-name' => $sender->name, diff --git a/core/modules/contact/lib/Drupal/contact/Tests/ContactPersonalTest.php b/core/modules/contact/lib/Drupal/contact/Tests/ContactPersonalTest.php index 61f1fb9da19ce8b7545b578b09c536d8e039d596..7e1bd7188c95f2e899c077223c64137482bcca9a 100644 --- a/core/modules/contact/lib/Drupal/contact/Tests/ContactPersonalTest.php +++ b/core/modules/contact/lib/Drupal/contact/Tests/ContactPersonalTest.php @@ -57,7 +57,7 @@ function setUp() { $this->admin_user = $this->drupalCreateUser(array('administer contact forms', 'administer users')); // Create some normal users with their contact forms enabled by default. - config('contact.settings')->set('user_default_enabled', 1)->save(); + \Drupal::config('contact.settings')->set('user_default_enabled', 1)->save(); $this->web_user = $this->drupalCreateUser(array('access user contact forms')); $this->contact_user = $this->drupalCreateUser(); } @@ -76,7 +76,7 @@ function testSendPersonalContactMessage() { $this->assertEqual($mail['from'], $this->web_user->getEmail()); $this->assertEqual($mail['key'], 'user_mail'); $variables = array( - '!site-name' => config('system.site')->get('name'), + '!site-name' => \Drupal::config('system.site')->get('name'), '!subject' => $message['subject'], '!recipient-name' => $this->contact_user->getUsername(), ); @@ -181,7 +181,7 @@ function testPersonalContactAccess() { */ function testPersonalContactFlood() { $flood_limit = 3; - config('contact.settings')->set('flood.limit', $flood_limit)->save(); + \Drupal::config('contact.settings')->set('flood.limit', $flood_limit)->save(); // Clear flood table in preparation for flood test and allow other checks to complete. db_delete('flood')->execute(); @@ -198,7 +198,7 @@ function testPersonalContactFlood() { // Submit contact form one over limit. $this->drupalGet('user/' . $this->contact_user->id(). '/contact'); - $this->assertRaw(t('You cannot send more than %number messages in @interval. Try again later.', array('%number' => $flood_limit, '@interval' => format_interval(config('contact.settings')->get('flood.interval')))), 'Normal user denied access to flooded contact form.'); + $this->assertRaw(t('You cannot send more than %number messages in @interval. Try again later.', array('%number' => $flood_limit, '@interval' => format_interval(\Drupal::config('contact.settings')->get('flood.interval')))), 'Normal user denied access to flooded contact form.'); // Test that the admin user can still access the contact form even though // the flood limit was reached. diff --git a/core/modules/contact/lib/Drupal/contact/Tests/ContactSitewideTest.php b/core/modules/contact/lib/Drupal/contact/Tests/ContactSitewideTest.php index 42f44237779f360be76a9f6e4fad7a24a05d46d6..56b902ed3ce905cfad6c54f68f710b35222be02c 100644 --- a/core/modules/contact/lib/Drupal/contact/Tests/ContactSitewideTest.php +++ b/core/modules/contact/lib/Drupal/contact/Tests/ContactSitewideTest.php @@ -44,7 +44,7 @@ function testSiteWideContact() { $this->drupalLogin($admin_user); $flood_limit = 3; - config('contact.settings') + \Drupal::config('contact.settings') ->set('flood.limit', $flood_limit) ->set('flood.interval', 600) ->save(); @@ -110,7 +110,7 @@ function testSiteWideContact() { $this->assertRaw(t('Category %label has been added.', array('%label' => $label))); // Check that the category was created in site default language. - $langcode = config('contact.category.' . $id)->get('langcode'); + $langcode = \Drupal::config('contact.category.' . $id)->get('langcode'); $default_langcode = language_default()->id; $this->assertEqual($langcode, $default_langcode); @@ -119,15 +119,15 @@ function testSiteWideContact() { // Test update contact form category. $this->updateCategory($id, $label = $this->randomName(16), $recipients_str = implode(',', array($recipients[0], $recipients[1])), $reply = $this->randomName(30), FALSE); - $config = config('contact.category.' . $id)->get(); + $config = \Drupal::config('contact.category.' . $id)->get(); $this->assertEqual($config['label'], $label); $this->assertEqual($config['recipients'], array($recipients[0], $recipients[1])); $this->assertEqual($config['reply'], $reply); - $this->assertNotEqual($id, config('contact.settings')->get('default_category')); + $this->assertNotEqual($id, \Drupal::config('contact.settings')->get('default_category')); $this->assertRaw(t('Category %label has been updated.', array('%label' => $label))); // Reset the category back to be the default category. - config('contact.settings')->set('default_category', $id)->save(); + \Drupal::config('contact.settings')->set('default_category', $id)->save(); // Ensure that the contact form is shown without a category selection input. user_role_grant_permissions(DRUPAL_ANONYMOUS_RID, array('access site-wide contact form')); @@ -182,7 +182,7 @@ function testSiteWideContact() { $this->assertText(t('Message field is required.')); // Test contact form with no default category selected. - config('contact.settings') + \Drupal::config('contact.settings') ->set('default_category', '') ->save(); $this->drupalGet('contact'); @@ -202,7 +202,7 @@ function testSiteWideContact() { // Submit contact form one over limit. $this->drupalGet('contact'); $this->assertResponse(403); - $this->assertRaw(t('You cannot send more than %number messages in @interval. Try again later.', array('%number' => config('contact.settings')->get('flood.limit'), '@interval' => format_interval(600)))); + $this->assertRaw(t('You cannot send more than %number messages in @interval. Try again later.', array('%number' => \Drupal::config('contact.settings')->get('flood.limit'), '@interval' => format_interval(600)))); // Test listing controller. $this->drupalLogin($admin_user); @@ -376,7 +376,7 @@ function submitContact($name, $mail, $subject, $id, $message) { $edit['mail'] = $mail; $edit['subject'] = $subject; $edit['message'] = $message; - if ($id == config('contact.settings')->get('default_category')) { + if ($id == \Drupal::config('contact.settings')->get('default_category')) { $this->drupalPost('contact', $edit, t('Send message')); } else { diff --git a/core/modules/contact/lib/Drupal/contact/Tests/ContactUpgradePathTest.php b/core/modules/contact/lib/Drupal/contact/Tests/ContactUpgradePathTest.php index 4c61653d2ad0f877c63ac6bd1bc7f09158990a25..b5785aa16cedf264c258b2501db1cab5913707a2 100644 --- a/core/modules/contact/lib/Drupal/contact/Tests/ContactUpgradePathTest.php +++ b/core/modules/contact/lib/Drupal/contact/Tests/ContactUpgradePathTest.php @@ -60,7 +60,7 @@ public function testContactUpgrade() { $this->assertEqual($contact_category->recipients, array('test1@example.com', 'test2@example.com')); // Ensure that the default category has been maintained. - $this->assertEqual(config('contact.settings')->get('default_category'), $default_contact_category, 'Default category upgraded.'); + $this->assertEqual(\Drupal::config('contact.settings')->get('default_category'), $default_contact_category, 'Default category upgraded.'); // Check that no default config imported on upgrade. $this->assertFalse(entity_load('contact_category', 'feedback')); diff --git a/core/modules/content_translation/content_translation.module b/core/modules/content_translation/content_translation.module index 56d950885fa26861c5fc0e0b1063d326092a74fa..34e918ca1888e77127bacc559a9ef352b476de9b 100644 --- a/core/modules/content_translation/content_translation.module +++ b/core/modules/content_translation/content_translation.module @@ -413,7 +413,7 @@ function content_translation_get_config_key($entity_type, $bundle, $setting) { */ function content_translation_get_config($entity_type, $bundle, $setting) { $key = content_translation_get_config_key($entity_type, $bundle, $setting); - return config('content_translation.settings')->get($key); + return Drupal::config('content_translation.settings')->get($key); } /** @@ -430,7 +430,7 @@ function content_translation_get_config($entity_type, $bundle, $setting) { */ function content_translation_set_config($entity_type, $bundle, $setting, $value) { $key = content_translation_get_config_key($entity_type, $bundle, $setting); - return config('content_translation.settings')->set($key, $value)->save(); + return Drupal::config('content_translation.settings')->set($key, $value)->save(); } /** diff --git a/core/modules/datetime/lib/Drupal/datetime/DateHelper.php b/core/modules/datetime/lib/Drupal/datetime/DateHelper.php index 39c770e15ebea74a15f9835976504c3fabcc4964..3f8b0f84dace3679edf53831b95c983ae3127bd4 100644 --- a/core/modules/datetime/lib/Drupal/datetime/DateHelper.php +++ b/core/modules/datetime/lib/Drupal/datetime/DateHelper.php @@ -259,7 +259,7 @@ public static function weekDaysAbbr1($required = FALSE) { * An array of weekdays reordered to match the first day of the week. */ public static function weekDaysOrdered($weekdays) { - $first_day = config('system.date')->get('first_day'); + $first_day = \Drupal::config('system.date')->get('first_day'); if ($first_day > 0) { for ($i = 1; $i <= $first_day; $i++) { $last = array_shift($weekdays); diff --git a/core/modules/dblog/dblog.module b/core/modules/dblog/dblog.module index 202cfcf5c757592165e9df0c8d3ad67e6f2a71c7..9bd8f7f76c0f930c409412eca0f1f83fd94faec5 100644 --- a/core/modules/dblog/dblog.module +++ b/core/modules/dblog/dblog.module @@ -99,7 +99,7 @@ function dblog_page_build(&$page) { */ function dblog_cron() { // Cleanup the watchdog table. - $row_limit = config('dblog.settings')->get('row_limit'); + $row_limit = Drupal::config('dblog.settings')->get('row_limit'); // For row limit n, get the wid of the nth row in descending wid order. // Counting the most recent n rows avoids issues with wid number sequences, @@ -169,7 +169,7 @@ function dblog_form_system_logging_settings_alter(&$form, $form_state) { $form['dblog_row_limit'] = array( '#type' => 'select', '#title' => t('Database log messages to keep'), - '#default_value' => config('dblog.settings')->get('row_limit'), + '#default_value' => Drupal::config('dblog.settings')->get('row_limit'), '#options' => array(0 => t('All')) + drupal_map_assoc(array(100, 1000, 10000, 100000, 1000000)), '#description' => t('The maximum number of messages to keep in the database log. Requires a cron maintenance task.', array('@cron' => url('admin/reports/status'))) ); @@ -183,5 +183,5 @@ function dblog_form_system_logging_settings_alter(&$form, $form_state) { * @see dblog_form_system_logging_settings_alter() */ function dblog_logging_settings_submit($form, &$form_state) { - config('dblog.settings')->set('row_limit', $form_state['values']['dblog_row_limit'])->save(); + Drupal::config('dblog.settings')->set('row_limit', $form_state['values']['dblog_row_limit'])->save(); } diff --git a/core/modules/dblog/lib/Drupal/dblog/Tests/DbLogTest.php b/core/modules/dblog/lib/Drupal/dblog/Tests/DbLogTest.php index 59a40c3ec624c05f7e477b6434c9e91277625725..440638320adde5c89def24cc56a8107be7598e23 100644 --- a/core/modules/dblog/lib/Drupal/dblog/Tests/DbLogTest.php +++ b/core/modules/dblog/lib/Drupal/dblog/Tests/DbLogTest.php @@ -90,7 +90,7 @@ private function verifyRowLimit($row_limit) { $this->assertResponse(200); // Check row limit variable. - $current_limit = config('dblog.settings')->get('row_limit'); + $current_limit = \Drupal::config('dblog.settings')->get('row_limit'); $this->assertTrue($current_limit == $row_limit, format_string('[Cache] Row limit variable of @count equals row limit of @limit', array('@count' => $current_limit, '@limit' => $row_limit))); } diff --git a/core/modules/entity/entity.install b/core/modules/entity/entity.install index af2aba14dd120d6d7a9416ae588b60492643c6ac..9cbd71e5c7e8860c0d05f89ebb483c2fcba5f4f2 100644 --- a/core/modules/entity/entity.install +++ b/core/modules/entity/entity.install @@ -25,7 +25,7 @@ */ function _update_8000_entity_get_display($entity_type, $bundle, $view_mode) { $id = $entity_type . '.' . $bundle . '.' . $view_mode; - $config = config("entity.display.$id"); + $config = Drupal::config("entity.display.$id"); if ($config->get()) { return $config; } @@ -64,7 +64,7 @@ function _update_8000_entity_get_display($entity_type, $bundle, $view_mode) { */ function _update_8000_entity_get_form_display($entity_type, $bundle, $form_mode) { $id = $entity_type . '.' . $bundle . '.' . $form_mode; - $config = config("entity.form_display.$id"); + $config = Drupal::config("entity.form_display.$id"); if ($config->get()) { return $config; } diff --git a/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceSelectionAccessTest.php b/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceSelectionAccessTest.php index 1482d4ed2a787fc11cb0758080bec05696e98c17..c3107ecb484b902a653621c4cbff4cd48752e41b 100644 --- a/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceSelectionAccessTest.php +++ b/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceSelectionAccessTest.php @@ -248,7 +248,7 @@ public function testUserHandler() { ), ); - $user_values['anonymous']->name = config('user.settings')->get('anonymous'); + $user_values['anonymous']->name = \Drupal::config('user.settings')->get('anonymous'); $users = array(); $user_labels = array(); diff --git a/core/modules/field/field.module b/core/modules/field/field.module index 2457e4acd498f32d4d6efa3be5a6ffb4de4a4cde..c2eda351931b31700af5be8130db68711dc00f96 100644 --- a/core/modules/field/field.module +++ b/core/modules/field/field.module @@ -191,7 +191,7 @@ function field_cron() { field_sync_field_status(); // Do a pass of purging on deleted Field API data, if any exists. - $limit = config('field.settings')->get('purge_batch_size'); + $limit = Drupal::config('field.settings')->get('purge_batch_size'); field_purge_batch($limit); } diff --git a/core/modules/field/field.multilingual.inc b/core/modules/field/field.multilingual.inc index ca33a319d2bae2b783d5138b273b9dc1caf8e428..0442bbd3c2c8d7f8bee1dc6a0b99f21cac014f73 100644 --- a/core/modules/field/field.multilingual.inc +++ b/core/modules/field/field.multilingual.inc @@ -155,7 +155,7 @@ function field_content_languages() { * Checks whether field language fallback is enabled. */ function field_language_fallback_enabled() { - return language_multilingual() && config('field.settings')->get('language_fallback'); + return language_multilingual() && Drupal::config('field.settings')->get('language_fallback'); } /** diff --git a/core/modules/field/lib/Drupal/field/Tests/CrudTest.php b/core/modules/field/lib/Drupal/field/Tests/CrudTest.php index 70c223606f3fae15accaa887abd3fcb8514abca8..8e16c3e4add70e69affec354a66d7d4e85b329ad 100644 --- a/core/modules/field/lib/Drupal/field/Tests/CrudTest.php +++ b/core/modules/field/lib/Drupal/field/Tests/CrudTest.php @@ -64,7 +64,7 @@ function testCreateField() { $this->assertEqual($field_config['settings'], $field_type['settings'], 'Default field settings have been written.'); // Ensure that default storage was set. - $this->assertEqual($field_config['storage']['type'], config('field.settings')->get('default_storage'), 'The field type is properly saved.'); + $this->assertEqual($field_config['storage']['type'], \Drupal::config('field.settings')->get('default_storage'), 'The field type is properly saved.'); // Guarantee that the name is unique. try { diff --git a/core/modules/field/lib/Drupal/field/Tests/FormTest.php b/core/modules/field/lib/Drupal/field/Tests/FormTest.php index b7c600e084e974d617401f496ddf72c4adcf284f..b263859125b08d8ad274c64840908dd8ad209b49 100644 --- a/core/modules/field/lib/Drupal/field/Tests/FormTest.php +++ b/core/modules/field/lib/Drupal/field/Tests/FormTest.php @@ -92,7 +92,7 @@ function testFieldFormSingle() { $this->drupalGet('entity_test/add'); // Create token value expected for description. - $token_description = check_plain(config('system.site')->get('name')) . '_description'; + $token_description = check_plain(\Drupal::config('system.site')->get('name')) . '_description'; $this->assertText($token_description, 'Token replacement for description is displayed'); $this->assertFieldByName("{$field_name}[$langcode][0][value]", '', 'Widget is displayed'); $this->assertNoField("{$field_name}[$langcode][1][value]", 'No extraneous widget is displayed'); diff --git a/core/modules/field_sql_storage/field_sql_storage.install b/core/modules/field_sql_storage/field_sql_storage.install index 8d14ca85130028db8dff187fc80fb6a2735f31bb..5c9eef2e92ab92bcd4533654d6cbe2e29cf2ebde 100644 --- a/core/modules/field_sql_storage/field_sql_storage.install +++ b/core/modules/field_sql_storage/field_sql_storage.install @@ -96,7 +96,7 @@ function field_sql_storage_update_8000(&$sandbox) { // Retrieve the next field definition. When the index exceeds the number of // 'configuration' fields, use it to iterate on deleted fields. if (isset($config_names[$sandbox['index']])) { - $field_config = config($config_names[$sandbox['index']])->get(); + $field_config = Drupal::config($config_names[$sandbox['index']])->get(); } else { $field_config = $deleted_fields[$sandbox['index'] - count($config_names)]; diff --git a/core/modules/field_ui/lib/Drupal/field_ui/FieldOverview.php b/core/modules/field_ui/lib/Drupal/field_ui/FieldOverview.php index 621c08dd85f45778dea21540bdadb4fd0d7b3e42..d2208a1ac6868a5e0a74cb29494938d662671117 100644 --- a/core/modules/field_ui/lib/Drupal/field_ui/FieldOverview.php +++ b/core/modules/field_ui/lib/Drupal/field_ui/FieldOverview.php @@ -92,7 +92,7 @@ public function buildForm(array $form, array &$form_state, $entity_type = NULL, $field_types = $this->fieldTypeManager->getDefinitions(); // Field prefix. - $field_prefix = config('field_ui.settings')->get('field_prefix'); + $field_prefix = \Drupal::config('field_ui.settings')->get('field_prefix'); $form += array( '#entity_type' => $this->entity_type, @@ -327,7 +327,7 @@ protected function validateAddNew(array $form, array &$form_state) { $field_name = $field['field_name']; // Add the field prefix. - $field_name = config('field_ui.settings')->get('field_prefix') . $field_name; + $field_name = \Drupal::config('field_ui.settings')->get('field_prefix') . $field_name; form_set_value($form['fields']['_add_new_field']['field_name'], $field_name, $form_state); } diff --git a/core/modules/file/file.field.inc b/core/modules/file/file.field.inc index 6445527149593e1c7807948295b3a59aa3019413..3e3806e8b43a3009c6d3b7e224809388993c4d50 100644 --- a/core/modules/file/file.field.inc +++ b/core/modules/file/file.field.inc @@ -414,7 +414,7 @@ function file_field_widget_process($element, &$form_state, $form) { // Add the description field if enabled. if ($element['#description_field'] && $item['fids']) { - $config = config('file.settings'); + $config = Drupal::config('file.settings'); $element['description'] = array( '#type' => $config->get('description.type'), '#title' => t('Description'), diff --git a/core/modules/file/file.install b/core/modules/file/file.install index 614b07c95f505d022da33a26b3785b130488f03a..37b89aeaa4d83131f5a96f114099c8e9abe573e2 100644 --- a/core/modules/file/file.install +++ b/core/modules/file/file.install @@ -303,7 +303,7 @@ function file_update_8002() { */ function file_update_8003() { foreach (config_get_storage_names_with_prefix('field.field.') as $config_name) { - $field_config = config($config_name); + $field_config = Drupal::config($config_name); // Only update file fields that use the default SQL storage. if (in_array($field_config->get('type'), array('file', 'image')) && $field_config->get('storage.type') == 'field_sql_storage') { $field = new Field($field_config->get()); diff --git a/core/modules/file/file.module b/core/modules/file/file.module index e9352defd52d31efbe4a555ee56e2e2635d669da..018eef643a1d4eb5cb7a2422e0acaa8986d70fe1 100644 --- a/core/modules/file/file.module +++ b/core/modules/file/file.module @@ -875,7 +875,7 @@ function file_save_upload($form_field_name, $validators = array(), $destination // rename filename.php.foo and filename.php to filename.php.foo.txt and // filename.php.txt, respectively). Don't rename if 'allow_insecure_uploads' // evaluates to TRUE. - if (!config('system.file')->get('allow_insecure_uploads') && preg_match('/\.(php|pl|py|cgi|asp|js)(\.|$)/i', $file->getFilename()) && (substr($file->getFilename(), -4) != '.txt')) { + if (!Drupal::config('system.file')->get('allow_insecure_uploads') && preg_match('/\.(php|pl|py|cgi|asp|js)(\.|$)/i', $file->getFilename()) && (substr($file->getFilename(), -4) != '.txt')) { $file->setMimeType('text/plain'); $file->setFileUri($file->getFileUri() . '.txt'); $file->setFilename($file->getFilename() . '.txt'); @@ -1663,7 +1663,7 @@ function file_icon_url(File $file, $icon_directory = NULL) { function file_icon_path(File $file, $icon_directory = NULL) { // Use the default set of icons if none specified. if (!isset($icon_directory)) { - $icon_directory = config('file.settings')->get('icon.directory'); + $icon_directory = Drupal::config('file.settings')->get('icon.directory'); } // If there's an icon matching the exact mimetype, go for it. diff --git a/core/modules/file/lib/Drupal/file/Tests/RemoteFileSaveUploadTest.php b/core/modules/file/lib/Drupal/file/Tests/RemoteFileSaveUploadTest.php index fb5e68bb1823db19bf5d1847a5b53cef56829aff..b9932b7317d7e03df283e9ef01fd3c3af714d113 100644 --- a/core/modules/file/lib/Drupal/file/Tests/RemoteFileSaveUploadTest.php +++ b/core/modules/file/lib/Drupal/file/Tests/RemoteFileSaveUploadTest.php @@ -27,6 +27,6 @@ public static function getInfo() { function setUp() { parent::setUp(); - config('system.file')->set('default_scheme', 'dummy-remote')->save(); + \Drupal::config('system.file')->set('default_scheme', 'dummy-remote')->save(); } } diff --git a/core/modules/file/lib/Drupal/file/Tests/SaveUploadTest.php b/core/modules/file/lib/Drupal/file/Tests/SaveUploadTest.php index 84261cb95c7ac8e7baf7a150c0265c517e9c3917..6246e5d4340514574496e2026643ac08447d8616 100644 --- a/core/modules/file/lib/Drupal/file/Tests/SaveUploadTest.php +++ b/core/modules/file/lib/Drupal/file/Tests/SaveUploadTest.php @@ -180,7 +180,7 @@ function testHandleExtension() { * Test dangerous file handling. */ function testHandleDangerousFile() { - $config = config('system.file'); + $config = \Drupal::config('system.file'); // Allow the .php extension and make sure it gets renamed to .txt for // safety. Also check to make sure its MIME type was changed. $edit = array( @@ -224,7 +224,7 @@ function testHandleDangerousFile() { */ function testHandleFileMunge() { // Ensure insecure uploads are disabled for this test. - config('system.file')->set('allow_insecure_uploads', 0)->save(); + \Drupal::config('system.file')->set('allow_insecure_uploads', 0)->save(); $this->image = file_move($this->image, $this->image->getFileUri() . '.foo.' . $this->image_extension); // Reset the hook counters to get rid of the 'move' we just called. diff --git a/core/modules/filter/filter.install b/core/modules/filter/filter.install index b450c36c5ae1958f1729a2574e8d7c09f2ac0a3f..8508e9dc94ead9688626173ad450cd083e7e2001 100644 --- a/core/modules/filter/filter.install +++ b/core/modules/filter/filter.install @@ -49,7 +49,7 @@ function filter_update_8001() { $format['filters'] = $filters; // Save the config object. - $config = config('filter.format.' . $id); + $config = Drupal::config('filter.format.' . $id); $config->setData($format); $config->save(); } diff --git a/core/modules/filter/filter.module b/core/modules/filter/filter.module index 1a0d9d132024e607de32573b7556b35855178445..58d3a073117df35a356550f90e43e11707fea45f 100644 --- a/core/modules/filter/filter.module +++ b/core/modules/filter/filter.module @@ -584,7 +584,7 @@ function filter_fallback_format() { // existing (and potentially unsafe) text format on the site automatically // available to all users. Returning NULL at least guarantees that this // cannot happen. - return config('filter.settings')->get('fallback_format'); + return Drupal::config('filter.settings')->get('fallback_format'); } /** @@ -839,7 +839,7 @@ function filter_process_format($element) { // If multiple text formats are available, remove the fallback. The // "always_show_fallback_choice" is a hidden variable that has no UI. It // defaults to false. - if (!config('filter.settings')->get('always_show_fallback_choice')) { + if (!Drupal::config('filter.settings')->get('always_show_fallback_choice')) { $fallback_format = filter_fallback_format(); if ($element['#format'] !== $fallback_format && count($formats) > 1) { unset($formats[$fallback_format]); @@ -1209,7 +1209,7 @@ function _filter_url($text, $filter) { // we cannot cleanly differ between protocols here without hard-coding MAILTO, // so '//' is optional for all protocols. // @see filter_xss_bad_protocol() - $protocols = config('system.filter')->get('protocols'); + $protocols = Drupal::config('system.filter')->get('protocols'); $protocols = implode(':(?://)?|', $protocols) . ':(?://)?'; $valid_url_path_characters = "[\p{L}\p{M}\p{N}!\*\';:=\+,\.\$\/%#\[\]\-_~@&]"; diff --git a/core/modules/filter/lib/Drupal/filter/Plugin/Filter/FilterHtml.php b/core/modules/filter/lib/Drupal/filter/Plugin/Filter/FilterHtml.php index 177ccdb4045d65ee5aeeaf3261f1a8b561a34a33..04c312a4153609db54de0d70f9094c9b6948f4d3 100644 --- a/core/modules/filter/lib/Drupal/filter/Plugin/Filter/FilterHtml.php +++ b/core/modules/filter/lib/Drupal/filter/Plugin/Filter/FilterHtml.php @@ -102,7 +102,7 @@ public function tips($long = FALSE) { $output .= '

' . t('This site allows HTML content. While learning all of HTML may feel intimidating, learning how to use a very small number of the most basic HTML "tags" is very easy. This table provides examples for each tag that is enabled on this site.') . '

'; $output .= '

' . t('For more information see W3C\'s HTML Specifications or use your favorite search engine to find other sites that explain HTML.', array('@html-specifications' => 'http://www.w3.org/TR/html/')) . '

'; $tips = array( - 'a' => array(t('Anchors are used to make links to other pages.'), '' . check_plain(config('system.site')->get('name')) . ''), + 'a' => array(t('Anchors are used to make links to other pages.'), '' . check_plain(\Drupal::config('system.site')->get('name')) . ''), 'br' => array(t('By default line break tags are automatically added, so use this tag to add additional ones. Use of this tag is different because it is not used with an open/close pair like all the others. Use the extra " /" inside the tag to maintain XHTML 1.0 compatibility'), t('Text with
line break')), 'p' => array(t('By default paragraph tags are automatically added, so use this tag to add additional ones.'), '

' . t('Paragraph one.') . '

' . t('Paragraph two.') . '

'), 'strong' => array(t('Strong', array(), array('context' => 'Font weight')), '' . t('Strong', array(), array('context' => 'Font weight')) . ''), diff --git a/core/modules/filter/lib/Drupal/filter/Tests/FilterAdminTest.php b/core/modules/filter/lib/Drupal/filter/Tests/FilterAdminTest.php index 503930514f36d66ef34b6018aaefd8cdaa3124ac..5f3f6fd4e370defaf7828306f2c6a8a7b3354a2d 100644 --- a/core/modules/filter/lib/Drupal/filter/Tests/FilterAdminTest.php +++ b/core/modules/filter/lib/Drupal/filter/Tests/FilterAdminTest.php @@ -248,7 +248,7 @@ function testFilterAdmin() { // Use plain text and see if it escapes all tags, whether allowed or not. // In order to test plain text, we have to enable the hidden variable for // "show_fallback_format", which displays plain text in the format list. - config('filter.settings') + \Drupal::config('filter.settings') ->set('always_show_fallback_choice', TRUE) ->save(); $edit = array(); @@ -256,7 +256,7 @@ function testFilterAdmin() { $this->drupalPost('node/' . $node->id() . '/edit', $edit, t('Save')); $this->drupalGet('node/' . $node->id()); $this->assertText(check_plain($text), 'The "Plain text" text format escapes all HTML tags.'); - config('filter.settings') + \Drupal::config('filter.settings') ->set('always_show_fallback_choice', FALSE) ->save(); diff --git a/core/modules/filter/lib/Drupal/filter/Tests/FilterUnitTest.php b/core/modules/filter/lib/Drupal/filter/Tests/FilterUnitTest.php index cd5a762eb5e73e5d9f8d59f27996055b631a6d1f..d3461f31b10c66d2d9bebfd54a994dae397190eb 100644 --- a/core/modules/filter/lib/Drupal/filter/Tests/FilterUnitTest.php +++ b/core/modules/filter/lib/Drupal/filter/Tests/FilterUnitTest.php @@ -431,7 +431,7 @@ function testUrlFilter() { ), // Absolute URL protocols. // The list to test is found in the beginning of _filter_url() at - // $protocols = config('system.filter')->get('protocols')... (approx line 1555). + // $protocols = \Drupal::config('system.filter')->get('protocols')... (approx line 1555). ' https://example.com, ftp://ftp.example.com, diff --git a/core/modules/forum/forum.admin.inc b/core/modules/forum/forum.admin.inc index 7b19630221bcaa0c79cbe003fda7c83f90930ac3..c63b21f53ebcffbe49a0c410b9302ae687f91169 100644 --- a/core/modules/forum/forum.admin.inc +++ b/core/modules/forum/forum.admin.inc @@ -18,7 +18,7 @@ */ function forum_overview($form, &$form_state) { module_load_include('inc', 'taxonomy', 'taxonomy.admin'); - $config = config('forum.settings'); + $config = Drupal::config('forum.settings'); $vid = $config->get('vocabulary'); $vocabulary = entity_load('taxonomy_vocabulary', $vid); diff --git a/core/modules/forum/forum.install b/core/modules/forum/forum.install index cd7ebdbc23156cb8e2cf7b2e1d1dbb6d0092e6d6..60efc3038a73e181648a4a41a1e493acb457db3e 100644 --- a/core/modules/forum/forum.install +++ b/core/modules/forum/forum.install @@ -24,7 +24,7 @@ function forum_enable() { // Create the forum vocabulary if it does not exist. // @todo Change Forum module so forum.settings can contain the vocabulary's // machine name. - $config = config('forum.settings'); + $config = Drupal::config('forum.settings'); // If the module was disabled only, the current config may contain a valid // vocabulary ID already. $vocabulary = entity_load('taxonomy_vocabulary', $config->get('vocabulary')); diff --git a/core/modules/forum/forum.module b/core/modules/forum/forum.module index 4621ddd5c2241cf9e79336caef11cafceca1ac95..46921af74dffc8ac580e428ea2bad14e8e5be201 100644 --- a/core/modules/forum/forum.module +++ b/core/modules/forum/forum.module @@ -237,7 +237,7 @@ function forum_entity_info(&$info) { */ function forum_entity_bundle_info_alter(&$bundles) { // Take over URI construction for taxonomy terms that are forums. - if ($vid = config('forum.settings')->get('vocabulary')) { + if ($vid = Drupal::config('forum.settings')->get('vocabulary')) { if (isset($bundles['taxonomy_term'][$vid])) { $bundles['taxonomy_term'][$vid]['uri_callback'] = 'forum_uri'; } @@ -280,7 +280,7 @@ function forum_node_validate(EntityInterface $node, $form) { // vocabulary is selected, not a "container" term. if (!empty($node->taxonomy_forums[$langcode])) { // Extract the node's proper topic ID. - $containers = config('forum.settings')->get('containers'); + $containers = Drupal::config('forum.settings')->get('containers'); foreach ($node->taxonomy_forums[$langcode] as $delta => $item) { // If no term was selected (e.g. when no terms exist yet), remove the // item. @@ -450,7 +450,7 @@ function forum_permission() { */ function forum_taxonomy_term_delete(Term $term) { // For containers, remove the tid from the forum_containers variable. - $config = config('forum.settings'); + $config = Drupal::config('forum.settings'); $containers = $config->get('containers'); $key = array_search($term->id(), $containers); if ($key !== FALSE) { @@ -569,7 +569,7 @@ function forum_field_storage_pre_update(EntityInterface $entity, &$skip_fields) * Implements hook_form_BASE_FORM_ID_alter(). */ function forum_form_taxonomy_vocabulary_form_alter(&$form, &$form_state, $form_id) { - $vid = config('forum.settings')->get('vocabulary'); + $vid = Drupal::config('forum.settings')->get('vocabulary'); $vocabulary = $form_state['controller']->getEntity(); if ($vid == $vocabulary->id()) { $form['help_forum_vocab'] = array( @@ -591,7 +591,7 @@ function forum_form_taxonomy_vocabulary_form_alter(&$form, &$form_state, $form_i * Implements hook_form_FORM_ID_alter() for taxonomy_term_form(). */ function forum_form_taxonomy_term_form_alter(&$form, &$form_state, $form_id) { - $vid = config('forum.settings')->get('vocabulary'); + $vid = Drupal::config('forum.settings')->get('vocabulary'); if (isset($form['vid']['#value']) && $form['vid']['#value'] == $vid) { // Hide multiple parents select from forum terms. $form['relations']['parent']['#access'] = FALSE; @@ -673,7 +673,7 @@ function forum_forum_load($tid = NULL) { return $cache[$tid]; } - $config = config('forum.settings'); + $config = Drupal::config('forum.settings'); $vid = $config->get('vocabulary'); // Load and validate the parent term. @@ -988,7 +988,7 @@ function template_preprocess_forums(&$variables) { $variables['forums'] = array(); } - if ($variables['tid'] && array_search($variables['tid'], config('forum.settings')->get('containers')) === FALSE) { + if ($variables['tid'] && array_search($variables['tid'], Drupal::config('forum.settings')->get('containers')) === FALSE) { $variables['topics'] = array( '#theme' => 'forum_topic_list', '#tid' => $variables['tid'], @@ -1173,7 +1173,7 @@ function template_preprocess_forum_topic_list(&$variables) { * - first_new: Indicates whether this is the first topic with new posts. */ function template_preprocess_forum_icon(&$variables) { - $variables['hot_threshold'] = config('forum.settings')->get('topics.hot_threshold'); + $variables['hot_threshold'] = Drupal::config('forum.settings')->get('topics.hot_threshold'); if ($variables['num_posts'] > $variables['hot_threshold']) { $icon_status_class = $variables['new_posts'] ? 'hot-new' : 'hot'; diff --git a/core/modules/forum/forum.pages.inc b/core/modules/forum/forum.pages.inc index 6278bf3d1a17787ab85b328b44beadd776a85dfe..3908f31799fee3c8c58192aced104511edbe08c2 100644 --- a/core/modules/forum/forum.pages.inc +++ b/core/modules/forum/forum.pages.inc @@ -18,7 +18,7 @@ * @see forum_menu() */ function forum_page($forum_term = NULL) { - $config = config('forum.settings'); + $config = Drupal::config('forum.settings'); $vocabulary = entity_load('taxonomy_vocabulary', $config->get('vocabulary')); if (!isset($forum_term)) { diff --git a/core/modules/forum/lib/Drupal/forum/Tests/ForumTest.php b/core/modules/forum/lib/Drupal/forum/Tests/ForumTest.php index fe50a4d14115520daf16355f21f72eab7056b2c5..d09baf5dd65316178cc60cbe28de0ed30d03c502 100644 --- a/core/modules/forum/lib/Drupal/forum/Tests/ForumTest.php +++ b/core/modules/forum/lib/Drupal/forum/Tests/ForumTest.php @@ -240,7 +240,7 @@ function testForum() { */ function testAddOrphanTopic() { // Must remove forum topics to test creating orphan topics. - $vid = config('forum.settings')->get('vocabulary'); + $vid = \Drupal::config('forum.settings')->get('vocabulary'); $tids = \Drupal::entityQuery('taxonomy_term') ->condition('vid', $vid) ->execute(); @@ -340,7 +340,7 @@ private function doAdminTests($user) { */ function editForumVocabulary() { // Backup forum taxonomy. - $vid = config('forum.settings')->get('vocabulary'); + $vid = \Drupal::config('forum.settings')->get('vocabulary'); $original_vocabulary = entity_load('taxonomy_vocabulary', $vid); // Generate a random name and description. @@ -406,7 +406,7 @@ function createForum($type, $parent = 0) { ); // Verify forum. - $term = db_query("SELECT * FROM {taxonomy_term_data} t WHERE t.vid = :vid AND t.name = :name AND t.description = :desc", array(':vid' => config('forum.settings')->get('vocabulary'), ':name' => $name, ':desc' => $description))->fetchAssoc(); + $term = db_query("SELECT * FROM {taxonomy_term_data} t WHERE t.vid = :vid AND t.name = :name AND t.description = :desc", array(':vid' => \Drupal::config('forum.settings')->get('vocabulary'), ':name' => $name, ':desc' => $description))->fetchAssoc(); $this->assertTrue(!empty($term), 'The ' . $type . ' exists in the database'); // Verify forum hierarchy. @@ -437,7 +437,7 @@ function deleteForum($tid) { // Assert that the associated term has been removed from the // forum_containers variable. - $containers = config('forum.settings')->get('containers'); + $containers = \Drupal::config('forum.settings')->get('containers'); $this->assertFalse(in_array($tid, $containers), 'The forum_containers variable has been updated.'); } diff --git a/core/modules/image/image.admin.inc b/core/modules/image/image.admin.inc index 5f8d46a83a8d16c4386c83b6dad244c883cd9af0..a2280ff764a499d356f362dc14984a6b9b44a576 100644 --- a/core/modules/image/image.admin.inc +++ b/core/modules/image/image.admin.inc @@ -70,7 +70,7 @@ function theme_image_style_effects($variables) { function theme_image_style_preview($variables) { $style = $variables['style']; - $sample_image = config('image.settings')->get('preview_image'); + $sample_image = Drupal::config('image.settings')->get('preview_image'); $sample_width = 160; $sample_height = 160; diff --git a/core/modules/image/image.install b/core/modules/image/image.install index 58cf110bb103447707192f16b458d34797ae1ebb..39ddedf5da1b72a827f15a02956ac746577b396c 100644 --- a/core/modules/image/image.install +++ b/core/modules/image/image.install @@ -158,7 +158,7 @@ function image_update_8000() { // Convert each style into a configuration object. foreach ($styles as $name => $style) { - $config = config('image.style.' . $name); + $config = Drupal::config('image.style.' . $name); $config->set('name', $name); $config->set('effects', $style['effects']); $config->save(); diff --git a/core/modules/image/lib/Drupal/image/Tests/ImageStylesPathAndUrlTest.php b/core/modules/image/lib/Drupal/image/Tests/ImageStylesPathAndUrlTest.php index 4648701e8bf282f0d933ba256ea43b8da3f53384..880ee6fa8a7d699bae341c21fc107e8fa2e0d8a4 100644 --- a/core/modules/image/lib/Drupal/image/Tests/ImageStylesPathAndUrlTest.php +++ b/core/modules/image/lib/Drupal/image/Tests/ImageStylesPathAndUrlTest.php @@ -109,7 +109,7 @@ function doImageStyleUrlAndPathTests($scheme, $clean_url = TRUE, $extra_slash = // Make the default scheme neither "public" nor "private" to verify the // functions work for other than the default scheme. - config('system.file')->set('default_scheme', 'temporary')->save(); + \Drupal::config('system.file')->set('default_scheme', 'temporary')->save(); // Create the directories for the styles. $directory = $scheme . '://styles/' . $this->style->id(); @@ -200,7 +200,7 @@ function doImageStyleUrlAndPathTests($scheme, $clean_url = TRUE, $extra_slash = // Allow insecure image derivatives to be created for the remainder of this // test. - config('image.settings')->set('allow_insecure_derivatives', TRUE)->save(); + \Drupal::config('image.settings')->set('allow_insecure_derivatives', TRUE)->save(); // Create another working copy of the file. $files = $this->drupalGetTestFiles('image'); @@ -213,7 +213,7 @@ function doImageStyleUrlAndPathTests($scheme, $clean_url = TRUE, $extra_slash = // Suppress the security token in the URL, then get the URL of a file that // has not been created and try to create it. Check that the security token // is not present in the URL but that the image is still accessible. - config('image.settings')->set('suppress_itok_output', TRUE)->save(); + \Drupal::config('image.settings')->set('suppress_itok_output', TRUE)->save(); $generated_uri = $this->style->buildUri($original_uri); $this->assertFalse(file_exists($generated_uri), 'Generated file does not exist.'); $generate_url = $this->style->buildUrl($original_uri, $clean_url); diff --git a/core/modules/language/language.admin.inc b/core/modules/language/language.admin.inc index 041398eb27d377959340a823cdc12437a251e4a1..979419eba96554fb429afddc34a0a79fff74313f 100644 --- a/core/modules/language/language.admin.inc +++ b/core/modules/language/language.admin.inc @@ -284,7 +284,7 @@ function language_negotiation_configure_form() { '#language_negotiation_info' => language_negotiation_info(), ); $form['#language_types'] = array(); - $configurable = config('system.language.types')->get('configurable'); + $configurable = Drupal::config('system.language.types')->get('configurable'); foreach ($form['#language_types_info'] as $type => $info) { // Show locked language types only if they are configurable. if (empty($info['locked']) || in_array($type, $configurable)) { @@ -320,7 +320,7 @@ function language_negotiation_configure_form_table(&$form, $type) { ); // Only show configurability checkbox for the unlocked language types. if (empty($info['locked'])) { - $configurable = config('system.language.types')->get('configurable'); + $configurable = Drupal::config('system.language.types')->get('configurable'); $table_form['configurable'] = array( '#type' => 'checkbox', '#title' => t('Customize %language_name language detection to differ from User interface text language detection settings.', array('%language_name' => $info['name'])), @@ -483,7 +483,7 @@ function theme_language_negotiation_configure_form($variables) { function language_negotiation_configure_form_submit($form, &$form_state) { $configurable_types = $form['#language_types']; - $stored_values = config('system.language.types')->get('configurable'); + $stored_values = Drupal::config('system.language.types')->get('configurable'); $customized = array(); $method_weights_type = array(); diff --git a/core/modules/language/language.module b/core/modules/language/language.module index 66433d314c890f870b2b5218365ed8fe856f8fcb..4d2688c633e70f5ab9d37b354fb9c027b4b5d1ae 100644 --- a/core/modules/language/language.module +++ b/core/modules/language/language.module @@ -363,7 +363,7 @@ function language_configuration_element_submit(&$form, &$form_state) { * - language_show: if the language element should be hidden or not. */ function language_save_default_configuration($entity_type, $bundle, $values = array()) { - config('language.settings')->set(language_get_default_configuration_settings_key($entity_type, $bundle), array('langcode' => $values['langcode'], 'language_show' => $values['language_show']))->save(); + Drupal::config('language.settings')->set(language_get_default_configuration_settings_key($entity_type, $bundle), array('langcode' => $values['langcode'], 'language_show' => $values['language_show']))->save(); } /** @@ -380,7 +380,7 @@ function language_save_default_configuration($entity_type, $bundle, $values = ar * - language_show: if the language element is hidden or not. */ function language_get_default_configuration($entity_type, $bundle) { - $configuration = config('language.settings')->get(language_get_default_configuration_settings_key($entity_type, $bundle)); + $configuration = Drupal::config('language.settings')->get(language_get_default_configuration_settings_key($entity_type, $bundle)); if (is_null($configuration)) { $configuration = array(); } @@ -397,7 +397,7 @@ function language_get_default_configuration($entity_type, $bundle) { * A string representing the bundle. */ function language_clear_default_configuration($entity_type, $bundle) { - config('language.settings')->clear(language_get_default_configuration_settings_key($entity_type, $bundle))->save(); + Drupal::config('language.settings')->clear(language_get_default_configuration_settings_key($entity_type, $bundle))->save(); } /** @@ -803,7 +803,7 @@ function language_preprocess_block(&$variables) { * Drupal language codes as values. */ function language_get_browser_drupal_langcode_mappings() { - $config = config('language.mappings'); + $config = Drupal::config('language.mappings'); if ($config->isNew()) { return array(); } @@ -818,7 +818,7 @@ function language_get_browser_drupal_langcode_mappings() { * Drupal language codes as values. */ function language_set_browser_drupal_langcode_mappings($mappings) { - $config = config('language.mappings'); + $config = Drupal::config('language.mappings'); $config->setData($mappings); $config->save(); } diff --git a/core/modules/language/language.negotiation.inc b/core/modules/language/language.negotiation.inc index 9e145bba3a49d5cbd248e5789db6233a353e88a5..88348128ba70d4daff70e100ea7855b7bc5f9c73 100644 --- a/core/modules/language/language.negotiation.inc +++ b/core/modules/language/language.negotiation.inc @@ -243,7 +243,7 @@ function language_from_user_admin(array $languages, Request $request = NULL) { * A valid language code on success, FALSE otherwise. */ function language_from_session($languages) { - $param = config('language.negotiation')->get('session.parameter'); + $param = Drupal::config('language.negotiation')->get('session.parameter'); // Request parameter: we need to update the session parameter only if we have // an authenticated user. @@ -283,7 +283,7 @@ function language_from_url($languages, Request $request = NULL) { return $language_url; } - switch (config('language.negotiation')->get('url.source')) { + switch (Drupal::config('language.negotiation')->get('url.source')) { case LANGUAGE_NEGOTIATION_URL_PREFIX: $request_path = urldecode(trim($request->getPathInfo(), '/')); @@ -359,7 +359,7 @@ function language_from_url($languages, Request $request = NULL) { */ function language_url_fallback($language = NULL, $request = NULL, $language_type = Language::TYPE_INTERFACE) { $default = language_default(); - $prefix = (config('language.negotiation')->get('url.source') == LANGUAGE_NEGOTIATION_URL_PREFIX); + $prefix = (Drupal::config('language.negotiation')->get('url.source') == LANGUAGE_NEGOTIATION_URL_PREFIX); // If the default language is not configured to convey language information, // a missing URL language information indicates that URL language should be @@ -400,7 +400,7 @@ function language_switcher_url($type, $path) { * Return the session language switcher block. */ function language_switcher_session($type, $path) { - $param = config('language.negotiation')->get('session.parameter'); + $param = Drupal::config('language.negotiation')->get('session.parameter'); $language_query = isset($_SESSION[$param]) ? $_SESSION[$param] : language($type)->id; $languages = language_list(); @@ -431,7 +431,7 @@ function language_switcher_session($type, $path) { * Reads language prefixes and uses the langcode if no prefix is set. */ function language_negotiation_url_prefixes() { - return config('language.negotiation')->get('url.prefixes'); + return Drupal::config('language.negotiation')->get('url.prefixes'); } /** @@ -456,7 +456,7 @@ function language_negotiation_url_prefixes_update() { * Saves language prefix settings. */ function language_negotiation_url_prefixes_save(array $prefixes) { - config('language.negotiation') + Drupal::config('language.negotiation') ->set('url.prefixes', $prefixes) ->save(); } @@ -465,14 +465,14 @@ function language_negotiation_url_prefixes_save(array $prefixes) { * Reads language domains. */ function language_negotiation_url_domains() { - return config('language.negotiation')->get('url.domains'); + return Drupal::config('language.negotiation')->get('url.domains'); } /** * Saves the language domain settings. */ function language_negotiation_url_domains_save(array $domains) { - config('language.negotiation') + Drupal::config('language.negotiation') ->set('url.domains', $domains) ->save(); } @@ -489,7 +489,7 @@ function language_url_rewrite_session(&$path, &$options) { global $user; if (!$user->id()) { $languages = language_list(); - $query_param = check_plain(config('language.negotiation')->get('session.parameter')); + $query_param = check_plain(Drupal::config('language.negotiation')->get('session.parameter')); $query_value = isset($_GET[$query_param]) ? check_plain($_GET[$query_param]) : NULL; $query_rewrite = isset($languages[$query_value]) && language_negotiation_method_enabled(LANGUAGE_NEGOTIATION_SESSION); } diff --git a/core/modules/language/lib/Drupal/language/Tests/LanguageUILanguageNegotiationTest.php b/core/modules/language/lib/Drupal/language/Tests/LanguageUILanguageNegotiationTest.php index d6dc85329f35e7f9443c4cad24ecae53cc04e403..e039341cc91b829c6598a41fc24eed9d52240300 100644 --- a/core/modules/language/lib/Drupal/language/Tests/LanguageUILanguageNegotiationTest.php +++ b/core/modules/language/lib/Drupal/language/Tests/LanguageUILanguageNegotiationTest.php @@ -159,7 +159,7 @@ function testUILanguageNegotiation() { $this->runTest($test); // An invalid language is selected. - config('language.negotiation')->set('selected_langcode', NULL)->save(); + \Drupal::config('language.negotiation')->set('selected_langcode', NULL)->save(); $test = array( 'language_negotiation' => array(LANGUAGE_NEGOTIATION_SELECTED), 'path' => 'admin/config', @@ -171,7 +171,7 @@ function testUILanguageNegotiation() { $this->runTest($test); // No selected language is available. - config('language.negotiation')->set('selected_langcode', $langcode_unknown)->save(); + \Drupal::config('language.negotiation')->set('selected_langcode', $langcode_unknown)->save(); $test = array( 'language_negotiation' => array(LANGUAGE_NEGOTIATION_SELECTED), 'path' => 'admin/config', @@ -367,7 +367,7 @@ protected function runTest($test) { language_negotiation_set(Language::TYPE_INTERFACE, $method_weights); } if (!empty($test['language_negotiation_url_part'])) { - config('language.negotiation') + \Drupal::config('language.negotiation') ->set('url.source', $test['language_negotiation_url_part']) ->save(); } diff --git a/core/modules/language/lib/Drupal/language/Tests/LanguageUrlRewritingTest.php b/core/modules/language/lib/Drupal/language/Tests/LanguageUrlRewritingTest.php index 8379ca2aa706ed4f2840e0f3dcec5e57af4b90d6..5266fd16679cdc25a7c9aea5b201d986f2310548 100644 --- a/core/modules/language/lib/Drupal/language/Tests/LanguageUrlRewritingTest.php +++ b/core/modules/language/lib/Drupal/language/Tests/LanguageUrlRewritingTest.php @@ -114,7 +114,7 @@ function testDomainNameNegotiationPort() { $this->rebuildContainer(); // Enable domain configuration. - config('language.negotiation') + \Drupal::config('language.negotiation') ->set('url.source', LANGUAGE_NEGOTIATION_URL_DOMAIN) ->save(); diff --git a/core/modules/language/tests/language_test/language_test.module b/core/modules/language/tests/language_test/language_test.module index 267cdf32b87130eeeb9f320c7952328effafffcf..c3386cf7b4816555bbd6a6154640b98816491857 100644 --- a/core/modules/language/tests/language_test/language_test.module +++ b/core/modules/language/tests/language_test/language_test.module @@ -47,10 +47,10 @@ function language_test_language_types_info_alter(array &$language_types) { unset($language_types[Language::TYPE_CONTENT]['fixed']); // By default languages are not configurable. Make Language::TYPE_CONTENT // configurable. - $configurable = config('system.language.types')->get('configurable'); + $configurable = Drupal::config('system.language.types')->get('configurable'); if (!in_array(Language::TYPE_CONTENT, $configurable)) { $configurable[] = Language::TYPE_CONTENT; - config('system.language.types')->set('configurable', $configurable)->save(); + Drupal::config('system.language.types')->set('configurable', $configurable)->save(); } } } diff --git a/core/modules/layout/lib/Drupal/layout/Config/DisplayInterface.php b/core/modules/layout/lib/Drupal/layout/Config/DisplayInterface.php index 916d89712cb24b682a0019e39429fcff7f64d8ea..4130f6c31c836b2a07268b6e23e5572c7c13ee5f 100644 --- a/core/modules/layout/lib/Drupal/layout/Config/DisplayInterface.php +++ b/core/modules/layout/lib/Drupal/layout/Config/DisplayInterface.php @@ -41,7 +41,7 @@ interface DisplayInterface extends ConfigEntityInterface { * displays (e.g., by a "regular" page, by an administrative page, and within * one or more dashboards). This function returns the block instances that * have been added to this display. Each key of the returned array is the - * block instance's configuration object name, and config() may be called on + * block instance's configuration object name, and \Drupal::config() may be called on * it in order to retrieve the full configuration that is shared across all * displays. For each key, the value is an array of display-specific * configuration, primarily the 'region' and 'weight', and anything else that diff --git a/core/modules/locale/lib/Drupal/locale/Form/LocaleSettingsForm.php b/core/modules/locale/lib/Drupal/locale/Form/LocaleSettingsForm.php index 5669d8fb108286c8215f6332aee3f569d07cc670..826ba38be293eb2f7d41860b1d10e78de79bf5f8 100644 --- a/core/modules/locale/lib/Drupal/locale/Form/LocaleSettingsForm.php +++ b/core/modules/locale/lib/Drupal/locale/Form/LocaleSettingsForm.php @@ -44,7 +44,7 @@ public function buildForm(array $form, array &$form_state) { '#default_value' => $config->get('translation.check_disabled_modules'), ); - if ($directory =config('locale.settings')->get('translation.path')) { + if ($directory =\Drupal::config('locale.settings')->get('translation.path')) { $description = t('Translation files are stored locally in the %path directory. You can change this directory on the File system configuration page.', array('%path' => $directory, '@url' => url('admin/config/media/file-system'))); } else { diff --git a/core/modules/locale/lib/Drupal/locale/LocaleLookup.php b/core/modules/locale/lib/Drupal/locale/LocaleLookup.php index 075a81592b4477451f159c4bfd084b604f416148..6881092eaa609266b7dd93fc289b9621d1fd10ea 100644 --- a/core/modules/locale/lib/Drupal/locale/LocaleLookup.php +++ b/core/modules/locale/lib/Drupal/locale/LocaleLookup.php @@ -106,7 +106,7 @@ protected function resolveCacheMiss($offset) { // the exact list of strings used on a page. From a performance // perspective that is a really bad idea, so we have no user // interface for this. Be careful when turning this option off! - if (config('locale.settings')->get('cache_strings')) { + if (\Drupal::config('locale.settings')->get('cache_strings')) { $this->persist($offset); } return $value; diff --git a/core/modules/locale/lib/Drupal/locale/PoDatabaseWriter.php b/core/modules/locale/lib/Drupal/locale/PoDatabaseWriter.php index b28748a47828964c28e74f3cfbcd7131a5d78ef7..dd444922e5b904c1e31782858f48af065b412502 100644 --- a/core/modules/locale/lib/Drupal/locale/PoDatabaseWriter.php +++ b/core/modules/locale/lib/Drupal/locale/PoDatabaseWriter.php @@ -155,7 +155,7 @@ function getHeader() { */ function setHeader(PoHeader $header) { $this->_header = $header; - $config = config('locale.settings'); + $config = \Drupal::config('locale.settings'); $locale_plurals = \Drupal::state()->get('locale.translation.plurals') ?: array(); // Check for options. diff --git a/core/modules/locale/lib/Drupal/locale/Tests/LocaleConfigTranslationTest.php b/core/modules/locale/lib/Drupal/locale/Tests/LocaleConfigTranslationTest.php index 414cde0708f0b7a9a29de9681c129d651be1037f..aa53fbb0356ed9f19aab0bb3724413893de7305c 100644 --- a/core/modules/locale/lib/Drupal/locale/Tests/LocaleConfigTranslationTest.php +++ b/core/modules/locale/lib/Drupal/locale/Tests/LocaleConfigTranslationTest.php @@ -136,7 +136,7 @@ function testConfigTranslation() { $this->assertEqual($property->getValue(), $image_style_label, 'Got the right translation for image style name after translation'); // Quick test to ensure translation file exists. - $this->assertEqual(config('locale.config.xx.image.style.medium')->get('label'), $image_style_label); + $this->assertEqual(\Drupal::config('locale.config.xx.image.style.medium')->get('label'), $image_style_label); // Disable and uninstall the module. $this->drupalPost('admin/modules', array('modules[Core][image][enable]' => FALSE), t('Save configuration')); @@ -144,7 +144,7 @@ function testConfigTranslation() { $this->drupalPost(NULL, array(), t('Uninstall')); // Ensure that the translated configuration has been removed. - $this->assertFalse(config('locale.config.xx.image.style.medium')->get('label'), 'Translated configuration for image module removed.'); + $this->assertFalse(\Drupal::config('locale.config.xx.image.style.medium')->get('label'), 'Translated configuration for image module removed.'); } } diff --git a/core/modules/locale/lib/Drupal/locale/Tests/LocaleImportFunctionalTest.php b/core/modules/locale/lib/Drupal/locale/Tests/LocaleImportFunctionalTest.php index 198207b66fce37f24e066eb0a80bb363b769e388..f8fb4c4dbb9077977f7aa5aa35908c92f7710dfe 100644 --- a/core/modules/locale/lib/Drupal/locale/Tests/LocaleImportFunctionalTest.php +++ b/core/modules/locale/lib/Drupal/locale/Tests/LocaleImportFunctionalTest.php @@ -53,7 +53,7 @@ function testStandalonePoFile() { $this->importPoFile($this->getPoFile(), array( 'langcode' => 'fr', )); - $config = config('locale.settings'); + $config = \Drupal::config('locale.settings'); // The import should automatically create the corresponding language. $this->assertRaw(t('The language %language has been created.', array('%language' => 'French')), 'The language has been automatically created.'); diff --git a/core/modules/locale/lib/Drupal/locale/Tests/LocalePathTest.php b/core/modules/locale/lib/Drupal/locale/Tests/LocalePathTest.php index f81c916abb3a90ceb83a92e99718558a06cd45e6..878444dd23804034bae603bc8bb8a26de674eb23 100644 --- a/core/modules/locale/lib/Drupal/locale/Tests/LocalePathTest.php +++ b/core/modules/locale/lib/Drupal/locale/Tests/LocalePathTest.php @@ -34,7 +34,7 @@ function setUp() { parent::setUp(); $this->drupalCreateContentType(array('type' => 'page', 'name' => 'Basic page')); - config('system.site')->set('page.front', 'node')->save(); + \Drupal::config('system.site')->set('page.front', 'node')->save(); } /** diff --git a/core/modules/locale/lib/Drupal/locale/Tests/LocaleTranslationUiTest.php b/core/modules/locale/lib/Drupal/locale/Tests/LocaleTranslationUiTest.php index 167fc6a3668311a2cb986aaac1a6bbf69001a1de..e391022218b8680dcf421c4006ff75f0a35424b0 100644 --- a/core/modules/locale/lib/Drupal/locale/Tests/LocaleTranslationUiTest.php +++ b/core/modules/locale/lib/Drupal/locale/Tests/LocaleTranslationUiTest.php @@ -216,7 +216,7 @@ function testStringTranslation() { function testJavaScriptTranslation() { $user = $this->drupalCreateUser(array('translate interface', 'administer languages', 'access administration pages')); $this->drupalLogin($user); - $config = config('locale.settings'); + $config = \Drupal::config('locale.settings'); $langcode = 'xx'; // The English name for the language. This will be translated. diff --git a/core/modules/locale/lib/Drupal/locale/Tests/LocaleUninstallTest.php b/core/modules/locale/lib/Drupal/locale/Tests/LocaleUninstallTest.php index e2d1109c002df14b227dfb672e35586f7e93d2fd..1cfb5387274ceb89f659ff0d19ec74ab22f28171 100644 --- a/core/modules/locale/lib/Drupal/locale/Tests/LocaleUninstallTest.php +++ b/core/modules/locale/lib/Drupal/locale/Tests/LocaleUninstallTest.php @@ -50,7 +50,7 @@ function setUp() { */ function testUninstallProcess() { $locale_module = array('locale', 'language'); - $config = config('locale.settings'); + $config = \Drupal::config('locale.settings'); $language = new Language(array( 'id' => 'fr', 'name' => 'French', @@ -87,7 +87,7 @@ function testUninstallProcess() { $edit = array('strings[' . $string->lid . '][translations][0]' => 'french translation'); $this->drupalPost('admin/config/regional/translate', $edit, t('Save translations')); _locale_rebuild_js('fr'); - $config = config('locale.settings'); + $config = \Drupal::config('locale.settings'); $locale_javascripts = $this->container->get('state')->get('locale.translation.javascript') ?: array(); $js_file = 'public://' . $config->get('javascript.directory') . '/fr_' . $locale_javascripts['fr'] . '.js'; $this->assertTrue($result = file_exists($js_file), String::format('JavaScript file created: %file', array('%file' => $result ? $js_file : 'none'))); @@ -103,7 +103,7 @@ function testUninstallProcess() { variable_set('language_negotiation_' . Language::TYPE_URL, language_language_negotiation_info()); // Change language negotiation settings. - config('language.negotiation') + \Drupal::config('language.negotiation') ->set('url.source', LANGUAGE_NEGOTIATION_URL_PREFIX) ->set('session.parameter', TRUE) ->save(); @@ -136,8 +136,8 @@ function testUninstallProcess() { $this->assertTrue($language_negotiation, String::format('URL language negotiation: %setting', array('%setting' => $language_negotiation ? 'none' : 'set'))); // Check language negotiation method settings. - $this->assertFalse(config('language.negotiation')->get('url.source'), 'URL language negotiation method indicator settings cleared.'); - $this->assertFalse(config('language.negotiation')->get('session.parameter'), 'Visit language negotiation method settings cleared.'); + $this->assertFalse(\Drupal::config('language.negotiation')->get('url.source'), 'URL language negotiation method indicator settings cleared.'); + $this->assertFalse(\Drupal::config('language.negotiation')->get('session.parameter'), 'Visit language negotiation method settings cleared.'); // Check JavaScript parsed. $javascript_parsed_count = count($this->container->get('state')->get('system.javascript_parsed') ?: array()); diff --git a/core/modules/locale/lib/Drupal/locale/Tests/LocaleUpdateBase.php b/core/modules/locale/lib/Drupal/locale/Tests/LocaleUpdateBase.php index e8562baeb04362f2ca6d4dcfcb873e0716307a6d..46d082ee1d89dad285c8a46d2a7b2eb4b4e1d964 100644 --- a/core/modules/locale/lib/Drupal/locale/Tests/LocaleUpdateBase.php +++ b/core/modules/locale/lib/Drupal/locale/Tests/LocaleUpdateBase.php @@ -69,7 +69,7 @@ function setUp() { protected function setTranslationsDirectory($path) { $this->tranlations_directory = $path; file_prepare_directory($path, FILE_CREATE_DIRECTORY); - config('locale.settings')->set('translation.path', $path)->save(); + \Drupal::config('locale.settings')->set('translation.path', $path)->save(); } /** @@ -165,7 +165,7 @@ protected function makePoFile($path, $filename, $timestamp = NULL, $translations * imported. */ protected function setTranslationFiles() { - $config = config('locale.settings'); + $config = \Drupal::config('locale.settings'); // A flag is set to let the locale_test module replace the project data with // a set of test projects which match the below project files. diff --git a/core/modules/locale/lib/Drupal/locale/Tests/LocaleUpdateCronTest.php b/core/modules/locale/lib/Drupal/locale/Tests/LocaleUpdateCronTest.php index 219b7f052ad641dd9db8bee6448d8086b7164b55..90a914f1b0c98ff483c3ee1501cd3a65747a0f06 100644 --- a/core/modules/locale/lib/Drupal/locale/Tests/LocaleUpdateCronTest.php +++ b/core/modules/locale/lib/Drupal/locale/Tests/LocaleUpdateCronTest.php @@ -46,7 +46,7 @@ function testUpdateCron() { // Setup local and remote translations files. $this->setTranslationFiles(); - config('locale.settings')->set('translation.default_filename', '%project-%version.%language._po')->save(); + \Drupal::config('locale.settings')->set('translation.default_filename', '%project-%version.%language._po')->save(); // Update translations using batch to ensure a clean test starting point. $this->drupalGet('admin/reports/translations/check'); diff --git a/core/modules/locale/lib/Drupal/locale/Tests/LocaleUpdateTest.php b/core/modules/locale/lib/Drupal/locale/Tests/LocaleUpdateTest.php index cb19716b8cd37a638d01bd61c9bcde93ca297ff7..9f55abccaac72c8c69746e1afe05b6bd0a78edf0 100644 --- a/core/modules/locale/lib/Drupal/locale/Tests/LocaleUpdateTest.php +++ b/core/modules/locale/lib/Drupal/locale/Tests/LocaleUpdateTest.php @@ -65,7 +65,7 @@ function testUpdateProjects() { */ function testUpdateProjectsHidden() { module_load_include('compare.inc', 'locale'); - $config = config('locale.settings'); + $config = \Drupal::config('locale.settings'); // Make the test modules look like a normal custom module. \Drupal::state()->set('locale.test_system_info_alter', TRUE); @@ -97,7 +97,7 @@ function testUpdateProjectsHidden() { * for local files only, check for both local and remote files. */ function testUpdateCheckStatus() { - $config = config('locale.settings'); + $config = \Drupal::config('locale.settings'); // Set a flag to let the locale_test module replace the project data with a // set of test projects. \Drupal::state()->set('locale.test_projects_alter', TRUE); @@ -149,7 +149,7 @@ function testUpdateCheckStatus() { * - Import overwrite: all existing translations */ function testUpdateImportSourceRemote() { - $config = config('locale.settings'); + $config = \Drupal::config('locale.settings'); // Build the test environment. $this->setTranslationFiles(); @@ -211,7 +211,7 @@ function testUpdateImportSourceRemote() { * - Import overwrite: all existing translations */ function testUpdateImportSourceLocal() { - $config = config('locale.settings'); + $config = \Drupal::config('locale.settings'); // Build the test environment. $this->setTranslationFiles(); @@ -265,7 +265,7 @@ function testUpdateImportSourceLocal() { * - Import overwrite: only overwrite non-customized translations */ function testUpdateImportModeNonCustomized() { - $config = config('locale.settings'); + $config = \Drupal::config('locale.settings'); // Build the test environment. $this->setTranslationFiles(); @@ -301,7 +301,7 @@ function testUpdateImportModeNonCustomized() { * - Import overwrite: don't overwrite any existing translation */ function testUpdateImportModeNone() { - $config = config('locale.settings'); + $config = \Drupal::config('locale.settings'); // Build the test environment. $this->setTranslationFiles(); diff --git a/core/modules/locale/lib/Drupal/locale/TranslationsStream.php b/core/modules/locale/lib/Drupal/locale/TranslationsStream.php index 34ef38ecf851fd651be49274c1f0f570a9c11acd..5245bd4c49af49cbad6782e4217417cc0c5b2842 100644 --- a/core/modules/locale/lib/Drupal/locale/TranslationsStream.php +++ b/core/modules/locale/lib/Drupal/locale/TranslationsStream.php @@ -20,7 +20,7 @@ class TranslationsStream extends LocalStream { * Implements Drupal\Core\StreamWrapper\LocalStream::getDirectoryPath() */ function getDirectoryPath() { - return config('locale.settings')->get('translation.path'); + return \Drupal::config('locale.settings')->get('translation.path'); } /** diff --git a/core/modules/locale/locale.bulk.inc b/core/modules/locale/locale.bulk.inc index 8a156568a057fd014b62608f586f69eb3622ad69..02731a45dde508346167d04bb8ee6e373c3aa510 100644 --- a/core/modules/locale/locale.bulk.inc +++ b/core/modules/locale/locale.bulk.inc @@ -243,7 +243,7 @@ function locale_translate_export_form_submit($form, &$form_state) { if (!empty($item)) { $uri = tempnam('temporary://', 'po_'); $header = $reader->getHeader(); - $header->setProjectName(config('system.site')->get('name')); + $header->setProjectName(Drupal::config('system.site')->get('name')); $header->setLanguageName($languageName); $writer = new PoStreamWriter; @@ -348,7 +348,7 @@ function locale_translate_get_interface_translation_files($projects = array(), $ // containing a project name and language code: {project}.{langcode}.po or // {project}-{version}.{langcode}.po. // Only files of known projects and languages will be returned. - $directory = config('locale.settings')->get('translation.path'); + $directory = Drupal::config('locale.settings')->get('translation.path'); $result = file_scan_directory($directory, '![a-z_]+(\-[0-9a-z\.\-\+]+|)\.[^\./]+\.po$!', array('recurse' => FALSE)); foreach ($result as $file) { @@ -799,7 +799,7 @@ function locale_config_batch_build(array $names, array $langcodes, $options = ar $batch_names[] = $name; $i++; // During installation the caching of configuration objects is disabled - // so it is very expensive to initialize the config() object on each request. + // so it is very expensive to initialize the Drupal::config() object on each request. // We batch a small number of configuration object upgrades together to // improve the overall performance of the process. if ($i % 20 == 0) { diff --git a/core/modules/locale/locale.compare.inc b/core/modules/locale/locale.compare.inc index d0271bde4c0e599c3c0bd4d8cde66c5d050e7bc3..ed4664d50e2ff3f5e005dd5c5104b7da003ee48f 100644 --- a/core/modules/locale/locale.compare.inc +++ b/core/modules/locale/locale.compare.inc @@ -130,7 +130,7 @@ function locale_translation_project_list() { $projects = &drupal_static(__FUNCTION__, array()); if (empty($projects)) { module_load_include('compare.inc', 'update'); - $config = config('locale.settings'); + $config = Drupal::config('locale.settings'); $projects = array(); $additional_whitelist = array( @@ -195,9 +195,9 @@ function _locale_translation_prepare_project_list($data, $type) { * - "server_pattern": URI containing po file pattern. */ function locale_translation_default_translation_server() { - $pattern = config('locale.settings')->get('translation.default_server_pattern'); + $pattern = Drupal::config('locale.settings')->get('translation.default_server_pattern'); // An additional check is required here. During the upgrade process - // config()->get() returns NULL. We use the defined value as fallback. + // Drupal::config()->get() returns NULL. We use the defined value as fallback. $pattern = $pattern ? $pattern : LOCALE_TRANSLATION_DEFAULT_SERVER_PATTERN; return array( diff --git a/core/modules/locale/locale.install b/core/modules/locale/locale.install index b7814211b67f3bd5a93d6fe96947b5e5c119683b..b830040d2b29cca9ee1c60561056ecd109162559 100644 --- a/core/modules/locale/locale.install +++ b/core/modules/locale/locale.install @@ -12,9 +12,9 @@ */ function locale_install() { // Create the interface translations directory and ensure it's writable. - if (!$directory = config('locale.settings')->get('translation.path')) { + if (!$directory = Drupal::config('locale.settings')->get('translation.path')) { $directory = conf_path() . '/files/translations'; - config('locale.settings')->set('translation.path', $directory)->save(); + Drupal::config('locale.settings')->set('translation.path', $directory)->save(); } file_prepare_directory($directory, FILE_CREATE_DIRECTORY | FILE_MODIFY_PERMISSIONS); } @@ -23,7 +23,7 @@ function locale_install() { * Implements hook_uninstall(). */ function locale_uninstall() { - $config = config('locale.settings'); + $config = Drupal::config('locale.settings'); // Delete all JavaScript translation files. $locale_js_directory = 'public://' . $config->get('javascript.directory'); @@ -468,7 +468,7 @@ function locale_update_8002() { */ function locale_update_8003() { $message = ''; - $config = config('language.negotiation'); + $config = Drupal::config('language.negotiation'); $domains = $config->get('url.domains') ?: array(); // $used_domains keeps track of the domain names in use. @@ -953,7 +953,7 @@ function locale_update_8016() { foreach ($result as $format) { $language = $format->language; // Create config objects for the language if not yet done. - config("locale.config.$language.system.date_format." . $format->type) + Drupal::config("locale.config.$language.system.date_format." . $format->type) ->set('pattern.php', $format->format) ->save(); } diff --git a/core/modules/locale/locale.module b/core/modules/locale/locale.module index c83ff19af8a932de5dd434cde933d226acada0e4..01c9a4f38b2926bdcbfe910665e10ab4461df164 100644 --- a/core/modules/locale/locale.module +++ b/core/modules/locale/locale.module @@ -427,7 +427,7 @@ function locale_cron() { // and a translatable language was set. // Update tasks are added to the queue here but processed by Drupal's cron // using the cron worker defined in locale_queue_info(). - if ($frequency = config('locale.settings')->get('translation.update_interval_days') && locale_translatable_language_list()) { + if ($frequency = Drupal::config('locale.settings')->get('translation.update_interval_days') && locale_translatable_language_list()) { module_load_include('translation.inc', 'locale'); locale_cron_fill_queue(); } @@ -519,7 +519,7 @@ function locale_system_update(array $components) { // Skip running the translation imports if in the installer, // because it would break out of the installer flow. We have // built-in support for translation imports in the installer. - if (!drupal_installation_attempted() && locale_translatable_language_list() && config('locale.settings')->get('translation.import_enabled')) { + if (!drupal_installation_attempted() && locale_translatable_language_list() && Drupal::config('locale.settings')->get('translation.import_enabled')) { module_load_include('compare.inc', 'locale'); // Update the list of translatable projects and start the import batch. @@ -595,7 +595,7 @@ function locale_js_alter(&$javascript) { $language_interface = language(Language::TYPE_INTERFACE); - $dir = 'public://' . config('local.settings')->get('javascript.directory'); + $dir = 'public://' . Drupal::config('local.settings')->get('javascript.directory'); $parsed = Drupal::state()->get('system.javascript_parsed') ?: array(); $files = $new_files = FALSE; @@ -696,7 +696,7 @@ function locale_library_info_alter(&$libraries, $module) { 'ui' => array( 'datepicker' => array( 'isRTL' => $language_interface->direction == Language::DIRECTION_RTL, - 'firstDay' => config('system.date')->get('first_day'), + 'firstDay' => Drupal::config('system.date')->get('first_day'), ), ), ), @@ -773,7 +773,7 @@ function locale_form_language_admin_add_form_alter(&$form, &$form_state) { * Set a batch for a newly-added language. */ function locale_form_language_admin_add_form_alter_submit($form, $form_state) { - if (config('locale.settings')->get('translation.import_enabled')) { + if (Drupal::config('locale.settings')->get('translation.import_enabled')) { if (empty($form_state['values']['predefined_langcode']) || $form_state['values']['predefined_langcode'] == 'custom') { $langcode = $form_state['values']['langcode']; } @@ -835,7 +835,7 @@ function locale_form_system_file_system_settings_alter(&$form, $form_state) { $form['translation_path'] = array( '#type' => 'textfield', '#title' => t('Interface translations directory'), - '#default_value' => config('locale.settings')->get('translation.path'), + '#default_value' => Drupal::config('locale.settings')->get('translation.path'), '#maxlength' => 255, '#description' => t('A local file system path where interface translation files will be stored.'), '#required' => TRUE, @@ -860,7 +860,7 @@ function locale_system_file_system_settings_submit(&$form, $form_state) { locale_translation_clear_status(); } - config('locale.settings') + Drupal::config('locale.settings') ->set('translation.path', $form_state['values']['translation_path']) ->save(); } @@ -1095,7 +1095,7 @@ function locale_translation_clear_status() { * when checking or importing translation files, FALSE otherwise. */ function locale_translation_use_remote_source() { - return config('locale.settings')->get('translation.use_source') == LOCALE_TRANSLATION_USE_SOURCE_REMOTE_AND_LOCAL; + return Drupal::config('locale.settings')->get('translation.use_source') == LOCALE_TRANSLATION_USE_SOURCE_REMOTE_AND_LOCAL; } /** @@ -1308,7 +1308,7 @@ function _locale_invalidate_js($langcode = NULL) { * The language, the translation file should be (re)created for. */ function _locale_rebuild_js($langcode = NULL) { - $config = config('locale.settings'); + $config = Drupal::config('locale.settings'); if (!isset($langcode)) { $language = language(Language::TYPE_INTERFACE); } diff --git a/core/modules/locale/locale.translation.inc b/core/modules/locale/locale.translation.inc index 3c77ff0b2be9a524fc08bfd34263610b35557205..30c7b0f27879e7edf8884d8fd780b869669f727c 100644 --- a/core/modules/locale/locale.translation.inc +++ b/core/modules/locale/locale.translation.inc @@ -236,7 +236,7 @@ function locale_translation_source_build($project, $langcode, $filename = NULL) $source->timestamp = 0; $source->last_checked = 0; - $filename = $filename ? $filename : config('locale.settings')->get('translation.default_filename'); + $filename = $filename ? $filename : Drupal::config('locale.settings')->get('translation.default_filename'); // If the server_pattern contains a remote file path we will check for a // remote file. The local version of this file will only be checked if a @@ -322,7 +322,7 @@ function locale_translation_build_server_pattern($project, $template) { */ function locale_cron_fill_queue() { $updates = array(); - $config = config('locale.settings'); + $config = Drupal::config('locale.settings'); // Determine which project+language should be updated. $last = REQUEST_TIME - $config->get('translation.update_interval_days') * 3600 * 24; @@ -425,7 +425,7 @@ function _locale_translation_source_compare($source1, $source2) { * Array of translation import options. */ function _locale_translation_default_update_options() { - $config = config('locale.settings'); + $config = Drupal::config('locale.settings'); return array( 'customized' => LOCALE_NOT_CUSTOMIZED, 'overwrite_options' => array( diff --git a/core/modules/menu/lib/Drupal/menu/Tests/MenuTest.php b/core/modules/menu/lib/Drupal/menu/Tests/MenuTest.php index 0ae93d41e5003e2213b5919f0f4a3d59a067ed5b..df8198176310bab2ee5efd6d313df096c638b5e8 100644 --- a/core/modules/menu/lib/Drupal/menu/Tests/MenuTest.php +++ b/core/modules/menu/lib/Drupal/menu/Tests/MenuTest.php @@ -161,7 +161,7 @@ function addCustomMenu() { // Enable the custom menu block. $menu_name = 'menu-' . $menu_name; // Drupal prepends the name with 'menu-'. // Confirm that the custom menu block is available. - $this->drupalGet('admin/structure/block/list/' . config('system.theme')->get('default') . '/add'); + $this->drupalGet('admin/structure/block/list/' . \Drupal::config('system.theme')->get('default') . '/add'); $this->assertText($label); // Enable the block. diff --git a/core/modules/menu/menu.install b/core/modules/menu/menu.install index ae94f90819b4eb06ebbb1216f5434e8f0a1ef4b8..f1fc64d8c69b26f1c3c021d6149b9061839efb1f 100644 --- a/core/modules/menu/menu.install +++ b/core/modules/menu/menu.install @@ -80,7 +80,7 @@ function menu_update_8004() { $result = db_query('SELECT * FROM {menu_custom}'); foreach ($result as $menu) { // Save the config object. - config('menu.menu.' . $menu->menu_name) + Drupal::config('menu.menu.' . $menu->menu_name) ->set('id', $menu->menu_name) ->set('uuid', $uuid->generate()) ->set('label', $menu->title) diff --git a/core/modules/menu/menu.module b/core/modules/menu/menu.module index 36cedbe408c3182b8e6cc3433e36b3f6b710d541..5d833821cc0c5ef1d26b930f9a4f8cc6f0120726 100644 --- a/core/modules/menu/menu.module +++ b/core/modules/menu/menu.module @@ -143,7 +143,7 @@ function menu_entity_bundle_info() { $bundles = array(); $config_names = config_get_storage_names_with_prefix('menu.menu.'); foreach ($config_names as $config_name) { - $config = config($config_name); + $config = Drupal::config($config_name); $bundles['menu_link'][$config->get('id')] = array( 'label' => $config->get('label'), ); @@ -236,7 +236,7 @@ function menu_menu_insert(Menu $menu) { // Make sure the menu is present in the active menus variable so that its // items may appear in the menu active trail. // See menu_set_active_menu_names(). - $config = config('system.menu'); + $config = Drupal::config('system.menu'); $active_menus = $config->get('active_menus_default') ?: array_keys(menu_get_menus()); if (!in_array($menu->id(), $active_menus)) { @@ -312,7 +312,7 @@ function menu_parent_options(array $menus, MenuLink $menu_link = NULL, $type = N // allow contrib modules to provide more scalable pattern choosers. // hook_form_alter is too late in itself because all the possible parents are // retrieved here, unless override_parent_selector is set to TRUE. - if (config('menu.settings')->get('override_parent_selector')) { + if (Drupal::config('menu.settings')->get('override_parent_selector')) { return array(); } diff --git a/core/modules/node/lib/Drupal/node/NodeFormController.php b/core/modules/node/lib/Drupal/node/NodeFormController.php index c9649ef16e318c3204c1f85dcb7711658a16cb7a..ccc1dccc86009e6e29af84e0316f6fe44f22442c 100644 --- a/core/modules/node/lib/Drupal/node/NodeFormController.php +++ b/core/modules/node/lib/Drupal/node/NodeFormController.php @@ -69,7 +69,7 @@ public function form(array $form, array &$form_state) { drupal_set_title(t('Edit @type @title', array('@type' => node_get_type_label($node), '@title' => $node->label())), PASS_THROUGH); } - $user_config = config('user.settings'); + $user_config = \Drupal::config('user.settings'); // Some special stuff when previewing a node. if (isset($form_state['node_preview'])) { $form['#prefix'] = $form_state['node_preview']; diff --git a/core/modules/node/lib/Drupal/node/Plugin/views/row/Rss.php b/core/modules/node/lib/Drupal/node/Plugin/views/row/Rss.php index 4d824bd3b605c61cd9b561e318f7887ec8044699..89c7940f6c50db198cc3cfabfa19e6fa50ca0345 100644 --- a/core/modules/node/lib/Drupal/node/Plugin/views/row/Rss.php +++ b/core/modules/node/lib/Drupal/node/Plugin/views/row/Rss.php @@ -100,7 +100,7 @@ public function render($row) { $display_mode = $this->options['item_length']; if ($display_mode == 'default') { - $display_mode = config('system.rss')->get('items.view_mode'); + $display_mode = \Drupal::config('system.rss')->get('items.view_mode'); } // Load the specified node: diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeAccessPagerTest.php b/core/modules/node/lib/Drupal/node/Tests/NodeAccessPagerTest.php index 7b2cfe37a352975fc2a5d9e0c537f0949ee06343..287ec65a1deb0034c2b18450e3517293f6105154 100644 --- a/core/modules/node/lib/Drupal/node/Tests/NodeAccessPagerTest.php +++ b/core/modules/node/lib/Drupal/node/Tests/NodeAccessPagerTest.php @@ -73,7 +73,7 @@ public function testCommentPager() { */ public function testForumPager() { // Look up the forums vocabulary ID. - $vid = config('forum.settings')->get('vocabulary'); + $vid = \Drupal::config('forum.settings')->get('vocabulary'); $this->assertTrue($vid, 'Forum navigation vocabulary ID is set.'); // Look up the general discussion term. diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeCreationTest.php b/core/modules/node/lib/Drupal/node/Tests/NodeCreationTest.php index 90592b0c81a80f35d9fa7b774c72835f463a7f24..cd5d89ffc6c954c8f465e681d533e0a854001f6b 100644 --- a/core/modules/node/lib/Drupal/node/Tests/NodeCreationTest.php +++ b/core/modules/node/lib/Drupal/node/Tests/NodeCreationTest.php @@ -104,10 +104,10 @@ function testFailedPageCreation() { */ function testUnpublishedNodeCreation() { // Set the front page to the test page. - config('system.site')->set('page.front', 'test-page')->save(); + \Drupal::config('system.site')->set('page.front', 'test-page')->save(); // Set "Basic page" content type to be unpublished by default. - config('node.type.page')->set('settings.node.options', array())->save(); + \Drupal::config('node.type.page')->set('settings.node.options', array())->save(); // Create a node. $edit = array(); diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeFormButtonsTest.php b/core/modules/node/lib/Drupal/node/Tests/NodeFormButtonsTest.php index b52d8250517c130ee50fb5c40f6db67f6599ec8e..2a8f025bb1d1674b9906cb5bc9e0438ebe78728a 100644 --- a/core/modules/node/lib/Drupal/node/Tests/NodeFormButtonsTest.php +++ b/core/modules/node/lib/Drupal/node/Tests/NodeFormButtonsTest.php @@ -109,7 +109,7 @@ function testNodeFormButtons() { // the initial order of buttons and/or status of the node when creating // a node. variable_set('node_options_article', array('promote')); - config('node.type.article')->set('settings.node.options.status', 0)->save(); + \Drupal::config('node.type.article')->set('settings.node.options.status', 0)->save(); // Verify the buttons on a node add form for an administrator. $this->drupalLogin($this->admin_user); diff --git a/core/modules/node/node.install b/core/modules/node/node.install index 84117d5f0042eb36123f8ee90be04eccc4ed8332..7b42475417d96a21684616642750af3af3ad3c86 100644 --- a/core/modules/node/node.install +++ b/core/modules/node/node.install @@ -418,8 +418,8 @@ function node_uninstall() { // Delete node type variables. $types = config_get_storage_names_with_prefix('node.type.'); foreach ($types as $config_name) { - $type = config($config_name)->get('type'); - config('language.settings')->clear('node. ' . $type . '.language.default_configuration')->save(); + $type = Drupal::config($config_name)->get('type'); + Drupal::config('language.settings')->clear('node. ' . $type . '.language.default_configuration')->save(); } // Delete node search ranking variables. @@ -640,7 +640,7 @@ function node_update_8007() { $language_show = update_variable_get('node_type_language_show_' . $type, NULL); if (isset($language_default) || isset($language_show)) { $values = array('langcode' => $language_default, 'language_show' => $language_show); - config('language.settings')->set('node.' . $type . '.language.default_configuration', $values)->save(); + Drupal::config('language.settings')->set('node.' . $type . '.language.default_configuration', $values)->save(); } } } @@ -1076,7 +1076,7 @@ function node_update_8020() { $result = db_query('SELECT * FROM {node_type}') ->fetchAllAssoc('type', PDO::FETCH_ASSOC); foreach ($result as $id => $node_type) { - $config = config('node.type.' . $id); + $config = Drupal::config('node.type.' . $id); // Node type. $config->setData($node_type); $config->set('uuid', $uuid->generate()); diff --git a/core/modules/node/node.module b/core/modules/node/node.module index dab86965b9621eaa0251cff673c6ca56a3c0ccd6..200c6f63218603b7eda39f2144dede2911598460 100644 --- a/core/modules/node/node.module +++ b/core/modules/node/node.module @@ -329,7 +329,7 @@ function node_type_get_names() { $config_names = config_get_storage_names_with_prefix('node.type.'); $names = array(); foreach ($config_names as $config_name) { - $config = config($config_name); + $config = Drupal::config($config_name); $names[$config->get('type')] = $config->get('name'); } cache()->set($cid, $names, CacheBackendInterface::CACHE_PERMANENT, array( @@ -1489,7 +1489,7 @@ function node_modules_uninstalled($modules) { // Remove module-specific settings from all node types. $config_names = config_get_storage_names_with_prefix('node.type.'); foreach ($config_names as $config_name) { - $config = config($config_name); + $config = Drupal::config($config_name); $changed = FALSE; foreach ($modules as $module) { if ($config->get('settings.' . $module)) { @@ -1572,7 +1572,7 @@ function node_block_access($block) { function node_feed($nids = FALSE, $channel = array()) { global $base_url; $language_content = language(Language::TYPE_CONTENT); - $rss_config = config('system.rss'); + $rss_config = Drupal::config('system.rss'); if ($nids === FALSE) { $nids = db_select('node_field_data', 'n') @@ -1624,7 +1624,7 @@ function node_feed($nids = FALSE, $channel = array()) { $channel_defaults = array( 'version' => '2.0', - 'title' => config('system.site')->get('name'), + 'title' => Drupal::config('system.site')->get('name'), 'link' => $base_url, 'description' => $rss_config->get('channel.description'), 'language' => $language_content->id @@ -1711,7 +1711,7 @@ function node_page_view(EntityInterface $node) { * Implements hook_update_index(). */ function node_update_index() { - $limit = (int) config('search.settings')->get('index.cron_limit'); + $limit = (int) Drupal::config('search.settings')->get('index.cron_limit'); $result = db_query_range("SELECT n.nid FROM {node} n LEFT JOIN {search_dataset} d ON d.type = 'node' AND d.sid = n.nid WHERE d.sid IS NULL OR d.reindex <> 0 ORDER BY d.reindex ASC, n.nid ASC", 0, $limit, array(), array('target' => 'slave')); $nids = $result->fetchCol(); @@ -1914,9 +1914,9 @@ function node_form_system_site_information_settings_form_alter(&$form, &$form_st $form['front_page']['default_nodes_main'] = array( '#type' => 'select', '#title' => t('Number of posts on front page'), - '#default_value' => config('node.settings')->get('items_per_page'), + '#default_value' => Drupal::config('node.settings')->get('items_per_page'), '#options' => drupal_map_assoc(array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 20, 25, 30)), - '#access' => (config('system.site')->get('page.front') == 'node'), + '#access' => (Drupal::config('system.site')->get('page.front') == 'node'), '#description' => t('The maximum number of posts displayed on overview pages such as the front page.'), ); $form['#submit'][] = 'node_form_system_site_information_settings_form_submit'; @@ -1928,7 +1928,7 @@ function node_form_system_site_information_settings_form_alter(&$form, &$form_st * @see node_form_system_site_information_settings_form_alter() */ function node_form_system_site_information_settings_form_submit($form, &$form_state) { - config('node.settings') + Drupal::config('node.settings') ->set('items_per_page', $form_state['values']['default_nodes_main']) ->save(); } @@ -2606,6 +2606,6 @@ function node_library_info() { */ function node_system_info_alter(&$info, $file, $type) { if ($type == 'module' && $file->name == 'translation') { - $info['hidden'] = !module_exists('translation') && config('system.module.disabled')->get('translation') === NULL; + $info['hidden'] = !module_exists('translation') && Drupal::config('system.module.disabled')->get('translation') === NULL; } } diff --git a/core/modules/overlay/overlay.module b/core/modules/overlay/overlay.module index 2edb2561164b3b5d6b391165fddc16e89e167826..52edcf8c2a2f30687c6c66f3c800e084fc91eed2 100644 --- a/core/modules/overlay/overlay.module +++ b/core/modules/overlay/overlay.module @@ -501,13 +501,13 @@ function overlay_overlay_parent_initialize() { // Let the client side know which paths are administrative. $paths = path_get_admin_paths(); foreach ($paths as &$type) { - $type = str_replace('', config('system.site')->get('page.front'), $type); + $type = str_replace('', Drupal::config('system.site')->get('page.front'), $type); } drupal_add_js(array('overlay' => array('paths' => $paths)), 'setting'); $path_prefixes = array(); if (module_exists('language')) { language_negotiation_include(); - if (config('language.negotiation')->get('url.source') == LANGUAGE_NEGOTIATION_URL_PREFIX) { + if (Drupal::config('language.negotiation')->get('url.source') == LANGUAGE_NEGOTIATION_URL_PREFIX) { // Skip the empty string indicating the default language. We always accept // paths without a prefix. $path_prefixes = language_negotiation_url_prefixes(); diff --git a/core/modules/php/php.module b/core/modules/php/php.module index 02fd1dd6522ea770f51e2588ac9ce8d515480c8f..9baffe7832a74340bf90aa96c95b8419673ab283 100644 --- a/core/modules/php/php.module +++ b/core/modules/php/php.module @@ -70,7 +70,7 @@ function php_eval($code) { // so code evaluated will not see the caller module as the current theme. // If theme info is not initialized get the path from default theme. if (!isset($theme_info)) { - $theme_path = drupal_get_path('theme', config('system.theme')->get('default')); + $theme_path = drupal_get_path('theme', Drupal::config('system.theme')->get('default')); } else { $theme_path = dirname($theme_info->filename); diff --git a/core/modules/rdf/rdf.install b/core/modules/rdf/rdf.install index 5bb8f677799bf3895c348a7135733fa1d87a0908..117c91053ab80907706ebed8d092e224a4e5df00 100644 --- a/core/modules/rdf/rdf.install +++ b/core/modules/rdf/rdf.install @@ -23,7 +23,7 @@ function rdf_update_8000() { $bundle = $row['bundle']; // Create a config object for the mapping. - $config = config("rdf.mapping.$entity_type.$bundle") + $config = Drupal::config("rdf.mapping.$entity_type.$bundle") ->set('id', "$entity_type.$bundle") ->set('uuid', $uuid->generate()) ->set('targetEntityType', $entity_type) diff --git a/core/modules/rest/lib/Drupal/rest/Tests/RESTTestBase.php b/core/modules/rest/lib/Drupal/rest/Tests/RESTTestBase.php index 94d3e61de0bc12d5763ae3d39b13887ca6b16d6d..db8feb2ce0b108c26f4c1a2428e7684454230e2a 100644 --- a/core/modules/rest/lib/Drupal/rest/Tests/RESTTestBase.php +++ b/core/modules/rest/lib/Drupal/rest/Tests/RESTTestBase.php @@ -197,7 +197,7 @@ protected function entityValues($entity_type) { */ protected function enableService($resource_type, $method = 'GET', $format = NULL, $auth = array()) { // Enable REST API for this entity type. - $config = config('rest.settings'); + $config = \Drupal::config('rest.settings'); $settings = array(); if ($resource_type) { if ($format) { diff --git a/core/modules/rest/rest.module b/core/modules/rest/rest.module index d0e055143ac64b4dbb78a5761c32e0fbb001bf56..a37bfe7aaa91e7d0fa68edb8f0c8e918a57ec4cb 100644 --- a/core/modules/rest/rest.module +++ b/core/modules/rest/rest.module @@ -11,7 +11,7 @@ function rest_permission() { $permissions = array(); $manager = Drupal::service('plugin.manager.rest'); - $resources = config('rest.settings')->get('resources'); + $resources = Drupal::config('rest.settings')->get('resources'); if ($resources && $enabled = array_intersect_key($manager->getDefinitions(), $resources)) { foreach ($enabled as $key => $resource) { $plugin = $manager->getInstance(array('id' => $key)); diff --git a/core/modules/search/lib/Drupal/search/Plugin/views/filter/Search.php b/core/modules/search/lib/Drupal/search/Plugin/views/filter/Search.php index 7461bdd4e8a28e96ddb54ed4b451596b1854f68f..89b21e4c4c1b79f3ad95ffc846a24811db955e86 100644 --- a/core/modules/search/lib/Drupal/search/Plugin/views/filter/Search.php +++ b/core/modules/search/lib/Drupal/search/Plugin/views/filter/Search.php @@ -85,7 +85,7 @@ public function validateExposed(&$form, &$form_state) { if (!empty($form_state['values'][$key])) { $this->query_parse_search_expression($form_state['values'][$key]); if (count($this->search_query->words()) == 0) { - form_set_error($key, format_plural(config('search.settings')->get('index.minimum_word_size'), 'You must include at least one positive keyword with 1 character or more.', 'You must include at least one positive keyword with @count characters or more.')); + form_set_error($key, format_plural(\Drupal::config('search.settings')->get('index.minimum_word_size'), 'You must include at least one positive keyword with 1 character or more.', 'You must include at least one positive keyword with @count characters or more.')); } } } diff --git a/core/modules/search/lib/Drupal/search/SearchQuery.php b/core/modules/search/lib/Drupal/search/SearchQuery.php index 86887b722d1762881227fa7201d510332b1fdf3b..8776bcea0422aaa71ba9f1cf99726838222324f8 100644 --- a/core/modules/search/lib/Drupal/search/SearchQuery.php +++ b/core/modules/search/lib/Drupal/search/SearchQuery.php @@ -200,7 +200,7 @@ protected function parseSearchExpression() { // Classify tokens. $or = FALSE; $warning = ''; - $limit_combinations = config('search.settings')->get('and_or_limit'); + $limit_combinations = \Drupal::config('search.settings')->get('and_or_limit'); // The first search expression does not count as AND. $and_count = -1; $or_count = 0; @@ -323,7 +323,7 @@ protected function parseWord($word) { $split = explode(' ', $word); foreach ($split as $s) { $num = is_numeric($s); - if ($num || drupal_strlen($s) >= config('search.settings')->get('index.minimum_word_size')) { + if ($num || drupal_strlen($s) >= \Drupal::config('search.settings')->get('index.minimum_word_size')) { if (!isset($this->words[$s])) { $this->words[$s] = $s; $num_new_scores++; @@ -349,11 +349,11 @@ public function executeFirstPass() { $this->parseSearchExpression(); if (count($this->words) == 0) { - form_set_error('keys', format_plural(config('search.settings')->get('index.minimum_word_size'), 'You must include at least one positive keyword with 1 character or more.', 'You must include at least one positive keyword with @count characters or more.')); + form_set_error('keys', format_plural(\Drupal::config('search.settings')->get('index.minimum_word_size'), 'You must include at least one positive keyword with 1 character or more.', 'You must include at least one positive keyword with @count characters or more.')); return FALSE; } if ($this->expressionsIgnored) { - drupal_set_message(t('Your search used too many AND/OR expressions. Only the first @count terms were included in this search.', array('@count' => config('search.settings')->get('and_or_limit'))), 'warning'); + drupal_set_message(t('Your search used too many AND/OR expressions. Only the first @count terms were included in this search.', array('@count' => \Drupal::config('search.settings')->get('and_or_limit'))), 'warning'); } $this->executedFirstPass = TRUE; diff --git a/core/modules/search/lib/Drupal/search/Tests/SearchEmbedFormTest.php b/core/modules/search/lib/Drupal/search/Tests/SearchEmbedFormTest.php index ff822c6b4eb3ba79c0d44d2609116330a54ec4b4..4659260a8ca9677f91a97ff5e4f5a7a993f69f69 100644 --- a/core/modules/search/lib/Drupal/search/Tests/SearchEmbedFormTest.php +++ b/core/modules/search/lib/Drupal/search/Tests/SearchEmbedFormTest.php @@ -50,7 +50,7 @@ function setUp() { search_update_totals(); // Set up a dummy initial count of times the form has been submitted. - $this->submit_count = config('search_embedded_form.settings')->get('submitted'); + $this->submit_count = \Drupal::config('search_embedded_form.settings')->get('submitted'); $this->refreshVariables(); } @@ -63,7 +63,7 @@ function testEmbeddedForm() { array('name' => 'John'), t('Send away')); $this->assertText(t('Test form was submitted'), 'Form message appears'); - $count = config('search_embedded_form.settings')->get('submitted'); + $count = \Drupal::config('search_embedded_form.settings')->get('submitted'); $this->assertEqual($this->submit_count + 1, $count, 'Form submission count is correct'); $this->submit_count = $count; @@ -74,7 +74,7 @@ function testEmbeddedForm() { array('name' => 'John'), t('Send away')); $this->assertText(t('Test form was submitted'), 'Form message appears'); - $count = config('search_embedded_form.settings')->get('submitted'); + $count = \Drupal::config('search_embedded_form.settings')->get('submitted'); $this->assertEqual($this->submit_count + 1, $count, 'Form submission count is correct'); $this->submit_count = $count; @@ -84,7 +84,7 @@ function testEmbeddedForm() { array('keys' => 'foo'), t('Search')); $this->assertNoText(t('Test form was submitted'), 'Form message does not appear'); - $count = config('search_embedded_form.settings')->get('submitted'); + $count = \Drupal::config('search_embedded_form.settings')->get('submitted'); $this->assertEqual($this->submit_count, $count, 'Form submission count is correct'); $this->submit_count = $count; } diff --git a/core/modules/search/lib/Drupal/search/Tests/SearchKeywordsConditionsTest.php b/core/modules/search/lib/Drupal/search/Tests/SearchKeywordsConditionsTest.php index 87414faaa3a736d92c69ccbfe657c977a4c4a7f9..ab7a0c916aa0726dab14bc34f71b3eb8ae99b4ef 100644 --- a/core/modules/search/lib/Drupal/search/Tests/SearchKeywordsConditionsTest.php +++ b/core/modules/search/lib/Drupal/search/Tests/SearchKeywordsConditionsTest.php @@ -35,7 +35,7 @@ function setUp() { // Login with sufficient privileges. $this->drupalLogin($this->searching_user); // Test with all search modules enabled. - config('search.settings')->set('active_modules', array('node' => 'node', 'user' => 'user', 'search_extra_type' => 'search_extra_type'))->save(); + \Drupal::config('search.settings')->set('active_modules', array('node' => 'node', 'user' => 'user', 'search_extra_type' => 'search_extra_type'))->save(); menu_router_rebuild(); } diff --git a/core/modules/search/lib/Drupal/search/Tests/SearchMatchTest.php b/core/modules/search/lib/Drupal/search/Tests/SearchMatchTest.php index 0f3d5740c547089c29f7e1248d78d9faf3e3ab76..76958c68def41f317f4d0f93b1acff013661480a 100644 --- a/core/modules/search/lib/Drupal/search/Tests/SearchMatchTest.php +++ b/core/modules/search/lib/Drupal/search/Tests/SearchMatchTest.php @@ -36,7 +36,7 @@ function testMatching() { * Set up a small index of items to test against. */ function _setup() { - config('search.settings')->set('index.minimum_word_size', 3)->save(); + \Drupal::config('search.settings')->set('index.minimum_word_size', 3)->save(); for ($i = 1; $i <= 7; ++$i) { search_index($i, SEARCH_TYPE, $this->getText($i), Language::LANGCODE_NOT_SPECIFIED); diff --git a/core/modules/search/lib/Drupal/search/Tests/SearchMultilingualEntityTest.php b/core/modules/search/lib/Drupal/search/Tests/SearchMultilingualEntityTest.php index d9ab4150ed2c2b5bbb53699da6ae8834ee4f2761..e1021b4abf4158bdc2d57c168f1759eee7357c16 100644 --- a/core/modules/search/lib/Drupal/search/Tests/SearchMultilingualEntityTest.php +++ b/core/modules/search/lib/Drupal/search/Tests/SearchMultilingualEntityTest.php @@ -93,7 +93,7 @@ function setUp() { */ function testIndexingThrottle() { // Index only 4 items per cron run. - config('search.settings')->set('index.cron_limit', 4)->save(); + \Drupal::config('search.settings')->set('index.cron_limit', 4)->save(); // Update the index. This does the initial processing. node_update_index(); // Run the shutdown function. Testing is a unique case where indexing diff --git a/core/modules/search/lib/Drupal/search/Tests/SearchPageOverrideTest.php b/core/modules/search/lib/Drupal/search/Tests/SearchPageOverrideTest.php index df72d2bd5ee7f057164915aa4c77f921f36549e8..45bcadf7ce0b0918185bc02155e5022daf915d36 100644 --- a/core/modules/search/lib/Drupal/search/Tests/SearchPageOverrideTest.php +++ b/core/modules/search/lib/Drupal/search/Tests/SearchPageOverrideTest.php @@ -37,7 +37,7 @@ function setUp() { $this->drupalLogin($this->search_user); // Enable the extra type module for searching. - config('search.settings')->set('active_modules', array('node' => 'node', 'user' => 'user', 'search_extra_type' => 'search_extra_type'))->save(); + \Drupal::config('search.settings')->set('active_modules', array('node' => 'node', 'user' => 'user', 'search_extra_type' => 'search_extra_type'))->save(); menu_router_rebuild(); } diff --git a/core/modules/search/lib/Drupal/search/Tests/SearchPageTextTest.php b/core/modules/search/lib/Drupal/search/Tests/SearchPageTextTest.php index b9dede6a8261c67424c78d60cd6715b107b41339..247096c54aacaf9c6ae9bf6011e72cd4b06e347c 100644 --- a/core/modules/search/lib/Drupal/search/Tests/SearchPageTextTest.php +++ b/core/modules/search/lib/Drupal/search/Tests/SearchPageTextTest.php @@ -60,7 +60,7 @@ function testSearchText() { // Test a search input exceeding the limit of AND/OR combinations to test // the Denial-of-Service protection. - $limit = config('search.settings')->get('and_or_limit'); + $limit = \Drupal::config('search.settings')->get('and_or_limit'); $keys = array(); for ($i = 0; $i < $limit + 1; $i++) { $keys[] = $this->randomName(3); diff --git a/core/modules/search/lib/Drupal/search/Tests/SearchRankingTest.php b/core/modules/search/lib/Drupal/search/Tests/SearchRankingTest.php index 887e997bea3f85523a92d68763e02e20e6733ef5..6e223f6e17dea7b675c697f6b65ebe3cf652d1d9 100644 --- a/core/modules/search/lib/Drupal/search/Tests/SearchRankingTest.php +++ b/core/modules/search/lib/Drupal/search/Tests/SearchRankingTest.php @@ -78,7 +78,7 @@ function testRankings() { $this->drupalPost(NULL, $edit, t('Save')); // Enable counting of statistics. - config('statistics.settings')->set('count_content_views', 1)->save(); + \Drupal::config('statistics.settings')->set('count_content_views', 1)->save(); // Then View one of the nodes a bunch of times. // Manually calling statistics.php, simulating ajax behavior. diff --git a/core/modules/search/lib/Drupal/search/Tests/SearchTokenizerTest.php b/core/modules/search/lib/Drupal/search/Tests/SearchTokenizerTest.php index 8e705d1763a89d8cbae3a774e23a0c8ba39b75ad..361cebfcf1817cf44a1f5e1ccd0fbe157d2da74b 100644 --- a/core/modules/search/lib/Drupal/search/Tests/SearchTokenizerTest.php +++ b/core/modules/search/lib/Drupal/search/Tests/SearchTokenizerTest.php @@ -30,7 +30,7 @@ public static function getInfo() { function testTokenizer() { // Set the minimum word size to 1 (to split all CJK characters) and make // sure CJK tokenizing is turned on. - config('search.settings') + \Drupal::config('search.settings') ->set('index.minimum_word_size', 1) ->set('index.overlap_cjk', TRUE) ->save(); @@ -118,7 +118,7 @@ function testTokenizer() { function testNoTokenizer() { // Set the minimum word size to 1 (to split all CJK characters) and make // sure CJK tokenizing is turned on. - config('search.settings') + \Drupal::config('search.settings') ->set('minimum_word_size', 1) ->set('overlap_cjk', TRUE) ->save(); diff --git a/core/modules/search/search.api.php b/core/modules/search/search.api.php index 1a343d26eadf4a07fac64fdaae99db5bdb253858..649a933fa93ff7a693eb001306e1150c8b129f0c 100644 --- a/core/modules/search/search.api.php +++ b/core/modules/search/search.api.php @@ -115,7 +115,7 @@ function hook_search_admin() { // Note: reversed to reflect that higher number = higher ranking. $options = drupal_map_assoc(range(0, 10)); - $ranks = config('node.settings')->get('search_rank'); + $ranks = Drupal::config('node.settings')->get('search_rank'); foreach (Drupal::moduleHandler()->invokeAll('ranking') as $var => $values) { $form['content_ranking']['factors'][$var] = array( '#title' => $values['title'], @@ -329,7 +329,7 @@ function hook_search_preprocess($text, $langcode = NULL) { * When implementing this hook, your module should index content items that * were modified or added since the last run. PHP has a time limit * for cron, though, so it is advisable to limit how many items you index - * per run using config('search.settings')->get('index.cron_limit') (see + * per run using Drupal::config('search.settings')->get('index.cron_limit') (see * example below). Also, since the cron run could time out and abort in the * middle of your run, you should update your module's internal bookkeeping on * when items have last been indexed as you go rather than waiting to the end @@ -338,7 +338,7 @@ function hook_search_preprocess($text, $langcode = NULL) { * @ingroup search */ function hook_update_index() { - $limit = (int) config('search.settings')->get('index.cron_limit'); + $limit = (int) Drupal::config('search.settings')->get('index.cron_limit'); $result = db_query_range("SELECT n.nid FROM {node} n LEFT JOIN {search_dataset} d ON d.type = 'node' AND d.sid = n.nid WHERE d.sid IS NULL OR d.reindex <> 0 ORDER BY d.reindex ASC, n.nid ASC", 0, $limit); @@ -402,7 +402,7 @@ function callback_search_conditions($keys) { if (!empty($_REQUEST['sample_search_keys'])) { $conditions['sample_search_keys'] = $_REQUEST['sample_search_keys']; } - if ($force_keys = config('sample_search.settings')->get('force_keywords')) { + if ($force_keys = Drupal::config('sample_search.settings')->get('force_keywords')) { $conditions['sample_search_force_keywords'] = $force_keys; } return $conditions; diff --git a/core/modules/search/search.module b/core/modules/search/search.module index ac06f3eb2d3eff046ea94638394fb2e93da714f9..fece768e77afb38106e1c2f82caf1edd36c0d2ee 100644 --- a/core/modules/search/search.module +++ b/core/modules/search/search.module @@ -252,7 +252,7 @@ function search_get_info($all = FALSE) { } // Return only modules that are set to active in search settings. - return array_intersect_key($search_hooks, array_flip(config('search.settings')->get('active_modules'))); + return array_intersect_key($search_hooks, array_flip(Drupal::config('search.settings')->get('active_modules'))); } /** @@ -263,7 +263,7 @@ function search_get_info($all = FALSE) { */ function search_get_default_module_info() { $info = search_get_info(); - $default = config('search.settings')->get('default_module'); + $default = Drupal::config('search.settings')->get('default_module'); if (isset($info[$default])) { return $info[$default]; } @@ -362,7 +362,7 @@ function search_cron() { // to date. drupal_register_shutdown_function('search_update_totals'); - foreach (config('search.settings')->get('active_modules') as $module) { + foreach (Drupal::config('search.settings')->get('active_modules') as $module) { // Update word index module_invoke($module, 'update_index'); } @@ -423,7 +423,7 @@ function search_simplify($text, $langcode = NULL) { search_invoke_preprocess($text, $langcode); // Simple CJK handling - if (config('search.settings')->get('index.overlap_cjk')) { + if (Drupal::config('search.settings')->get('index.overlap_cjk')) { $text = preg_replace_callback('/[' . PREG_CLASS_CJK . ']+/u', 'search_expand_cjk', $text); } @@ -477,7 +477,7 @@ function search_simplify($text, $langcode = NULL) { * Tokenized text, starting and ending with a space character. */ function search_expand_cjk($matches) { - $min = config('search.settings')->get('index.minimum_word_size'); + $min = Drupal::config('search.settings')->get('index.minimum_word_size'); $str = $matches[0]; $length = drupal_strlen($str); // If the text is shorter than the minimum word size, don't tokenize it. @@ -558,7 +558,7 @@ function search_invoke_preprocess(&$text, $langcode = NULL) { * @ingroup search */ function search_index($sid, $module, $text, $langcode) { - $minimum_word_size = config('search.settings')->get('index.minimum_word_size'); + $minimum_word_size = Drupal::config('search.settings')->get('index.minimum_word_size'); // Link matching global $base_url; @@ -567,7 +567,7 @@ function search_index($sid, $module, $text, $langcode) { // Multipliers for scores of words inside certain HTML tags. The weights are stored // in a variable so that modules can overwrite the default weights. // Note: 'a' must be included for link ranking to work. - $tags = config('search.settings')->get('index.tag_weights'); + $tags = Drupal::config('search.settings')->get('index.tag_weights'); // Strip off all ignored tags to speed up processing, but insert space before/after // them to keep word boundaries. diff --git a/core/modules/search/tests/modules/search_embedded_form/search_embedded_form.module b/core/modules/search/tests/modules/search_embedded_form/search_embedded_form.module index 919d228b521082df9c918814aeec644ca182405c..d59f184de56b896ea6f21aece6e347cbcc8a6176 100644 --- a/core/modules/search/tests/modules/search_embedded_form/search_embedded_form.module +++ b/core/modules/search/tests/modules/search_embedded_form/search_embedded_form.module @@ -30,7 +30,7 @@ function search_embedded_form_menu() { * @see search_embedded_form_form_submit(). */ function search_embedded_form_form($form, &$form_state) { - $count = config('search_embedded_form.settings')->get('submitted'); + $count = Drupal::config('search_embedded_form.settings')->get('submitted'); $form['name'] = array( '#type' => 'textfield', @@ -56,7 +56,7 @@ function search_embedded_form_form($form, &$form_state) { * Submit handler for search_embedded_form_form(). */ function search_embedded_form_form_submit($form, &$form_state) { - $config = config('search_embedded_form.settings'); + $config = Drupal::config('search_embedded_form.settings'); $submit_count = (int) $config->get('submitted'); $config->set('submitted', $submit_count + 1)->save(); drupal_set_message(t('Test form was submitted')); diff --git a/core/modules/search/tests/modules/search_extra_type/search_extra_type.module b/core/modules/search/tests/modules/search_extra_type/search_extra_type.module index 4435b4494f8c26027405d52d11f5c5f9e4ad0b58..b405e9a114a495073307c2cf6d1c8ebce57ad890 100644 --- a/core/modules/search/tests/modules/search_extra_type/search_extra_type.module +++ b/core/modules/search/tests/modules/search_extra_type/search_extra_type.module @@ -91,7 +91,7 @@ function search_extra_type_search_admin() { 'bi' => t('Bistromathic'), 'ii' => t('Infinite Improbability'), ), - '#default_value' => config('search_extra_type.settings')->get('boost'), + '#default_value' => Drupal::config('search_extra_type.settings')->get('boost'), ); $form['#submit'][] = 'search_extra_type_admin_submit'; @@ -103,7 +103,7 @@ function search_extra_type_search_admin() { * Form API callback: Save admin settings */ function search_extra_type_admin_submit($form, &$form_state) { - config('search_extra_type.settings') + Drupal::config('search_extra_type.settings') ->set('boost', $form_state['values']['extra_type_settings']['boost']) ->save(); } diff --git a/core/modules/shortcut/lib/Drupal/shortcut/Tests/ShortcutLinksTest.php b/core/modules/shortcut/lib/Drupal/shortcut/Tests/ShortcutLinksTest.php index 4cfd030bef3e7cb6b32ea22ace9905f93bcb56d5..0d68469338cca5ac096b633e1e890cf85a01ef8a 100644 --- a/core/modules/shortcut/lib/Drupal/shortcut/Tests/ShortcutLinksTest.php +++ b/core/modules/shortcut/lib/Drupal/shortcut/Tests/ShortcutLinksTest.php @@ -64,7 +64,7 @@ function testShortcutLinkAdd() { */ function testShortcutQuickLink() { theme_enable(array('seven')); - config('system.theme')->set('admin', 'seven')->save(); + \Drupal::config('system.theme')->set('admin', 'seven')->save(); variable_set('node_admin_theme', TRUE); $link = reset($this->set->links); @@ -136,7 +136,7 @@ function testShortcutLinkDelete() { */ function testNoShortcutLink() { // Change to a theme that displays shortcuts. - config('system.theme') + \Drupal::config('system.theme') ->set('default', 'seven') ->save(); diff --git a/core/modules/shortcut/shortcut.api.php b/core/modules/shortcut/shortcut.api.php index 8468c08f9283664fe57d5b43414995ef96ee25ef..27eecf3d9135ce81996a4f0408c5dcfe896f89f5 100644 --- a/core/modules/shortcut/shortcut.api.php +++ b/core/modules/shortcut/shortcut.api.php @@ -32,7 +32,7 @@ */ function hook_shortcut_default_set($account) { // Use a special set of default shortcuts for administrators only. - if (in_array(config('user.settings')->get('admin_role'), $account->getRoles())) { + if (in_array(Drupal::config('user.settings')->get('admin_role'), $account->getRoles())) { return 'admin-shortcuts'; } } diff --git a/core/modules/shortcut/shortcut.install b/core/modules/shortcut/shortcut.install index d78fa3b6b7fb5cf09680e709b01781c2189cc4b5..76e70973f47ab71d80ca58e5a1c40e425dd97077 100644 --- a/core/modules/shortcut/shortcut.install +++ b/core/modules/shortcut/shortcut.install @@ -84,7 +84,7 @@ function shortcut_update_8000() { ->condition('menu_name', 'shortcut-set-1') ->execute(); } - config('shortcut.set.' . $set->set_name) + Drupal::config('shortcut.set.' . $set->set_name) ->set('id', $set->set_name) ->set('label', $set->title) ->set('uuid', $uuid->generate()) diff --git a/core/modules/simpletest/lib/Drupal/simpletest/DrupalUnitTestBase.php b/core/modules/simpletest/lib/Drupal/simpletest/DrupalUnitTestBase.php index 54305c0c30a8f62aa55e998c0b64585b80df898f..b55feee2a316e6256a1c49b78fd1ece0f581369f 100644 --- a/core/modules/simpletest/lib/Drupal/simpletest/DrupalUnitTestBase.php +++ b/core/modules/simpletest/lib/Drupal/simpletest/DrupalUnitTestBase.php @@ -121,7 +121,7 @@ protected function setUp() { $modules = call_user_func_array('array_merge_recursive', $modules); $this->enableModules($modules, FALSE); // In order to use theme functions default theme config needs to exist. - config('system.theme')->set('default', 'stark'); + \Drupal::config('system.theme')->set('default', 'stark'); } protected function tearDown() { diff --git a/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php b/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php index 4040625ac2e2bcb836d4c3b8c508cde0c9178aad..04e98f168991b1c814d1c2fc5fff47e9144ea966 100644 --- a/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php +++ b/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php @@ -702,7 +702,7 @@ protected function verbose($message) { */ public function run(array $methods = array()) { TestServiceProvider::$currentTest = $this; - $simpletest_config = config('simpletest.settings'); + $simpletest_config = \Drupal::config('simpletest.settings'); $class = get_class($this); if ($simpletest_config->get('verbose')) { diff --git a/core/modules/simpletest/lib/Drupal/simpletest/Tests/DrupalUnitTestBaseTest.php b/core/modules/simpletest/lib/Drupal/simpletest/Tests/DrupalUnitTestBaseTest.php index 1171d1e42f055ef12cb403ed2224b50e0036befb..a2788b1be64676adacb596016eabf0dea6a19d45 100644 --- a/core/modules/simpletest/lib/Drupal/simpletest/Tests/DrupalUnitTestBaseTest.php +++ b/core/modules/simpletest/lib/Drupal/simpletest/Tests/DrupalUnitTestBaseTest.php @@ -191,7 +191,7 @@ function testInstallConfig() { $this->enableModules(array('user')); $this->installConfig(array('user')); $this->assertTrue($this->container->get('config.storage')->exists('user.settings')); - $this->assertTrue(config('user.settings')->get('register')); + $this->assertTrue(\Drupal::config('user.settings')->get('register')); } /** diff --git a/core/modules/simpletest/lib/Drupal/simpletest/Tests/SimpleTestTest.php b/core/modules/simpletest/lib/Drupal/simpletest/Tests/SimpleTestTest.php index 03b4380f8845633004a5017c4fec05aa004e83db..7aaf42f573b6007bf904558b9ac9eab56d068a58 100644 --- a/core/modules/simpletest/lib/Drupal/simpletest/Tests/SimpleTestTest.php +++ b/core/modules/simpletest/lib/Drupal/simpletest/Tests/SimpleTestTest.php @@ -61,7 +61,7 @@ function testInternalBrowser() { $this->drupalGet('test-page'); $this->assertTrue($this->drupalGetHeader('Date'), 'An HTTP header was received.'); $this->assertTitle(t('Test page | @site-name', array( - '@site-name' => config('system.site')->get('name'), + '@site-name' => \Drupal::config('system.site')->get('name'), ))); $this->assertNoTitle('Foo'); diff --git a/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php b/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php index ab24fc8a63318322883e6c3093ade9bf8746f00a..f1f5336cbfcd12d9bd0786e202eeb43c713d2e67 100644 --- a/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php +++ b/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php @@ -366,7 +366,7 @@ protected function drupalPlaceBlock($plugin_id, array $settings = array()) { 'plugin' => $plugin_id, 'region' => 'sidebar_first', 'machine_name' => strtolower($this->randomName(8)), - 'theme' => config('system.theme')->get('default'), + 'theme' => \Drupal::config('system.theme')->get('default'), 'label' => $this->randomName(8), 'visibility' => array(), 'weight' => 0, @@ -790,7 +790,7 @@ protected function setUp() { // Set 'parent_profile' of simpletest to add the parent profile's // search path to the child site's search paths. // @see drupal_system_listing() - config('simpletest.settings')->set('parent_profile', $this->originalProfile)->save(); + \Drupal::config('simpletest.settings')->set('parent_profile', $this->originalProfile)->save(); // Collect modules to install. $class = get_class($this); @@ -814,7 +814,7 @@ protected function setUp() { // Now make sure that the file path configurations are saved. This is done // after we install the modules to override default values. foreach ($variable_groups as $config_base => $variables) { - $config = config($config_base); + $config = \Drupal::config($config_base); foreach ($variables as $name => $value) { $config->set($name, $value); } @@ -823,7 +823,7 @@ protected function setUp() { variable_set('file_public_path', $this->public_files_directory); // Use the test mail class instead of the default mail handler class. - config('system.mail')->set('interface.default', 'Drupal\Core\Mail\VariableLog')->save(); + \Drupal::config('system.mail')->set('interface.default', 'Drupal\Core\Mail\VariableLog')->save(); drupal_set_time_limit($this->timeLimit); // Temporary fix so that when running from run-tests.sh we don't get an diff --git a/core/modules/simpletest/simpletest.module b/core/modules/simpletest/simpletest.module index 4df46833a40a87f3d2059a0d28ec05fe45e763a2..4004dd334456d5ef372a56232798d7c2ebdc9b3c 100644 --- a/core/modules/simpletest/simpletest.module +++ b/core/modules/simpletest/simpletest.module @@ -579,7 +579,7 @@ function simpletest_generate_file($filename, $width, $lines, $type = 'binary-tex function simpletest_clean_environment() { simpletest_clean_database(); simpletest_clean_temporary_directories(); - if (config('simpletest.settings')->get('clear_results')) { + if (Drupal::config('simpletest.settings')->get('clear_results')) { $count = simpletest_clean_results_table(); drupal_set_message(format_plural($count, 'Removed 1 test result.', 'Removed @count test results.')); } @@ -648,7 +648,7 @@ function simpletest_clean_temporary_directories() { * The number of results removed. */ function simpletest_clean_results_table($test_id = NULL) { - if (config('simpletest.settings')->get('clear_results')) { + if (Drupal::config('simpletest.settings')->get('clear_results')) { if ($test_id) { $count = db_query('SELECT COUNT(test_id) FROM {simpletest_test_id} WHERE test_id = :test_id', array(':test_id' => $test_id))->fetchField(); diff --git a/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsAdminTest.php b/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsAdminTest.php index b78e19fb11f841ccd8a5a0761fc454d5f7054906..6c70985a96c36572af0e17d1930c057fc152bce5 100644 --- a/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsAdminTest.php +++ b/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsAdminTest.php @@ -70,13 +70,13 @@ function setUp() { * Verifies that the statistics settings page works. */ function testStatisticsSettings() { - $config = config('statistics.settings'); + $config = \Drupal::config('statistics.settings'); $this->assertFalse($config->get('count_content_views'), 'Count content view log is disabled by default.'); // Enable counter on content view. $edit['statistics_count_content_views'] = 1; $this->drupalPost('admin/config/system/statistics', $edit, t('Save configuration')); - $config = config('statistics.settings'); + $config = \Drupal::config('statistics.settings'); $this->assertTrue($config->get('count_content_views'), 'Count content view log is enabled.'); // Hit the node. @@ -103,7 +103,7 @@ function testStatisticsSettings() { * Tests that when a node is deleted, the node counter is deleted too. */ function testDeleteNode() { - config('statistics.settings')->set('count_content_views', 1)->save(); + \Drupal::config('statistics.settings')->set('count_content_views', 1)->save(); $this->drupalGet('node/' . $this->test_node->id()); // Manually calling statistics.php, simulating ajax behavior. @@ -134,7 +134,7 @@ function testDeleteNode() { * Tests that cron clears day counts and expired access logs. */ function testExpiredLogs() { - config('statistics.settings') + \Drupal::config('statistics.settings') ->set('count_content_views', 1) ->save(); \Drupal::state()->set('statistics.day_timestamp', 8640000); diff --git a/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsLoggingTest.php b/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsLoggingTest.php index 115a8bcd302ff3ddbff4e608219dafe9e46fb8ee..5c8fbbb4c73d5170dd02fc0725b57230e2461a97 100644 --- a/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsLoggingTest.php +++ b/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsLoggingTest.php @@ -54,13 +54,13 @@ function setUp() { $this->node = $this->drupalCreateNode(array('title' => $this->randomName(255), 'uid' => $this->auth_user->id())); // Enable page caching. - $config = config('system.performance'); + $config = \Drupal::config('system.performance'); $config->set('cache.page.use_internal', 1); $config->set('cache.page.max_age', 300); $config->save(); // Enable access logging. - config('statistics.settings') + \Drupal::config('statistics.settings') ->set('count_content_views', 1) ->save(); diff --git a/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsTestBase.php b/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsTestBase.php index f4d75f49e79ed8a1e0d6a5f88ffbe55cdcba2f40..8ad4df2cff63119792e5f4c742cc621d8b48b17c 100644 --- a/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsTestBase.php +++ b/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsTestBase.php @@ -41,7 +41,7 @@ function setUp() { $this->drupalLogin($this->blocking_user); // Enable logging. - config('statistics.settings') + \Drupal::config('statistics.settings') ->set('count_content_views', 1) ->save(); } diff --git a/core/modules/statistics/statistics.module b/core/modules/statistics/statistics.module index c40fc6a6be596ea1dcbb9d46f79a01ffdb435fd6..1faf13ea520c6248bad096de47792303ec549816 100644 --- a/core/modules/statistics/statistics.module +++ b/core/modules/statistics/statistics.module @@ -211,7 +211,7 @@ function statistics_node_predelete(EntityInterface $node) { * Implements hook_ranking(). */ function statistics_ranking() { - if (config('statistics.settings')->get('count_content_views')) { + if (Drupal::config('statistics.settings')->get('count_content_views')) { return array( 'views' => array( 'title' => t('Number of views'), @@ -274,7 +274,7 @@ function statistics_library_info() { * to count content views. */ function statistics_block_alter(&$definitions) { - $statistics_count_content_views = config('statistics.settings')->get('count_content_views'); + $statistics_count_content_views = Drupal::config('statistics.settings')->get('count_content_views'); if (empty($statistics_count_content_views)) { unset($definitions['statistics_popular_block']); } diff --git a/core/modules/statistics/statistics.php b/core/modules/statistics/statistics.php index 22d2fb457a2849e7dfd9028808e7da185e537141..20a2ec93a3c41be123bd2f026ae418dd1031ddfb 100644 --- a/core/modules/statistics/statistics.php +++ b/core/modules/statistics/statistics.php @@ -12,7 +12,7 @@ include_once dirname(dirname(__DIR__)) . '/includes/bootstrap.inc'; drupal_bootstrap(DRUPAL_BOOTSTRAP_VARIABLES); -if (config('statistics.settings')->get('count_content_views')) { +if (\Drupal::config('statistics.settings')->get('count_content_views')) { $nid = filter_input(INPUT_POST, 'nid', FILTER_VALIDATE_INT); if ($nid) { db_merge('node_counter') diff --git a/core/modules/syslog/syslog.install b/core/modules/syslog/syslog.install index 5b2c41ae82615ac425f2ec10eb41a7176adff7dc..c9eb769350e4d04043a36681f6ad34a4b25aef03 100644 --- a/core/modules/syslog/syslog.install +++ b/core/modules/syslog/syslog.install @@ -11,7 +11,7 @@ function syslog_install() { // The default facility setting depends on the operating system, so it needs // to be set dynamically during installation. - config('syslog.settings')->set('facility', defined('LOG_LOCAL0') ? LOG_LOCAL0 : LOG_USER)->save(); + Drupal::config('syslog.settings')->set('facility', defined('LOG_LOCAL0') ? LOG_LOCAL0 : LOG_USER)->save(); } /** diff --git a/core/modules/syslog/syslog.module b/core/modules/syslog/syslog.module index fe781c3b1c0590527b9f89fdc6912ad9498c45d5..c46f58aec0636a94d250148626064d20b81882fa 100644 --- a/core/modules/syslog/syslog.module +++ b/core/modules/syslog/syslog.module @@ -45,7 +45,7 @@ function syslog_help($path, $arg) { * Implements hook_form_FORM_ID_alter(). */ function syslog_form_system_logging_settings_alter(&$form, &$form_state) { - $config = config('syslog.settings'); + $config = Drupal::config('syslog.settings'); $help = module_exists('help') ? ' ' . l(t('More information'), 'admin/help/syslog') . '.' : NULL; $form['syslog_identity'] = array( '#type' => 'textfield', @@ -78,7 +78,7 @@ function syslog_form_system_logging_settings_alter(&$form, &$form_state) { * @see syslog_form_system_logging_settings_alter() */ function syslog_logging_settings_submit($form, &$form_state) { - config('syslog.settings') + Drupal::config('syslog.settings') ->set('identity', $form_state['values']['syslog_identity']) ->set('facility', $form_state['values']['syslog_facility']) ->set('format', $form_state['values']['syslog_format']) @@ -111,7 +111,7 @@ function syslog_watchdog(array $log_entry) { global $base_url; $log_init = &drupal_static(__FUNCTION__, FALSE); - $config = config('syslog.settings'); + $config = Drupal::config('syslog.settings'); if (!$log_init) { $log_init = TRUE; diff --git a/core/modules/system/lib/Drupal/system/Access/CronAccessCheck.php b/core/modules/system/lib/Drupal/system/Access/CronAccessCheck.php index a0cc9814d0f394505d3cd3185bdd139067ba2f00..9c12bd0ad301a95bb51b80d0f750e0202dc815ee 100644 --- a/core/modules/system/lib/Drupal/system/Access/CronAccessCheck.php +++ b/core/modules/system/lib/Drupal/system/Access/CronAccessCheck.php @@ -32,7 +32,7 @@ public function access(Route $route, Request $request) { watchdog('cron', 'Cron could not run because an invalid key was used.', array(), WATCHDOG_NOTICE); return FALSE; } - elseif (config('system.maintenance')->get('enabled')) { + elseif (\Drupal::config('system.maintenance')->get('enabled')) { watchdog('cron', 'Cron could not run because the site is in maintenance mode.', array(), WATCHDOG_NOTICE); return FALSE; } diff --git a/core/modules/system/lib/Drupal/system/Plugin/Core/Entity/DateFormat.php b/core/modules/system/lib/Drupal/system/Plugin/Core/Entity/DateFormat.php index badf567e6d3dc50381ebfafcb60f2a3efa97d685..e853b9bb66eab223df4cf307e0a55a61d66c98ed 100644 --- a/core/modules/system/lib/Drupal/system/Plugin/Core/Entity/DateFormat.php +++ b/core/modules/system/lib/Drupal/system/Plugin/Core/Entity/DateFormat.php @@ -192,7 +192,7 @@ public static function postDelete(EntityStorageControllerInterface $storage_cont foreach ($entities as $entity) { $format_id = $entity->id(); foreach ($languages as $langcode => $data) { - config("locale.config.$langcode.system.date_format.$format_id")->delete(); + \Drupal::config("locale.config.$langcode.system.date_format.$format_id")->delete(); } } } diff --git a/core/modules/system/lib/Drupal/system/Plugin/ImageToolkit/GDToolkit.php b/core/modules/system/lib/Drupal/system/Plugin/ImageToolkit/GDToolkit.php index 86612c72ab3506e4abf7842a7d38aedd9281a02e..2421004a7ba0696a34eccfd7e68d6a4913b3ae7a 100644 --- a/core/modules/system/lib/Drupal/system/Plugin/ImageToolkit/GDToolkit.php +++ b/core/modules/system/lib/Drupal/system/Plugin/ImageToolkit/GDToolkit.php @@ -33,7 +33,7 @@ public function settingsForm() { '#description' => t('Define the image quality for JPEG manipulations. Ranges from 0 to 100. Higher values mean better image quality but bigger files.'), '#min' => 0, '#max' => 100, - '#default_value' => config('system.image.gd')->get('jpeg_quality'), + '#default_value' => \Drupal::config('system.image.gd')->get('jpeg_quality'), '#field_suffix' => t('%'), ); return $form; @@ -43,7 +43,7 @@ public function settingsForm() { * {@inheritdoc} */ public function settingsFormSubmit($form, &$form_state) { - config('system.image.gd') + \Drupal::config('system.image.gd') ->set('jpeg_quality', $form_state['values']['gd']['image_jpeg_quality']) ->save(); } @@ -196,7 +196,7 @@ public function save(ImageInterface $image, $destination) { return FALSE; } if ($extension == 'jpeg') { - $success = $function($image->getResource(), $destination, config('system.image.gd')->get('jpeg_quality')); + $success = $function($image->getResource(), $destination, \Drupal::config('system.image.gd')->get('jpeg_quality')); } else { // Always save PNG images with full transparency. diff --git a/core/modules/system/lib/Drupal/system/Plugin/ImageToolkitManager.php b/core/modules/system/lib/Drupal/system/Plugin/ImageToolkitManager.php index f8e334da96ad50491989c089fbec2e43eb5a01e8..5f00afb3ac4620b729cede9d207753f4a03f551c 100644 --- a/core/modules/system/lib/Drupal/system/Plugin/ImageToolkitManager.php +++ b/core/modules/system/lib/Drupal/system/Plugin/ImageToolkitManager.php @@ -43,7 +43,7 @@ public function __construct(\Traversable $namespaces, CacheBackendInterface $cac * Object of the default toolkit, or FALSE on error. */ public function getDefaultToolkit() { - $toolkit_id = config('system.image')->get('toolkit'); + $toolkit_id = \Drupal::config('system.image')->get('toolkit'); $toolkits = $this->getAvailableToolkits(); if (!isset($toolkits[$toolkit_id]) || !class_exists($toolkits[$toolkit_id]['class'])) { diff --git a/core/modules/system/lib/Drupal/system/Tests/Ajax/FrameworkTest.php b/core/modules/system/lib/Drupal/system/Tests/Ajax/FrameworkTest.php index 44d1ab8afca0de8a7732db4c6cfe0289abcd1e4a..7b86c566f4aaba5373aaa722752130505be1ad5c 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Ajax/FrameworkTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Ajax/FrameworkTest.php @@ -189,7 +189,7 @@ function testLazyLoadOverriddenCSS() { // The test theme overrides system.module.css without an implementation, // thereby removing it. theme_enable(array('test_theme')); - config('system.theme') + \Drupal::config('system.theme') ->set('default', 'test_theme') ->save(); diff --git a/core/modules/system/lib/Drupal/system/Tests/Batch/PageTest.php b/core/modules/system/lib/Drupal/system/Tests/Batch/PageTest.php index be6bcef57226969ae5d5305dffdb745935e6bc9d..f268e0279f7fb4ceab72f609b9737ef64c1d78f0 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Batch/PageTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Batch/PageTest.php @@ -35,11 +35,11 @@ public static function getInfo() { function testBatchProgressPageTheme() { // Make sure that the page which starts the batch (an administrative page) // is using a different theme than would normally be used by the batch API. - config('system.theme') + \Drupal::config('system.theme') ->set('default', 'bartik') ->save(); theme_enable(array('seven')); - config('system.theme')->set('admin', 'seven')->save(); + \Drupal::config('system.theme')->set('admin', 'seven')->save(); // Log in as an administrator who can see the administrative theme. $admin_user = $this->drupalCreateUser(array('view the administration theme')); $this->drupalLogin($admin_user); diff --git a/core/modules/system/lib/Drupal/system/Tests/Bootstrap/PageCacheTest.php b/core/modules/system/lib/Drupal/system/Tests/Bootstrap/PageCacheTest.php index 59d71b642415f4eb7a1305681ffc9a68decd2807..67a70b8f216dca9c84ebe13d299c2145d32a81fd 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Bootstrap/PageCacheTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Bootstrap/PageCacheTest.php @@ -35,7 +35,7 @@ public static function getInfo() { function setUp() { parent::setUp(); - config('system.site') + \Drupal::config('system.site') ->set('name', 'Drupal') ->set('page.front', 'test-page') ->save(); @@ -72,7 +72,7 @@ function testAcceptHeaderRequests() { * Tests support of requests with If-Modified-Since and If-None-Match headers. */ function testConditionalRequests() { - $config = config('system.performance'); + $config = \Drupal::config('system.performance'); $config->set('cache.page.use_internal', 1); $config->set('cache.page.max_age', 300); $config->save(); @@ -117,7 +117,7 @@ function testConditionalRequests() { * Tests cache headers. */ function testPageCache() { - $config = config('system.performance'); + $config = \Drupal::config('system.performance'); $config->set('cache.page.use_internal', 1); $config->set('cache.page.max_age', 300); $config->set('response.gzip', 1); @@ -177,7 +177,7 @@ function testPageCache() { * mod_deflate Apache module. */ function testPageCompression() { - $config = config('system.performance'); + $config = \Drupal::config('system.performance'); $config->set('cache.page.use_internal', 1); $config->set('cache.page.max_age', 300); $config->set('response.gzip', 1); @@ -200,7 +200,7 @@ function testPageCompression() { $this->drupalGet(''); $this->assertEqual($this->drupalGetHeader('X-Drupal-Cache'), 'HIT', 'Page was cached.'); $this->assertFalse($this->drupalGetHeader('Content-Encoding'), 'A Content-Encoding header was not sent.'); - $this->assertTitle(t('Test page | @site-name', array('@site-name' => config('system.site')->get('name'))), 'Site title matches.'); + $this->assertTitle(t('Test page | @site-name', array('@site-name' => \Drupal::config('system.site')->get('name'))), 'Site title matches.'); $this->assertRaw('', 'Page was not compressed.'); // Disable compression mode. diff --git a/core/modules/system/lib/Drupal/system/Tests/Common/FormatDateTest.php b/core/modules/system/lib/Drupal/system/Tests/Common/FormatDateTest.php index 843f716dddde389f625c8bbe257f71a58e3af4ef..2bd36c26f0608fe4ebd8cc550b54376df75bf8f5 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Common/FormatDateTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Common/FormatDateTest.php @@ -38,7 +38,7 @@ public static function getInfo() { function setUp() { parent::setUp('language'); - config('system.date') + \Drupal::config('system.date') ->set('timezone.user.configurable', 1) ->save(); $formats = $this->container->get('plugin.manager.entity') diff --git a/core/modules/system/lib/Drupal/system/Tests/Common/JavaScriptTest.php b/core/modules/system/lib/Drupal/system/Tests/Common/JavaScriptTest.php index 128dc30362979b504c9a52d20aee1a874290591f..96168fea8447c97f998d67ff2e7fbbab584ad0d1 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Common/JavaScriptTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Common/JavaScriptTest.php @@ -39,7 +39,7 @@ function setUp() { parent::setUp(); // Disable preprocessing - $config = config('system.performance'); + $config = \Drupal::config('system.performance'); $this->preprocess_js = $config->get('js.preprocess'); $config->set('js.preprocess', 0); $config->save(); @@ -51,7 +51,7 @@ function setUp() { function tearDown() { // Restore configured value for JavaScript preprocessing. - $config = config('system.performance'); + $config = \Drupal::config('system.performance'); $config->set('js.preprocess', $this->preprocess_js); $config->save(); parent::tearDown(); @@ -120,7 +120,7 @@ function testAttributes() { */ function testAggregatedAttributes() { // Enable aggregation. - config('system.performance')->set('js.preprocess', 1)->save(); + \Drupal::config('system.performance')->set('js.preprocess', 1)->save(); $default_query_string = variable_get('css_js_query_string', '0'); @@ -327,7 +327,7 @@ function testAggregation() { // Now ensure that with aggregation on, one file is made for the // 'every_page' files, and one file is made for the others. drupal_static_reset('drupal_add_js'); - $config = config('system.performance'); + $config = \Drupal::config('system.performance'); $config->set('js.preprocess', 1); $config->save(); drupal_add_library('system', 'drupal'); @@ -349,7 +349,7 @@ function testAggregation() { */ function testAggregationOrder() { // Enable JavaScript aggregation. - config('system.performance')->set('js.preprocess', 1)->save(); + \Drupal::config('system.performance')->set('js.preprocess', 1)->save(); drupal_static_reset('drupal_add_js'); // Add two JavaScript files to the current request and build the cache. diff --git a/core/modules/system/lib/Drupal/system/Tests/Common/RenderTest.php b/core/modules/system/lib/Drupal/system/Tests/Common/RenderTest.php index c9645778ab1f8b9295849b49b3158be83eecc137..17993432ad4437511c25a7fcf2ae071667a9b79d 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Common/RenderTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Common/RenderTest.php @@ -508,7 +508,7 @@ function testDrupalRenderInvalidKeys() { ); $message = t('%type: !message in %function (line ', $error); - config('system.logging')->set('error_level', ERROR_REPORTING_DISPLAY_ALL)->save(); + \Drupal::config('system.logging')->set('error_level', ERROR_REPORTING_DISPLAY_ALL)->save(); $this->drupalGet('common-test/drupal-render-invalid-keys'); $this->assertResponse(200, 'Received expected HTTP status code.'); $this->assertRaw($message, format_string('Found error message: !message.', array('!message' => $message))); diff --git a/core/modules/system/lib/Drupal/system/Tests/Datetime/DrupalDateTimeTest.php b/core/modules/system/lib/Drupal/system/Tests/Datetime/DrupalDateTimeTest.php index dc24e3833cc36535428cca8bf0542a40833ee7ce..027d8669f68c2ca91df855bc5ddb7ddd04eda18b 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Datetime/DrupalDateTimeTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Datetime/DrupalDateTimeTest.php @@ -48,7 +48,7 @@ public function testDateTimezone() { $date_string = '2007-01-31 21:00:00'; // Make sure no site timezone has been set. - config('system.date') + \Drupal::config('system.date') ->set('timezone.user.configurable', 0) ->set('timezone.default', NULL) ->save(); @@ -68,7 +68,7 @@ public function testDateTimezone() { $this->assertTrue($timezone == 'America/Yellowknife', 'DrupalDateTime uses the specified timezone if provided.'); // Set a site timezone. - config('system.date')->set('timezone.default', 'Europe/Warsaw')->save(); + \Drupal::config('system.date')->set('timezone.default', 'Europe/Warsaw')->save(); // Create a date object with an unspecified timezone, which should // end up using the site timezone. @@ -77,7 +77,7 @@ public function testDateTimezone() { $this->assertTrue($timezone == 'Europe/Warsaw', 'DrupalDateTime uses the site timezone if provided.'); // Create user. - config('system.date')->set('timezone.user.configurable', 1)->save(); + \Drupal::config('system.date')->set('timezone.user.configurable', 1)->save(); $test_user = $this->drupalCreateUser(array()); $this->drupalLogin($test_user); diff --git a/core/modules/system/lib/Drupal/system/Tests/File/DirectoryTest.php b/core/modules/system/lib/Drupal/system/Tests/File/DirectoryTest.php index f72430fdbdd75bc8f84ac29e1b38e69ffa3d40e2..7fd19c592455bd9c0a35fb5c152a6956bbca66dd 100644 --- a/core/modules/system/lib/Drupal/system/Tests/File/DirectoryTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/File/DirectoryTest.php @@ -89,7 +89,7 @@ function testFileCheckDirectoryHandling() { } // Test that the directory has the correct permissions. - $this->assertDirectoryPermissions($directory, octdec(config('system.file')->get('chmod.directory'))); + $this->assertDirectoryPermissions($directory, octdec(\Drupal::config('system.file')->get('chmod.directory'))); // Remove .htaccess file to then test that it gets re-created. @drupal_unlink(file_default_scheme() . '://.htaccess'); @@ -160,7 +160,7 @@ function testFileDestination() { */ function testFileDirectoryTemp() { // Start with an empty variable to ensure we have a clean slate. - $config = config('system.file'); + $config = \Drupal::config('system.file'); $config->set('path.temporary', '')->save(); $tmp_directory = file_directory_temp(); $this->assertEqual(empty($tmp_directory), FALSE, 'file_directory_temp() returned a non-empty value.'); diff --git a/core/modules/system/lib/Drupal/system/Tests/File/NameMungingTest.php b/core/modules/system/lib/Drupal/system/Tests/File/NameMungingTest.php index fe89a330aad564e20f62d79f4ba146a9e3b133db..9c0d3d94b60a8af527f4768ef3efbfae6c69e1ca 100644 --- a/core/modules/system/lib/Drupal/system/Tests/File/NameMungingTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/File/NameMungingTest.php @@ -30,7 +30,7 @@ function setUp() { */ function testMunging() { // Disable insecure uploads. - config('system.file')->set('allow_insecure_uploads', 0)->save(); + \Drupal::config('system.file')->set('allow_insecure_uploads', 0)->save(); $munged_name = file_munge_filename($this->name, '', TRUE); $messages = drupal_get_messages(); $this->assertTrue(in_array(t('For security reasons, your upload has been renamed to %filename.', array('%filename' => $munged_name)), $messages['status']), 'Alert properly set when a file is renamed.'); @@ -51,7 +51,7 @@ function testMungeNullByte() { * come out untouched, no matter how evil the filename. */ function testMungeIgnoreInsecure() { - config('system.file')->set('allow_insecure_uploads', 1)->save(); + \Drupal::config('system.file')->set('allow_insecure_uploads', 1)->save(); $munged_name = file_munge_filename($this->name, ''); $this->assertIdentical($munged_name, $this->name, format_string('The original filename (%original) matches the munged filename (%munged) when insecure uploads are enabled.', array('%munged' => $munged_name, '%original' => $this->name))); } diff --git a/core/modules/system/lib/Drupal/system/Tests/File/RemoteFileDirectoryTest.php b/core/modules/system/lib/Drupal/system/Tests/File/RemoteFileDirectoryTest.php index 557c03f180a1155e400f9b726bdd107e2f14b9a9..4c7abd201a71d659cb11de57976b986728820b09 100644 --- a/core/modules/system/lib/Drupal/system/Tests/File/RemoteFileDirectoryTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/File/RemoteFileDirectoryTest.php @@ -27,6 +27,6 @@ public static function getInfo() { function setUp() { parent::setUp('file_test'); - config('system.file')->set('default_scheme', 'dummy-remote')->save(); + \Drupal::config('system.file')->set('default_scheme', 'dummy-remote')->save(); } } diff --git a/core/modules/system/lib/Drupal/system/Tests/File/RemoteFileScanDirectoryTest.php b/core/modules/system/lib/Drupal/system/Tests/File/RemoteFileScanDirectoryTest.php index 0dccd29b9e9e0a21abce0df4ad71b532c612e240..fe554cd9bfdd5c3592fbb02de743497999a21ff5 100644 --- a/core/modules/system/lib/Drupal/system/Tests/File/RemoteFileScanDirectoryTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/File/RemoteFileScanDirectoryTest.php @@ -27,6 +27,6 @@ public static function getInfo() { function setUp() { parent::setUp('file_test'); - config('system.file')->set('default_scheme', 'dummy-remote')->save(); + \Drupal::config('system.file')->set('default_scheme', 'dummy-remote')->save(); } } diff --git a/core/modules/system/lib/Drupal/system/Tests/File/RemoteFileUnmanagedCopyTest.php b/core/modules/system/lib/Drupal/system/Tests/File/RemoteFileUnmanagedCopyTest.php index 365c8bb1e0a1831ca93fd47a22427992d8d7fce3..21973ba696e5f3a893f6bf7d7db2d22905e3d249 100644 --- a/core/modules/system/lib/Drupal/system/Tests/File/RemoteFileUnmanagedCopyTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/File/RemoteFileUnmanagedCopyTest.php @@ -27,6 +27,6 @@ public static function getInfo() { function setUp() { parent::setUp('file_test'); - config('system.file')->set('default_scheme', 'dummy-remote')->save(); + \Drupal::config('system.file')->set('default_scheme', 'dummy-remote')->save(); } } diff --git a/core/modules/system/lib/Drupal/system/Tests/File/RemoteFileUnmanagedDeleteRecursiveTest.php b/core/modules/system/lib/Drupal/system/Tests/File/RemoteFileUnmanagedDeleteRecursiveTest.php index 6e51f6b714597be6ee1e806911410093df4bf9a2..9fbaface3daefbaa6897ff062d234a5cd0d6779d 100644 --- a/core/modules/system/lib/Drupal/system/Tests/File/RemoteFileUnmanagedDeleteRecursiveTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/File/RemoteFileUnmanagedDeleteRecursiveTest.php @@ -27,6 +27,6 @@ public static function getInfo() { function setUp() { parent::setUp('file_test'); - config('system.file')->set('default_scheme', 'dummy-remote')->save(); + \Drupal::config('system.file')->set('default_scheme', 'dummy-remote')->save(); } } diff --git a/core/modules/system/lib/Drupal/system/Tests/File/RemoteFileUnmanagedDeleteTest.php b/core/modules/system/lib/Drupal/system/Tests/File/RemoteFileUnmanagedDeleteTest.php index 46160f5c155e9b0f5065354f9a785e1b7f831ab4..b5dfcf7da5790727b3364809886d661ea633ba0f 100644 --- a/core/modules/system/lib/Drupal/system/Tests/File/RemoteFileUnmanagedDeleteTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/File/RemoteFileUnmanagedDeleteTest.php @@ -27,6 +27,6 @@ public static function getInfo() { function setUp() { parent::setUp('file_test'); - config('system.file')->set('default_scheme', 'dummy-remote')->save(); + \Drupal::config('system.file')->set('default_scheme', 'dummy-remote')->save(); } } diff --git a/core/modules/system/lib/Drupal/system/Tests/File/RemoteFileUnmanagedSaveDataTest.php b/core/modules/system/lib/Drupal/system/Tests/File/RemoteFileUnmanagedSaveDataTest.php index e21b9cef4282aaa1d30dd0831475e693173af6b3..1e5712a3a63133ad96c20638e771c2ff26864c41 100644 --- a/core/modules/system/lib/Drupal/system/Tests/File/RemoteFileUnmanagedSaveDataTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/File/RemoteFileUnmanagedSaveDataTest.php @@ -27,6 +27,6 @@ public static function getInfo() { function setUp() { parent::setUp('file_test'); - config('system.file')->set('default_scheme', 'dummy-remote')->save(); + \Drupal::config('system.file')->set('default_scheme', 'dummy-remote')->save(); } } diff --git a/core/modules/system/lib/Drupal/system/Tests/File/StreamWrapperTest.php b/core/modules/system/lib/Drupal/system/Tests/File/StreamWrapperTest.php index c17dcb73e140472c655efeab76c4ffcbc14c79eb..1b5c42901bea06e88a8378cb97eb87bed581e829 100644 --- a/core/modules/system/lib/Drupal/system/Tests/File/StreamWrapperTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/File/StreamWrapperTest.php @@ -67,7 +67,7 @@ function testGetInstanceByScheme() { * Test the URI and target functions. */ function testUriFunctions() { - $config = config('system.file'); + $config = \Drupal::config('system.file'); $instance = file_stream_wrapper_get_instance_by_uri($this->scheme . '://foo'); $this->assertEqual($this->classname, get_class($instance), 'Got correct class type for dummy URI.'); diff --git a/core/modules/system/lib/Drupal/system/Tests/File/UnmanagedCopyTest.php b/core/modules/system/lib/Drupal/system/Tests/File/UnmanagedCopyTest.php index 7f5248cff75737eee37a0e85f4b73acf45442454..70f1903b259d34b10d2b76c57870ec0397cf60e0 100644 --- a/core/modules/system/lib/Drupal/system/Tests/File/UnmanagedCopyTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/File/UnmanagedCopyTest.php @@ -23,7 +23,7 @@ public static function getInfo() { * Copy a normal file. */ function testNormal() { - $config = config('system.file'); + $config = \Drupal::config('system.file'); // Create a file for testing $uri = $this->createUri(); @@ -65,7 +65,7 @@ function testNonExistent() { * Copy a file onto itself. */ function testOverwriteSelf() { - $config = config('system.file'); + $config = \Drupal::config('system.file'); // Create a file for testing $uri = $this->createUri(); diff --git a/core/modules/system/lib/Drupal/system/Tests/File/UnmanagedMoveTest.php b/core/modules/system/lib/Drupal/system/Tests/File/UnmanagedMoveTest.php index 23ac6327785ae1941a574acdd4aebf0f2e44cfd1..1503bd1c862446c1e4198ccd40e5a8f2ddc8be3f 100644 --- a/core/modules/system/lib/Drupal/system/Tests/File/UnmanagedMoveTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/File/UnmanagedMoveTest.php @@ -23,7 +23,7 @@ public static function getInfo() { * Move a normal file. */ function testNormal() { - $config = config('system.file'); + $config = \Drupal::config('system.file'); // Create a file for testing $uri = $this->createUri(); diff --git a/core/modules/system/lib/Drupal/system/Tests/File/UnmanagedSaveDataTest.php b/core/modules/system/lib/Drupal/system/Tests/File/UnmanagedSaveDataTest.php index 1077c4cf18c2988089f017dd9f061172b1e80f2b..043ed6c78c1b880db523c1f75bf35ec27f02e5ba 100644 --- a/core/modules/system/lib/Drupal/system/Tests/File/UnmanagedSaveDataTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/File/UnmanagedSaveDataTest.php @@ -36,6 +36,6 @@ function testFileSaveData() { $this->assertTrue($filepath, 'Unnamed file saved correctly.'); $this->assertEqual('asdf.txt', drupal_basename($filepath), 'File was named correctly.'); $this->assertEqual($contents, file_get_contents($filepath), 'Contents of the file are correct.'); - $this->assertFilePermissions($filepath, octdec(config('system.file')->get('chmod.file'))); + $this->assertFilePermissions($filepath, octdec(\Drupal::config('system.file')->get('chmod.file'))); } } diff --git a/core/modules/system/lib/Drupal/system/Tests/Installer/InstallerTranslationTest.php b/core/modules/system/lib/Drupal/system/Tests/Installer/InstallerTranslationTest.php index 2c6e10ff151291cfaaa97ed5c5cf8d31b0bd2588..29abf30362e23e0642060983f2d096b3d641d039 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Installer/InstallerTranslationTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Installer/InstallerTranslationTest.php @@ -113,7 +113,7 @@ protected function setUp() { $this->rebuildContainer(); foreach ($variable_groups as $config_base => $variables) { - $config = config($config_base); + $config = \Drupal::config($config_base); foreach ($variables as $name => $value) { $config->set($name, $value); } @@ -121,7 +121,7 @@ protected function setUp() { } // Use the test mail class instead of the default mail handler class. - config('system.mail')->set('interface.default', 'Drupal\Core\Mail\VariableLog')->save(); + \Drupal::config('system.mail')->set('interface.default', 'Drupal\Core\Mail\VariableLog')->save(); drupal_set_time_limit($this->timeLimit); // When running from run-tests.sh we don't get an empty current path which diff --git a/core/modules/system/lib/Drupal/system/Tests/InstallerTest.php b/core/modules/system/lib/Drupal/system/Tests/InstallerTest.php index 43824bf73f56b3c0f165d4d1ebdbceb1ced0f83b..2c4ead88d8a7257861306e6e302bf3c4914feb05 100644 --- a/core/modules/system/lib/Drupal/system/Tests/InstallerTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/InstallerTest.php @@ -89,7 +89,7 @@ protected function setUp() { $this->rebuildContainer(); foreach ($variable_groups as $config_base => $variables) { - $config = config($config_base); + $config = \Drupal::config($config_base); foreach ($variables as $name => $value) { $config->set($name, $value); } @@ -97,7 +97,7 @@ protected function setUp() { } // Use the test mail class instead of the default mail handler class. - config('system.mail')->set('interface.default', 'Drupal\Core\Mail\VariableLog')->save(); + \Drupal::config('system.mail')->set('interface.default', 'Drupal\Core\Mail\VariableLog')->save(); drupal_set_time_limit($this->timeLimit); // When running from run-tests.sh we don't get an empty current path which diff --git a/core/modules/system/lib/Drupal/system/Tests/Mail/MailTest.php b/core/modules/system/lib/Drupal/system/Tests/Mail/MailTest.php index d832f0676d662536b2895b62ef5bd7dc085777ce..b6a5d985b58c3b803a7864a787c667a27b2d5a90 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Mail/MailTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Mail/MailTest.php @@ -43,7 +43,7 @@ function setUp() { parent::setUp(); // Set MailTestCase (i.e. this class) as the SMTP library - config('system.mail')->set('interface.default', 'Drupal\system\Tests\Mail\MailTest')->save(); + \Drupal::config('system.mail')->set('interface.default', 'Drupal\system\Tests\Mail\MailTest')->save(); } /** diff --git a/core/modules/system/lib/Drupal/system/Tests/Menu/BreadcrumbTest.php b/core/modules/system/lib/Drupal/system/Tests/Menu/BreadcrumbTest.php index dd4cee8be50eaa6ffa807d2f1e8e4d0dcd3cc03d..d51c9ea75c3fb239e8b8825b5c2feb6336cff6e7 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Menu/BreadcrumbTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Menu/BreadcrumbTest.php @@ -49,7 +49,7 @@ function setUp() { 'region' => 'content', ); $this->drupalPlaceBlock('system_menu_block:menu-tools', $settings); - $settings['theme'] = config('system.theme')->get('admin'); + $settings['theme'] = \Drupal::config('system.theme')->get('admin'); $this->drupalPlaceBlock('system_menu_block:menu-tools', $settings); } diff --git a/core/modules/system/lib/Drupal/system/Tests/Menu/LocalTasksTest.php b/core/modules/system/lib/Drupal/system/Tests/Menu/LocalTasksTest.php index 34034d67828e43bd19c0547bb2f5c191b312d9f1..1a32725b6fc8d3508a2f2aac41382e0a726a1728 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Menu/LocalTasksTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Menu/LocalTasksTest.php @@ -51,7 +51,7 @@ function testLocalTasks() { )); // Enable addition of tasks in menu_test_menu_local_tasks(). - config('menu_test.settings')->set('tasks.add', TRUE)->save(); + \Drupal::config('menu_test.settings')->set('tasks.add', TRUE)->save(); // Verify that the added tasks appear even if there are no tasks normally. $this->drupalGet('menu-test/tasks/empty'); @@ -80,7 +80,7 @@ function testLocalTasks() { )); // Enable manipulation of tasks in menu_test_menu_local_tasks_alter(). - config('menu_test.settings')->set('tasks.alter', TRUE)->save(); + \Drupal::config('menu_test.settings')->set('tasks.alter', TRUE)->save(); // Verify that the added tasks appear even if there are no tasks normally. $this->drupalGet('menu-test/tasks/empty'); diff --git a/core/modules/system/lib/Drupal/system/Tests/Menu/MenuRouterTest.php b/core/modules/system/lib/Drupal/system/Tests/Menu/MenuRouterTest.php index ac5e151fd7d8b5a36dbee878aa2bd322ff353ef7..0a94658ac6999fdf66e91640415443d83584534b 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Menu/MenuRouterTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Menu/MenuRouterTest.php @@ -60,7 +60,7 @@ function setUp() { $this->admin_theme = 'seven'; $this->alternate_theme = 'stark'; theme_enable(array($this->default_theme)); - config('system.theme') + \Drupal::config('system.theme') ->set('default', $this->default_theme) ->set('admin', $this->admin_theme) ->save(); @@ -160,7 +160,7 @@ function testExoticPath() { * Test the theme callback when the site is in maintenance mode. */ function testThemeCallbackMaintenanceMode() { - config('system.maintenance')->set('enabled', 1)->save(); + \Drupal::config('system.maintenance')->set('enabled', 1)->save(); theme_enable(array($this->admin_theme)); // For a regular user, the fact that the site is in maintenance mode means @@ -175,7 +175,7 @@ function testThemeCallbackMaintenanceMode() { $this->assertText('Custom theme: seven. Actual theme: seven.', 'The theme callback system is correctly triggered for an administrator when the site is in maintenance mode.'); $this->assertRaw('seven/style.css', "The administrative theme's CSS appears on the page."); - config('system.maintenance')->set('enabled', 0)->save(); + \Drupal::config('system.maintenance')->set('enabled', 0)->save(); } /** @@ -184,15 +184,15 @@ function testThemeCallbackMaintenanceMode() { * @see \Drupal\menu_test\EventSubscriber\MaintenanceModeSubscriber::onKernelRequestMaintenance(). */ function testMaintenanceModeLoginPaths() { - config('system.maintenance')->set('enabled', 1)->save(); + \Drupal::config('system.maintenance')->set('enabled', 1)->save(); - $offline_message = t('@site is currently under maintenance. We should be back shortly. Thank you for your patience.', array('@site' => config('system.site')->get('name'))); + $offline_message = t('@site is currently under maintenance. We should be back shortly. Thank you for your patience.', array('@site' => \Drupal::config('system.site')->get('name'))); $this->drupalGet('test-page'); $this->assertText($offline_message); $this->drupalGet('menu_login_callback'); $this->assertText('This is TestControllers::testLogin.', 'Maintenance mode can be bypassed using an event subscriber.'); - config('system.maintenance')->set('enabled', 0)->save(); + \Drupal::config('system.maintenance')->set('enabled', 0)->save(); } /** diff --git a/core/modules/system/lib/Drupal/system/Tests/Menu/TrailTest.php b/core/modules/system/lib/Drupal/system/Tests/Menu/TrailTest.php index eb59f949cb21dc00127e76d01bcd48cbc0b20629..fbd3e34d05585cdf3fc9312245f3ac20189ef025 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Menu/TrailTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Menu/TrailTest.php @@ -107,7 +107,7 @@ function testMenuTreeSetPath() { */ function testCustom403And404Pages() { // Set the custom 403 and 404 pages we will use. - config('system.site') + \Drupal::config('system.site') ->set('page.403', 'menu-test/custom-403-page') ->set('page.404', 'menu-test/custom-404-page') ->save(); diff --git a/core/modules/system/lib/Drupal/system/Tests/Module/ModuleEnableTest.php b/core/modules/system/lib/Drupal/system/Tests/Module/ModuleEnableTest.php index 7ff9f681a6f2f457b0cbf9b24cdfc988913055c9..d4967f85aac35565962a319616f95510a1258b89 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Module/ModuleEnableTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Module/ModuleEnableTest.php @@ -32,7 +32,7 @@ public static function getInfo() { */ function testEnableUserTwice() { $this->container->get('module_handler')->enable(array('user'), FALSE); - $this->assertIdentical(config('system.module')->get('enabled.user'), '0'); + $this->assertIdentical(\Drupal::config('system.module')->get('enabled.user'), '0'); } /** diff --git a/core/modules/system/lib/Drupal/system/Tests/Module/ModuleTestBase.php b/core/modules/system/lib/Drupal/system/Tests/Module/ModuleTestBase.php index aed76b3e34a1ae5e67bd1ffad1dc56b99f8a5bfa..95844f6cae0824355f7f0621598589a85071c3dd 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Module/ModuleTestBase.php +++ b/core/modules/system/lib/Drupal/system/Tests/Module/ModuleTestBase.php @@ -118,7 +118,7 @@ function assertModuleConfig($module) { // list all default config once more, but filtered by $module. $names = $module_file_storage->listAll($module . '.'); foreach ($names as $key => $name) { - if (config($name)->get()) { + if (\Drupal::config($name)->get()) { unset($names[$key]); } } diff --git a/core/modules/system/lib/Drupal/system/Tests/Path/MatchPathTest.php b/core/modules/system/lib/Drupal/system/Tests/Path/MatchPathTest.php index 15af3b63620130b03cfe1544fdb714c79db723fb..4adb5cfd50dc7f1b89052b285b93e3d0b7efb0bd 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Path/MatchPathTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Path/MatchPathTest.php @@ -31,7 +31,7 @@ function setUp() { // Set up a random site front page to test the '' placeholder. $this->front = $this->randomName(); - config('system.site')->set('page.front', $this->front)->save(); + \Drupal::config('system.site')->set('page.front', $this->front)->save(); // Refresh our static variables from the database. $this->refreshVariables(); } diff --git a/core/modules/system/lib/Drupal/system/Tests/Path/UrlAlterFunctionalTest.php b/core/modules/system/lib/Drupal/system/Tests/Path/UrlAlterFunctionalTest.php index 6a782edcc66644d1c8447049a1a63218f476b79e..3454c1e01fbdd66b2f2216050aae13b5355d3b07 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Path/UrlAlterFunctionalTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Path/UrlAlterFunctionalTest.php @@ -68,7 +68,7 @@ function testUrlAlter() { $this->drupalGet('community'); $this->assertText('General discussion', 'The community path gets resolved correctly'); $this->assertUrlOutboundAlter('forum', 'community'); - $forum_vid = config('forum.settings')->get('vocabulary'); + $forum_vid = \Drupal::config('forum.settings')->get('vocabulary'); $term_name = $this->randomName(); $term = entity_create('taxonomy_term', array( 'name' => $term_name, diff --git a/core/modules/system/lib/Drupal/system/Tests/Session/SessionTest.php b/core/modules/system/lib/Drupal/system/Tests/Session/SessionTest.php index 7310de536266de04b27f5702cadffc8020547f0e..427ad70416a5efe355cf9a985377421b00c5e438 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Session/SessionTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Session/SessionTest.php @@ -149,7 +149,7 @@ function testEmptyAnonymousSession() { $this->assertSessionEmpty(TRUE); // The same behavior is expected when caching is enabled. - $config = config('system.performance'); + $config = \Drupal::config('system.performance'); $config->set('cache.page.use_internal', 1); $config->set('cache.page.max_age', 300); $config->save(); diff --git a/core/modules/system/lib/Drupal/system/Tests/System/AccessDeniedTest.php b/core/modules/system/lib/Drupal/system/Tests/System/AccessDeniedTest.php index 35af9a359bf2fcf5b6554198284fa7434bf64a5f..0e047ec5ac2fbf527b3e5e48d15f58b19280257e 100644 --- a/core/modules/system/lib/Drupal/system/Tests/System/AccessDeniedTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/System/AccessDeniedTest.php @@ -78,7 +78,7 @@ function testAccessDenied() { // Log back in, set the custom 403 page to /user and remove the block $this->drupalLogin($this->admin_user); - config('system.site')->set('page.403', 'user')->save(); + \Drupal::config('system.site')->set('page.403', 'user')->save(); $edit = array( 'region' => -1, ); diff --git a/core/modules/system/lib/Drupal/system/Tests/System/CronRunTest.php b/core/modules/system/lib/Drupal/system/Tests/System/CronRunTest.php index 67a5993ceeb4930f8bb0b04c8da923c8816f4d92..5e35a15fff1ecd3c1fedb99db533654424869ce2 100644 --- a/core/modules/system/lib/Drupal/system/Tests/System/CronRunTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/System/CronRunTest.php @@ -59,7 +59,7 @@ function testAutomaticCron() { $cron_last = time(); $cron_safe_threshold = 100; \Drupal::state()->set('system.cron_last', $cron_last); - config('system.cron') + \Drupal::config('system.cron') ->set('threshold.autorun', $cron_safe_threshold) ->save(); $this->drupalGet(''); diff --git a/core/modules/system/lib/Drupal/system/Tests/System/DateTimeTest.php b/core/modules/system/lib/Drupal/system/Tests/System/DateTimeTest.php index 938c7e6cf2e582cf5de1dc8c9e29ef71543e3689..c644f3a697d60eba76507d5d1c6d004b2948668f 100644 --- a/core/modules/system/lib/Drupal/system/Tests/System/DateTimeTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/System/DateTimeTest.php @@ -43,7 +43,7 @@ function setUp() { */ function testTimeZoneHandling() { // Setup date/time settings for Honolulu time. - $config = config('system.date') + $config = \Drupal::config('system.date') ->set('timezone.default', 'Pacific/Honolulu') ->set('timezone.user.configurable', 0) ->save(); @@ -135,7 +135,7 @@ function testDateFormatStorage() { $format = $date_format->getPattern(); $this->assertEqual('dmYHis', $format, 'Localized date format resides in general config too.'); - $format = config('locale.config.en.system.date_format.test_short')->get('pattern.php'); + $format = \Drupal::config('locale.config.en.system.date_format.test_short')->get('pattern.php'); $this->assertEqual('dmYHis', $format, 'Localized date format resides in localized config.'); } diff --git a/core/modules/system/lib/Drupal/system/Tests/System/ErrorHandlerTest.php b/core/modules/system/lib/Drupal/system/Tests/System/ErrorHandlerTest.php index 11d1356917bd26df363e88cfeee324f91e1507b4..3ecb0e5341ffd4182cd478bcd83e22564dff5040 100644 --- a/core/modules/system/lib/Drupal/system/Tests/System/ErrorHandlerTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/System/ErrorHandlerTest.php @@ -33,7 +33,7 @@ public static function getInfo() { * Test the error handler. */ function testErrorHandler() { - $config = config('system.logging'); + $config = \Drupal::config('system.logging'); $error_notice = array( '%type' => 'Notice', '!message' => 'Undefined variable: bananas', @@ -54,7 +54,7 @@ function testErrorHandler() { ); // Set error reporting to display verbose notices. - config('system.logging')->set('error_level', ERROR_REPORTING_DISPLAY_VERBOSE)->save(); + \Drupal::config('system.logging')->set('error_level', ERROR_REPORTING_DISPLAY_VERBOSE)->save(); $this->drupalGet('error-test/generate-warnings'); $this->assertResponse(200, 'Received expected HTTP status code.'); $this->assertErrorMessage($error_notice); diff --git a/core/modules/system/lib/Drupal/system/Tests/System/FrontPageTest.php b/core/modules/system/lib/Drupal/system/Tests/System/FrontPageTest.php index f39c6f6f420ffcced7809a94abe1a340af1516bb..d26a3a4b0a8b52757b237e82f6c8d7a28c2c31d8 100644 --- a/core/modules/system/lib/Drupal/system/Tests/System/FrontPageTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/System/FrontPageTest.php @@ -38,7 +38,7 @@ function setUp() { $this->node_path = "node/" . $this->drupalCreateNode(array('promote' => 1))->id(); // Configure 'node' as front page. - config('system.site')->set('page.front', 'node')->save(); + \Drupal::config('system.site')->set('page.front', 'node')->save(); // Enable front page logging in system_test.module. \Drupal::state()->set('system_test.front_page_output', 1); } diff --git a/core/modules/system/lib/Drupal/system/Tests/System/SiteMaintenanceTest.php b/core/modules/system/lib/Drupal/system/Tests/System/SiteMaintenanceTest.php index 5a295a25e38df1f77213aff39b695881665a9775..52a4ab019b281cbab973f20c0763579d642468fa 100644 --- a/core/modules/system/lib/Drupal/system/Tests/System/SiteMaintenanceTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/System/SiteMaintenanceTest.php @@ -35,7 +35,7 @@ function setUp() { parent::setUp(); // Configure 'node' as front page. - config('system.site')->set('page.front', 'node')->save(); + \Drupal::config('system.site')->set('page.front', 'node')->save(); // Create a user allowed to access site in maintenance mode. $this->user = $this->drupalCreateUser(array('access site in maintenance mode')); @@ -56,7 +56,7 @@ function testSiteMaintenance() { $admin_message = t('Operating in maintenance mode. Go online.', array('@url' => url('admin/config/development/maintenance'))); $user_message = t('Operating in maintenance mode.'); - $offline_message = t('@site is currently under maintenance. We should be back shortly. Thank you for your patience.', array('@site' => config('system.site')->get('name'))); + $offline_message = t('@site is currently under maintenance. We should be back shortly. Thank you for your patience.', array('@site' => \Drupal::config('system.site')->get('name'))); $this->drupalGet(''); $this->assertRaw($admin_message, 'Found the site maintenance mode message.'); diff --git a/core/modules/system/lib/Drupal/system/Tests/System/SystemConfigFormTestBase.php b/core/modules/system/lib/Drupal/system/Tests/System/SystemConfigFormTestBase.php index 5686e3f19a5aafcc49f83f17ebd9e8ea5d2d68b7..5019d867f0a97b604c63925baa0f9e3537851ea8 100644 --- a/core/modules/system/lib/Drupal/system/Tests/System/SystemConfigFormTestBase.php +++ b/core/modules/system/lib/Drupal/system/Tests/System/SystemConfigFormTestBase.php @@ -63,7 +63,7 @@ public function testConfigForm() { $this->assertTrue($valid_form, format_string('Input values: %values
Validation handler errors: %errors', $args)); foreach ($this->values as $data) { - $this->assertEqual($data['#value'], config($data['#config_name'])->get($data['#config_key'])); + $this->assertEqual($data['#value'], \Drupal::config($data['#config_name'])->get($data['#config_key'])); } } } diff --git a/core/modules/system/lib/Drupal/system/Tests/System/ThemeTest.php b/core/modules/system/lib/Drupal/system/Tests/System/ThemeTest.php index dd8920c43a871e9087187713753e6270dd385acd..4358f10a4fe0ca072072d7b218010cea679063e3 100644 --- a/core/modules/system/lib/Drupal/system/Tests/System/ThemeTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/System/ThemeTest.php @@ -211,7 +211,7 @@ function testAdministrationTheme() { $this->assertRaw('core/themes/stark', 'Site default theme used on the add content page.'); // Reset to the default theme settings. - config('system.theme') + \Drupal::config('system.theme') ->set('default', 'bartik') ->save(); $edit = array( @@ -235,7 +235,7 @@ function testSwitchDefaultTheme() { theme_enable(array('bartik')); $this->drupalGet('admin/appearance'); $this->clickLink(t('Set default')); - $this->assertEqual(config('system.theme')->get('default'), 'bartik'); + $this->assertEqual(\Drupal::config('system.theme')->get('default'), 'bartik'); drupal_flush_all_caches(); diff --git a/core/modules/system/lib/Drupal/system/Tests/System/TokenReplaceTest.php b/core/modules/system/lib/Drupal/system/Tests/System/TokenReplaceTest.php index 742ec0fec48c6615ff18fc75c2723625239d7364..84bf929e9e07658bf254986fe456aabfa33500dd 100644 --- a/core/modules/system/lib/Drupal/system/Tests/System/TokenReplaceTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/System/TokenReplaceTest.php @@ -116,15 +116,15 @@ function testSystemSiteTokenReplacement() { ); // Set a few site variables. - config('system.site') + \Drupal::config('system.site') ->set('name', 'Drupal') ->set('slogan', 'Slogan') ->save(); // Generate and test sanitized tokens. $tests = array(); - $tests['[site:name]'] = check_plain(config('system.site')->get('name')); - $tests['[site:slogan]'] = filter_xss_admin(config('system.site')->get('slogan')); + $tests['[site:name]'] = check_plain(\Drupal::config('system.site')->get('name')); + $tests['[site:slogan]'] = filter_xss_admin(\Drupal::config('system.site')->get('slogan')); $tests['[site:mail]'] = 'simpletest@example.com'; $tests['[site:url]'] = url('', $url_options); $tests['[site:url-brief]'] = preg_replace(array('!^https?://!', '!/$!'), '', url('', $url_options)); @@ -139,8 +139,8 @@ function testSystemSiteTokenReplacement() { } // Generate and test unsanitized tokens. - $tests['[site:name]'] = config('system.site')->get('name'); - $tests['[site:slogan]'] = config('system.site')->get('slogan'); + $tests['[site:name]'] = \Drupal::config('system.site')->get('name'); + $tests['[site:slogan]'] = \Drupal::config('system.site')->get('slogan'); foreach ($tests as $input => $expected) { $output = $token_service->replace($input, array(), array('langcode' => $language_interface->id, 'sanitize' => FALSE)); diff --git a/core/modules/system/lib/Drupal/system/Tests/Theme/EntityFilteringThemeTest.php b/core/modules/system/lib/Drupal/system/Tests/Theme/EntityFilteringThemeTest.php index 7a06c785c1373882369b23d3519cc9921ec379c9..f7d53e2cb2d454e66e10105ef48cbc33b4a83f51 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Theme/EntityFilteringThemeTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Theme/EntityFilteringThemeTest.php @@ -130,7 +130,7 @@ function testThemedEntity() { // Check each path in all available themes. foreach ($this->themes as $theme) { - config('system.theme') + \Drupal::config('system.theme') ->set('default', $theme) ->save(); foreach ($paths as $path) { diff --git a/core/modules/system/lib/Drupal/system/Tests/Theme/FunctionsTest.php b/core/modules/system/lib/Drupal/system/Tests/Theme/FunctionsTest.php index d8505bcc6c654ba8a0b57be9be2ada30498c090f..93302999a09a0eeab1c30e5a0221f7bca17ef06c 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Theme/FunctionsTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Theme/FunctionsTest.php @@ -142,7 +142,7 @@ function testLinks() { // Required to verify the "active" class in expected links below, and // because the current path is different when running tests manually via // simpletest.module ('batch') and via the testing framework (''). - _current_path(config('system.site')->get('page.front')); + _current_path(\Drupal::config('system.site')->get('page.front')); // Verify that a list of links is properly rendered. $variables = array(); diff --git a/core/modules/system/lib/Drupal/system/Tests/Theme/ThemeInfoStylesTest.php b/core/modules/system/lib/Drupal/system/Tests/Theme/ThemeInfoStylesTest.php index d8e58ccd52421a7c7f4a0441d300da50f9ffe45e..47acb019fe19351c1e8d7c89b8294864a555a312 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Theme/ThemeInfoStylesTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Theme/ThemeInfoStylesTest.php @@ -34,7 +34,7 @@ public static function getInfo() { */ function testStylesheets() { theme_enable(array('test_basetheme', 'test_subtheme')); - config('system.theme') + \Drupal::config('system.theme') ->set('default', 'test_subtheme') ->save(); diff --git a/core/modules/system/lib/Drupal/system/Tests/Theme/ThemeTest.php b/core/modules/system/lib/Drupal/system/Tests/Theme/ThemeTest.php index 8bbb3d0960b33fd8c060334920529fb2c38cc145..90a60f536c58a1fab3f9e0eeac8db420f52f6968 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Theme/ThemeTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Theme/ThemeTest.php @@ -63,7 +63,7 @@ function testAttributeMerging() { function testThemeSuggestions() { // Set the front page as something random otherwise the CLI // test runner fails. - config('system.site')->set('page.front', 'nobody-home')->save(); + \Drupal::config('system.site')->set('page.front', 'nobody-home')->save(); $args = array('node', '1', 'edit'); $suggestions = theme_get_suggestions($args, 'page'); $this->assertEqual($suggestions, array('page__node', 'page__node__%', 'page__node__1', 'page__node__edit'), 'Found expected node edit page suggestions'); @@ -107,7 +107,7 @@ function testFrontPageThemeSuggestion() { $original_path = _current_path(); // Set the current path to node because theme_get_suggestions() will query // it to see if we are on the front page. - config('system.site')->set('page.front', 'node')->save(); + \Drupal::config('system.site')->set('page.front', 'node')->save(); _current_path('node'); $suggestions = theme_get_suggestions(array('node'), 'page'); // Set it back to not annoy the batch runner. @@ -133,7 +133,7 @@ function testCSSOverride() { // what is output to the HTML HEAD based on what is in a theme's .info.yml // file, so it doesn't matter what page we get, as long as it is themed with // the test theme. First we test with CSS aggregation disabled. - $config = config('system.performance'); + $config = \Drupal::config('system.performance'); $config->set('css.preprocess', 0); $config->save(); $this->drupalGet('theme-test/suggestion'); @@ -154,7 +154,7 @@ function testCSSOverride() { * Ensures a themes template is overrideable based on the 'template' filename. */ function testTemplateOverride() { - config('system.theme') + \Drupal::config('system.theme') ->set('default', 'test_theme') ->save(); $this->drupalGet('theme-test/template-test'); diff --git a/core/modules/system/lib/Drupal/system/Tests/Theme/ThemeTestPhpTemplate.php b/core/modules/system/lib/Drupal/system/Tests/Theme/ThemeTestPhpTemplate.php index 54f1b0f40c0767a3059df8a382ac668d509a85c5..35680fae0a508d6e2fb962e3a050f413c777b25e 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Theme/ThemeTestPhpTemplate.php +++ b/core/modules/system/lib/Drupal/system/Tests/Theme/ThemeTestPhpTemplate.php @@ -38,7 +38,7 @@ function setUp() { * Ensures a theme's template is overrideable based on the 'template' filename. */ function testTemplateOverride() { - config('system.theme') + \Drupal::config('system.theme') ->set('default', 'test_theme_phptemplate') ->save(); $this->drupalGet('theme-test/template-test'); diff --git a/core/modules/system/lib/Drupal/system/Tests/Theme/ThemeTestTwig.php b/core/modules/system/lib/Drupal/system/Tests/Theme/ThemeTestTwig.php index 78605113f275ba43eaf63469470adc09eda89772..2dce51fea564661b509f16143dc4a576a55f5a0f 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Theme/ThemeTestTwig.php +++ b/core/modules/system/lib/Drupal/system/Tests/Theme/ThemeTestTwig.php @@ -38,7 +38,7 @@ function setUp() { * Tests that the Twig engine handles PHP data correctly. */ function testTwigVariableDataTypes() { - config('system.theme') + \Drupal::config('system.theme') ->set('default', 'test_theme') ->save(); $this->drupalGet('twig-theme-test/php-variables'); diff --git a/core/modules/system/lib/Drupal/system/Tests/Theme/TwigDebugMarkupTest.php b/core/modules/system/lib/Drupal/system/Tests/Theme/TwigDebugMarkupTest.php index 34675f74058824b18c44ee1baf00ed69bec2a09f..53d6a0b77a8747f4ceb6d72a7a488fa51fbe0785 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Theme/TwigDebugMarkupTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Theme/TwigDebugMarkupTest.php @@ -35,7 +35,7 @@ public static function getInfo() { function testTwigDebugMarkup() { $extension = twig_extension(); theme_enable(array('test_theme')); - config('system.theme')->set('default', 'test_theme')->save(); + \Drupal::config('system.theme')->set('default', 'test_theme')->save(); // Enable debug, rebuild the service container, and clear all caches. $this->settingsSet('twig_debug', TRUE); $this->rebuildContainer(); diff --git a/core/modules/system/lib/Drupal/system/Tests/Theme/TwigExtensionTest.php b/core/modules/system/lib/Drupal/system/Tests/Theme/TwigExtensionTest.php index 8526cb2e103e9cfc3de9dd2349b1c797a63bc68f..8fdc293ce219030dd7f39ea69ca071154a2d9c54 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Theme/TwigExtensionTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Theme/TwigExtensionTest.php @@ -47,7 +47,7 @@ function testTwigExtensionLoaded() { * Tests that the Twig extension's filter produces expected output. */ function testTwigExtensionFilter() { - config('system.theme') + \Drupal::config('system.theme') ->set('default', 'test_theme') ->save(); @@ -59,7 +59,7 @@ function testTwigExtensionFilter() { * Tests that the Twig extension's function produces expected output. */ function testTwigExtensionFunction() { - config('system.theme') + \Drupal::config('system.theme') ->set('default', 'test_theme') ->save(); diff --git a/core/modules/system/lib/Drupal/system/Tests/Theme/TwigSettingsTest.php b/core/modules/system/lib/Drupal/system/Tests/Theme/TwigSettingsTest.php index a764dc987e9ad10db4e75035732d9b09b62f8012..e7bc98c141a3beb87f9a1bebb73782ef6bc4eec2 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Theme/TwigSettingsTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Theme/TwigSettingsTest.php @@ -78,7 +78,7 @@ function testTwigDebugOverride() { function testTwigCacheOverride() { $extension = twig_extension(); theme_enable(array('test_theme')); - config('system.theme') + \Drupal::config('system.theme') ->set('default', 'test_theme') ->save(); diff --git a/core/modules/system/lib/Drupal/system/Tests/Update/UpdateScriptTest.php b/core/modules/system/lib/Drupal/system/Tests/Update/UpdateScriptTest.php index e7fa8e01fed626fe2bfd8428e3b00b45fd442394..65981f1b204d16fec153745dddc75dd42d23c53f 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Update/UpdateScriptTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Update/UpdateScriptTest.php @@ -74,7 +74,7 @@ function testUpdateAccess() { * Tests that requirements warnings and errors are correctly displayed. */ function testRequirements() { - $update_script_test_config = config('update_script_test.settings'); + $update_script_test_config = \Drupal::config('update_script_test.settings'); $this->drupalLogin($this->update_user); // If there are no requirements warnings or errors, we expect to be able to @@ -130,10 +130,10 @@ function testThemeSystem() { // Since visiting update.php triggers a rebuild of the theme system from an // unusual maintenance mode environment, we check that this rebuild did not // put any incorrect information about the themes into the database. - $original_theme_data = config('system.theme')->get('enabled'); + $original_theme_data = \Drupal::config('system.theme')->get('enabled'); $this->drupalLogin($this->update_user); $this->drupalGet($this->update_url, array('external' => TRUE)); - $final_theme_data = config('system.theme')->get('enabled'); + $final_theme_data = \Drupal::config('system.theme')->get('enabled'); $this->assertEqual($original_theme_data, $final_theme_data, 'Visiting update.php does not alter the information about themes stored in the database.'); } diff --git a/core/modules/system/lib/Drupal/system/Tests/Upgrade/BareMinimalUpgradePathTest.php b/core/modules/system/lib/Drupal/system/Tests/Upgrade/BareMinimalUpgradePathTest.php index 2abff853fcc1103852cd361cb5eda5a1006c3da8..914b72d3ae8ac42de20ede9ee103136309c2ab8f 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Upgrade/BareMinimalUpgradePathTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Upgrade/BareMinimalUpgradePathTest.php @@ -84,10 +84,10 @@ public function testBasicMinimalUpgrade() { $this->assertEqual(array_diff_key($required, $enabled), array()); // Verify that image.module was correctly installed. - $this->assertEqual('thumbnail', config('image.style.thumbnail')->get('name')); + $this->assertEqual('thumbnail', \Drupal::config('image.style.thumbnail')->get('name')); // Make sure that the default mail configuration has been converted. - $this->assertEqual(array('default' => 'Drupal\Core\Mail\PhpMail'), config('system.mail')->get('interface'), 'Default mail configuration set.'); + $this->assertEqual(array('default' => 'Drupal\Core\Mail\PhpMail'), \Drupal::config('system.mail')->get('interface'), 'Default mail configuration set.'); } /** diff --git a/core/modules/system/lib/Drupal/system/Tests/Upgrade/BlockUpgradePathTest.php b/core/modules/system/lib/Drupal/system/Tests/Upgrade/BlockUpgradePathTest.php index 45f2efbfd24196118d3c316db4328cb879ab554f..bde6f60b10a91bc5698fe10ba352c6176e299757 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Upgrade/BlockUpgradePathTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Upgrade/BlockUpgradePathTest.php @@ -46,7 +46,7 @@ public function testBlockUpgradeTitleLength() { 'machine_name' => strtolower($this->randomName(8)), 'region' => 'sidebar_first', ); - $this->drupalPost('admin/structure/block/add/system_powered_by_block/' . config('system.theme')->get('default'), $settings, t('Save block')); + $this->drupalPost('admin/structure/block/add/system_powered_by_block/' . \Drupal::config('system.theme')->get('default'), $settings, t('Save block')); $this->assertText($settings['settings[label]'], 'Block with title longer than 64 characters successfully created.'); // Try to add a block with a title over 255 characters. @@ -55,7 +55,7 @@ public function testBlockUpgradeTitleLength() { 'machine_name' => strtolower($this->randomName(8)), 'region' => 'sidebar_first', ); - $this->drupalPost('admin/structure/block/add/system_powered_by_block/' . config('system.theme')->get('default'), $settings, t('Save block')); + $this->drupalPost('admin/structure/block/add/system_powered_by_block/' . \Drupal::config('system.theme')->get('default'), $settings, t('Save block')); // Confirm that the custom block cannot be created with title longer than // the maximum number of characters. diff --git a/core/modules/system/lib/Drupal/system/Tests/Upgrade/DateUpgradePathTest.php b/core/modules/system/lib/Drupal/system/Tests/Upgrade/DateUpgradePathTest.php index 990cbd52be5805b458059a8044a7c18928144aac..5e1dd58c677f34c9087d176512d5974f7adf8654 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Upgrade/DateUpgradePathTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Upgrade/DateUpgradePathTest.php @@ -92,7 +92,7 @@ public function testDateUpgrade() { ); foreach ($expected_de_formats as $locale_format) { - $format = config('locale.config.de.system.date_format.' . $locale_format['type'])->get('pattern.php'); + $format = \Drupal::config('locale.config.de.system.date_format.' . $locale_format['type'])->get('pattern.php'); $this->assertEqual($locale_format['format'], $format); } } diff --git a/core/modules/system/lib/Drupal/system/Tests/Upgrade/FieldUpgradePathTest.php b/core/modules/system/lib/Drupal/system/Tests/Upgrade/FieldUpgradePathTest.php index dd13cf99c5bca25ab8ae6de857d2f84c7a79d5fa..66a95c0ef429b74370da53c1c125093fc6bd9052 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Upgrade/FieldUpgradePathTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Upgrade/FieldUpgradePathTest.php @@ -37,8 +37,8 @@ public function testEntityDisplayUpgrade() { // Check that the configuration entries were created. $displays = array( - 'default' => config('entity.display.node.article.default')->get(), - 'teaser' => config('entity.display.node.article.teaser')->get(), + 'default' => \Drupal::config('entity.display.node.article.default')->get(), + 'teaser' => \Drupal::config('entity.display.node.article.teaser')->get(), ); $this->assertTrue(!empty($displays['default'])); $this->assertTrue(!empty($displays['teaser'])); @@ -88,7 +88,7 @@ public function testEntityFormDisplayUpgrade() { $this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.'); // Check that the configuration entries were created. - $form_display = config('entity.form_display.node.article.default')->get(); + $form_display = \Drupal::config('entity.form_display.node.article.default')->get(); $this->assertTrue(!empty($form_display)); // Check that the 'body' field is configured as expected. @@ -152,7 +152,7 @@ function testFieldUpgradeToConfig() { // Check that the configuration for the instance on article and page nodes // is correct. foreach (array('article', 'page') as $node_type) { - $config = config("field.instance.node.$node_type.body")->get(); + $config = \Drupal::config("field.instance.node.$node_type.body")->get(); // We cannot predict the value of the UUID, we just check it's present. $this->assertFalse(empty($config['uuid'])); unset($config['uuid']); diff --git a/core/modules/system/lib/Drupal/system/Tests/Upgrade/ImageUpgradePathTest.php b/core/modules/system/lib/Drupal/system/Tests/Upgrade/ImageUpgradePathTest.php index cc5979ab468d50de50c9178dd9c5709c74e80021..dbc072ec3bf43a5c5d14b19343d1c2b1bb8b4d03 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Upgrade/ImageUpgradePathTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Upgrade/ImageUpgradePathTest.php @@ -68,7 +68,7 @@ public function testImageStyleUpgrade() { ), ); foreach ($expected_styles as $name => $style) { - $config = config('image.style.' . $name); + $config = \Drupal::config('image.style.' . $name); // Replace placeholder with image effect name keys with UUID's generated // during by the image style upgrade functions. foreach ($config->get('effects') as $uuid => $effect) { diff --git a/core/modules/system/lib/Drupal/system/Tests/Upgrade/MailUpgradePathTest.php b/core/modules/system/lib/Drupal/system/Tests/Upgrade/MailUpgradePathTest.php index a77c6b7141b0b7654dac50dfa0abe525016d3dbd..417f41e7cd3ccbc186daf10ecceec6bd323d1862 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Upgrade/MailUpgradePathTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Upgrade/MailUpgradePathTest.php @@ -35,7 +35,7 @@ public function testMailSystemUpgrade() { $this->performUpgrade(TRUE); // Get the new mailer definitions. - $mail_system = config('system.mail')->get('interface'); + $mail_system = \Drupal::config('system.mail')->get('interface'); // Check that the default mailer has been changed to a PSR-0 definition. $this->assertEqual($mail_system['default'], 'Drupal\Core\Mail\PhpMail', 'Default mailer upgraded to Drupal 8 syntax.'); diff --git a/core/modules/system/lib/Drupal/system/Tests/Upgrade/SystemUpgradePathTest.php b/core/modules/system/lib/Drupal/system/Tests/Upgrade/SystemUpgradePathTest.php index 67ec26876b897aeeb7935c3adb7a7d0b1e8d4b5b..a53b70f1717b019e0d1b9bd866460b0bdf65b357 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Upgrade/SystemUpgradePathTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Upgrade/SystemUpgradePathTest.php @@ -170,7 +170,7 @@ public function testVariableUpgrade() { ); foreach ($expected_config as $file => $values) { - $config = config($file); + $config = \Drupal::config($file); $this->verbose(print_r($config->get(), TRUE)); foreach ($values as $name => $value) { $stored = $config->get($name); diff --git a/core/modules/system/system.admin.inc b/core/modules/system/system.admin.inc index 05c67a7c47d51c1074ee99fddaaadc28492b0150..050cdd76cc21e6ca7e746034917d58d631181749 100644 --- a/core/modules/system/system.admin.inc +++ b/core/modules/system/system.admin.inc @@ -94,9 +94,9 @@ function system_themes_page() { $themes = system_rebuild_theme_data(); uasort($themes, 'system_sort_modules_by_info_name'); - $theme_default = config('system.theme')->get('default'); + $theme_default = Drupal::config('system.theme')->get('default'); $theme_groups = array(); - $admin_theme = config('system.theme')->get('admin'); + $admin_theme = Drupal::config('system.theme')->get('admin'); foreach ($themes as &$theme) { if (!empty($theme->info['hidden'])) { @@ -233,7 +233,7 @@ function system_themes_admin_form($form, &$form_state, $theme_options) { '#options' => array(0 => t('Default theme')) + $theme_options, '#title' => t('Administration theme'), '#description' => t('Choose "Default theme" to always use the same theme as the rest of the site.'), - '#default_value' => config('system.theme')->get('admin'), + '#default_value' => Drupal::config('system.theme')->get('admin'), ); $form['admin_theme']['actions'] = array('#type' => 'actions'); $form['admin_theme']['actions']['submit'] = array( @@ -248,7 +248,7 @@ function system_themes_admin_form($form, &$form_state, $theme_options) { */ function system_themes_admin_form_submit($form, &$form_state) { drupal_set_message(t('The configuration options have been saved.')); - config('system.theme')->set('admin', $form_state['values']['admin_theme'])->save(); + Drupal::config('system.theme')->set('admin', $form_state['values']['admin_theme'])->save(); } /** @@ -269,7 +269,7 @@ function system_theme_default() { theme_enable(array($theme)); } // Set the default theme. - config('system.theme') + Drupal::config('system.theme') ->set('default', $theme) ->save(); @@ -283,7 +283,7 @@ function system_theme_default() { // The status message depends on whether an admin theme is currently in use: // a value of 0 means the admin theme is set to be the default theme. - $admin_theme = config('system.theme')->get('admin'); + $admin_theme = Drupal::config('system.theme')->get('admin'); if ($admin_theme != 0 && $admin_theme != $theme) { drupal_set_message(t('Please note that the administration theme is still set to the %admin_theme theme; consequently, the theme on this page remains unchanged. All non-administrative sections of the site, however, will show the selected %selected_theme theme by default.', array( '%admin_theme' => $themes[$admin_theme]->info['name'], @@ -981,7 +981,7 @@ function theme_system_date_format_localize_form($variables) { */ function system_date_format_localize_form_save($langcode, $date_format_id, DateFormatInterface $format) { $format->addLocale($langcode)->save(); - config('locale.config.' . $langcode . '.system.date_format.' . $date_format_id) + Drupal::config('locale.config.' . $langcode . '.system.date_format.' . $date_format_id) ->set('pattern', $format->get('pattern')) ->save(); } diff --git a/core/modules/system/system.api.php b/core/modules/system/system.api.php index ca809443891580715b702879fb05a2d776ecd408..bbc3c72f40635a8b39d61d6bc17403d53f2ba05c 100644 --- a/core/modules/system/system.api.php +++ b/core/modules/system/system.api.php @@ -1357,7 +1357,7 @@ function hook_mail_alter(&$message) { $message['send'] = FALSE; return; } - $message['body'][] = "--\nMail sent out from " . config('system.site')->get('name'); + $message['body'][] = "--\nMail sent out from " . Drupal::config('system.site')->get('name'); } } @@ -1775,7 +1775,7 @@ function hook_watchdog(array $log_entry) { $to = 'someone@example.com'; $params = array(); $params['subject'] = t('[@site_name] @severity_desc: Alert from your web site', array( - '@site_name' => config('system.site')->get('name'), + '@site_name' => Drupal::config('system.site')->get('name'), '@severity_desc' => $severity_list[$log_entry['severity']], )); @@ -1841,7 +1841,7 @@ function hook_mail($key, &$message, $params) { $account = $params['account']; $context = $params['context']; $variables = array( - '%site_name' => config('system.site')->get('name'), + '%site_name' => Drupal::config('system.site')->get('name'), '%username' => user_format_name($account), ); if ($context['hook'] == 'taxonomy') { @@ -3153,7 +3153,7 @@ function hook_tokens($type, $tokens, array $data = array(), array $options = arr // Default values for the chained tokens handled below. case 'author': - $name = ($node->uid == 0) ? config('user.settings')->get('anonymous') : $node->name; + $name = ($node->uid == 0) ? Drupal::config('user.settings')->get('anonymous') : $node->name; $replacements[$original] = $sanitize ? filter_xss($name) : $name; break; diff --git a/core/modules/system/system.install b/core/modules/system/system.install index ef16eaab816401fd90351fd6b6c78f92bab70d57..3f0fac01fed65f764d7467ad8f3d61e83aceba0b 100644 --- a/core/modules/system/system.install +++ b/core/modules/system/system.install @@ -259,7 +259,7 @@ function system_requirements($phase) { // Report cron status. if ($phase == 'runtime') { - $cron_config = config('system.cron'); + $cron_config = Drupal::config('system.cron'); // Cron warning threshold defaults to two days. $threshold_warning = $cron_config->get('threshold.requirements_warning'); // Cron error threshold defaults to two weeks. @@ -300,7 +300,7 @@ function system_requirements($phase) { ); } if ($phase != 'install') { - $filesystem_config = config('system.file'); + $filesystem_config = Drupal::config('system.file'); $directories = array( variable_get('file_public_path', conf_path() . '/files'), // By default no private files directory is configured. For private files @@ -522,7 +522,7 @@ function system_install() { // Enable and set the default theme. Can't use theme_enable() this early in // installation. config_install_default_config('theme', 'stark'); - config('system.theme') + Drupal::config('system.theme') ->set('default', 'stark') ->save(); @@ -1426,7 +1426,7 @@ function system_update_8013() { function system_update_8014() { // Not using update_variables_to_config(), since the only value is // 'error_level', which needs to be mapped to a new value. - $config = config('system.logging'); + $config = Drupal::config('system.logging'); $error_level = db_query("SELECT value FROM {variable} WHERE name = 'error_level'")->fetchField(); if ($error_level !== FALSE) { $error_level = unserialize($error_level); @@ -1881,7 +1881,7 @@ function system_update_8045() { if (!empty($date_formats)) { foreach ($date_formats as $type => $format) { // Set name and locked properties. - $config = config("system.date_format.$type") + $config = Drupal::config("system.date_format.$type") ->set('id', $type) ->set('label', $format['title']) ->set('locked', $format['locked']) @@ -1926,7 +1926,7 @@ function system_update_8046() { update_install_default_config('module', 'views.view.user_admin_people', 'user'); update_install_default_config('module', 'views.view.content', 'node'); - $front_page = config('system.site')->get('page.front') ?: 'node'; + $front_page = Drupal::config('system.site')->get('page.front') ?: 'node'; if ($front_page == 'node') { // This imports the node frontpage view. update_install_default_config('module', 'views.view.frontpage', 'node'); @@ -2173,7 +2173,7 @@ function system_update_8056() { foreach ($entity_view_modes as $entity_type => $view_modes) { foreach ($view_modes as $key => $name) { $status = in_array($key, array('teaser', 'compact')); - config("entity.view_mode.$entity_type.$key") + Drupal::config("entity.view_mode.$entity_type.$key") ->set('id', "$entity_type.$key") ->set('label', $name) ->set('targetEntityType', $entity_type) @@ -2197,7 +2197,7 @@ function system_update_8057() { $action['aid'] = $action['callback'] . '_' . $action['aid']; } $configuration = unserialize($action['parameters']) ?: array(); - config('action.action.' . $action['aid']) + Drupal::config('action.action.' . $action['aid']) ->set('id', $action['aid']) ->set('label', $action['label']) ->set('status', '1') diff --git a/core/modules/system/system.module b/core/modules/system/system.module index 536e6d2f13c05e2425b93e209404d827f6799a0d..5297fe0690f99215a92938b86d40cc1fe92e59aa 100644 --- a/core/modules/system/system.module +++ b/core/modules/system/system.module @@ -224,7 +224,7 @@ function system_permission() { ), 'view the administration theme' => array( 'title' => t('View the administration theme'), - 'description' => config('system.theme')->get('admin') ?: t('This is only used when the site is configured to use a separate administration theme on the Appearance page.', array('@appearance-url' => url('admin/appearance'))), + 'description' => Drupal::config('system.theme')->get('admin') ?: t('This is only used when the site is configured to use a separate administration theme on the Appearance page.', array('@appearance-url' => url('admin/appearance'))), ), 'access site reports' => array( 'title' => t('View site reports'), @@ -2011,7 +2011,7 @@ function system_stream_wrappers() { ); // Only register the private file stream wrapper if a file path has been set. - if (config('system.file')->get('path.private')) { + if (Drupal::config('system.file')->get('path.private')) { $wrappers['private'] = array( 'name' => t('Private files'), 'class' => 'Drupal\Core\StreamWrapper\PrivateStream', @@ -2246,7 +2246,7 @@ function system_custom_theme() { $request = drupal_container()->get('request'); $path = $request->attributes->get('_system_path'); if (user_access('view the administration theme') && path_is_admin($path)) { - return config('system.theme')->get('admin'); + return Drupal::config('system.theme')->get('admin'); } } } @@ -2255,7 +2255,7 @@ function system_custom_theme() { * Implements hook_form_FORM_ID_alter(). */ function system_form_user_form_alter(&$form, &$form_state) { - if (config('system.date')->get('timezone.user.configurable')) { + if (Drupal::config('system.date')->get('timezone.user.configurable')) { system_user_timezone($form, $form_state); } } @@ -2264,7 +2264,7 @@ function system_form_user_form_alter(&$form, &$form_state) { * Implements hook_form_FORM_ID_alter(). */ function system_form_user_register_form_alter(&$form, &$form_state) { - $config = config('system.date'); + $config = Drupal::config('system.date'); if ($config->get('timezone.user.configurable') && $config->get('timezone.user.default') == DRUPAL_USER_TIMEZONE_SELECT) { system_user_timezone($form, $form_state); } @@ -2274,7 +2274,7 @@ function system_form_user_register_form_alter(&$form, &$form_state) { * Implements hook_user_presave(). */ function system_user_presave(UserInterface $account) { - $config = config('system.date'); + $config = Drupal::config('system.date'); if ($config->get('timezone.user.configurable') && !$account->getTimeZone() && !$config->get('timezone.user.default')) { $account->timezone = $config->get('timezone.default'); } @@ -2284,7 +2284,7 @@ function system_user_presave(UserInterface $account) { * Implements hook_user_login(). */ function system_user_login($account) { - $config = config('system.date'); + $config = Drupal::config('system.date'); // If the user has a NULL time zone, notify them to set a time zone. if (!$account->getTimezone() && $config->get('timezone.user.configurable') && $config->get('timezone.user.warn')) { drupal_set_message(t('Configure your account time zone setting.', array('@user-edit' => url("user/$account->id()/edit", array('query' => drupal_get_destination(), 'fragment' => 'edit-timezone'))))); @@ -2306,7 +2306,7 @@ function system_user_timezone(&$form, &$form_state) { $form['timezone']['timezone'] = array( '#type' => 'select', '#title' => t('Time zone'), - '#default_value' => $account->getTimezone() ? $account->getTimezone() : config('system.date')->get('timezone.default'), + '#default_value' => $account->getTimezone() ? $account->getTimezone() : Drupal::config('system.date')->get('timezone.default'), '#options' => system_time_zones($account->id() != $user->id()), '#description' => t('Select the desired local time and time zone. Dates and times throughout this site will be displayed using this time zone.'), ); @@ -2596,8 +2596,8 @@ function system_rebuild_module_data() { $files = array(); ksort($modules); // Add name, status, weight, and schema version. - $enabled_modules = (array) config('system.module')->get('enabled'); - $disabled_modules = (array) config('system.module.disabled')->get(); + $enabled_modules = (array) Drupal::config('system.module')->get('enabled'); + $disabled_modules = (array) Drupal::config('system.module.disabled')->get(); $all_modules = $enabled_modules + $disabled_modules; foreach ($modules as $module => $record) { $record->name = $module; @@ -2750,7 +2750,7 @@ function system_rebuild_theme_data() { // based on the current config. Remove this code when themes have a proper // installation status. // @see http://drupal.org/node/1067408 - $enabled_themes = (array) config('system.theme')->get('enabled'); + $enabled_themes = (array) Drupal::config('system.theme')->get('enabled'); $files = array(); foreach ($themes as $name => $theme) { $theme->status = (int) isset($enabled_themes[$name]); @@ -2977,7 +2977,7 @@ function confirm_form($form, $question, $path, $description = NULL, $yes = NULL, function system_admin_compact_mode() { // PHP converts dots into underscores in cookie names to avoid problems with // its parser, so we use a converted cookie name. - return isset($_COOKIE['Drupal_visitor_admin_compact_mode']) ? $_COOKIE['Drupal_visitor_admin_compact_mode'] : config('system.site')->get('admin_compact_mode'); + return isset($_COOKIE['Drupal_visitor_admin_compact_mode']) ? $_COOKIE['Drupal_visitor_admin_compact_mode'] : Drupal::config('system.site')->get('admin_compact_mode'); } /** @@ -3250,7 +3250,7 @@ function system_run_automated_cron() { // If the site is not fully installed, suppress the automated cron run. // Otherwise it could be triggered prematurely by Ajax requests during // installation. - if (($threshold = config('system.cron')->get('threshold.autorun')) > 0 && variable_get('install_task') == 'done') { + if (($threshold = Drupal::config('system.cron')->get('threshold.autorun')) > 0 && variable_get('install_task') == 'done') { $cron_last = Drupal::state()->get('system.cron_last') ?: NULL; if (!isset($cron_last) || (REQUEST_TIME - $cron_last > $threshold)) { drupal_cron_run(); diff --git a/core/modules/system/system.tokens.inc b/core/modules/system/system.tokens.inc index 9a8a4593f7e821a531414d14d0448e00bd31243f..2dca362d57eda7d2a5a7bb996e6174627ca6f996 100644 --- a/core/modules/system/system.tokens.inc +++ b/core/modules/system/system.tokens.inc @@ -103,17 +103,17 @@ function system_tokens($type, $tokens, array $data = array(), array $options = a foreach ($tokens as $name => $original) { switch ($name) { case 'name': - $site_name = config('system.site')->get('name'); + $site_name = Drupal::config('system.site')->get('name'); $replacements[$original] = $sanitize ? check_plain($site_name) : $site_name; break; case 'slogan': - $slogan = config('system.site')->get('slogan'); + $slogan = Drupal::config('system.site')->get('slogan'); $replacements[$original] = $sanitize ? filter_xss_admin($slogan) : $slogan; break; case 'mail': - $replacements[$original] = config('system.site')->get('mail'); + $replacements[$original] = Drupal::config('system.site')->get('mail'); break; case 'url': diff --git a/core/modules/system/tests/modules/design_test/design_test.module b/core/modules/system/tests/modules/design_test/design_test.module index f69f9617e3f626fe6ab853bb599e6fe6a2bae97a..334ea31fb707a5d5972391b254f12c25a8a351bb 100644 --- a/core/modules/system/tests/modules/design_test/design_test.module +++ b/core/modules/system/tests/modules/design_test/design_test.module @@ -96,7 +96,7 @@ function design_test_menu_local_tasks_alter(&$data, $router_item, $root_path) { $actions = &$data['actions']['output']; // Determine the currently selected theme, if any. $selected_theme = drupal_container()->get('request')->query->get('theme'); - $default_theme = config('system.theme')->get('default'); + $default_theme = Drupal::config('system.theme')->get('default'); // Expand all enabled themes into action links. $themes = list_themes(); diff --git a/core/modules/system/tests/modules/form_test/lib/Drupal/form_test/FormTestArgumentsObject.php b/core/modules/system/tests/modules/form_test/lib/Drupal/form_test/FormTestArgumentsObject.php index ee13968caa195eedd88bcb4c44bab392c1cdcbbe..111b164b21cd78a626f73fbc0e1f4c733fc864de 100644 --- a/core/modules/system/tests/modules/form_test/lib/Drupal/form_test/FormTestArgumentsObject.php +++ b/core/modules/system/tests/modules/form_test/lib/Drupal/form_test/FormTestArgumentsObject.php @@ -53,7 +53,7 @@ public function validateForm(array &$form, array &$form_state) { */ public function submitForm(array &$form, array &$form_state) { drupal_set_message(t('The FormTestArgumentsObject::submitForm() method was used for this form.')); - config('form_test.object') + \Drupal::config('form_test.object') ->set('bananas', $form_state['values']['bananas']) ->save(); } diff --git a/core/modules/system/tests/modules/form_test/lib/Drupal/form_test/FormTestControllerObject.php b/core/modules/system/tests/modules/form_test/lib/Drupal/form_test/FormTestControllerObject.php index b342128d76981a8379f5ccd94fcfc60bbe449129..cfb5dfd9498fe39d4ac5744f5c52177afa8bacbc 100644 --- a/core/modules/system/tests/modules/form_test/lib/Drupal/form_test/FormTestControllerObject.php +++ b/core/modules/system/tests/modules/form_test/lib/Drupal/form_test/FormTestControllerObject.php @@ -66,7 +66,7 @@ public function validateForm(array &$form, array &$form_state) { */ public function submitForm(array &$form, array &$form_state) { drupal_set_message(t('The FormTestControllerObject::submitForm() method was used for this form.')); - config('form_test.object') + \Drupal::config('form_test.object') ->set('bananas', $form_state['values']['bananas']) ->save(); } diff --git a/core/modules/system/tests/modules/form_test/lib/Drupal/form_test/FormTestObject.php b/core/modules/system/tests/modules/form_test/lib/Drupal/form_test/FormTestObject.php index 22b6d7a7800015684ba97c6615cab30e52cd9abe..8106fa10fd9638e62956a3d5e058aca00ca92049 100644 --- a/core/modules/system/tests/modules/form_test/lib/Drupal/form_test/FormTestObject.php +++ b/core/modules/system/tests/modules/form_test/lib/Drupal/form_test/FormTestObject.php @@ -52,7 +52,7 @@ public function validateForm(array &$form, array &$form_state) { */ public function submitForm(array &$form, array &$form_state) { drupal_set_message(t('The FormTestObject::submitForm() method was used for this form.')); - config('form_test.object') + \Drupal::config('form_test.object') ->set('bananas', $form_state['values']['bananas']) ->save(); } diff --git a/core/modules/system/tests/modules/form_test/lib/Drupal/form_test/FormTestServiceObject.php b/core/modules/system/tests/modules/form_test/lib/Drupal/form_test/FormTestServiceObject.php index c7663efb911455c85aed98324fc5a8d80d93a696..264f7475ce0d507e6a264bfa48783522c232846d 100644 --- a/core/modules/system/tests/modules/form_test/lib/Drupal/form_test/FormTestServiceObject.php +++ b/core/modules/system/tests/modules/form_test/lib/Drupal/form_test/FormTestServiceObject.php @@ -53,7 +53,7 @@ public function validateForm(array &$form, array &$form_state) { */ public function submitForm(array &$form, array &$form_state) { drupal_set_message(t('The FormTestServiceObject::submitForm() method was used for this form.')); - config('form_test.object') + \Drupal::config('form_test.object') ->set('bananas', $form_state['values']['bananas']) ->save(); } diff --git a/core/modules/system/tests/modules/menu_test/menu_test.module b/core/modules/system/tests/modules/menu_test/menu_test.module index 8f71bd32d824f3fdd45fbed811d4d93e9a44ab5a..fd9a90068bf82d341d68f42ffaf7b590f5d80ee6 100644 --- a/core/modules/system/tests/modules/menu_test/menu_test.module +++ b/core/modules/system/tests/modules/menu_test/menu_test.module @@ -461,7 +461,7 @@ function menu_test_local_action_dynamic_title($arg) { * several local tasks to menu-test/tasks. */ function menu_test_menu_local_tasks(&$data, $router_item, $root_path) { - if (!config('menu_test.settings')->get('tasks.add')) { + if (!Drupal::config('menu_test.settings')->get('tasks.add')) { return; } if (strpos($router_item['tab_root'], 'menu-test/tasks/') === 0) { @@ -491,7 +491,7 @@ function menu_test_menu_local_tasks(&$data, $router_item, $root_path) { * several local tasks to menu-test/tasks. */ function menu_test_menu_local_tasks_alter(&$data, $router_item, $root_path) { - if (!config('menu_test.settings')->get('tasks.alter')) { + if (!Drupal::config('menu_test.settings')->get('tasks.alter')) { return; } if (strpos($router_item['tab_root'], 'menu-test/tasks/') === 0) { @@ -634,7 +634,7 @@ function menu_test_theme_page_callback($inherited = FALSE) { function menu_test_theme_callback($argument) { // Test using the variable administrative theme. if ($argument == 'use-admin-theme') { - return config('system.theme')->get('admin'); + return Drupal::config('system.theme')->get('admin'); } // Test using a theme that exists, but may or may not be enabled. elseif ($argument == 'use-stark-theme') { diff --git a/core/modules/system/tests/modules/plugin_test/lib/Drupal/plugin_test/Plugin/plugin_test/mock_block/MockLayoutBlockDeriver.php b/core/modules/system/tests/modules/plugin_test/lib/Drupal/plugin_test/Plugin/plugin_test/mock_block/MockLayoutBlockDeriver.php index 1bfe806251053e78aaf0f6f14538c455c9699f2c..2348b7558c06c8845ce1e191cf12711ab5108fdd 100644 --- a/core/modules/system/tests/modules/plugin_test/lib/Drupal/plugin_test/Plugin/plugin_test/mock_block/MockLayoutBlockDeriver.php +++ b/core/modules/system/tests/modules/plugin_test/lib/Drupal/plugin_test/Plugin/plugin_test/mock_block/MockLayoutBlockDeriver.php @@ -44,7 +44,7 @@ public function getDerivativeDefinitions(array $base_plugin_definition) { // We also allow them to add a customized one. Here, we just mock the // customized one, but in a real implementation, this would be fetched - // from some config() object. + // from some \Drupal::config() object. 'foo' => array( 'label' => t('Layout Foo'), ) + $base_plugin_definition, diff --git a/core/modules/system/tests/modules/system_mail_failure_test/lib/Drupal/system_mail_failure_test/TestPhpMailFailure.php b/core/modules/system/tests/modules/system_mail_failure_test/lib/Drupal/system_mail_failure_test/TestPhpMailFailure.php index a719d7a640362612a5a560a3db3fef72d8fbc0e5..f20472a60a7753d20c7c2643a12a41cc09533540 100644 --- a/core/modules/system/tests/modules/system_mail_failure_test/lib/Drupal/system_mail_failure_test/TestPhpMailFailure.php +++ b/core/modules/system/tests/modules/system_mail_failure_test/lib/Drupal/system_mail_failure_test/TestPhpMailFailure.php @@ -16,7 +16,7 @@ * This class is for running tests or for development. To use set the * configuration: * @code - * config('system.mail')->set('interface.default', 'Drupal\system_mail_failure_test\TestPhpMailFailure')->save(); + * \Drupal::config('system.mail')->set('interface.default', 'Drupal\system_mail_failure_test\TestPhpMailFailure')->save(); * @endcode */ class TestPhpMailFailure extends PhpMail implements MailInterface { diff --git a/core/modules/system/tests/modules/update_script_test/update_script_test.install b/core/modules/system/tests/modules/update_script_test/update_script_test.install index 5666827bb45458f1a3207eb02c699629f50dfeb3..c5c9e590ef132095881b017cf5bab690f02f90c5 100644 --- a/core/modules/system/tests/modules/update_script_test/update_script_test.install +++ b/core/modules/system/tests/modules/update_script_test/update_script_test.install @@ -13,7 +13,7 @@ function update_script_test_requirements($phase) { if ($phase == 'update') { // Set a requirements warning or error when the test requests it. - $requirement_type = config('update_script_test.settings')->get('requirement_type'); + $requirement_type = Drupal::config('update_script_test.settings')->get('requirement_type'); switch ($requirement_type) { case REQUIREMENT_WARNING: $requirements['update_script_test'] = array( diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/TermFormController.php b/core/modules/taxonomy/lib/Drupal/taxonomy/TermFormController.php index 5e8c870720893fe962dbb0baa6cbd88e0ce8ad39..0c925288c4f2d9d2addb7a5a27bc68df1809d5bf 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/TermFormController.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/TermFormController.php @@ -62,7 +62,7 @@ public function form(array $form, array &$form_state) { // numbers of items so we check for taxonomy.settings:override_selector // before loading the full vocabulary. Contrib modules can then intercept // before hook_form_alter to provide scalable alternatives. - if (!config('taxonomy.settings')->get('override_selector')) { + if (!\Drupal::config('taxonomy.settings')->get('override_selector')) { $parent = array_keys(taxonomy_term_load_parents($term->id())); $children = taxonomy_get_tree($vocabulary->id(), $term->id()); diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/ThemeTest.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/ThemeTest.php index 6e3acb943dbfeb9a7b74db99290ee349a7320e2b..452e33ff6242c32d81e24614077816429967ba0d 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/ThemeTest.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/ThemeTest.php @@ -25,11 +25,11 @@ function setUp() { // Make sure we are using distinct default and administrative themes for // the duration of these tests. - config('system.theme') + \Drupal::config('system.theme') ->set('default', 'bartik') ->save(); theme_enable(array('seven')); - config('system.theme')->set('admin', 'seven')->save(); + \Drupal::config('system.theme')->set('admin', 'seven')->save(); // Create and log in as a user who has permission to add and edit taxonomy // terms and view the administrative theme. diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/VocabularyTest.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/VocabularyTest.php index 5381156ed31786e9541a90357bd9ff27439762ae..b5e0b7701647ef80a6078bd40521918ef2d9ba38 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/VocabularyTest.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/VocabularyTest.php @@ -71,7 +71,7 @@ function testVocabularyInterface() { $edit['vid'] = 'don_t_panic'; $this->drupalPost('admin/structure/taxonomy/add', $edit, t('Save')); - $site_name = config('system.site')->get('name'); + $site_name = \Drupal::config('system.site')->get('name'); $this->assertTitle(t('Don\'t Panic | @site-name', array('@site-name' => $site_name))); $this->assertNoTitle(t('Don't Panic | @site-name', array('@site-name' => $site_name))); } diff --git a/core/modules/taxonomy/taxonomy.admin.inc b/core/modules/taxonomy/taxonomy.admin.inc index c4f950b91b485a3e7089c127752b3c60c2f89270..b61424e195f6fc554b45aa9c8ee234e360b355bc 100644 --- a/core/modules/taxonomy/taxonomy.admin.inc +++ b/core/modules/taxonomy/taxonomy.admin.inc @@ -39,7 +39,7 @@ function taxonomy_overview_terms($form, &$form_state, Vocabulary $vocabulary) { $parent_fields = FALSE; $page = isset($_GET['page']) ? $_GET['page'] : 0; - $page_increment = config('taxonomy.settings')->get('terms_per_page_admin'); + $page_increment = Drupal::config('taxonomy.settings')->get('terms_per_page_admin'); $page_entries = 0; $before_entries = 0; $after_entries = 0; diff --git a/core/modules/taxonomy/taxonomy.install b/core/modules/taxonomy/taxonomy.install index 860cde3654c1aa6f37f79e058df8de6bdad744e0..f89db3ac0374f7476be1e963e81582723073a19f 100644 --- a/core/modules/taxonomy/taxonomy.install +++ b/core/modules/taxonomy/taxonomy.install @@ -312,7 +312,7 @@ function taxonomy_update_8005() { $result = db_query('SELECT * FROM {taxonomy_vocabulary}'); foreach ($result as $vocabulary) { - $config = config('taxonomy.vocabulary.' . $vocabulary->machine_name) + $config = Drupal::config('taxonomy.vocabulary.' . $vocabulary->machine_name) ->set('vid', $vocabulary->machine_name) ->set('name', $vocabulary->name) ->set('uuid', !empty($vocabulary->uuid) ? $vocabulary->uuid : $uuid->generate()) @@ -354,7 +354,7 @@ function taxonomy_update_8006() { */ function taxonomy_update_8007() { foreach (config_get_storage_names_with_prefix('field.field.') as $config_name) { - $field_config = config($config_name); + $field_config = Drupal::config($config_name); // Only update taxonomy reference fields that use the default SQL storage. if ($field_config->get('type') == 'taxonomy_term_reference' && $field_config->get('storage.type') == 'field_sql_storage') { $field = new Field($field_config->get()); diff --git a/core/modules/taxonomy/taxonomy.module b/core/modules/taxonomy/taxonomy.module index 2167270594dc25067178fc5f981a4b608581feb6..090baaffdf2e1719d6bf5470ec1790e9e15e2ec6 100644 --- a/core/modules/taxonomy/taxonomy.module +++ b/core/modules/taxonomy/taxonomy.module @@ -113,7 +113,7 @@ function taxonomy_permission() { function taxonomy_entity_bundle_info() { $bundles = array(); foreach (taxonomy_vocabulary_get_names() as $id) { - $config = config('taxonomy.vocabulary.' . $id); + $config = Drupal::config('taxonomy.vocabulary.' . $id); $bundles['taxonomy_term'][$id]['label'] = $config->get('name'); } return $bundles; @@ -181,7 +181,7 @@ function taxonomy_field_extra_fields() { * An array of nids matching the query. */ function taxonomy_select_nodes($tid, $pager = TRUE, $limit = FALSE, $order = array('t.sticky' => 'DESC', 't.created' => 'DESC')) { - if (!config('taxonomy.settings')->get('maintain_index_table')) { + if (!Drupal::config('taxonomy.settings')->get('maintain_index_table')) { return array(); } $query = db_select('taxonomy_index', 't'); @@ -1129,7 +1129,7 @@ function taxonomy_build_node_index($node) { // We maintain a denormalized table of term/node relationships, containing // only data for current, published nodes. $status = NULL; - if (config('taxonomy.settings')->get('maintain_index_table')) { + if (Drupal::config('taxonomy.settings')->get('maintain_index_table')) { // If a node property is not set in the node object when $node->save() is // called, the old value from $node->original is used. if (!empty($node->original)) { @@ -1209,7 +1209,7 @@ function taxonomy_node_predelete(EntityInterface $node) { * The node entity. */ function taxonomy_delete_node_index(EntityInterface $node) { - if (config('taxonomy.settings')->get('maintain_index_table')) { + if (Drupal::config('taxonomy.settings')->get('maintain_index_table')) { db_delete('taxonomy_index')->condition('nid', $node->id())->execute(); } } @@ -1218,7 +1218,7 @@ function taxonomy_delete_node_index(EntityInterface $node) { * Implements hook_taxonomy_term_delete(). */ function taxonomy_taxonomy_term_delete(Term $term) { - if (config('taxonomy.settings')->get('maintain_index_table')) { + if (Drupal::config('taxonomy.settings')->get('maintain_index_table')) { // Clean up the {taxonomy_index} table when terms are deleted. db_delete('taxonomy_index')->condition('tid', $term->id())->execute(); } diff --git a/core/modules/taxonomy/taxonomy.pages.inc b/core/modules/taxonomy/taxonomy.pages.inc index d70b8fdfca890acf63404629c13a67dae467e600..4baf150ed2a5022ce378191daf1f1e5c5c966e51 100644 --- a/core/modules/taxonomy/taxonomy.pages.inc +++ b/core/modules/taxonomy/taxonomy.pages.inc @@ -44,7 +44,7 @@ function taxonomy_term_page(Term $term) { } $build['taxonomy_terms'] = taxonomy_term_view_multiple(array($term->id() => $term)); - if ($nids = taxonomy_select_nodes($term->id(), TRUE, config('node.settings')->get('items_per_page'))) { + if ($nids = taxonomy_select_nodes($term->id(), TRUE, Drupal::config('node.settings')->get('items_per_page'))) { $nodes = node_load_multiple($nids); $build['nodes'] = node_view_multiple($nodes); $build['pager'] = array( @@ -70,11 +70,11 @@ function taxonomy_term_page(Term $term) { */ function taxonomy_term_feed(Term $term) { $channel['link'] = url('taxonomy/term/' . $term->id(), array('absolute' => TRUE)); - $channel['title'] = config('system.site')->get('name') . ' - ' . $term->label(); + $channel['title'] = Drupal::config('system.site')->get('name') . ' - ' . $term->label(); // Only display the description if we have a single term, to avoid clutter and confusion. // HTML will be removed from feed description. $channel['description'] = check_markup($term->description->value, $term->format->value, '', TRUE); - $nids = taxonomy_select_nodes($term->id(), FALSE, config('system.rss')->get('items.limit')); + $nids = taxonomy_select_nodes($term->id(), FALSE, Drupal::config('system.rss')->get('items.limit')); return node_feed($nids, $channel); } diff --git a/core/modules/text/text.module b/core/modules/text/text.module index 3c239c0b57c67c39da3e24615fb0ddab093667a2..0bb7427810e9b06a9838f0014796cec3a8ddbeb2 100644 --- a/core/modules/text/text.module +++ b/core/modules/text/text.module @@ -102,7 +102,7 @@ function text_sanitize($text_processing, $langcode, $item, $column) { function text_summary($text, $format = NULL, $size = NULL) { if (!isset($size)) { - $size = config('text.settings')->get('default_summary_length'); + $size = Drupal::config('text.settings')->get('default_summary_length'); } // Find where the delimiter is in the body diff --git a/core/modules/tracker/tracker.module b/core/modules/tracker/tracker.module index 26af4847fe315a09ac9a6161595a8b632e08d53f..1052b5fcebb6f6a204292b1be894262aa9df29a6 100644 --- a/core/modules/tracker/tracker.module +++ b/core/modules/tracker/tracker.module @@ -82,7 +82,7 @@ function tracker_cron() { $state = Drupal::state(); $max_nid = $state->get('tracker.index_nid') ?: 0; if ($max_nid > 0) { - $batch_size = config('tracker.settings')->get('cron_index_limit'); + $batch_size = Drupal::config('tracker.settings')->get('cron_index_limit'); $last_nid = FALSE; // @todo This should be actually filtering on the desired language and just // fall back to the default language. diff --git a/core/modules/translation/translation.module b/core/modules/translation/translation.module index 17d148e28bbe33a77e381a44a43b0f5954954ece..5846ca2c01131a9bdbc0f95e1503ee7629baec5d 100644 --- a/core/modules/translation/translation.module +++ b/core/modules/translation/translation.module @@ -266,7 +266,7 @@ function translation_node_view(EntityInterface $node, EntityDisplay $display, $v // only for configurable language types and interface language is the only // configurable language type in core, we use it as default. Contributed // modules can change this behavior by setting the system variable below. - $type = config('translation.settings')->get('language_type'); + $type = Drupal::config('translation.settings')->get('language_type'); $custom_links = language_negotiation_get_switch_links($type, 'node/' . $node->id()); $links = array(); @@ -545,7 +545,7 @@ function translation_path_get_translations($path) { * Replaces links with pointers to translated versions of the content. */ function translation_language_switch_links_alter(array &$links, $type, $path) { - $language_type = config('translation.settings')->get('language_type'); + $language_type = Drupal::config('translation.settings')->get('language_type'); if ($type == $language_type && preg_match("!^node/(\d+)(/.+|)!", $path, $matches)) { $node = node_load((int) $matches[1]); diff --git a/core/modules/translation/translation.pages.inc b/core/modules/translation/translation.pages.inc index 66da1e46964af9a6bdcdd1bcc5c9e9034eac47b7..62d2ada411ea72cc58e9da8ae93a9295ff0091fe 100644 --- a/core/modules/translation/translation.pages.inc +++ b/core/modules/translation/translation.pages.inc @@ -33,7 +33,7 @@ function translation_node_overview(EntityInterface $node) { $translations = array($node->langcode => $node); } - $type = config('translation.settings')->get('language_type'); + $type = Drupal::config('translation.settings')->get('language_type'); $header = array(t('Language'), t('Title'), t('Status'), t('Operations')); foreach (language_list() as $langcode => $language) { diff --git a/core/modules/update/lib/Drupal/update/Tests/UpdateContribTest.php b/core/modules/update/lib/Drupal/update/Tests/UpdateContribTest.php index 757894fd642bd30a24a78e885b41bd5e4c30340f..a18409254e15474d33c7897279338a994415b8f3 100644 --- a/core/modules/update/lib/Drupal/update/Tests/UpdateContribTest.php +++ b/core/modules/update/lib/Drupal/update/Tests/UpdateContribTest.php @@ -49,7 +49,7 @@ function testNoReleasesAvailable() { 'hidden' => FALSE, ), ); - config('update_test.settings')->set('system_info', $system_info)->save(); + \Drupal::config('update_test.settings')->set('system_info', $system_info)->save(); $this->refreshUpdateStatus(array('drupal' => '0', 'aaa_update_test' => 'no-releases')); $this->drupalGet('admin/reports/updates'); // Cannot use $this->standardTests() because we need to check for the @@ -77,7 +77,7 @@ function testUpdateContribBasic() { 'hidden' => FALSE, ), ); - config('update_test.settings')->set('system_info', $system_info)->save(); + \Drupal::config('update_test.settings')->set('system_info', $system_info)->save(); $this->refreshUpdateStatus( array( 'drupal' => '0', @@ -136,7 +136,7 @@ function testUpdateContribOrder() { 'hidden' => FALSE, ), ); - config('update_test.settings')->set('system_info', $system_info)->save(); + \Drupal::config('update_test.settings')->set('system_info', $system_info)->save(); $this->refreshUpdateStatus(array('drupal' => '0', '#all' => '1_0')); $this->standardTests(); // We're expecting the report to say all projects are up to date. @@ -189,7 +189,7 @@ function testUpdateBaseThemeSecurityUpdate() { 'hidden' => FALSE, ), ); - config('update_test.settings')->set('system_info', $system_info)->save(); + \Drupal::config('update_test.settings')->set('system_info', $system_info)->save(); $xml_mapping = array( 'drupal' => '0', 'update_test_subtheme' => '1_0', @@ -204,9 +204,9 @@ function testUpdateBaseThemeSecurityUpdate() { * Tests that disabled themes are only shown when desired. */ function testUpdateShowDisabledThemes() { - $update_settings = config('update.settings'); + $update_settings = \Drupal::config('update.settings'); // Make sure all the update_test_* themes are disabled. - $theme_config = config('system.theme'); + $theme_config = \Drupal::config('system.theme'); foreach ($theme_config->get('enabled') as $theme => $weight) { if (preg_match('/^update_test_/', $theme)) { $theme_config->clear("enabled.$theme"); @@ -238,7 +238,7 @@ function testUpdateShowDisabledThemes() { // of update_max_fetch_attempts. Therefore this variable is set very high // to avoid test failures in those cases. $update_settings->set('fetch.max_attempts', 99999)->save(); - config('update_test.settings')->set('system_info', $system_info)->save(); + \Drupal::config('update_test.settings')->set('system_info', $system_info)->save(); $xml_mapping = array( 'drupal' => '0', 'update_test_subtheme' => '1_0', @@ -286,7 +286,7 @@ function testUpdateHiddenBaseTheme() { 'hidden' => FALSE, ), ); - config('update_test.settings')->set('system_info', $system_info)->save(); + \Drupal::config('update_test.settings')->set('system_info', $system_info)->save(); $projects = update_get_projects(); $theme_data = system_rebuild_theme_data(); $project_info = new ProjectInfo(); @@ -319,7 +319,7 @@ function testUpdateBrokenFetchURL() { 'hidden' => FALSE, ), ); - config('update_test.settings')->set('system_info', $system_info)->save(); + \Drupal::config('update_test.settings')->set('system_info', $system_info)->save(); $xml_mapping = array( 'drupal' => '0', @@ -360,7 +360,7 @@ function testUpdateBrokenFetchURL() { * update, then assert if we see the appropriate warnings on the right pages. */ function testHookUpdateStatusAlter() { - $update_test_config = config('update_test.settings'); + $update_test_config = \Drupal::config('update_test.settings'); $update_admin_user = $this->drupalCreateUser(array('administer site configuration', 'administer software updates')); $this->drupalLogin($update_admin_user); diff --git a/core/modules/update/lib/Drupal/update/Tests/UpdateCoreTest.php b/core/modules/update/lib/Drupal/update/Tests/UpdateCoreTest.php index bfbd4a0335add6aa8f3deeb9a216333a8d523427..f0c55be564beb350e2efe34f11a93940c31f8a8b 100644 --- a/core/modules/update/lib/Drupal/update/Tests/UpdateCoreTest.php +++ b/core/modules/update/lib/Drupal/update/Tests/UpdateCoreTest.php @@ -91,7 +91,7 @@ function testDatestampMismatch() { 'datestamp' => '1000000000', ), ); - config('update_test.settings')->set('system_info', $system_info)->save(); + \Drupal::config('update_test.settings')->set('system_info', $system_info)->save(); $this->refreshUpdateStatus(array('drupal' => 'dev')); $this->assertNoText(t('2001-Sep-')); $this->assertText(t('Up to date')); @@ -104,8 +104,8 @@ function testDatestampMismatch() { */ function testModulePageRunCron() { $this->setSystemInfo7_0(); - config('update.settings')->set('fetch.url', url('update-test', array('absolute' => TRUE)))->save(); - config('update_test.settings')->set('xml_map', array('drupal' => '0'))->save(); + \Drupal::config('update.settings')->set('fetch.url', url('update-test', array('absolute' => TRUE)))->save(); + \Drupal::config('update_test.settings')->set('xml_map', array('drupal' => '0'))->save(); $this->cronRun(); $this->drupalGet('admin/modules'); @@ -118,8 +118,8 @@ function testModulePageRunCron() { function testModulePageUpToDate() { $this->setSystemInfo7_0(); // Instead of using refreshUpdateStatus(), set these manually. - config('update.settings')->set('fetch.url', url('update-test', array('absolute' => TRUE)))->save(); - config('update_test.settings')->set('xml_map', array('drupal' => '0'))->save(); + \Drupal::config('update.settings')->set('fetch.url', url('update-test', array('absolute' => TRUE)))->save(); + \Drupal::config('update_test.settings')->set('xml_map', array('drupal' => '0'))->save(); $this->drupalGet('admin/reports/updates'); $this->clickLink(t('Check manually')); @@ -135,8 +135,8 @@ function testModulePageUpToDate() { function testModulePageRegularUpdate() { $this->setSystemInfo7_0(); // Instead of using refreshUpdateStatus(), set these manually. - config('update.settings')->set('fetch.url', url('update-test', array('absolute' => TRUE)))->save(); - config('update_test.settings')->set('xml_map', array('drupal' => '1'))->save(); + \Drupal::config('update.settings')->set('fetch.url', url('update-test', array('absolute' => TRUE)))->save(); + \Drupal::config('update_test.settings')->set('xml_map', array('drupal' => '1'))->save(); $this->drupalGet('admin/reports/updates'); $this->clickLink(t('Check manually')); @@ -152,8 +152,8 @@ function testModulePageRegularUpdate() { function testModulePageSecurityUpdate() { $this->setSystemInfo7_0(); // Instead of using refreshUpdateStatus(), set these manually. - config('update.settings')->set('fetch.url', url('update-test', array('absolute' => TRUE)))->save(); - config('update_test.settings')->set('xml_map', array('drupal' => '2-sec'))->save(); + \Drupal::config('update.settings')->set('fetch.url', url('update-test', array('absolute' => TRUE)))->save(); + \Drupal::config('update_test.settings')->set('xml_map', array('drupal' => '2-sec'))->save(); $this->drupalGet('admin/reports/updates'); $this->clickLink(t('Check manually')); @@ -224,8 +224,8 @@ function testFetchTasks() { function testLanguageModuleUpdate() { $this->setSystemInfo7_0(); // Instead of using refreshUpdateStatus(), set these manually. - config('update.settings')->set('fetch.url', url('update-test', array('absolute' => TRUE)))->save(); - config('update_test.settings')->set('xml_map', array('drupal' => '1'))->save(); + \Drupal::config('update.settings')->set('fetch.url', url('update-test', array('absolute' => TRUE)))->save(); + \Drupal::config('update_test.settings')->set('xml_map', array('drupal' => '1'))->save(); $this->drupalGet('admin/reports/updates'); $this->assertText(t('Language')); @@ -240,6 +240,6 @@ protected function setSystemInfo7_0() { 'version' => '7.0', ), ); - config('update_test.settings')->set('system_info', $setting)->save(); + \Drupal::config('update_test.settings')->set('system_info', $setting)->save(); } } diff --git a/core/modules/update/lib/Drupal/update/Tests/UpdateTestBase.php b/core/modules/update/lib/Drupal/update/Tests/UpdateTestBase.php index 99d01d1a80d685660bf791be411c66d708036f45..47a66490ea8edab315924fed536c43f3b553b0c4 100644 --- a/core/modules/update/lib/Drupal/update/Tests/UpdateTestBase.php +++ b/core/modules/update/lib/Drupal/update/Tests/UpdateTestBase.php @@ -43,9 +43,9 @@ abstract class UpdateTestBase extends WebTestBase { protected function refreshUpdateStatus($xml_map, $url = 'update-test') { // Tell the Update Manager module to fetch from the URL provided by // update_test module. - config('update.settings')->set('fetch.url', url($url, array('absolute' => TRUE)))->save(); + \Drupal::config('update.settings')->set('fetch.url', url($url, array('absolute' => TRUE)))->save(); // Save the map for update_test_mock_page() to use. - config('update_test.settings')->set('xml_map', $xml_map)->save(); + \Drupal::config('update_test.settings')->set('xml_map', $xml_map)->save(); // Manually check the update status. $this->drupalGet('admin/reports/updates/check'); } diff --git a/core/modules/update/lib/Drupal/update/Tests/UpdateUploadTest.php b/core/modules/update/lib/Drupal/update/Tests/UpdateUploadTest.php index d3bcdb8bf486483355992f9e30c0ce5cbdd978ff..73a7b9ce945fa6427b68aad65593d15ae571d9fb 100644 --- a/core/modules/update/lib/Drupal/update/Tests/UpdateUploadTest.php +++ b/core/modules/update/lib/Drupal/update/Tests/UpdateUploadTest.php @@ -81,11 +81,11 @@ function testUpdateManagerCoreSecurityUpdateMessages() { 'version' => '7.0', ), ); - config('update_test.settings') + \Drupal::config('update_test.settings') ->set('system_info', $setting) ->set('xml_map', array('drupal' => '2-sec')) ->save(); - config('update.settings')->set('fetch.url', url('update-test', array('absolute' => TRUE)))->save(); + \Drupal::config('update.settings')->set('fetch.url', url('update-test', array('absolute' => TRUE)))->save(); // Initialize the update status. $this->drupalGet('admin/reports/updates'); diff --git a/core/modules/update/tests/modules/update_test/update_test.module b/core/modules/update/tests/modules/update_test/update_test.module index 31ee72dc4b5de96bb097608ce479f817ec7b2508..a8c9e2261d0d99597c4f62d7a0f81fa92462d4e6 100644 --- a/core/modules/update/tests/modules/update_test/update_test.module +++ b/core/modules/update/tests/modules/update_test/update_test.module @@ -51,7 +51,7 @@ function update_test_menu() { * just for that module or theme. */ function update_test_system_info_alter(&$info, $file) { - $setting = config('update_test.settings')->get('system_info'); + $setting = Drupal::config('update_test.settings')->get('system_info'); foreach (array('#all', $file->name) as $id) { if (!empty($setting[$id])) { foreach ($setting[$id] as $key => $value) { @@ -73,7 +73,7 @@ function update_test_system_info_alter(&$info, $file) { * module or theme. */ function update_test_update_status_alter(&$projects) { - $setting = config('update_test.settings')->get('update_status'); + $setting = Drupal::config('update_test.settings')->get('update_status'); if (!empty($setting)) { foreach ($projects as $project_name => &$project) { foreach (array('#all', $project_name) as $id) { @@ -109,7 +109,7 @@ function update_test_update_status_alter(&$projects) { * @see update_test_menu() */ function update_test_mock_page($project_name) { - $xml_map = config('update_test.settings')->get('xml_map'); + $xml_map = Drupal::config('update_test.settings')->get('xml_map'); if (isset($xml_map[$project_name])) { $availability_scenario = $xml_map[$project_name]; } diff --git a/core/modules/update/update.api.php b/core/modules/update/update.api.php index 9e5f9376eabc54472c844cbca9fcc5d98c9c619e..ce8234c606fdf665796b24eed687cf1e75902e92 100644 --- a/core/modules/update/update.api.php +++ b/core/modules/update/update.api.php @@ -83,7 +83,7 @@ function hook_update_projects_alter(&$projects) { * @see update_calculate_project_data() */ function hook_update_status_alter(&$projects) { - $settings = config('update_advanced.settings')->get('projects'); + $settings = Drupal::config('update_advanced.settings')->get('projects'); foreach ($projects as $project => $project_info) { if (isset($settings[$project]) && isset($settings[$project]['check']) && ($settings[$project]['check'] == 'never' || diff --git a/core/modules/update/update.authorize.inc b/core/modules/update/update.authorize.inc index 57acc3406e11d8bc52a765b0c453e64b29020325..ee1e6fb5d0c7d3fc407c17957dd8560e3d679b3f 100644 --- a/core/modules/update/update.authorize.inc +++ b/core/modules/update/update.authorize.inc @@ -191,7 +191,7 @@ function update_authorize_update_batch_finished($success, $results) { $success = FALSE; } } - $offline = config('system.maintenance')->get('enabled'); + $offline = Drupal::config('system.maintenance')->get('enabled'); if ($success) { // Now that the update completed, we need to clear the available update data // and recompute our status, so prevent show bogus results. @@ -199,7 +199,7 @@ function update_authorize_update_batch_finished($success, $results) { // Take the site out of maintenance mode if it was previously that way. if ($offline && isset($_SESSION['maintenance_mode']) && $_SESSION['maintenance_mode'] == FALSE) { - config('system.maintenance')->set('enabled', FALSE)->save(); + Drupal::config('system.maintenance')->set('enabled', FALSE)->save(); $page_message = array( 'message' => t('Update was completed successfully. Your site has been taken out of maintenance mode.'), 'type' => 'status', @@ -258,11 +258,11 @@ function update_authorize_install_batch_finished($success, $results) { $success = FALSE; } } - $offline = config('system.maintenance')->get('enabled'); + $offline = Drupal::config('system.maintenance')->get('enabled'); if ($success) { // Take the site out of maintenance mode if it was previously that way. if ($offline && isset($_SESSION['maintenance_mode']) && $_SESSION['maintenance_mode'] == FALSE) { - config('system.maintenance')->set('enabled', FALSE)->save(); + Drupal::config('system.maintenance')->set('enabled', FALSE)->save(); $page_message = array( 'message' => t('Installation was completed successfully. Your site has been taken out of maintenance mode.'), 'type' => 'status', diff --git a/core/modules/update/update.compare.inc b/core/modules/update/update.compare.inc index 6741b4176a2f0b1290225854444e7140c5d91162..3c0422d36741066bee1312f291f25982a000325a 100644 --- a/core/modules/update/update.compare.inc +++ b/core/modules/update/update.compare.inc @@ -66,7 +66,7 @@ function update_get_projects() { $project_info = new ProjectInfo(); $project_info->processInfoList($projects, $module_data, 'module', TRUE); $project_info->processInfoList($projects, $theme_data, 'theme', TRUE); - if (config('update.settings')->get('check.disabled_extensions')) { + if (Drupal::config('update.settings')->get('check.disabled_extensions')) { $project_info->processInfoList($projects, $module_data, 'module', FALSE); $project_info->processInfoList($projects, $theme_data, 'theme', FALSE); } diff --git a/core/modules/update/update.fetch.inc b/core/modules/update/update.fetch.inc index 3fce0234d8d5a6747c14d5780f56f7a7b4571e0b..8ac927f2bcabbca5c1f4c802c3b4396bb3d0d29a 100644 --- a/core/modules/update/update.fetch.inc +++ b/core/modules/update/update.fetch.inc @@ -110,7 +110,7 @@ function update_fetch_data_finished($success, $results) { */ function _update_fetch_data() { $queue = Drupal::queue('update_fetch_tasks'); - $end = time() + config('update.settings')->get('fetch.timeout'); + $end = time() + Drupal::config('update.settings')->get('fetch.timeout'); while (time() < $end && ($item = $queue->claimItem())) { _update_process_fetch_task($item->data); $queue->deleteItem($item); @@ -131,7 +131,7 @@ function _update_fetch_data() { */ function _update_process_fetch_task($project) { global $base_url; - $update_config = config('update.settings'); + $update_config = Drupal::config('update.settings'); $fail = &drupal_static(__FUNCTION__, array()); // This can be in the middle of a long-running batch, so REQUEST_TIME won't // necessarily be valid. @@ -319,7 +319,7 @@ function _update_get_fetch_url_base($project) { $url = $project['info']['project status url']; } else { - $url = config('update.settings')->get('fetch.url'); + $url = Drupal::config('update.settings')->get('fetch.url'); if (empty($url)) { $url = UPDATE_DEFAULT_URL; } @@ -337,7 +337,7 @@ function _update_get_fetch_url_base($project) { * @see update_requirements() */ function _update_cron_notify() { - $update_config = config('update.settings'); + $update_config = Drupal::config('update.settings'); module_load_install('update'); $status = update_requirements('runtime'); $params = array(); diff --git a/core/modules/update/update.manager.inc b/core/modules/update/update.manager.inc index ed73e370f96b9082317d611d0b8c70fdfd90ccf0..9e9d73abf70bf2d37323c329bf54b128c12c5892 100644 --- a/core/modules/update/update.manager.inc +++ b/core/modules/update/update.manager.inc @@ -430,9 +430,9 @@ function update_manager_update_ready_form($form, &$form_state) { */ function update_manager_update_ready_form_submit($form, &$form_state) { // Store maintenance_mode setting so we can restore it when done. - $_SESSION['maintenance_mode'] = config('system.maintenance')->get('enabled'); + $_SESSION['maintenance_mode'] = Drupal::config('system.maintenance')->get('enabled'); if ($form_state['values']['maintenance_mode'] == TRUE) { - config('system.maintenance')->set('enabled', TRUE)->save(); + Drupal::config('system.maintenance')->set('enabled', TRUE)->save(); } if (!empty($_SESSION['update_manager_update_projects'])) { diff --git a/core/modules/update/update.module b/core/modules/update/update.module index 111aa14f9e794ae93cd905cf382ff61c2a7f134a..ac63694aa389d3e71ce3a647d6e0bca40aee552f 100644 --- a/core/modules/update/update.module +++ b/core/modules/update/update.module @@ -281,7 +281,7 @@ function update_theme() { * Implements hook_cron(). */ function update_cron() { - $update_config = config('update.settings'); + $update_config = Drupal::config('update.settings'); $frequency = $update_config->get('check.interval_days'); $interval = 60 * 60 * 24 * $frequency; $last_check = Drupal::state()->get('update.last_check') ?: 0; @@ -489,7 +489,7 @@ function update_fetch_data() { function update_mail($key, &$message, $params) { $langcode = $message['langcode']; $language = language_load($langcode); - $message['subject'] .= t('New release(s) available for !site_name', array('!site_name' => config('system.site')->get('name')), array('langcode' => $langcode)); + $message['subject'] .= t('New release(s) available for !site_name', array('!site_name' => Drupal::config('system.site')->get('name')), array('langcode' => $langcode)); foreach ($params as $msg_type => $msg_reason) { $message['body'][] = _update_message_text($msg_type, $msg_reason, FALSE, $langcode); } @@ -498,7 +498,7 @@ function update_mail($key, &$message, $params) { $message['body'][] = t('You can automatically install your missing updates using the Update manager:', array(), array('langcode' => $langcode)) . "\n" . url('admin/reports/updates/update', array('absolute' => TRUE, 'language' => $language)); } $settings_url = url('admin/reports/updates/settings', array('absolute' => TRUE)); - if (config('update.settings')->get('notification.threshold') == 'all') { + if (Drupal::config('update.settings')->get('notification.threshold') == 'all') { $message['body'][] = t('Your site is currently configured to send these emails when any updates are available. To get notified only for security updates, !url.', array('!url' => $settings_url)); } else { diff --git a/core/modules/update/update.report.inc b/core/modules/update/update.report.inc index 50a9da62903342659d7599724968c295d5a518db..1ce4f7cdcdaadd3b79f9600c851c1514e4ca77fa 100644 --- a/core/modules/update/update.report.inc +++ b/core/modules/update/update.report.inc @@ -32,7 +32,7 @@ function theme_update_report($variables) { $header = array(); $rows = array(); - $notification_level = config('update.settings')->get('notification.threshold'); + $notification_level = Drupal::config('update.settings')->get('notification.threshold'); // Create an array of status values keyed by module or theme name, since // we'll need this while generating the report if we have to cross reference diff --git a/core/modules/user/lib/Drupal/user/Access/RegisterAccessCheck.php b/core/modules/user/lib/Drupal/user/Access/RegisterAccessCheck.php index a7e393346d9b6dea009baedae77559a62cf1d151..1fb068824d504cf442a0178d1ca4cfa26aee72ef 100644 --- a/core/modules/user/lib/Drupal/user/Access/RegisterAccessCheck.php +++ b/core/modules/user/lib/Drupal/user/Access/RegisterAccessCheck.php @@ -27,6 +27,6 @@ public function appliesTo() { * Implements AccessCheckInterface::access(). */ public function access(Route $route, Request $request) { - return user_is_anonymous() && (config('user.settings')->get('register') != USER_REGISTER_ADMINISTRATORS_ONLY); + return user_is_anonymous() && (\Drupal::config('user.settings')->get('register') != USER_REGISTER_ADMINISTRATORS_ONLY); } } diff --git a/core/modules/user/lib/Drupal/user/AccountFormController.php b/core/modules/user/lib/Drupal/user/AccountFormController.php index 709951a7b7393859785b69355e6e6aff0928e781..e0df82b722427a456f2ec3678349b14a775cd982 100644 --- a/core/modules/user/lib/Drupal/user/AccountFormController.php +++ b/core/modules/user/lib/Drupal/user/AccountFormController.php @@ -21,7 +21,7 @@ abstract class AccountFormController extends EntityFormControllerNG { public function form(array $form, array &$form_state) { $account = $this->entity; global $user; - $config = config('user.settings'); + $config = \Drupal::config('user.settings'); $language_interface = language(Language::TYPE_INTERFACE); $register = $account->isAnonymous(); diff --git a/core/modules/user/lib/Drupal/user/Plugin/Block/UserLoginBlock.php b/core/modules/user/lib/Drupal/user/Plugin/Block/UserLoginBlock.php index ab4401c0e3b40a08c99731a734015434ce8ea200..00a9061df9a77d1a900c5226cc7eaefc49287c3a 100644 --- a/core/modules/user/lib/Drupal/user/Plugin/Block/UserLoginBlock.php +++ b/core/modules/user/lib/Drupal/user/Plugin/Block/UserLoginBlock.php @@ -95,7 +95,7 @@ public function build() { $form['#action'] = url(current_path(), array('query' => drupal_get_destination(), 'external' => FALSE)); // Build action links. $items = array(); - if (config('user.settings')->get('register') != USER_REGISTER_ADMINISTRATORS_ONLY) { + if (\Drupal::config('user.settings')->get('register') != USER_REGISTER_ADMINISTRATORS_ONLY) { $items['create_account'] = l(t('Create new account'), 'user/register', array( 'attributes' => array( 'title' => t('Create a new user account.'), diff --git a/core/modules/user/lib/Drupal/user/Plugin/views/argument/Uid.php b/core/modules/user/lib/Drupal/user/Plugin/views/argument/Uid.php index 5bd0bff5de94d98c3759f9cfb27fe729b2c66702..03c492a49600eb4453613f638e304f398915c5c1 100644 --- a/core/modules/user/lib/Drupal/user/Plugin/views/argument/Uid.php +++ b/core/modules/user/lib/Drupal/user/Plugin/views/argument/Uid.php @@ -27,7 +27,7 @@ class Uid extends Numeric { */ public function titleQuery() { if (!$this->argument) { - return array(config('user.settings')->get('anonymous')); + return array(\Drupal::config('user.settings')->get('anonymous')); } $titles = array(); diff --git a/core/modules/user/lib/Drupal/user/Plugin/views/argument_validator/User.php b/core/modules/user/lib/Drupal/user/Plugin/views/argument_validator/User.php index d01460248332dbee12c6be6c79afb91d7aae1ffe..abbb25c474449210637e662f35a565a107156743 100644 --- a/core/modules/user/lib/Drupal/user/Plugin/views/argument_validator/User.php +++ b/core/modules/user/lib/Drupal/user/Plugin/views/argument_validator/User.php @@ -124,7 +124,7 @@ public function validateArgument($argument) { } else { if ($type == 'name' || $type == 'either') { - $name = $GLOBALS['user']->getUserName() ?: config('user.settings')->get('anonymous'); + $name = $GLOBALS['user']->getUserName() ?: \Drupal::config('user.settings')->get('anonymous'); if ($argument == $name) { $account = clone $GLOBALS['user']; } diff --git a/core/modules/user/lib/Drupal/user/RegisterFormController.php b/core/modules/user/lib/Drupal/user/RegisterFormController.php index d5f5024ad3a4e55d84cba0bfd47b7a63d5ba4a6b..4d6b7fca7366d022f56e1aa1d1d855c6d803ea6c 100644 --- a/core/modules/user/lib/Drupal/user/RegisterFormController.php +++ b/core/modules/user/lib/Drupal/user/RegisterFormController.php @@ -69,7 +69,7 @@ protected function actions(array $form, array &$form_state) { public function submit(array $form, array &$form_state) { $admin = $form_state['values']['administer_users']; - if (!config('user.settings')->get('verify_mail') || $admin) { + if (!\Drupal::config('user.settings')->get('verify_mail') || $admin) { $pass = $form_state['values']['pass']; } else { @@ -112,7 +112,7 @@ public function save(array $form, array &$form_state) { drupal_set_message(t('Created a new user account for %name. No e-mail has been sent.', array('@url' => url($uri['path'], $uri['options']), '%name' => $account->getUsername()))); } // No e-mail verification required; log in user immediately. - elseif (!$admin && !config('user.settings')->get('verify_mail') && $account->isActive()) { + elseif (!$admin && !\Drupal::config('user.settings')->get('verify_mail') && $account->isActive()) { _user_mail_notify('register_no_approval_required', $account); user_login_finalize($account); drupal_set_message(t('Registration successful. You are now logged in.')); diff --git a/core/modules/user/lib/Drupal/user/Tests/UserAdminTest.php b/core/modules/user/lib/Drupal/user/Tests/UserAdminTest.php index 1dd89b2aae11273407c3d824b16080a51cb619e7..0b61e236485c3ca2194a0e45e06c14caf4ca1ff9 100644 --- a/core/modules/user/lib/Drupal/user/Tests/UserAdminTest.php +++ b/core/modules/user/lib/Drupal/user/Tests/UserAdminTest.php @@ -127,14 +127,14 @@ function testNotificationEmailAddress() { $this->drupalLogout(); // Test custom user registration approval email address(es). - $config = config('user.settings'); + $config = \Drupal::config('user.settings'); // Allow users to register with admin approval. $config ->set('verify_mail', TRUE) ->set('register', USER_REGISTER_VISITORS_ADMINISTRATIVE_APPROVAL) ->save(); // Set the site and notification email addresses. - $system = config('system.site'); + $system = \Drupal::config('system.site'); $server_address = $this->randomName() . '@example.com'; $notify_address = $this->randomName() . '@example.com'; $system diff --git a/core/modules/user/lib/Drupal/user/Tests/UserAutocompleteTest.php b/core/modules/user/lib/Drupal/user/Tests/UserAutocompleteTest.php index 46518f4688c8fb1d8a7c77262570caba397f1acd..e6fad9a9ee3affd4aa200b883fd6403f9c6e8eca 100644 --- a/core/modules/user/lib/Drupal/user/Tests/UserAutocompleteTest.php +++ b/core/modules/user/lib/Drupal/user/Tests/UserAutocompleteTest.php @@ -49,7 +49,7 @@ function testUserAutocomplete() { $this->assertRaw($this->unprivileged_user->getUsername(), 'User name found in autocompletion results.'); $anonymous_name = $this->randomString() . ''; - config('user.settings')->set('anonymous', $anonymous_name)->save(); + \Drupal::config('user.settings')->set('anonymous', $anonymous_name)->save(); // Test that anonymous username is in the result when requested and escaped // with check_plain(). $users = $this->drupalGetJSON('user/autocomplete/anonymous', array('query' => array('q' => drupal_substr($anonymous_name, 0, 4)))); diff --git a/core/modules/user/lib/Drupal/user/Tests/UserCancelTest.php b/core/modules/user/lib/Drupal/user/Tests/UserCancelTest.php index 42c2f7fd7fbdf114d6b801b3b2e903f4b3df6584..051499ecfc22036170792aa22b301cc4377e7bad 100644 --- a/core/modules/user/lib/Drupal/user/Tests/UserCancelTest.php +++ b/core/modules/user/lib/Drupal/user/Tests/UserCancelTest.php @@ -33,7 +33,7 @@ function setUp() { * Attempt to cancel account without permission. */ function testUserCancelWithoutPermission() { - config('user.settings')->set('cancel_method', 'user_cancel_reassign')->save(); + \Drupal::config('user.settings')->set('cancel_method', 'user_cancel_reassign')->save(); // Create a user. $account = $this->drupalCreateUser(array()); @@ -103,7 +103,7 @@ function testUserCancelUid1() { * Attempt invalid account cancellations. */ function testUserCancelInvalid() { - config('user.settings')->set('cancel_method', 'user_cancel_reassign')->save(); + \Drupal::config('user.settings')->set('cancel_method', 'user_cancel_reassign')->save(); // Create a user. $account = $this->drupalCreateUser(array('cancel account')); @@ -145,7 +145,7 @@ function testUserCancelInvalid() { * Disable account and keep all content. */ function testUserBlock() { - config('user.settings')->set('cancel_method', 'user_cancel_block')->save(); + \Drupal::config('user.settings')->set('cancel_method', 'user_cancel_block')->save(); // Create a user. $web_user = $this->drupalCreateUser(array('cancel account')); @@ -180,7 +180,7 @@ function testUserBlock() { * Disable account and unpublish all content. */ function testUserBlockUnpublish() { - config('user.settings')->set('cancel_method', 'user_cancel_block_unpublish')->save(); + \Drupal::config('user.settings')->set('cancel_method', 'user_cancel_block_unpublish')->save(); // Create a user. $account = $this->drupalCreateUser(array('cancel account')); @@ -224,7 +224,7 @@ function testUserBlockUnpublish() { * Delete account and anonymize all content. */ function testUserAnonymize() { - config('user.settings')->set('cancel_method', 'user_cancel_reassign')->save(); + \Drupal::config('user.settings')->set('cancel_method', 'user_cancel_reassign')->save(); // Create a user. $account = $this->drupalCreateUser(array('cancel account')); @@ -248,7 +248,7 @@ function testUserAnonymize() { $this->drupalGet('user/' . $account->id() . '/edit'); $this->drupalPost(NULL, NULL, t('Cancel account')); $this->assertText(t('Are you sure you want to cancel your account?'), 'Confirmation form to cancel account displayed.'); - $this->assertRaw(t('Your account will be removed and all account information deleted. All of your content will be assigned to the %anonymous-name user.', array('%anonymous-name' => config('user.settings')->get('anonymous'))), 'Informs that all content will be attributed to anonymous account.'); + $this->assertRaw(t('Your account will be removed and all account information deleted. All of your content will be assigned to the %anonymous-name user.', array('%anonymous-name' => \Drupal::config('user.settings')->get('anonymous'))), 'Informs that all content will be attributed to anonymous account.'); // Confirm account cancellation. $timestamp = time(); @@ -275,7 +275,7 @@ function testUserAnonymize() { * Delete account and remove all content. */ function testUserDelete() { - config('user.settings')->set('cancel_method', 'user_cancel_delete')->save(); + \Drupal::config('user.settings')->set('cancel_method', 'user_cancel_delete')->save(); module_enable(array('comment')); $this->resetAll(); @@ -339,7 +339,7 @@ function testUserDelete() { * Create an administrative user and delete another user. */ function testUserCancelByAdmin() { - config('user.settings')->set('cancel_method', 'user_cancel_reassign')->save(); + \Drupal::config('user.settings')->set('cancel_method', 'user_cancel_reassign')->save(); // Create a regular user. $account = $this->drupalCreateUser(array()); @@ -364,7 +364,7 @@ function testUserCancelByAdmin() { * Tests deletion of a user account without an e-mail address. */ function testUserWithoutEmailCancelByAdmin() { - config('user.settings')->set('cancel_method', 'user_cancel_reassign')->save(); + \Drupal::config('user.settings')->set('cancel_method', 'user_cancel_reassign')->save(); // Create a regular user. $account = $this->drupalCreateUser(array()); @@ -393,9 +393,9 @@ function testUserWithoutEmailCancelByAdmin() { */ function testMassUserCancelByAdmin() { module_enable(array('views')); - config('user.settings')->set('cancel_method', 'user_cancel_reassign')->save(); + \Drupal::config('user.settings')->set('cancel_method', 'user_cancel_reassign')->save(); // Enable account cancellation notification. - config('user.settings')->set('notify.status_canceled', TRUE)->save(); + \Drupal::config('user.settings')->set('notify.status_canceled', TRUE)->save(); // Create administrative user. $admin_user = $this->drupalCreateUser(array('administer users')); diff --git a/core/modules/user/lib/Drupal/user/Tests/UserCreateFailMailTest.php b/core/modules/user/lib/Drupal/user/Tests/UserCreateFailMailTest.php index eb37e527db43d9df5be987c51e07f5aa684082c6..be4fb7b869f2666a914aebe687ce3d61e2aae339 100644 --- a/core/modules/user/lib/Drupal/user/Tests/UserCreateFailMailTest.php +++ b/core/modules/user/lib/Drupal/user/Tests/UserCreateFailMailTest.php @@ -37,7 +37,7 @@ protected function testUserAdd() { $this->drupalLogin($user); // Replace the mail functionality with a fake, malfunctioning service. - config('system.mail')->set('interface.default', 'Drupal\system_mail_failure_test\TestPhpMailFailure')->save(); + \Drupal::config('system.mail')->set('interface.default', 'Drupal\system_mail_failure_test\TestPhpMailFailure')->save(); // Create a user, but fail to send an email. $name = $this->randomName(); $edit = array( diff --git a/core/modules/user/lib/Drupal/user/Tests/UserCreateTest.php b/core/modules/user/lib/Drupal/user/Tests/UserCreateTest.php index 1e1c8918e2f97943519e799f34950d202790713e..eaaf350a81cb569778e333580ad69e702d3a5861 100644 --- a/core/modules/user/lib/Drupal/user/Tests/UserCreateTest.php +++ b/core/modules/user/lib/Drupal/user/Tests/UserCreateTest.php @@ -80,7 +80,7 @@ protected function testUserAdd() { $this->assertFieldByXPath('//input[@type="radio" and @id="edit-status-1" and @checked="checked"]', NULL, 'Default setting for user status is active.'); // Test that the password strength indicator displays. - $config = config('user.settings'); + $config = \Drupal::config('user.settings'); $config->set('password_strength', TRUE)->save(); $this->drupalGet('admin/people/create'); diff --git a/core/modules/user/lib/Drupal/user/Tests/UserEditTest.php b/core/modules/user/lib/Drupal/user/Tests/UserEditTest.php index 0713df00b0b0e20944b5a1dc4b5a7a0479846926..548c0c77c8a389db663b6389cb8a5c30e26a5dad 100644 --- a/core/modules/user/lib/Drupal/user/Tests/UserEditTest.php +++ b/core/modules/user/lib/Drupal/user/Tests/UserEditTest.php @@ -78,7 +78,7 @@ function testUserEdit() { $this->drupalLogout(); // Test that the password strength indicator displays. - $config = config('user.settings'); + $config = \Drupal::config('user.settings'); $this->drupalLogin($user1); $config->set('password_strength', TRUE)->save(); diff --git a/core/modules/user/lib/Drupal/user/Tests/UserEditedOwnAccountTest.php b/core/modules/user/lib/Drupal/user/Tests/UserEditedOwnAccountTest.php index 6bdb9d096c05e4a62209bab177e29637847dd518..3647e696925536ae1dcd399d9d0bcd2f8722119d 100644 --- a/core/modules/user/lib/Drupal/user/Tests/UserEditedOwnAccountTest.php +++ b/core/modules/user/lib/Drupal/user/Tests/UserEditedOwnAccountTest.php @@ -25,7 +25,7 @@ public static function getInfo() { function testUserEditedOwnAccount() { // Change account setting 'Who can register accounts?' to Administrators // only. - config('user.settings')->set('register', USER_REGISTER_ADMINISTRATORS_ONLY)->save(); + \Drupal::config('user.settings')->set('register', USER_REGISTER_ADMINISTRATORS_ONLY)->save(); // Create a new user account and log in. $account = $this->drupalCreateUser(array('change own username')); diff --git a/core/modules/user/lib/Drupal/user/Tests/UserEntityCallbacksTest.php b/core/modules/user/lib/Drupal/user/Tests/UserEntityCallbacksTest.php index b367e2d627bc73131c1362c9f60d1f8357d0f798..76bf0e992f835c93202154fdd998ab80a951348f 100644 --- a/core/modules/user/lib/Drupal/user/Tests/UserEntityCallbacksTest.php +++ b/core/modules/user/lib/Drupal/user/Tests/UserEntityCallbacksTest.php @@ -44,7 +44,7 @@ function testLabelCallback() { // Setup a random anonymous name to be sure the name is used. $name = $this->randomName(); - config('user.settings')->set('anonymous', $name)->save(); + \Drupal::config('user.settings')->set('anonymous', $name)->save(); $this->assertEqual($this->anonymous->label(), $name, 'The variable anonymous should be used for name of uid 0'); } diff --git a/core/modules/user/lib/Drupal/user/Tests/UserLoginTest.php b/core/modules/user/lib/Drupal/user/Tests/UserLoginTest.php index 38b7abfc6add39fdd90b1c3072f05eaf4c8112c8..053e13d17ceb9979286545c3ee5720c319dc5550 100644 --- a/core/modules/user/lib/Drupal/user/Tests/UserLoginTest.php +++ b/core/modules/user/lib/Drupal/user/Tests/UserLoginTest.php @@ -26,7 +26,7 @@ public static function getInfo() { * Test the global login flood control. */ function testGlobalLoginFloodControl() { - config('user.flood') + \Drupal::config('user.flood') ->set('ip_limit', 10) // Set a high per-user limit out so that it is not relevant in the test. ->set('user_limit', 4000) @@ -63,7 +63,7 @@ function testGlobalLoginFloodControl() { * Test the per-user login flood control. */ function testPerUserLoginFloodControl() { - config('user.flood') + \Drupal::config('user.flood') // Set a high global limit out so that it is not relevant in the test. ->set('ip_limit', 4000) ->set('user_limit', 3) @@ -149,7 +149,7 @@ function assertFailedLogin($account, $flood_trigger = NULL) { $this->assertNoFieldByXPath("//input[@name='pass' and @value!='']", NULL, 'Password value attribute is blank.'); if (isset($flood_trigger)) { if ($flood_trigger == 'user') { - $this->assertRaw(format_plural(config('user.flood')->get('user_limit'), 'Sorry, there has been more than one failed login attempt for this account. It is temporarily blocked. Try again later or request a new password.', 'Sorry, there have been more than @count failed login attempts for this account. It is temporarily blocked. Try again later or request a new password.', array('@url' => url('user/password')))); + $this->assertRaw(format_plural(\Drupal::config('user.flood')->get('user_limit'), 'Sorry, there has been more than one failed login attempt for this account. It is temporarily blocked. Try again later or request a new password.', 'Sorry, there have been more than @count failed login attempts for this account. It is temporarily blocked. Try again later or request a new password.', array('@url' => url('user/password')))); } else { // No uid, so the limit is IP-based. diff --git a/core/modules/user/lib/Drupal/user/Tests/UserPasswordResetTest.php b/core/modules/user/lib/Drupal/user/Tests/UserPasswordResetTest.php index 97390c7bfc45018d42eb9358ec7ec3df9a7b5fd9..3a1190939847e401a9c6d84be5e50e3c33ae049d 100644 --- a/core/modules/user/lib/Drupal/user/Tests/UserPasswordResetTest.php +++ b/core/modules/user/lib/Drupal/user/Tests/UserPasswordResetTest.php @@ -68,7 +68,7 @@ function testUserPasswordReset() { // Verify that the user was sent an e-mail. $this->assertMail('to', $this->account->getEmail(), 'Password e-mail sent to user.'); - $subject = t('Replacement login information for @username at @site', array('@username' => $this->account->getUsername(), '@site' => config('system.site')->get('name'))); + $subject = t('Replacement login information for @username at @site', array('@username' => $this->account->getUsername(), '@site' => \Drupal::config('system.site')->get('name'))); $this->assertMail('subject', $subject, 'Password reset e-mail subject is correct.'); $resetURL = $this->getResetURL(); @@ -81,7 +81,7 @@ function testUserPasswordReset() { // Check successful login. $this->drupalPost(NULL, NULL, t('Log in')); $this->assertLink(t('Log out')); - $this->assertTitle(t('@name | @site', array('@name' => $this->account->getUsername(), '@site' => config('system.site')->get('name'))), 'Logged in using password reset link.'); + $this->assertTitle(t('@name | @site', array('@name' => $this->account->getUsername(), '@site' => \Drupal::config('system.site')->get('name'))), 'Logged in using password reset link.'); // Log out, and try to log in again using the same one-time link. $this->drupalLogout(); @@ -97,7 +97,7 @@ function testUserPasswordReset() { $this->assertTrue( count($this->drupalGetMails(array('id' => 'user_password_reset'))) === $before + 1, 'E-mail sent when requesting password reset using e-mail address.'); // Create a password reset link as if the request time was 60 seconds older than the allowed limit. - $timeout = config('user.settings')->get('password_reset_timeout'); + $timeout = \Drupal::config('user.settings')->get('password_reset_timeout'); $bogus_timestamp = REQUEST_TIME - $timeout - 60; $_uid = $this->account->id(); $this->drupalGet("user/reset/$_uid/$bogus_timestamp/" . user_pass_rehash($this->account->getPassword(), $bogus_timestamp, $this->account->getLastLoginTime())); diff --git a/core/modules/user/lib/Drupal/user/Tests/UserRegistrationTest.php b/core/modules/user/lib/Drupal/user/Tests/UserRegistrationTest.php index deb1175cac882e8c4d2c859f8b3a695cd259c6a2..ec86be26bc3192b4205ff772aa3448a9c76fd374 100644 --- a/core/modules/user/lib/Drupal/user/Tests/UserRegistrationTest.php +++ b/core/modules/user/lib/Drupal/user/Tests/UserRegistrationTest.php @@ -28,7 +28,7 @@ public static function getInfo() { } function testRegistrationWithEmailVerification() { - $config = config('user.settings'); + $config = \Drupal::config('user.settings'); // Require e-mail verification. $config->set('verify_mail', TRUE)->save(); @@ -61,7 +61,7 @@ function testRegistrationWithEmailVerification() { } function testRegistrationWithoutEmailVerification() { - $config = config('user.settings'); + $config = \Drupal::config('user.settings'); // Don't require e-mail verification and allow registration by site visitors // without administrator approval. $config @@ -126,7 +126,7 @@ function testRegistrationWithoutEmailVerification() { function testRegistrationEmailDuplicates() { // Don't require e-mail verification and allow registration by site visitors // without administrator approval. - config('user.settings') + \Drupal::config('user.settings') ->set('verify_mail', FALSE) ->set('register', USER_REGISTER_VISITORS) ->save(); @@ -152,13 +152,13 @@ function testRegistrationEmailDuplicates() { function testRegistrationDefaultValues() { // Don't require e-mail verification and allow registration by site visitors // without administrator approval. - $config_user_settings = config('user.settings') + $config_user_settings = \Drupal::config('user.settings') ->set('verify_mail', FALSE) ->set('register', USER_REGISTER_VISITORS) ->save(); // Set the default timezone to Brussels. - $config_system_date = config('system.date') + $config_system_date = \Drupal::config('system.date') ->set('timezone.user.configurable', 1) ->set('timezone.default', 'Europe/Brussels') ->save(); diff --git a/core/modules/user/lib/Drupal/user/Tests/UserSignatureTest.php b/core/modules/user/lib/Drupal/user/Tests/UserSignatureTest.php index c85922678eb3a770fe36102f5ead6c23690968bf..fe74aa13fb7970b0b37deaa0ccc54d25b5da745c 100644 --- a/core/modules/user/lib/Drupal/user/Tests/UserSignatureTest.php +++ b/core/modules/user/lib/Drupal/user/Tests/UserSignatureTest.php @@ -34,7 +34,7 @@ function setUp() { parent::setUp(); // Enable user signatures. - config('user.settings')->set('signatures', 1)->save(); + \Drupal::config('user.settings')->set('signatures', 1)->save(); // Create Basic page node type. $this->drupalCreateContentType(array('type' => 'page', 'name' => 'Basic page')); diff --git a/core/modules/user/lib/Drupal/user/Tests/UserTimeZoneTest.php b/core/modules/user/lib/Drupal/user/Tests/UserTimeZoneTest.php index 4c95efdd8537d003f881b6edea5c1b62cb2cd74b..8189fcb1c1eb6b2751d80d7b9ff18bc7eceedd02 100644 --- a/core/modules/user/lib/Drupal/user/Tests/UserTimeZoneTest.php +++ b/core/modules/user/lib/Drupal/user/Tests/UserTimeZoneTest.php @@ -26,7 +26,7 @@ public static function getInfo() { */ function testUserTimeZone() { // Setup date/time settings for Los Angeles time. - config('system.date') + \Drupal::config('system.date') ->set('timezone.user.configurable', 1) ->set('timezone.default', 'America/Los_Angeles') ->save(); diff --git a/core/modules/user/lib/Drupal/user/Tests/Views/BulkFormTest.php b/core/modules/user/lib/Drupal/user/Tests/Views/BulkFormTest.php index d2d42fcb91a2ac3f41110c01f5932e754106018c..68e8b4743439fe75c812867ffc79afd90e3f3bac 100644 --- a/core/modules/user/lib/Drupal/user/Tests/Views/BulkFormTest.php +++ b/core/modules/user/lib/Drupal/user/Tests/Views/BulkFormTest.php @@ -89,7 +89,7 @@ public function testBulkForm() { // Ensure the anonymous user is found. $this->drupalGet('test-user-bulk-form'); - $this->assertText(config('user.settings')->get('anonymous')); + $this->assertText(\Drupal::config('user.settings')->get('anonymous')); // Attempt to block the anonymous user. $edit = array( diff --git a/core/modules/user/lib/Drupal/user/Tests/Views/HandlerFieldUserNameTest.php b/core/modules/user/lib/Drupal/user/Tests/Views/HandlerFieldUserNameTest.php index 4a41b43ad9d8b23e37fc51de838c1db289b92484..99659a7a1ffd50c3f382f3862a0bd255f26036ac 100644 --- a/core/modules/user/lib/Drupal/user/Tests/Views/HandlerFieldUserNameTest.php +++ b/core/modules/user/lib/Drupal/user/Tests/Views/HandlerFieldUserNameTest.php @@ -49,7 +49,7 @@ public function testUserName() { $this->assertIdentical($render, $username, 'If the user is not linked the username should be printed out for a normal user.'); $view->result[0]->uid = 0; - $anon_name = config('user.settings')->get('anonymous'); + $anon_name = \Drupal::config('user.settings')->get('anonymous'); $view->result[0]->users_name = ''; $render = $view->field['name']->advancedRender($view->result[0]); $this->assertIdentical($render, $anon_name , 'For user0 it should use the default anonymous name by default.'); diff --git a/core/modules/user/user.api.php b/core/modules/user/user.api.php index d83832c39956cfa4dc859dbbc134d81226c17e63..07ba0eb374076b659f4485588555a1e93c523f66 100644 --- a/core/modules/user/user.api.php +++ b/core/modules/user/user.api.php @@ -284,7 +284,7 @@ function hook_user_update($account) { * The user object on which the operation was just performed. */ function hook_user_login($account) { - $config = config('system.date'); + $config = Drupal::config('system.date'); // If the user has a NULL time zone, notify them to set a time zone. if (!$account->getTimezone() && $config->get('timezone.user.configurable') && $config->get('timezone.user.warn')) { drupal_set_message(t('Configure your account time zone setting.', array('@user-edit' => url("user/" . $account->id() . "/edit", array('query' => drupal_get_destination(), 'fragment' => 'edit-timezone'))))); diff --git a/core/modules/user/user.install b/core/modules/user/user.install index 62eb4a93c1a059827a7e0b7d4a4aecfa966c8aab..4a48efbb2211a844d17ac2f22dec5f29e65b7cc3 100644 --- a/core/modules/user/user.install +++ b/core/modules/user/user.install @@ -494,7 +494,7 @@ function user_update_8004() { '2' => 'visitors_admin_approval', ); - $config = config('user.settings'); + $config = Drupal::config('user.settings'); $user_register = $config->get('register'); $user_cancel_method = $config->get('cancel_method'); @@ -1026,7 +1026,7 @@ function user_update_8017() { ->fetchAll(); foreach ($roles as $role) { - config('user.role.' . $role->rid) + Drupal::config('user.role.' . $role->rid) ->set('id', $role->rid) ->set('uuid', $uuid->generate()) ->set('label', $role->name) @@ -1109,7 +1109,7 @@ function user_update_8019() { } } foreach ($new_permissions as $rid => $permissions) { - config("user.role.$rid") + Drupal::config("user.role.$rid") ->set('permissions', $permissions) ->save(); } @@ -1121,7 +1121,7 @@ function user_update_8019() { function user_update_8020() { $uuid = new Uuid(); - config("entity.form_mode.user.register") + Drupal::config("entity.form_mode.user.register") ->set('id', "user.register") ->set('uuid', $uuid->generate()) ->set('label', 'Register') diff --git a/core/modules/user/user.module b/core/modules/user/user.module index 0a8d4ab91570c7d22877d64a7e8a099f18edd17f..2c0e2d39635274ac6e8d39b989cb41bdedec6240 100644 --- a/core/modules/user/user.module +++ b/core/modules/user/user.module @@ -204,7 +204,7 @@ function user_field_extra_fields() { 'description' => t('User module account form elements.'), 'weight' => -10, ); - if (config('user.settings')->get('signatures')) { + if (Drupal::config('user.settings')->get('signatures')) { $fields['user']['user']['form']['signature_settings'] = array( 'label' => t('Signature settings'), 'description' => t('User module form element.'), @@ -216,7 +216,7 @@ function user_field_extra_fields() { 'description' => t('User module form element.'), 'weight' => 0, ); - if (config('system.date')->get('timezone.user.configurable')) { + if (Drupal::config('system.date')->get('timezone.user.configurable')) { $fields['user']['user']['form']['timezone'] = array( 'label' => t('Timezone'), 'description' => t('System module form element.'), @@ -491,7 +491,7 @@ function user_permission() { ), 'cancel account' => array( 'title' => t('Cancel own user account'), - 'description' => t('Note: content may be kept, unpublished, deleted or transferred to the %anonymous-name user depending on the configured user settings.', array('%anonymous-name' => config('user.settings')->get('anonymous'), '@user-settings-url' => url('admin/config/people/accounts'))), + 'description' => t('Note: content may be kept, unpublished, deleted or transferred to the %anonymous-name user depending on the configured user settings.', array('%anonymous-name' => Drupal::config('user.settings')->get('anonymous'), '@user-settings-url' => url('admin/config/people/accounts'))), ), 'select account cancellation method' => array( 'title' => t('Select method for cancelling own account'), @@ -780,7 +780,7 @@ function user_is_logged_in() { * TRUE if the user is not already logged in and can register for an account. */ function user_register_access() { - return user_is_anonymous() && (config('user.settings')->get('register') != USER_REGISTER_ADMINISTRATORS_ONLY); + return user_is_anonymous() && (Drupal::config('user.settings')->get('register') != USER_REGISTER_ADMINISTRATORS_ONLY); } /** @@ -1463,7 +1463,7 @@ function user_mail($key, &$message, $params) { // the locale module is enabled. $user_config_context = config_context_enter('Drupal\user\UserConfigContext'); $user_config_context->setAccount($params['account']); - $mail_config = config('user.mail'); + $mail_config = Drupal::config('user.mail'); // We do not sanitize the token replacement, since the output of this // replacement is intended for an e-mail message, not a web browser. @@ -1777,7 +1777,7 @@ function user_multiple_cancel_confirm($form, &$form_state) { '#type' => 'checkbox', '#title' => t('Notify user when account is canceled.'), '#default_value' => FALSE, - '#access' => config('user.settings')->get('notify.status_canceled'), + '#access' => Drupal::config('user.settings')->get('notify.status_canceled'), '#description' => t('When enabled, the user will receive an e-mail notification after the account has been cancelled.'), ); @@ -1877,17 +1877,17 @@ function theme_user_signature($variables) { */ function _user_mail_notify($op, $account, $langcode = NULL) { // By default, we always notify except for canceled and blocked. - $notify = config('user.settings')->get('notify.' . $op); + $notify = Drupal::config('user.settings')->get('notify.' . $op); if ($notify || ($op != 'status_canceled' && $op != 'status_blocked')) { $params['account'] = $account; $langcode = $langcode ? $langcode : $account->getPreferredLangcode(); // Get the custom site notification email to use as the from email address // if it has been set. - $site_mail = config('system.site')->get('mail_notification'); + $site_mail = Drupal::config('system.site')->get('mail_notification'); // If the custom site notification email has not been set, we use the site // default for this. if (empty($site_mail)) { - $site_mail = config('system.site')->get('mail'); + $site_mail = Drupal::config('system.site')->get('mail'); } if (empty($site_mail)) { $site_mail = ini_get('sendmail_from'); @@ -1919,7 +1919,7 @@ function user_form_process_password_confirm($element) { 'showStrengthIndicator' => FALSE, ); - if (config('user.settings')->get('password_strength')) { + if (Drupal::config('user.settings')->get('password_strength')) { global $user; $password_settings['showStrengthIndicator'] = TRUE; @@ -1983,7 +1983,7 @@ function user_node_load($nodes, $types) { */ function user_modules_installed($modules) { // Assign all available permissions to the administrator role. - $rid = config('user.settings')->get('admin_role'); + $rid = Drupal::config('user.settings')->get('admin_role'); if ($rid) { $permissions = array(); foreach ($modules as $module) { diff --git a/core/modules/user/user.pages.inc b/core/modules/user/user.pages.inc index 33e259330d5c08820a40b89836bca86e8e699f2b..2aa9b887d184a246f44c98a20bfc0064dca9fceb 100644 --- a/core/modules/user/user.pages.inc +++ b/core/modules/user/user.pages.inc @@ -39,7 +39,7 @@ function user_pass_reset($form, &$form_state, $uid, $timestamp, $hashed_pass, $a } else { // Time out, in seconds, until login URL expires. - $timeout = config('user.settings')->get('password_reset_timeout'); + $timeout = Drupal::config('user.settings')->get('password_reset_timeout'); $current = REQUEST_TIME; $account = user_load($uid); // Verify that the user exists and is active. @@ -166,7 +166,7 @@ function user_cancel_confirm_form($form, &$form_state, $account) { '#description' => t('When enabled, the user must confirm the account cancellation via e-mail.'), ); // Also allow to send account canceled notification mail, if enabled. - $default_notify = config('user.settings')->get('notify.status_canceled'); + $default_notify = Drupal::config('user.settings')->get('notify.status_canceled'); $form['user_cancel_notify'] = array( '#type' => 'checkbox', '#title' => t('Notify user when account is canceled.'), @@ -182,7 +182,7 @@ function user_cancel_confirm_form($form, &$form_state, $account) { else { $question = t('Are you sure you want to cancel the account %name?', array('%name' => $account->getUsername())); } - $default_method = config('user.settings')->get('cancel_method'); + $default_method = Drupal::config('user.settings')->get('cancel_method'); $description = NULL; if ($can_select_method) { $description = t('Select the method to cancel the account above.'); @@ -248,7 +248,7 @@ function user_cancel_confirm_form_submit($form, &$form_state) { * @see user_multiple_cancel_confirm() */ function user_cancel_methods() { - $anonymous_name = config('user.settings')->get('anonymous'); + $anonymous_name = Drupal::config('user.settings')->get('anonymous'); $methods = array( 'user_cancel_block' => array( 'title' => t('Disable the account and keep its content.'), @@ -272,7 +272,7 @@ function user_cancel_methods() { drupal_alter('user_cancel_methods', $methods); // Turn all methods into real form elements. - $default_method = config('user.settings')->get('cancel_method'); + $default_method = Drupal::config('user.settings')->get('cancel_method'); $form = array( '#options' => array(), '#default_value' => $default_method, @@ -309,7 +309,7 @@ function user_cancel_confirm($account, $timestamp = 0, $hashed_pass = '') { // Validate expiration and hashed password/login. if ($timestamp <= $current && $current - $timestamp < $timeout && $account->id() && $timestamp >= $account->getLastLoginTime() && $hashed_pass == user_pass_rehash($account->getPassword(), $timestamp, $account->getLastLoginTime())) { $edit = array( - 'user_cancel_notify' => isset($account_data['cancel_notify']) ? $account_data['cancel_notify'] : config('user.settings')->get('notify.status_canceled'), + 'user_cancel_notify' => isset($account_data['cancel_notify']) ? $account_data['cancel_notify'] : Drupal::config('user.settings')->get('notify.status_canceled'), ); user_cancel($edit, $account->id(), $account_data['cancel_method']); // Since user_cancel() is not invoked via Form API, batch processing needs diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php index 4d042430606e614a06c22bdabe240fdc168f3093..c5836f93dc67a6df7dc310471599357cb4dd75fb 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php @@ -1745,7 +1745,7 @@ public function buildOptionsForm(&$form, &$form_state) { $this->theme = $theme; } elseif (empty($this->theme)) { - $this->theme = config('system.theme')->get('default'); + $this->theme = \Drupal::config('system.theme')->get('default'); } if (isset($GLOBALS['theme']) && $GLOBALS['theme'] == $this->theme) { diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/display/Embed.php b/core/modules/views/lib/Drupal/views/Plugin/views/display/Embed.php index b0049634d1fd3aee2122c06cea3afe62bebac0cd..ccb01917c6e1aa0fd66224a29e74bbf9f1d05157 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/display/Embed.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/display/Embed.php @@ -16,7 +16,7 @@ * @ingroup views_display_plugins * * @todo: Wait until annotations/plugins support access mehtods. - * no_ui => !config('views.settings')->get('ui.show.display_embed'), + * no_ui => !\Drupal::config('views.settings')->get('ui.show.display_embed'), * * @Plugin( * id = "embed", diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/field/FieldPluginBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/field/FieldPluginBase.php index 6fda24b6f0cb91617a2f8d164720e1d4758dea75..f37284f8ffac73018d5191a0207d0e823fea093a 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/field/FieldPluginBase.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/field/FieldPluginBase.php @@ -279,7 +279,7 @@ public function getElements() { '' => t(' - Use default -'), '0' => t('- None -') ); - $elements += config('views.settings')->get('field_rewrite_elements'); + $elements += \Drupal::config('views.settings')->get('field_rewrite_elements'); } return $elements; diff --git a/core/modules/views/lib/Drupal/views/Tests/Handler/HandlerTest.php b/core/modules/views/lib/Drupal/views/Tests/Handler/HandlerTest.php index 293125d1555880e3b151a03e46591ad47c245f76..03a2b7f165c4689da5ddd0e963e04e099a901a42 100644 --- a/core/modules/views/lib/Drupal/views/Tests/Handler/HandlerTest.php +++ b/core/modules/views/lib/Drupal/views/Tests/Handler/HandlerTest.php @@ -355,8 +355,8 @@ public function testAccess() { $views_data = $views_data['views_test_data']; // Enable access to callback only field and deny for callback + arguments. - config('views_test_data.tests')->set('handler_access_callback', TRUE)->save(); - config('views_test_data.tests')->set('handler_access_callback_argument', FALSE)->save(); + \Drupal::config('views_test_data.tests')->set('handler_access_callback', TRUE)->save(); + \Drupal::config('views_test_data.tests')->set('handler_access_callback_argument', FALSE)->save(); $view->initDisplay(); $view->initHandlers(); @@ -368,8 +368,8 @@ public function testAccess() { } // Enable access to the callback + argument handlers and deny for callback. - config('views_test_data.tests')->set('handler_access_callback', FALSE)->save(); - config('views_test_data.tests')->set('handler_access_callback_argument', TRUE)->save(); + \Drupal::config('views_test_data.tests')->set('handler_access_callback', FALSE)->save(); + \Drupal::config('views_test_data.tests')->set('handler_access_callback_argument', TRUE)->save(); $view->destroy(); $view->initDisplay(); $view->initHandlers(); diff --git a/core/modules/views/lib/Drupal/views/Tests/Plugin/DisplayExtenderTest.php b/core/modules/views/lib/Drupal/views/Tests/Plugin/DisplayExtenderTest.php index 5d9e69cfab75df9923ca296e7c60a75d95acb652..eeb59144a597ea6d288e63e86097745690b4caa7 100644 --- a/core/modules/views/lib/Drupal/views/Tests/Plugin/DisplayExtenderTest.php +++ b/core/modules/views/lib/Drupal/views/Tests/Plugin/DisplayExtenderTest.php @@ -41,7 +41,7 @@ protected function setUp() { * Test display extenders. */ public function testDisplayExtenders() { - config('views.settings')->set('display_extenders', array('display_extender_test'))->save(); + \Drupal::config('views.settings')->set('display_extenders', array('display_extender_test'))->save(); $this->assertEqual(count(views_get_enabled_display_extenders()), 1, 'Make sure that there is only one enabled display extender.'); $view = views_get_view('test_view'); diff --git a/core/modules/views/lib/Drupal/views/Tests/Plugin/DisplayTest.php b/core/modules/views/lib/Drupal/views/Tests/Plugin/DisplayTest.php index 272868c2aefcbf718b723fcdca4984a1a0a1c7ab..a106d38341fed89051b1d0f8368c23734171ebf3 100644 --- a/core/modules/views/lib/Drupal/views/Tests/Plugin/DisplayTest.php +++ b/core/modules/views/lib/Drupal/views/Tests/Plugin/DisplayTest.php @@ -234,7 +234,7 @@ public function testInvalidDisplayPlugins() { // Change the page plugin id to an invalid one. Bypass the entity system // so no menu rebuild was executed (so the path is still available). - $config = config('views.view.test_display_invalid'); + $config = \Drupal::config('views.view.test_display_invalid'); $config->set('display.page_1.display_plugin', 'invalid'); $config->save(); @@ -249,7 +249,7 @@ public function testInvalidDisplayPlugins() { $this->assertResponse(404); // Change the display plugin ID back to the correct ID. - $config = config('views.view.test_display_invalid'); + $config = \Drupal::config('views.view.test_display_invalid'); $config->set('display.page_1.display_plugin', 'page'); $config->save(); @@ -261,7 +261,7 @@ public function testInvalidDisplayPlugins() { $this->assertBlockAppears($block); // Change the block plugin ID to an invalid one. - $config = config('views.view.test_display_invalid'); + $config = \Drupal::config('views.view.test_display_invalid'); $config->set('display.block_1.display_plugin', 'invalid'); $config->save(); diff --git a/core/modules/views/lib/Drupal/views/Tests/ViewStorageTest.php b/core/modules/views/lib/Drupal/views/Tests/ViewStorageTest.php index 2ef4b0d2d9e8649558f89ada9f60b3e889fcb2ae..4a696c30fc89b5a66d275a06e3d98df1c73b0040 100644 --- a/core/modules/views/lib/Drupal/views/Tests/ViewStorageTest.php +++ b/core/modules/views/lib/Drupal/views/Tests/ViewStorageTest.php @@ -95,7 +95,7 @@ function testConfigurationEntityCRUD() { */ protected function loadTests() { $view = entity_load('view', 'test_view_storage'); - $data = config('views.view.test_view_storage')->get(); + $data = \Drupal::config('views.view.test_view_storage')->get(); // Confirm that an actual view object is loaded and that it returns all of // expected properties. @@ -140,7 +140,7 @@ protected function createTests() { } // Create a new View instance with config values. - $values = config('views.view.test_view_storage')->get(); + $values = \Drupal::config('views.view.test_view_storage')->get(); $created = $this->controller->create($values); $this->assertTrue($created instanceof View, 'Created object is a View.'); @@ -183,7 +183,7 @@ protected function displayTests() { $view = $view->createDuplicate(); $view->set('id', 'test_view_storage_new_new2'); $view->save(); - $values = config('views.view.test_view_storage_new_new2')->get(); + $values = \Drupal::config('views.view.test_view_storage_new_new2')->get(); $this->assertTrue(isset($values['display']['test']) && is_array($values['display']['test']), 'New display was saved.'); } diff --git a/core/modules/views/lib/Drupal/views/Tests/Wizard/BasicTest.php b/core/modules/views/lib/Drupal/views/Tests/Wizard/BasicTest.php index 8f3f4eb2683368419e5a58d1d6a678689fe7631e..cefd1dd3dba11c91bb17c1aa87c69d7f579cb7e4 100644 --- a/core/modules/views/lib/Drupal/views/Tests/Wizard/BasicTest.php +++ b/core/modules/views/lib/Drupal/views/Tests/Wizard/BasicTest.php @@ -122,7 +122,7 @@ function testViewsWizardAndListing() { $this->assertLinkByHref(url($view3['page[path]'])); // Confirm that the block is available in the block administration UI. - $this->drupalGet('admin/structure/block/list/' . config('system.theme')->get('default') . '/add'); + $this->drupalGet('admin/structure/block/list/' . \Drupal::config('system.theme')->get('default') . '/add'); $this->assertText('View: ' . $view3['label']); // Place the block. diff --git a/core/modules/views/lib/Drupal/views/Tests/Wizard/ItemsPerPageTest.php b/core/modules/views/lib/Drupal/views/Tests/Wizard/ItemsPerPageTest.php index 485f048c13637dfe99ffeef73e140f5cdbd272f1..d6136989f40a07b0dc6cbd123cf4c923243487d9 100644 --- a/core/modules/views/lib/Drupal/views/Tests/Wizard/ItemsPerPageTest.php +++ b/core/modules/views/lib/Drupal/views/Tests/Wizard/ItemsPerPageTest.php @@ -75,7 +75,7 @@ function testItemsPerPage() { $this->assertTrue($pos5 < $pos4 && $pos4 < $pos3 && $pos3 < $pos2, 'The nodes appear in the expected order in the page display.'); // Confirm that the block is listed in the block administration UI. - $this->drupalGet('admin/structure/block/list/' . config('system.theme')->get('default') . '/add'); + $this->drupalGet('admin/structure/block/list/' . \Drupal::config('system.theme')->get('default') . '/add'); $this->assertText('View: ' . $view['label']); // Place the block, visit a page that displays the block, and check that the diff --git a/core/modules/views/lib/Drupal/views/ViewExecutable.php b/core/modules/views/lib/Drupal/views/ViewExecutable.php index b1519a9d34638947e1ac54b33ef819962067bf05..21c95fbe12098f0df8d3d849269ac8b0c7bf53b2 100644 --- a/core/modules/views/lib/Drupal/views/ViewExecutable.php +++ b/core/modules/views/lib/Drupal/views/ViewExecutable.php @@ -1127,7 +1127,7 @@ public function build($display_id = NULL) { $exposed_form->query(); } - if (config('views.settings')->get('sql_signature')) { + if (\Drupal::config('views.settings')->get('sql_signature')) { $this->query->addSignature($this); } @@ -1278,7 +1278,7 @@ public function render($display_id = NULL) { } drupal_theme_initialize(); - $config = config('views.settings'); + $config = \Drupal::config('views.settings'); $exposed_form = $this->display_handler->getPlugin('exposed_form'); $exposed_form->preRender($this->result); @@ -1714,7 +1714,7 @@ public function getBreadcrumb($set = FALSE) { foreach ($this->build_info['breadcrumb'] as $path => $title) { // Check to see if the frontpage is in the breadcrumb trail; if it // is, we'll remove that from the actual breadcrumb later. - if ($path == config('system.site')->get('page.front')) { + if ($path == \Drupal::config('system.site')->get('page.front')) { $base = FALSE; $title = t('Home'); } diff --git a/core/modules/views/tests/modules/views_test_data/views_test_data.install b/core/modules/views/tests/modules/views_test_data/views_test_data.install index 6b1a868d4c032d45d65eaeb23675464dfc86b052..f01f4102736a86d69c9bf44ffb9ed61a4230c4be 100644 --- a/core/modules/views/tests/modules/views_test_data/views_test_data.install +++ b/core/modules/views/tests/modules/views_test_data/views_test_data.install @@ -31,5 +31,5 @@ function views_test_data_install() { 'em' => 'EM', 'marquee' => 'MARQUEE' ); - config('views.settings')->set('field_rewrite_elements', $values)->save(); + Drupal::config('views.settings')->set('field_rewrite_elements', $values)->save(); } diff --git a/core/modules/views/tests/modules/views_test_data/views_test_data.module b/core/modules/views/tests/modules/views_test_data/views_test_data.module index b00f8e8e393a89cf9a2e0d6c7026b4ea519b4535..e5dc45ea6652bb4a1349cea5e41bcaf54129c908 100644 --- a/core/modules/views/tests/modules/views_test_data/views_test_data.module +++ b/core/modules/views/tests/modules/views_test_data/views_test_data.module @@ -29,7 +29,7 @@ function views_test_data_permission() { * @see Drupal\views\Tests\Handler\HandlerTest */ function views_test_data_handler_test_access_callback() { - return config('views_test_data.tests')->get('handler_access_callback'); + return Drupal::config('views_test_data.tests')->get('handler_access_callback'); } /** @@ -48,7 +48,7 @@ function views_test_data_handler_test_access_callback_argument($argument = FALSE // Check the argument to be sure that access arguments are passed into the // callback. if ($argument) { - return config('views_test_data.tests')->get('handler_access_callback_argument'); + return Drupal::config('views_test_data.tests')->get('handler_access_callback_argument'); } else { return FALSE; diff --git a/core/modules/views/views.module b/core/modules/views/views.module index c7c2b3129b6b9bd76202050943542680c4c56494..cbb04b26952cbc5c29fa2265add3f3df5f67750b 100644 --- a/core/modules/views/views.module +++ b/core/modules/views/views.module @@ -890,7 +890,7 @@ function views_get_plugin_definitions() { * Get enabled display extenders. */ function views_get_enabled_display_extenders() { - $enabled = array_filter((array) config('views.settings')->get('display_extenders')); + $enabled = array_filter((array) Drupal::config('views.settings')->get('display_extenders')); return drupal_map_assoc($enabled); } @@ -1663,7 +1663,7 @@ function views_element_validate_tags($element, &$form_state) { * If TRUE, the data will be cached specific to the currently active language. */ function views_cache_set($cid, $data, $use_language = FALSE) { - if (config('views.settings')->get('skip_cache')) { + if (Drupal::config('views.settings')->get('skip_cache')) { return; } if ($use_language) { @@ -1687,7 +1687,7 @@ function views_cache_set($cid, $data, $use_language = FALSE) { * The cache or FALSE on failure. */ function views_cache_get($cid, $use_language = FALSE) { - if (config('views.settings')->get('skip_cache')) { + if (Drupal::config('views.settings')->get('skip_cache')) { return FALSE; } if ($use_language) { diff --git a/core/modules/views/views.theme.inc b/core/modules/views/views.theme.inc index a005b39632182301cfb8cd38765d93869d91ebc5..69e8b362a4eb58df8605534fc159a6b3d7f506ae 100644 --- a/core/modules/views/views.theme.inc +++ b/core/modules/views/views.theme.inc @@ -965,7 +965,7 @@ function template_preprocess_views_view_rss(&$variables) { $style = $view->style_plugin; - $config = config('system.site'); + $config = Drupal::config('system.site'); // The RSS 2.0 "spec" doesn't indicate HTML can be used in the description. // We strip all HTML tags, but need to prevent double encoding from properly diff --git a/core/modules/views_ui/lib/Drupal/views_ui/Tests/DefaultViewsTest.php b/core/modules/views_ui/lib/Drupal/views_ui/Tests/DefaultViewsTest.php index ed147ab9f9fbe7711a75fac6de4f2434ed8c1071..92ee4b4687db44b65df1302df9c9d7ef71a0241c 100644 --- a/core/modules/views_ui/lib/Drupal/views_ui/Tests/DefaultViewsTest.php +++ b/core/modules/views_ui/lib/Drupal/views_ui/Tests/DefaultViewsTest.php @@ -86,7 +86,7 @@ function testDefaultViews() { $edit = array( 'id' => 'clone_of_glossary', ); - $this->assertTitle(t('Clone of @label | @site-name', array('@label' => 'Glossary', '@site-name' => config('system.site')->get('name')))); + $this->assertTitle(t('Clone of @label | @site-name', array('@label' => 'Glossary', '@site-name' => \Drupal::config('system.site')->get('name')))); $this->drupalPost(NULL, $edit, t('Clone')); $this->assertUrl('admin/structure/views/view/clone_of_glossary', array(), 'The normal cloning name schema is applied.'); diff --git a/core/modules/views_ui/lib/Drupal/views_ui/Tests/DisplayExtenderUITest.php b/core/modules/views_ui/lib/Drupal/views_ui/Tests/DisplayExtenderUITest.php index 85e23b9094e2f20adbfd1798e16aeb6d21ab78e9..c04f8a55e9fb674db3f136b50227db70a37c7e38 100644 --- a/core/modules/views_ui/lib/Drupal/views_ui/Tests/DisplayExtenderUITest.php +++ b/core/modules/views_ui/lib/Drupal/views_ui/Tests/DisplayExtenderUITest.php @@ -31,7 +31,7 @@ public static function getInfo() { * Tests the display extender UI. */ public function testDisplayExtenderUI() { - config('views.settings')->set('display_extenders', array('display_extender_test'))->save(); + \Drupal::config('views.settings')->set('display_extenders', array('display_extender_test'))->save(); $view = views_get_view('test_view'); $view_edit_url = "admin/structure/views/view/{$view->storage->id()}/edit"; diff --git a/core/modules/views_ui/lib/Drupal/views_ui/Tests/DisplayTest.php b/core/modules/views_ui/lib/Drupal/views_ui/Tests/DisplayTest.php index 11bc5e3dd465160ff5b2dd06ef2cc60fba28ad36..7d827f9d21f37ec7e34d8b74f6a5f0d5b6617646 100644 --- a/core/modules/views_ui/lib/Drupal/views_ui/Tests/DisplayTest.php +++ b/core/modules/views_ui/lib/Drupal/views_ui/Tests/DisplayTest.php @@ -96,7 +96,7 @@ public function testRemoveDisplay() { */ public function testAddDisplay() { // Show the master display. - config('views.settings')->set('ui.show.master_display', TRUE)->save(); + \Drupal::config('views.settings')->set('ui.show.master_display', TRUE)->save(); $settings['page[create]'] = FALSE; $view = $this->randomView($settings); @@ -234,7 +234,7 @@ public function testDisplayPluginsAlter() { */ public function testDisplayAreas() { // Show the advanced column. - config('views.settings')->set('ui.show.advanced_column', TRUE)->save(); + \Drupal::config('views.settings')->set('ui.show.advanced_column', TRUE)->save(); // Add a new data display to the view. $view = views_get_view('test_display'); diff --git a/core/modules/views_ui/lib/Drupal/views_ui/Tests/OverrideDisplaysTest.php b/core/modules/views_ui/lib/Drupal/views_ui/Tests/OverrideDisplaysTest.php index 1dab1f66a97b0cc683a81876d8c38bc99265d3bb..87e52e17f1e237a4c205e22bf55f2741ac99b050 100644 --- a/core/modules/views_ui/lib/Drupal/views_ui/Tests/OverrideDisplaysTest.php +++ b/core/modules/views_ui/lib/Drupal/views_ui/Tests/OverrideDisplaysTest.php @@ -54,7 +54,7 @@ function testOverrideDisplays() { $this->assertText($original_title); // Confirm that the view block is available in the block administration UI. - $this->drupalGet('admin/structure/block/list/' . config('system.theme')->get('default') . '/add'); + $this->drupalGet('admin/structure/block/list/' . \Drupal::config('system.theme')->get('default') . '/add'); $this->assertText('View: ' . $view['label']); // Place the block. @@ -112,7 +112,7 @@ function testWizardMixedDefaultOverriddenDisplays() { $this->assertNoText($view['block[title]']); // Confirm that the block is available in the block administration UI. - $this->drupalGet('admin/structure/block/list/' . config('system.theme')->get('default') . '/add'); + $this->drupalGet('admin/structure/block/list/' . \Drupal::config('system.theme')->get('default') . '/add'); $this->assertText('View: ' . $view['label']); // Put the block into the first sidebar region, and make sure it will not diff --git a/core/modules/views_ui/lib/Drupal/views_ui/ViewEditFormController.php b/core/modules/views_ui/lib/Drupal/views_ui/ViewEditFormController.php index 7fa64d67a0bc72a0fd9e806ea4582cbe6449853f..6048d356c50f5ccdaca37f1cdfd2d6fae6df4e4e 100644 --- a/core/modules/views_ui/lib/Drupal/views_ui/ViewEditFormController.php +++ b/core/modules/views_ui/lib/Drupal/views_ui/ViewEditFormController.php @@ -95,7 +95,7 @@ public function form(array $form, array &$form_state) { $form['#attached']['library'][] = array('system', 'drupal.states'); $form['#attached']['library'][] = array('system', 'drupal.tabledrag'); - if (!config('views.settings')->get('no_javascript')) { + if (!\Drupal::config('views.settings')->get('no_javascript')) { $form['#attached']['library'][] = array('views_ui', 'views_ui.admin'); } @@ -509,7 +509,7 @@ public function getDisplayDetails($view, $display) { ); // Collapse the details by default. - if (config('views.settings')->get('ui.show.advanced_column')) { + if (\Drupal::config('views.settings')->get('ui.show.advanced_column')) { $build['columns']['third']['#collapsed'] = FALSE; } diff --git a/core/modules/views_ui/lib/Drupal/views_ui/ViewFormControllerBase.php b/core/modules/views_ui/lib/Drupal/views_ui/ViewFormControllerBase.php index 054308272c0cb0222c693568a0466aacd4ef8b6f..5150273c9f6ca52f827c0cf0fe5de47ecc53d34f 100644 --- a/core/modules/views_ui/lib/Drupal/views_ui/ViewFormControllerBase.php +++ b/core/modules/views_ui/lib/Drupal/views_ui/ViewFormControllerBase.php @@ -157,7 +157,7 @@ public function getDisplayTabs(ViewUI $view) { */ public function isDefaultDisplayShown(ViewUI $view) { // Always show the default display for advanced users who prefer that mode. - $advanced_mode = config('views.settings')->get('ui.show.master_display'); + $advanced_mode = \Drupal::config('views.settings')->get('ui.show.master_display'); // For other users, show the default display only if there are no others, and // hide it if there's at least one "real" display. $additional_displays = (count($view->getExecutable()->displayHandlers) == 1); diff --git a/core/modules/views_ui/lib/Drupal/views_ui/ViewPreviewFormController.php b/core/modules/views_ui/lib/Drupal/views_ui/ViewPreviewFormController.php index fb292faf15246ef6d01176d641e710aacf521d12..de4bd60013b5e557899a9160be5add4a1c676b53 100644 --- a/core/modules/views_ui/lib/Drupal/views_ui/ViewPreviewFormController.php +++ b/core/modules/views_ui/lib/Drupal/views_ui/ViewPreviewFormController.php @@ -73,7 +73,7 @@ public function form(array $form, array &$form_state) { '#type' => 'checkbox', '#id' => 'edit-displays-live-preview', '#title' => t('Auto preview'), - '#default_value' => config('views.settings')->get('ui.always_live_preview'), + '#default_value' => \Drupal::config('views.settings')->get('ui.always_live_preview'), ); // Add the arguments textfield diff --git a/core/modules/views_ui/lib/Drupal/views_ui/ViewUI.php b/core/modules/views_ui/lib/Drupal/views_ui/ViewUI.php index 7bae9560bd8acbfdf8f731e9eb049aa58900284a..7af391a96a743697e599b207a91ac2356754b26b 100644 --- a/core/modules/views_ui/lib/Drupal/views_ui/ViewUI.php +++ b/core/modules/views_ui/lib/Drupal/views_ui/ViewUI.php @@ -519,7 +519,7 @@ public function renderPreview($display_id, $args = array()) { $old_q = current_path(); // Determine where the query and performance statistics should be output. - $config = config('views.settings'); + $config = \Drupal::config('views.settings'); $show_query = $config->get('ui.show.sql_query.enabled'); $show_info = $config->get('ui.show.preview_information'); $show_location = $config->get('ui.show.sql_query.where'); diff --git a/core/modules/views_ui/views_ui.theme.inc b/core/modules/views_ui/views_ui.theme.inc index 30286bd19b13104995c22ffd19452f8822fce003..a3e2d1b1f354ba8039ae93f24a7ee382362bdfc2 100644 --- a/core/modules/views_ui/views_ui.theme.inc +++ b/core/modules/views_ui/views_ui.theme.inc @@ -180,7 +180,7 @@ function theme_views_ui_build_group_filter_form($variables) { drupal_render($form['default_group']['All']), '', array( - 'data' => config('views.settings')->get('ui.exposed_filter_any_label') == 'old_any' ? t('<Any>') : t('- Any -'), + 'data' => Drupal::config('views.settings')->get('ui.exposed_filter_any_label') == 'old_any' ? t('<Any>') : t('- Any -'), 'colspan' => 4, 'class' => array('class' => 'any-default-radios-row'), ), diff --git a/core/profiles/minimal/minimal.install b/core/profiles/minimal/minimal.install index 9666b2516d4423975af244b17f8eb65a6365aa71..cdc4a18db2ca91f5c659e7b7b3df4fa413d9c1cf 100644 --- a/core/profiles/minimal/minimal.install +++ b/core/profiles/minimal/minimal.install @@ -16,7 +16,7 @@ function minimal_install() { Drupal::config('system.theme.global')->set('features.node_user_picture', FALSE)->save(); // Allow visitor account creation, but with administrative approval. - config('user.settings')->set('register', USER_REGISTER_VISITORS_ADMINISTRATIVE_APPROVAL)->save(); + Drupal::config('user.settings')->set('register', USER_REGISTER_VISITORS_ADMINISTRATIVE_APPROVAL)->save(); // Enable default permissions for system roles. user_role_grant_permissions(DRUPAL_ANONYMOUS_RID, array('access content')); diff --git a/core/profiles/standard/standard.install b/core/profiles/standard/standard.install index f74841e3358ce611b302684d959b746e3dfaab64..a80beaaff14cc91ad5c05a0f8d696aa6ab99cfe5 100644 --- a/core/profiles/standard/standard.install +++ b/core/profiles/standard/standard.install @@ -15,20 +15,20 @@ function standard_install() { // Enable Bartik theme and set it as default theme instead of Stark. // @see system_install() $default_theme = 'bartik'; - config('system.theme') + Drupal::config('system.theme') ->set('default', $default_theme) ->save(); theme_enable(array($default_theme)); theme_disable(array('stark')); // Set front page to "node". - config('system.site')->set('page.front', 'node')->save(); + Drupal::config('system.site')->set('page.front', 'node')->save(); // Default "Basic page" to have comments disabled. variable_set('comment_page', COMMENT_NODE_HIDDEN); // Allow visitor account creation with administrative approval. - $user_settings = config('user.settings'); + $user_settings = Drupal::config('user.settings'); $user_settings->set('register', USER_REGISTER_VISITORS_ADMINISTRATIVE_APPROVAL)->save(); // Create user picture field. @@ -84,6 +84,6 @@ function standard_install() { // Enable the admin theme. theme_enable(array('seven')); - config('system.theme')->set('admin', 'seven')->save(); + Drupal::config('system.theme')->set('admin', 'seven')->save(); variable_set('node_admin_theme', '1'); } diff --git a/core/themes/bartik/bartik.theme b/core/themes/bartik/bartik.theme index 8f44e346fbe98462713e5568eebd631f99eece2d..ed59e8d4782a9aa27aad4f5d57a1516b94e090bc 100644 --- a/core/themes/bartik/bartik.theme +++ b/core/themes/bartik/bartik.theme @@ -43,7 +43,7 @@ function bartik_preprocess_page(&$variables) { $variables['secondary_menu']['#attributes']['class'] = array('links', 'inline', 'clearfix'); } - $site_config = config('system.site'); + $site_config = Drupal::config('system.site'); // Always print the site name and slogan, but if they are toggled off, we'll // just hide them visually. $variables['hide_site_name'] = theme_get_setting('features.name') ? FALSE : TRUE; @@ -87,7 +87,7 @@ function bartik_preprocess_maintenance_page(&$variables) { drupal_add_css(drupal_get_path('theme', 'bartik') . '/css/maintenance-page.css'); $variables['styles'] = drupal_get_css(); - $site_config = config('system.site'); + $site_config = Drupal::config('system.site'); // Always print the site name and slogan, but if they are toggled off, we'll // just hide them visually. $variables['hide_site_name'] = theme_get_setting('features.name') ? FALSE : TRUE;