diff --git a/core/includes/bootstrap.inc b/core/includes/bootstrap.inc index 9ee30d7..a45adaf 100644 --- a/core/includes/bootstrap.inc +++ b/core/includes/bootstrap.inc @@ -907,7 +907,7 @@ function drupal_get_filename($type, $name, $filename = NULL) { } } try { - $file_list = \Drupal::state()->get('system.' . $type . '.files'); + $file_list = Drupal::state()->get('system.' . $type . '.files'); if ($file_list && isset($file_list[$name]) && file_exists(DRUPAL_ROOT . '/' . $file_list[$name])) { $files[$type][$name] = $file_list[$name]; } diff --git a/core/includes/common.inc b/core/includes/common.inc index 3adfc02..04b2d81 100644 --- a/core/includes/common.inc +++ b/core/includes/common.inc @@ -3120,7 +3120,7 @@ function drupal_pre_render_styles($elements) { function drupal_build_css_cache($css) { $data = ''; $uri = ''; - $map = \Drupal::state()->get('drupal_css_cache_files') ?: array(); + $map = Drupal::state()->get('drupal_css_cache_files') ?: array(); // Create a new array so that only the file names are used to create the hash. // This prevents new aggregates from being created unnecessarily. $css_data = array(); @@ -3188,7 +3188,7 @@ function drupal_build_css_cache($css) { } // Save the updated map. $map[$key] = $uri; - \Drupal::state()->set('drupal_css_cache_files', $map); + Drupal::state()->set('drupal_css_cache_files', $map); } return $uri; } @@ -3353,7 +3353,7 @@ function _drupal_load_stylesheet($matches) { * Deletes old cached CSS files. */ function drupal_clear_css_cache() { - \Drupal::state()->delete('drupal_css_cache_files'); + Drupal::state()->delete('drupal_css_cache_files'); file_scan_directory('public://css', '/.*/', array('callback' => 'drupal_delete_file_if_stale')); } @@ -4714,7 +4714,7 @@ function drupal_add_tabledrag($table_id, $action, $relationship, $group, $subgro function drupal_build_js_cache($files) { $contents = ''; $uri = ''; - $map = \Drupal::state()->get('system.js_cache_files') ?: array(); + $map = Drupal::state()->get('system.js_cache_files') ?: array(); // Create a new array so that only the file names are used to create the hash. // This prevents new aggregates from being created unnecessarily. $js_data = array(); @@ -4759,7 +4759,7 @@ function drupal_build_js_cache($files) { } } $map[$key] = $uri; - \Drupal::state()->set('system.js_cache_files', $map); + Drupal::state()->set('system.js_cache_files', $map); } return $uri; } @@ -4768,8 +4768,8 @@ function drupal_build_js_cache($files) { * Deletes old cached JavaScript files and variables. */ function drupal_clear_js_cache() { - \Drupal::state()->delete('system.javascript_parsed'); - \Drupal::state()->delete('system.js_cache_files'); + Drupal::state()->delete('system.javascript_parsed'); + Drupal::state()->delete('system.js_cache_files'); file_scan_directory('public://js', '/.*/', array('callback' => 'drupal_delete_file_if_stale')); } @@ -4816,9 +4816,9 @@ function drupal_get_hash_salt() { * The private key. */ function drupal_get_private_key() { - if (!($key = \Drupal::state()->get('system.private_key'))) { + if (!($key = Drupal::state()->get('system.private_key'))) { $key = drupal_hash_base64(drupal_random_bytes(55)); - \Drupal::state()->set('system.private_key', $key); + Drupal::state()->set('system.private_key', $key); } return $key; } @@ -5040,7 +5040,7 @@ function drupal_cron_run() { } // Record cron time. - \Drupal::state()->set('system.cron_last', REQUEST_TIME); + Drupal::state()->set('system.cron_last', REQUEST_TIME); watchdog('cron', 'Cron run completed.', array(), WATCHDOG_NOTICE); // Release cron lock. diff --git a/core/includes/install.core.inc b/core/includes/install.core.inc index c5e5630..57d03eb 100644 --- a/core/includes/install.core.inc +++ b/core/includes/install.core.inc @@ -926,7 +926,7 @@ function install_base_system(&$install_state) { // after all the dependencies have been installed. $modules[] = drupal_get_profile(); - \Drupal::state()->set('install_profile_modules', array_diff($modules, array('system'))); + Drupal::state()->set('install_profile_modules', array_diff($modules, array('system'))); $install_state['database_tables_exist'] = TRUE; } @@ -1652,9 +1652,9 @@ function install_bootstrap_full() { * The batch definition. */ function install_profile_modules(&$install_state) { - $modules = \Drupal::state()->get('install_profile_modules') ?: array(); + $modules = Drupal::state()->get('install_profile_modules') ?: array(); $files = system_rebuild_module_data(); - \Drupal::state()->delete('install_profile_modules'); + Drupal::state()->delete('install_profile_modules'); // Always install required modules first. Respect the dependencies between // the modules. diff --git a/core/includes/menu.inc b/core/includes/menu.inc index 2dceb19..68d434c 100644 --- a/core/includes/menu.inc +++ b/core/includes/menu.inc @@ -327,7 +327,7 @@ function menu_get_ancestors($parts) { $ancestors = array(); $length = $number_parts - 1; $end = (1 << $number_parts) - 1; - $masks = \Drupal::state()->get('menu.masks'); + $masks = Drupal::state()->get('menu.masks'); // If the optimized menu.masks array is not available use brute force to get // the correct $ancestors and $placeholders returned. Do not use this as the // default value of the menu.masks variable to avoid building such a big @@ -461,7 +461,7 @@ function menu_get_item($path = NULL, $router_item = NULL) { if (!isset($router_items[$path])) { // Rebuild if we know it's needed, or if the menu masks are missing which // occurs rarely, likely due to a race condition of multiple rebuilds. - if (\Drupal::state()->get('menu_rebuild_needed') || !\Drupal::state()->get('menu.masks')) { + if (Drupal::state()->get('menu_rebuild_needed') || !Drupal::state()->get('menu.masks')) { menu_router_rebuild(); } $original_map = arg(NULL, $path); @@ -1270,7 +1270,7 @@ function menu_tree_page_data($menu_name, $max_depth = NULL, $only_active_trail = } $parents = $active_trail; - $expanded = \Drupal::state()->get('menu_expanded'); + $expanded = Drupal::state()->get('menu_expanded'); // Check whether the current menu has any links set to be expanded. if (!$only_active_trail && $expanded && in_array($menu_name, $expanded)) { // Collect all the links set to be expanded, and then add all of @@ -2629,7 +2629,7 @@ function menu_router_rebuild() { menu_cache_clear_all(); _menu_clear_page_cache(); // Indicate that the menu has been successfully rebuilt. - \Drupal::state()->delete('menu_rebuild_needed'); + Drupal::state()->delete('menu_rebuild_needed'); } catch (Exception $e) { $transaction->rollback(); @@ -2909,7 +2909,7 @@ function _menu_clear_page_cache() { */ function _menu_set_expanded_menus() { $names = db_query("SELECT menu_name FROM {menu_links} WHERE expanded <> 0 GROUP BY menu_name")->fetchCol(); - \Drupal::state()->set('menu_expanded', $names); + Drupal::state()->set('menu_expanded', $names); } /** @@ -3183,8 +3183,8 @@ function _menu_router_build($callbacks, $save = FALSE) { $path_roots = array_values($path_roots); // Update the path roots variable and reset the path alias whitelist cache // if the list has changed. - if ($path_roots != \Drupal::state()->get('menu_path_roots')) { - \Drupal::state()->set('menu_path_roots', array_values($path_roots)); + if ($path_roots != Drupal::state()->get('menu_path_roots')) { + Drupal::state()->set('menu_path_roots', array_values($path_roots)); drupal_container()->get('path.alias_manager')->cacheClear(); } _menu_router_save($menu, $masks); @@ -3270,7 +3270,7 @@ function _menu_router_save($menu, $masks) { // Insert any remaining records. $insert->execute(); // Store the masks. - \Drupal::state()->set('menu.masks', $masks); + Drupal::state()->set('menu.masks', $masks); return $menu; } diff --git a/core/includes/module.inc b/core/includes/module.inc index 2509a82..6b0f23c 100644 --- a/core/includes/module.inc +++ b/core/includes/module.inc @@ -47,7 +47,7 @@ function system_list($type) { // system.theme.data state will go away entirely as soon as themes have // a proper installation status. // @see http://drupal.org/node/1067408 - $theme_data = \Drupal::state()->get('system.theme.data'); + $theme_data = Drupal::state()->get('system.theme.data'); if (empty($theme_data)) { // @todo: system_list() may be called from _drupal_bootstrap_code(), in // which case system.module is not loaded yet. @@ -122,7 +122,7 @@ function system_list_reset() { // will cause system_list_reset() to be called, but theme data is not // necessarily rebuilt afterwards. // @todo Obsolete with proper installation status for themes. - \Drupal::state()->delete('system.theme.data'); + Drupal::state()->delete('system.theme.data'); } /** diff --git a/core/includes/update.inc b/core/includes/update.inc index b8399ee..a73ec63 100644 --- a/core/includes/update.inc +++ b/core/includes/update.inc @@ -170,7 +170,7 @@ function update_prepare_d8_bootstrap() { if ($has_required_schema) { if (!db_table_exists('key_value')) { $specs = array( - 'description' => 'Generic key-value storage table. See \Drupal::state() for an example.', + 'description' => 'Generic key-value storage table. See the state system for an example.', 'fields' => array( 'collection' => array( 'description' => 'A named collection of key and value pairs.', @@ -468,8 +468,8 @@ function update_prepare_d8_language() { $prefixes[$language->language] = $language->prefix; $domains[$language->language] = $language->domain; } - \Drupal::state()->set('locale.translation.plurals', $plurals); - \Drupal::state()->set('locale.translation.javascript', $javascript); + Drupal::state()->set('locale.translation.plurals', $plurals); + Drupal::state()->set('locale.translation.javascript', $javascript); config('language.negotiation') ->set('url.prefixes', $prefixes) ->set('url.domains', $domains) @@ -1483,7 +1483,7 @@ function update_config_manifest_add($config_prefix, array $ids) { * Updates 7.x variables to state records. * * Provides a generalized method to migrate variables from 7.x to 8.x's - * \Drupal::state() system. + * Drupal::state() system. * * @param array $variable_map * An associative array that maps old variables names to new state record @@ -1498,7 +1498,7 @@ function update_config_manifest_add($config_prefix, array $ids) { function update_variables_to_state(array $variable_map) { foreach ($variable_map as $variable_name => $state_name) { if (NULL !== $value = update_variable_get($variable_name)) { - \Drupal::state()->set($state_name, $value); + Drupal::state()->set($state_name, $value); } } diff --git a/core/includes/utility.inc b/core/includes/utility.inc index a2d48f0..f651fd6 100644 --- a/core/includes/utility.inc +++ b/core/includes/utility.inc @@ -49,7 +49,7 @@ function drupal_var_export($var, $prefix = '') { } elseif (is_object($var) && get_class($var) === 'stdClass') { // var_export() will export stdClass objects using an undefined - // magic method __set_\Drupal::state() leaving the export broken. This + // magic method __set_state() leaving the export broken. This // workaround avoids this by casting the object as an array for // export and casting it back to an object when evaluated. $output = '(object) ' . drupal_var_export((array) $var, $prefix); diff --git a/core/modules/comment/comment.install b/core/modules/comment/comment.install index 44547d4..bc6673c 100644 --- a/core/modules/comment/comment.install +++ b/core/modules/comment/comment.install @@ -29,7 +29,7 @@ function comment_uninstall() { } // Remove states. - \Drupal::state()->delete('comment.node_comment_statistics_scale'); + Drupal::state()->delete('comment.node_comment_statistics_scale'); } /** diff --git a/core/modules/comment/comment.module b/core/modules/comment/comment.module index e79059f..25635f0 100644 --- a/core/modules/comment/comment.module +++ b/core/modules/comment/comment.module @@ -1279,7 +1279,7 @@ function comment_node_update_index(EntityInterface $node, $langcode) { */ function comment_update_index() { // Store the maximum possible comments per thread (used for ranking by reply count) - \Drupal::state()->set('comment.node_comment_statistics_scale', 1.0 / max(1, db_query('SELECT MAX(comment_count) FROM {node_comment_statistics}')->fetchField())); + Drupal::state()->set('comment.node_comment_statistics_scale', 1.0 / max(1, db_query('SELECT MAX(comment_count) FROM {node_comment_statistics}')->fetchField())); } /** @@ -2006,7 +2006,7 @@ function comment_ranking() { ), // Inverse law that maps the highest reply count on the site to 1 and 0 to 0. 'score' => '2.0 - 2.0 / (1.0 + node_comment_statistics.comment_count * CAST(:scale AS DECIMAL))', - 'arguments' => array(':scale' => \Drupal::state()->get('comment.node_comment_statistics_scale') ?: 0), + 'arguments' => array(':scale' => Drupal::state()->get('comment.node_comment_statistics_scale') ?: 0), ), ); } diff --git a/core/modules/config/tests/config_test/config_test.module b/core/modules/config/tests/config_test/config_test.module index 1986cea..371bfb0 100644 --- a/core/modules/config/tests/config_test/config_test.module +++ b/core/modules/config/tests/config_test/config_test.module @@ -152,7 +152,7 @@ function config_test_cache_flush() { * Implements hook_ENTITY_TYPE_create(). */ function config_test_config_test_create(ConfigTest $config_test) { - if (\Drupal::state()->get('config_test.prepopulate')) { + if (Drupal::state()->get('config_test.prepopulate')) { $config_test->set('foo', 'baz'); } } diff --git a/core/modules/editor/tests/modules/editor_test.module b/core/modules/editor/tests/modules/editor_test.module index fc2d748..cdaf52e 100644 --- a/core/modules/editor/tests/modules/editor_test.module +++ b/core/modules/editor/tests/modules/editor_test.module @@ -31,7 +31,7 @@ function editor_test_editor_default_settings_alter(&$settings, $editor) { */ function editor_test_editor_js_settings_alter(&$settings) { // Allow tests to enable or disable this alter hook. - if (!\Drupal::state()->get('editor_test_js_settings_alter_enabled', FALSE)) { + if (!Drupal::state()->get('editor_test_js_settings_alter_enabled', FALSE)) { return; } diff --git a/core/modules/field/field.attach.inc b/core/modules/field/field.attach.inc index bac5829..580084f 100644 --- a/core/modules/field/field.attach.inc +++ b/core/modules/field/field.attach.inc @@ -797,7 +797,7 @@ function _field_invoke_widget_target() { * @endcode * * Additionally, some processing data is placed in $form_state, and can be - * accessed by field_form_get_\Drupal::state() and field_form_set_\Drupal::state(). + * accessed by field_form_get_Drupal::state() and field_form_set_Drupal::state(). * * @param \Drupal\Core\Entity\EntityInterface $entity * The entity for which to load form elements, used to initialize @@ -817,8 +817,8 @@ function _field_invoke_widget_target() { * An associative array of additional options. See field_invoke_method() for * details. * - * @see field_form_get_\Drupal::state() - * @see field_form_set_\Drupal::state() + * @see field_form_get_Drupal::state() + * @see field_form_set_Drupal::state() */ function field_attach_form(EntityInterface $entity, &$form, &$form_state, $langcode = NULL, array $options = array()) { // Set #parents to 'top-level' by default. diff --git a/core/modules/field/field.form.inc b/core/modules/field/field.form.inc index d184a0d..4bccf60 100644 --- a/core/modules/field/field.form.inc +++ b/core/modules/field/field.form.inc @@ -193,7 +193,7 @@ function field_add_more_js($form, $form_state) { * - errors: The array of field validation errors reported on the field. This * entry is populated at field_attach_form_validate() time. * - * @see field_form_set_\Drupal::state() + * @see field_form_set_Drupal::state() */ function field_form_get_state($parents, $field_name, $langcode, &$form_state) { $form_state_parents = _field_form_state_parents($parents, $field_name, $langcode); @@ -212,10 +212,10 @@ function field_form_get_state($parents, $field_name, $langcode, &$form_state) { * @param $form_state * The form state. * @param $field_state - * The array of data to store. See field_form_get_\Drupal::state() for the structure + * The array of data to store. See field_form_get_Drupal::state() for the structure * and content of the array. * - * @see field_form_get_\Drupal::state() + * @see field_form_get_Drupal::state() */ function field_form_set_state($parents, $field_name, $langcode, &$form_state, $field_state) { $form_state_parents = _field_form_state_parents($parents, $field_name, $langcode); diff --git a/core/modules/field/lib/Drupal/field/Plugin/Type/Widget/WidgetInterface.php b/core/modules/field/lib/Drupal/field/Plugin/Type/Widget/WidgetInterface.php index e60cb13..c0ffc95 100644 --- a/core/modules/field/lib/Drupal/field/Plugin/Type/Widget/WidgetInterface.php +++ b/core/modules/field/lib/Drupal/field/Plugin/Type/Widget/WidgetInterface.php @@ -84,8 +84,8 @@ public function settingsForm(array $form, array &$form_state); * widgets can simply overlook this property. This identifies the * location where the field values are placed within * $form_state['values'], and is used to access processing information - * for the field through the field_form_get_\Drupal::state() and - * field_form_set_\Drupal::state() functions. + * for the field through the field_form_get_state() and + * field_form_set_state() functions. * - #columns: A list of field storage columns of the field. * - #title: The sanitized element label for the field instance, ready for * output. diff --git a/core/modules/field/tests/modules/field_test/field_test.entity.inc b/core/modules/field/tests/modules/field_test/field_test.entity.inc index e9a7a91..0c823a4 100644 --- a/core/modules/field/tests/modules/field_test/field_test.entity.inc +++ b/core/modules/field/tests/modules/field_test/field_test.entity.inc @@ -14,7 +14,7 @@ function field_test_entity_info() { // If requested, clear the field cache while this is being called. See // Drupal\field\Tests\FieldInfoTest::testFieldInfoCache(). - if (\Drupal::state()->get('field_test.clear_info_cache_in_hook_entity_info')) { + if (Drupal::state()->get('field_test.clear_info_cache_in_hook_entity_info')) { field_info_cache_clear(); } } @@ -56,7 +56,7 @@ function field_test_entity_bundle_info_alter(&$bundles) { $entity_info = entity_get_info(); foreach ($bundles as $entity_type => $info) { if ($entity_info[$entity_type]['module'] == 'field_test') { - $bundles[$entity_type] = \Drupal::state()->get('field_test_bundles') ?: array('test_bundle' => array('label' => 'Test Bundle')); + $bundles[$entity_type] = Drupal::state()->get('field_test_bundles') ?: array('test_bundle' => array('label' => 'Test Bundle')); if ($entity_type == 'test_entity_bundle') { $bundles[$entity_type] += array('test_entity_2' => array('label' => 'Test entity 2')); } @@ -90,9 +90,9 @@ function field_test_entity_info_translatable($entity_type = NULL, $translatable * name will be used. */ function field_test_create_bundle($bundle, $text = NULL) { - $bundles = \Drupal::state()->get('field_test.bundles') ?: array('test_bundle' => array('label' => 'Test Bundle')); + $bundles = Drupal::state()->get('field_test.bundles') ?: array('test_bundle' => array('label' => 'Test Bundle')); $bundles += array($bundle => array('label' => $text ? $text : $bundle)); - \Drupal::state()->set('field_test.bundles', $bundles); + Drupal::state()->set('field_test.bundles', $bundles); $info = entity_get_info(); foreach ($info as $type => $type_info) { @@ -111,10 +111,10 @@ function field_test_create_bundle($bundle, $text = NULL) { * The new machine-readable name of the bundle. */ function field_test_rename_bundle($bundle_old, $bundle_new) { - $bundles = \Drupal::state()->get('field_test.bundles') ?: array('test_bundle' => array('label' => 'Test Bundle')); + $bundles = Drupal::state()->get('field_test.bundles') ?: array('test_bundle' => array('label' => 'Test Bundle')); $bundles[$bundle_new] = $bundles[$bundle_old]; unset($bundles[$bundle_old]); - \Drupal::state()->set('field_test.bundles', $bundles); + Drupal::state()->set('field_test.bundles', $bundles); $info = entity_get_info(); foreach ($info as $type => $type_info) { @@ -131,9 +131,9 @@ function field_test_rename_bundle($bundle_old, $bundle_new) { * The machine-readable name of the bundle to delete. */ function field_test_delete_bundle($bundle) { - $bundles = \Drupal::state()->get('field_test.bundles') ?: array('test_bundle' => array('label' => 'Test Bundle')); + $bundles = Drupal::state()->get('field_test.bundles') ?: array('test_bundle' => array('label' => 'Test Bundle')); unset($bundles[$bundle]); - \Drupal::state()->set('field_test.bundles', $bundles); + Drupal::state()->set('field_test.bundles', $bundles); $info = entity_get_info(); foreach ($info as $type => $type_info) { diff --git a/core/modules/field/tests/modules/field_test/field_test.module b/core/modules/field/tests/modules/field_test/field_test.module index c37d00a..352a29d 100644 --- a/core/modules/field/tests/modules/field_test/field_test.module +++ b/core/modules/field/tests/modules/field_test/field_test.module @@ -106,7 +106,7 @@ function field_test_field_test_op_multiple($entity_type, $entities, $field, $ins * Implements hook_field_available_languages_alter(). */ function field_test_field_available_languages_alter(&$langcodes, $context) { - if (\Drupal::state()->get('field_test.field_available_languages_alter')) { + if (Drupal::state()->get('field_test.field_available_languages_alter')) { // Add an unavailable language code. $langcodes[] = 'xx'; // Remove an available language code. @@ -119,7 +119,7 @@ function field_test_field_available_languages_alter(&$langcodes, $context) { * Implements hook_field_language_alter(). */ function field_test_field_language_alter(&$display_langcode, $context) { - if (\Drupal::state()->get('field_test.language_fallback') ?: TRUE) { + if (Drupal::state()->get('field_test.language_fallback') ?: TRUE) { field_language_fallback($display_langcode, $context['entity'], $context['langcode']); } } diff --git a/core/modules/field/tests/modules/field_test/field_test.storage.inc b/core/modules/field/tests/modules/field_test/field_test.storage.inc index 5af0372..31073ff 100644 --- a/core/modules/field/tests/modules/field_test/field_test.storage.inc +++ b/core/modules/field/tests/modules/field_test/field_test.storage.inc @@ -71,10 +71,10 @@ function field_test_field_storage_details_alter(&$details, $field) { */ function _field_test_storage_data($data = NULL) { if (!isset($data)) { - return \Drupal::state()->get('field_test.storage_data'); + return Drupal::state()->get('field_test.storage_data'); } else { - \Drupal::state()->set('field_test.storage_data', $data); + Drupal::state()->set('field_test.storage_data', $data); } } diff --git a/core/modules/field_ui/field_ui.module b/core/modules/field_ui/field_ui.module index e68120d..2204846 100644 --- a/core/modules/field_ui/field_ui.module +++ b/core/modules/field_ui/field_ui.module @@ -327,7 +327,7 @@ function field_ui_element_info() { function field_ui_field_attach_create_bundle($entity_type, $bundle) { // When a new bundle is created, the menu needs to be rebuilt to add our // menu item tabs. - \Drupal::state()->set('menu_rebuild_needed', TRUE); + Drupal::state()->set('menu_rebuild_needed', TRUE); } /** diff --git a/core/modules/file/tests/file_test/file_test.module b/core/modules/file/tests/file_test/file_test.module index c4453e4..bb1b50c 100644 --- a/core/modules/file/tests/file_test/file_test.module +++ b/core/modules/file/tests/file_test/file_test.module @@ -158,14 +158,14 @@ function file_test_reset() { 'move' => array(), 'delete' => array(), ); - \Drupal::state()->set('file_test.results', $results); + Drupal::state()->set('file_test.results', $results); // These hooks will return these values, see file_test_set_return(). $return = array( 'validate' => array(), 'download' => NULL, ); - \Drupal::state()->set('file_test.return', $return); + Drupal::state()->set('file_test.return', $return); } /** @@ -183,7 +183,7 @@ function file_test_reset() { * @see file_test_reset() */ function file_test_get_calls($op) { - $results = \Drupal::state()->get('file_test.results') ?: array(); + $results = Drupal::state()->get('file_test.results') ?: array(); return $results[$op]; } @@ -196,7 +196,7 @@ function file_test_get_calls($op) { * passed to each call. */ function file_test_get_all_calls() { - return \Drupal::state()->get('file_test.results') ?: array(); + return Drupal::state()->get('file_test.results') ?: array(); } /** @@ -212,9 +212,9 @@ function file_test_get_all_calls() { * @see file_test_reset() */ function _file_test_log_call($op, $args) { - $results = \Drupal::state()->get('file_test.results') ?: array(); + $results = Drupal::state()->get('file_test.results') ?: array(); $results[$op][] = $args; - \Drupal::state()->set('file_test.results', $results); + Drupal::state()->set('file_test.results', $results); } /** @@ -230,7 +230,7 @@ function _file_test_log_call($op, $args) { * @see file_test_reset() */ function _file_test_get_return($op) { - $return = \Drupal::state()->get('file_test.return') ?: array($op => NULL); + $return = Drupal::state()->get('file_test.return') ?: array($op => NULL); return $return[$op]; } @@ -246,9 +246,9 @@ function _file_test_get_return($op) { * @see file_test_reset() */ function file_test_set_return($op, $value) { - $return = \Drupal::state()->get('file_test.return') ?: array(); + $return = Drupal::state()->get('file_test.return') ?: array(); $return[$op] = $value; - \Drupal::state()->set('file_test.return', $return); + Drupal::state()->set('file_test.return', $return); } /** @@ -320,7 +320,7 @@ function file_test_file_predelete(File $file) { function file_test_file_url_alter(&$uri) { // Only run this hook when this variable is set. Otherwise, we'd have to add // another hidden test module just for this hook. - $alter_mode = \Drupal::state()->get('file_test.hook_file_url_alter'); + $alter_mode = Drupal::state()->get('file_test.hook_file_url_alter'); if (!$alter_mode) { return; } diff --git a/core/modules/image/image.module b/core/modules/image/image.module index 453192c..80b77ed 100644 --- a/core/modules/image/image.module +++ b/core/modules/image/image.module @@ -276,7 +276,7 @@ function image_form_system_file_system_settings_alter(&$form, &$form_state) { */ function image_system_file_system_settings_submit($form, &$form_state) { if ($form['file_public_path']['#default_value'] !== $form_state['values']['file_public_path']) { - \Drupal::state()->set('menu_rebuild_needed', TRUE); + Drupal::state()->set('menu_rebuild_needed', TRUE); } } diff --git a/core/modules/image/tests/image_module_test.module b/core/modules/image/tests/image_module_test.module index b60aed1..7cc6cdd 100644 --- a/core/modules/image/tests/image_module_test.module +++ b/core/modules/image/tests/image_module_test.module @@ -6,7 +6,7 @@ */ function image_module_test_file_download($uri) { - $default_uri = \Drupal::state()->get('image.test_file_download') ?: FALSE; + $default_uri = Drupal::state()->get('image.test_file_download') ?: FALSE; if ($default_uri == $uri) { return array('X-Image-Owned-By' => 'image_module_test'); } diff --git a/core/modules/language/tests/language_test/language_test.module b/core/modules/language/tests/language_test/language_test.module index c28d83e..e191c41 100644 --- a/core/modules/language/tests/language_test/language_test.module +++ b/core/modules/language/tests/language_test/language_test.module @@ -22,7 +22,7 @@ function language_test_init() { * Implements hook_language_types_info(). */ function language_test_language_types_info() { - if (\Drupal::state()->get('language_test.language_types')) { + if (Drupal::state()->get('language_test.language_types')) { return array( 'test_language_type' => array( 'name' => t('Test'), @@ -39,7 +39,7 @@ function language_test_language_types_info() { * Implements hook_language_types_info_alter(). */ function language_test_language_types_info_alter(array &$language_types) { - if (\Drupal::state()->get('language_test.content_language_type')) { + if (Drupal::state()->get('language_test.content_language_type')) { unset($language_types[LANGUAGE_TYPE_CONTENT]['fixed']); } } @@ -48,7 +48,7 @@ function language_test_language_types_info_alter(array &$language_types) { * Implements hook_language_negotiation_info(). */ function language_test_language_negotiation_info() { - if (\Drupal::state()->get('language_test.language_negotiation_info')) { + if (Drupal::state()->get('language_test.language_negotiation_info')) { $info = array( 'callbacks' => array( 'negotiation' => 'language_test_language_negotiation_method', @@ -75,7 +75,7 @@ function language_test_language_negotiation_info() { * Implements hook_language_negotiation_info_alter(). */ function language_test_language_negotiation_info_alter(array &$negotiation_info) { - if (\Drupal::state()->get('language_test.language_negotiation_info_alter')) { + if (Drupal::state()->get('language_test.language_negotiation_info_alter')) { unset($negotiation_info[LANGUAGE_NEGOTIATION_INTERFACE]); } } @@ -88,7 +88,7 @@ function language_test_store_language_negotiation() { foreach (language_types_get_all() as $type) { $last[$type] = language($type)->langcode; } - \Drupal::state()->set('language_test.language_negotiation_last', $last); + Drupal::state()->set('language_test.language_negotiation_last', $last); } /** diff --git a/core/modules/locale/locale.compare.inc b/core/modules/locale/locale.compare.inc index dd951b5..4176c99 100644 --- a/core/modules/locale/locale.compare.inc +++ b/core/modules/locale/locale.compare.inc @@ -19,7 +19,7 @@ */ function locale_translation_flush_projects() { // Followup issue: http://drupal.org/node/1842362 - // Replace {locale_project} table by \Drupal::state() variable(s). + // Replace {locale_project} table by Drupal::state() variable(s). db_truncate('locale_project')->execute(); } diff --git a/core/modules/locale/locale.install b/core/modules/locale/locale.install index b6eb5af..d230570 100644 --- a/core/modules/locale/locale.install +++ b/core/modules/locale/locale.install @@ -26,7 +26,7 @@ function locale_uninstall() { $locale_js_directory = 'public://' . $config->get('javascript.directory'); if (is_dir($locale_js_directory)) { - $locale_javascripts = \Drupal::state()->get('locale.translation.javascript') ?: array(); + $locale_javascripts = Drupal::state()->get('locale.translation.javascript') ?: array(); foreach ($locale_javascripts as $langcode => $file_suffix) { if (!empty($file_suffix)) { file_unmanaged_delete($locale_js_directory . '/' . $langcode . '_' . $file_suffix . '.js'); @@ -39,9 +39,9 @@ function locale_uninstall() { } // Clear variables. - \Drupal::state()->delete('system.javascript_parsed'); - \Drupal::state()->delete('locale.translation.plurals'); - \Drupal::state()->delete('locale.translation.javascript'); + Drupal::state()->delete('system.javascript_parsed'); + Drupal::state()->delete('locale.translation.plurals'); + Drupal::state()->delete('locale.translation.javascript'); // Remove all node type language variables. Node module might have been // enabled, but may be disabled, so use a wildcard delete. @@ -295,7 +295,7 @@ function locale_requirements($phase) { if ($languages) { // Determine the status of the translation updates per lanuage. - $status = \Drupal::state()->get('locale.translation_status'); + $status = Drupal::state()->get('locale.translation_status'); if ($status) { foreach ($status as $project_id => $project) { foreach ($project as $langcode => $project_info) { diff --git a/core/modules/locale/locale.module b/core/modules/locale/locale.module index b845a6b..acbac82 100644 --- a/core/modules/locale/locale.module +++ b/core/modules/locale/locale.module @@ -445,7 +445,7 @@ function locale_get_plural($count, $langcode = NULL) { if (!isset($plural_indexes[$langcode][$count])) { // Retrieve and statically cache the plural formulas for all languages. if (empty($plural_formulas)) { - $plural_formulas = \Drupal::state()->get('locale.translation.plurals') ?: array(); + $plural_formulas = Drupal::state()->get('locale.translation.plurals') ?: array(); } // If there is a plural formula for the language, evaluate it for the given // $count and statically cache the result for the combination of language @@ -583,7 +583,7 @@ function locale_js_alter(&$javascript) { $language_interface = language(LANGUAGE_TYPE_INTERFACE); $dir = 'public://' . config('local.settings')->get('javascript.directory'); - $parsed = \Drupal::state()->get('system.javascript_parsed') ?: array(); + $parsed = Drupal::state()->get('system.javascript_parsed') ?: array(); $files = $new_files = FALSE; foreach ($javascript as $item) { @@ -616,16 +616,16 @@ function locale_js_alter(&$javascript) { unset($parsed['refresh:' . $language_interface->langcode]); } // Store any changes after refresh was attempted. - \Drupal::state()->set('system.javascript_parsed', $parsed); + Drupal::state()->set('system.javascript_parsed', $parsed); } // If no refresh was attempted, but we have new source files, we need // to store them too. This occurs if current page is in English. elseif ($new_files) { - \Drupal::state()->set('system.javascript_parsed', $parsed); + Drupal::state()->set('system.javascript_parsed', $parsed); } // Add the translation JavaScript file to the page. - $locale_javascripts = \Drupal::state()->get('translation.javascript') ?: array(); + $locale_javascripts = Drupal::state()->get('translation.javascript') ?: array(); if ($files && !empty($locale_javascripts[$language_interface->langcode])) { // Add the translation JavaScript file to the page. $file = $dir . '/' . $language_interface->langcode . '_' . $locale_javascripts[$language_interface->langcode] . '.js'; @@ -938,7 +938,7 @@ function locale_translation_status_save($data) { // Followup issue: http://drupal.org/node/1842362 // Split status storage per module/language and expire individually. This will // improve performance for large sites. - $status = \Drupal::state()->get('locale.translation_status'); + $status = Drupal::state()->get('locale.translation_status'); $status = empty($status) ? array() : $status; // Merge the new data into the existing structured status array. @@ -948,8 +948,8 @@ function locale_translation_status_save($data) { } } - \Drupal::state()->set('locale.translation_status', $status); - \Drupal::state()->set('locale.translation_last_checked', REQUEST_TIME); + Drupal::state()->set('locale.translation_status', $status); + Drupal::state()->set('locale.translation_last_checked', REQUEST_TIME); } /** @@ -959,7 +959,7 @@ function locale_translation_status_save($data) { * Language code(s) to be deleted from the cache. */ function locale_translation_status_delete_languages($langcodes) { - if ($status = \Drupal::state()->get('locale.translation_status')) { + if ($status = Drupal::state()->get('locale.translation_status')) { foreach ($status as $project => $languages) { foreach ($languages as $langcode => $source) { if (in_array($langcode, $langcodes)) { @@ -967,7 +967,7 @@ function locale_translation_status_delete_languages($langcodes) { } } } - \Drupal::state()->set('locale.translation_status', $status); + Drupal::state()->set('locale.translation_status', $status); } } @@ -978,22 +978,22 @@ function locale_translation_status_delete_languages($langcodes) { * Project name(s) to be deleted from the cache. */ function locale_translation_status_delete_projects($projects) { - $status = \Drupal::state()->get('locale.translation_status'); + $status = Drupal::state()->get('locale.translation_status'); foreach ($status as $project => $languages) { if (in_array($project, $projects)) { unset($status[$project]); } } - \Drupal::state()->set('locale.translation_status', $status); + Drupal::state()->set('locale.translation_status', $status); } /** * Clear the translation status cache. */ function locale_translation_clear_status() { - \Drupal::state()->delete('locale.translation_status'); - \Drupal::state()->delete('locale.translation_last_checked'); + Drupal::state()->delete('locale.translation_status'); + Drupal::state()->delete('locale.translation_last_checked'); } /** @@ -1173,7 +1173,7 @@ function _locale_parse_js_file($filepath) { * New content of the 'system.javascript_parsed' variable. */ function _locale_invalidate_js($langcode = NULL) { - $parsed = \Drupal::state()->get('system.javascript_parsed') ?: array(); + $parsed = Drupal::state()->get('system.javascript_parsed') ?: array(); if (empty($langcode)) { // Invalidate all languages. @@ -1187,7 +1187,7 @@ function _locale_invalidate_js($langcode = NULL) { $parsed['refresh:' . $langcode] = 'waiting'; } - \Drupal::state()->set('system.javascript_parsed', $parsed); + Drupal::state()->set('system.javascript_parsed', $parsed); return $parsed; } @@ -1226,7 +1226,7 @@ function _locale_rebuild_js($langcode = NULL) { if (!empty($translations)) { $data = "Drupal.locale = { "; - $locale_plurals = \Drupal::state()->get('locale.translation.plurals') ?: array(); + $locale_plurals = Drupal::state()->get('locale.translation.plurals') ?: array(); if (!empty($locale_plurals[$language->langcode])) { $data .= "'pluralFormula': function (\$n) { return Number({$locale_plurals[$language->langcode]['formula']}); }, "; } @@ -1240,7 +1240,7 @@ function _locale_rebuild_js($langcode = NULL) { $dir = 'public://' . $config->get('javascript.directory'); // Delete old file, if we have no translations anymore, or a different file to be saved. - $locale_javascripts = \Drupal::state()->get('locale.translation.javascript') ?: array(); + $locale_javascripts = Drupal::state()->get('locale.translation.javascript') ?: array(); $changed_hash = !isset($locale_javascripts[$language->langcode]) || ($locale_javascripts[$language->langcode] != $data_hash); if (!empty($locale_javascripts[$language->langcode]) && (!$data || $changed_hash)) { file_unmanaged_delete($dir . '/' . $language->langcode . '_' . $locale_javascripts[$language->langcode] . '.js'); @@ -1284,7 +1284,7 @@ function _locale_rebuild_js($langcode = NULL) { // deleted). Act only if some operation was executed that changed the hash // code. if ($status && $changed_hash) { - \Drupal::state()->set('locale.translation.javascript', $locale_javascripts); + Drupal::state()->set('locale.translation.javascript', $locale_javascripts); } // Log the operation and return success flag. diff --git a/core/modules/locale/locale.pages.inc b/core/modules/locale/locale.pages.inc index 0c1eedb..99af0a3 100644 --- a/core/modules/locale/locale.pages.inc +++ b/core/modules/locale/locale.pages.inc @@ -279,7 +279,7 @@ function locale_translate_edit_form($form, &$form_state) { if (isset($langcode)) { $strings = locale_translate_filter_load_strings(); - $plural_formulas = \Drupal::state()->get('locale.translation.plurals') ?: array(); + $plural_formulas = Drupal::state()->get('locale.translation.plurals') ?: array(); foreach ($strings as $string) { // Cast into source string, will do for our purposes. @@ -499,7 +499,7 @@ function locale_translation_status_form($form, &$form_state) { $project_data = locale_translation_build_projects(); $languages = locale_translatable_language_list(); $projects = locale_translation_get_projects(); - $status = \Drupal::state()->get('locale.translation_status'); + $status = Drupal::state()->get('locale.translation_status'); // Prepare information about projects which have available translation // updates. @@ -542,7 +542,7 @@ function locale_translation_status_form($form, &$form_state) { uasort($options, 'drupal_sort_title'); } - $last_checked = \Drupal::state()->get('locale.translation_last_checked'); + $last_checked = Drupal::state()->get('locale.translation_last_checked'); $form['last_checked'] = array( '#markup' => '

' . theme('locale_translation_last_check', array('last' => $last_checked)) . '

', ); @@ -619,7 +619,7 @@ function locale_translation_status_form_submit($form, &$form_state) { // If the status was updated recently we can immediately start fetching the // translation updates. If the status is expired we clear it an run a batch to // update the status and then fetch the translation updates. - $last_checked = \Drupal::state()->get('locale.translation_last_checked'); + $last_checked = Drupal::state()->get('locale.translation_last_checked'); if ($last_checked < REQUEST_TIME - LOCALE_TRANSLATION_STATUS_TTL) { locale_translation_clear_status(); $batch = locale_translation_batch_update_build(array(), $langcodes, $options); diff --git a/core/modules/locale/locale.translation.inc b/core/modules/locale/locale.translation.inc index 739f7fc..7d58315 100644 --- a/core/modules/locale/locale.translation.inc +++ b/core/modules/locale/locale.translation.inc @@ -104,7 +104,7 @@ function locale_translation_load_sources($projects = NULL, $langcodes = NULL) { $langcodes = $langcodes ? $langcodes : array_keys(locale_translatable_language_list()); // Load source data from locale_translation_status cache. - $status = \Drupal::state()->get('locale.translation_status'); + $status = Drupal::state()->get('locale.translation_status'); // Use only the selected projects and languages for update. foreach($projects as $project) { diff --git a/core/modules/locale/tests/modules/locale_test/locale_test.install b/core/modules/locale/tests/modules/locale_test/locale_test.install index be5ad52..e820b9f 100644 --- a/core/modules/locale/tests/modules/locale_test/locale_test.install +++ b/core/modules/locale/tests/modules/locale_test/locale_test.install @@ -10,6 +10,6 @@ */ function locale_test_uninstall() { // Clear variables. - \Drupal::state()->delete('locale.test_system_info_alter'); - \Drupal::state()->delete('locale.test_projects_alter'); + Drupal::state()->delete('locale.test_system_info_alter'); + Drupal::state()->delete('locale.test_projects_alter'); } diff --git a/core/modules/locale/tests/modules/locale_test/locale_test.module b/core/modules/locale/tests/modules/locale_test/locale_test.module index 0394232..ace4172 100644 --- a/core/modules/locale/tests/modules/locale_test/locale_test.module +++ b/core/modules/locale/tests/modules/locale_test/locale_test.module @@ -16,7 +16,7 @@ function locale_test_system_info_alter(&$info, $file, $type) { // By default the locale_test modules are hidden and have a project specified. // To test the module detection proces by locale_project_list() the // test modules should mimic a custom module. I.e. be non-hidden. - if (\Drupal::state()->get('locale.test_system_info_alter')) { + if (Drupal::state()->get('locale.test_system_info_alter')) { if ($file->name == 'locale_test' || $file->name == 'locale_test_translate') { // Don't hide the module. $info['hidden'] = FALSE; @@ -37,7 +37,7 @@ function locale_test_system_info_alter(&$info, $file, $type) { * test script in order for this hook to take effect. */ function locale_test_locale_translation_projects_alter(&$projects) { - if (\Drupal::state()->get('locale.test_projects_alter')) { + if (Drupal::state()->get('locale.test_projects_alter')) { // Instead of the default ftp.drupal.org we use the file system of the test // instance to simulate a remote file location. diff --git a/core/modules/node/node.install b/core/modules/node/node.install index d8c9bf9..527ceb0 100644 --- a/core/modules/node/node.install +++ b/core/modules/node/node.install @@ -438,12 +438,12 @@ function node_uninstall() { variable_del('node_rank_recent'); // Delete remaining general module variables. - \Drupal::state()->delete('node.node_access_needs_rebuild'); + Drupal::state()->delete('node.node_access_needs_rebuild'); variable_del('node_admin_theme'); variable_del('node_recent_block_count'); // Delete any stored state. - \Drupal::state()->delete('node.cron_last'); + Drupal::state()->delete('node.cron_last'); } /** diff --git a/core/modules/node/node.module b/core/modules/node/node.module index bc4bfca..82cbe84 100644 --- a/core/modules/node/node.module +++ b/core/modules/node/node.module @@ -1450,7 +1450,7 @@ function node_ranking() { ); // Add relevance based on creation or changed date. - if ($node_cron_last = \Drupal::state()->get('node.cron_last')) { + if ($node_cron_last = Drupal::state()->get('node.cron_last')) { $ranking['recent'] = array( 'title' => t('Recently posted'), // Exponential decay with half-life of 6 months, starting at last indexed node @@ -2241,7 +2241,7 @@ function _node_index_node(EntityInterface $node) { // Save the changed time of the most recent indexed node, for the search // results half-life calculation. - \Drupal::state()->set('node.cron_last', $node->changed); + Drupal::state()->set('node.cron_last', $node->changed); $languages = $node->getTranslationLanguages(); @@ -2970,13 +2970,13 @@ function _node_access_write_grants(EntityInterface $node, $grants, $realm = NULL */ function node_access_needs_rebuild($rebuild = NULL) { if (!isset($rebuild)) { - return \Drupal::state()->get('node.node_access_needs_rebuild') ?: FALSE; + return Drupal::state()->get('node.node_access_needs_rebuild') ?: FALSE; } elseif ($rebuild) { - \Drupal::state()->set('node.node_access_needs_rebuild', TRUE); + Drupal::state()->set('node.node_access_needs_rebuild', TRUE); } else { - \Drupal::state()->delete('node.node_access_needs_rebuild'); + Drupal::state()->delete('node.node_access_needs_rebuild'); } } diff --git a/core/modules/node/tests/modules/node_access_test/node_access_test.module b/core/modules/node/tests/modules/node_access_test/node_access_test.module index d1363ad..0971750 100644 --- a/core/modules/node/tests/modules/node_access_test/node_access_test.module +++ b/core/modules/node/tests/modules/node_access_test/node_access_test.module @@ -22,7 +22,7 @@ function node_access_test_node_grants($account, $op) { $grants['node_access_test'] = array(8888, 8889); } - $no_access_uid = \Drupal::state()->get('node_access_test.no_access_uid') ?: 0; + $no_access_uid = Drupal::state()->get('node_access_test.no_access_uid') ?: 0; if ($op == 'view' && $account->uid == $no_access_uid) { $grants['node_access_all'] = array(0); } @@ -35,7 +35,7 @@ function node_access_test_node_grants($account, $op) { function node_access_test_node_access_records(EntityInterface $node) { $grants = array(); // For NodeAccessBaseTableTestCase, only set records for private nodes. - if (!\Drupal::state()->get('node_access_test.private') || $node->private) { + if (!Drupal::state()->get('node_access_test.private') || $node->private) { $grants[] = array( 'realm' => 'node_access_test', 'gid' => 8888, @@ -182,7 +182,7 @@ function node_access_entity_test_page() { */ function node_access_test_form_node_form_alter(&$form, $form_state) { // Only show this checkbox for NodeAccessBaseTableTestCase. - if (\Drupal::state()->get('node_access_test.private')) { + if (Drupal::state()->get('node_access_test.private')) { $node = $form_state['controller']->getEntity($form_state); $form['private'] = array( '#type' => 'checkbox', @@ -241,7 +241,7 @@ function _node_access_test_node_write(EntityInterface $node) { * Implements hook_node_access(). */ function node_access_test_node_access($node, $op, $account, $langcode) { - $secret_catalan = \Drupal::state()->get('node_access_test_secret_catalan') ?: 0; + $secret_catalan = Drupal::state()->get('node_access_test_secret_catalan') ?: 0; if ($secret_catalan && $langcode == 'ca') { // Make all Catalan content secret. return NODE_ACCESS_DENY; diff --git a/core/modules/node/tests/modules/node_test/node_test.module b/core/modules/node/tests/modules/node_test/node_test.module index 394b5ce..3cb030a 100644 --- a/core/modules/node/tests/modules/node_test/node_test.module +++ b/core/modules/node/tests/modules/node_test/node_test.module @@ -160,7 +160,7 @@ function node_test_node_update(EntityInterface $node) { */ function node_test_entity_view_mode_alter(&$view_mode, Drupal\Core\Entity\EntityInterface $entity, $context) { // Only alter the view mode if we are on the test callback. - $change_view_mode = \Drupal::state()->get( 'node_test_change_view_mode') ?: ''; + $change_view_mode = Drupal::state()->get( 'node_test_change_view_mode') ?: ''; if ($change_view_mode) { $view_mode = $change_view_mode; } diff --git a/core/modules/openid/tests/openid_test.module b/core/modules/openid/tests/openid_test.module index d725075..8ff285b 100644 --- a/core/modules/openid/tests/openid_test.module +++ b/core/modules/openid/tests/openid_test.module @@ -108,7 +108,7 @@ function openid_test_yadis_xrds() { $output .= ' - + xri://@ http://example.com/user @@ -226,12 +226,12 @@ function openid_test_endpoint() { */ function openid_test_redirect($count = 0) { if ($count == 0) { - $url = \Drupal::state()->get('openid_test.redirect_url'); + $url = Drupal::state()->get('openid_test.redirect_url'); } else { $url = url('openid-test/redirect/' . --$count, array('absolute' => TRUE)); } - $http_response_code = \Drupal::state()->get('openid_test.redirect_http_response_code') ?: 301; + $http_response_code = Drupal::state()->get('openid_test.redirect_http_response_code') ?: 301; return new RedirectResponse($url, $http_response_code); } @@ -303,9 +303,9 @@ function _openid_test_endpoint_associate() { function _openid_test_endpoint_authenticate() { module_load_include('inc', 'openid'); - $expected_identity = \Drupal::state()->get('openid_test.identity'); + $expected_identity = Drupal::state()->get('openid_test.identity'); if ($expected_identity && $_REQUEST['openid_identity'] != $expected_identity) { - $response = \Drupal::state()->get('openid_test.response') ?: array(); + $response = Drupal::state()->get('openid_test.response') ?: array(); $response += array( 'openid.ns' => OPENID_NS_2_0, 'openid.mode' => 'error', @@ -318,7 +318,7 @@ function _openid_test_endpoint_authenticate() { $nonce = _openid_nonce(); // Generate response containing the user's identity. - $response = \Drupal::state()->get('openid_test.response') ?: array(); + $response = Drupal::state()->get('openid_test.response') ?: array(); $response += array( 'openid.ns' => OPENID_NS_2_0, 'openid.mode' => 'id_res', @@ -359,7 +359,7 @@ function _openid_test_endpoint_authenticate() { * Implements hook_openid_request_alter(). */ function openid_test_openid_request_alter(&$request, $service) { - $parameters = \Drupal::state()->get('openid_test.request_alter'); + $parameters = Drupal::state()->get('openid_test.request_alter'); if (isset($parameters[$request['openid.mode']])) { $request = $parameters[$request['openid.mode']] + $request; } @@ -369,6 +369,6 @@ function openid_test_openid_request_alter(&$request, $service) { * Implements hook_openid_response(). */ function openid_test_openid_response($response, $account) { - \Drupal::state()->set('openid_test.hook_openid_response_response', $response); - \Drupal::state()->set('openid_test.hook_openid_response_account', $account ? $account : FALSE); + Drupal::state()->set('openid_test.hook_openid_response_response', $response); + Drupal::state()->set('openid_test.hook_openid_response_account', $account ? $account : FALSE); } diff --git a/core/modules/search/search.admin.inc b/core/modules/search/search.admin.inc index e94b768..06fd68d 100644 --- a/core/modules/search/search.admin.inc +++ b/core/modules/search/search.admin.inc @@ -180,7 +180,7 @@ function search_admin_settings_submit($form, &$form_state) { if ($config->get('active_modules') != $new_modules) { $config->set('active_modules', $new_modules); drupal_set_message(t('The active search modules have been changed.')); - \Drupal::state()->set('menu_rebuild_needed', TRUE); + Drupal::state()->set('menu_rebuild_needed', TRUE); } $config->save(); } diff --git a/core/modules/statistics/statistics.install b/core/modules/statistics/statistics.install index 9b443e5..5706db3 100644 --- a/core/modules/statistics/statistics.install +++ b/core/modules/statistics/statistics.install @@ -10,8 +10,8 @@ */ function statistics_uninstall() { // Remove states. - \Drupal::state()->delete('statistics.node_counter_scale'); - \Drupal::state()->delete('statistics.day_timestamp'); + Drupal::state()->delete('statistics.node_counter_scale'); + Drupal::state()->delete('statistics.day_timestamp'); } /** diff --git a/core/modules/statistics/statistics.module b/core/modules/statistics/statistics.module index 38b9bc5..318729c 100644 --- a/core/modules/statistics/statistics.module +++ b/core/modules/statistics/statistics.module @@ -90,14 +90,14 @@ function statistics_menu() { * Implements hook_cron(). */ function statistics_cron() { - $statistics_timestamp = \Drupal::state()->get('statistics.day_timestamp') ?: 0; + $statistics_timestamp = Drupal::state()->get('statistics.day_timestamp') ?: 0; if ((REQUEST_TIME - $statistics_timestamp) >= 86400) { // Reset day counts. db_update('node_counter') ->fields(array('daycount' => 0)) ->execute(); - \Drupal::state()->set('statistics.day_timestamp', REQUEST_TIME); + Drupal::state()->set('statistics.day_timestamp', REQUEST_TIME); } } @@ -220,7 +220,7 @@ function statistics_ranking() { ), // Inverse law that maps the highest view count on the site to 1 and 0 to 0. 'score' => '2.0 - 2.0 / (1.0 + node_counter.totalcount * CAST(:scale AS DECIMAL))', - 'arguments' => array(':scale' => \Drupal::state()->get('statistics.node_counter_scale') ?: 0), + 'arguments' => array(':scale' => Drupal::state()->get('statistics.node_counter_scale') ?: 0), ), ); } @@ -230,7 +230,7 @@ function statistics_ranking() { * Implements hook_update_index(). */ function statistics_update_index() { - \Drupal::state()->set('statistics.node_counter_scale', 1.0 / max(1, db_query('SELECT MAX(totalcount) FROM {node_counter}')->fetchField())); + Drupal::state()->set('statistics.node_counter_scale', 1.0 / max(1, db_query('SELECT MAX(totalcount) FROM {node_counter}')->fetchField())); } /** diff --git a/core/modules/system/system.admin.inc b/core/modules/system/system.admin.inc index b60855a..7ef1b53 100644 --- a/core/modules/system/system.admin.inc +++ b/core/modules/system/system.admin.inc @@ -1540,13 +1540,13 @@ function system_cron_settings($form, &$form_state) { '#submit' => array('system_run_cron_submit'), ); - $status = '

' . t('Last run: %cron-last ago.', array('%cron-last' => format_interval(REQUEST_TIME - \Drupal::state()->get('system.cron_last')))) . '

'; + $status = '

' . t('Last run: %cron-last ago.', array('%cron-last' => format_interval(REQUEST_TIME - Drupal::state()->get('system.cron_last')))) . '

'; $form['status'] = array( '#markup' => $status, ); $form['cron_url'] = array( - '#markup' => '

' . t('To run cron from outside the site, go to !cron', array('!cron' => url('cron/' . \Drupal::state()->get('system.cron_key'), array('absolute' => TRUE)))) . '

', + '#markup' => '

' . t('To run cron from outside the site, go to !cron', array('!cron' => url('cron/' . Drupal::state()->get('system.cron_key'), array('absolute' => TRUE)))) . '

', ); $form['cron'] = array( diff --git a/core/modules/system/system.install b/core/modules/system/system.install index f83e669..4545359 100644 --- a/core/modules/system/system.install +++ b/core/modules/system/system.install @@ -1,4 +1,4 @@ -configuring cron jobs.', array('@cron-handbook' => 'http://drupal.org/cron')); // Determine when cron last ran. - $cron_last = \Drupal::state()->get('system.cron_last'); + $cron_last = Drupal::state()->get('system.cron_last'); if (!is_numeric($cron_last)) { $cron_last = variable_get('install_time', 0); } @@ -294,7 +294,7 @@ function system_requirements($phase) { } $description .= ' ' . $t('You can run cron manually.', array('@cron' => url('admin/reports/status/run-cron'))); - $description .= '
' . $t('To run cron from outside the site, go to !cron', array('!cron' => url('cron/' . \Drupal::state()->get('system.cron_key'), array('absolute' => TRUE)))); + $description .= '
' . $t('To run cron from outside the site, go to !cron', array('!cron' => url('cron/' . Drupal::state()->get('system.cron_key'), array('absolute' => TRUE)))); $requirements['cron'] = array( 'title' => $t('Cron maintenance tasks'), @@ -530,7 +530,7 @@ function system_install() { // Populate the cron key state variable. $cron_key = drupal_hash_base64(drupal_random_bytes(55)); - \Drupal::state()->set('system.cron_key', $cron_key); + Drupal::state()->set('system.cron_key', $cron_key); } /** @@ -734,7 +734,7 @@ function system_schema() { ); $schema['key_value'] = array( - 'description' => 'Generic key-value storage table. See \Drupal::state() for an example.', + 'description' => 'Generic key-value storage table. See the state system for an example.', 'fields' => array( 'collection' => array( 'description' => 'A named collection of key and value pairs.', @@ -1784,7 +1784,7 @@ function system_update_8028() { */ function system_update_8029() { if ($value = update_variable_get('path_alias_whitelist', FALSE)) { - \Drupal::state()->set('system.path_alias_whitelist', $value); + Drupal::state()->set('system.path_alias_whitelist', $value); } update_variable_del('path_alias_whitelist'); } diff --git a/core/modules/system/system.module b/core/modules/system/system.module index 1a090bf..74839a8 100644 --- a/core/modules/system/system.module +++ b/core/modules/system/system.module @@ -2965,7 +2965,7 @@ function system_rebuild_module_data() { // Store filenames to allow system_list() and drupal_get_filename() to // retrieve them without having to rebuild or scan the filesystem. - \Drupal::state()->set('system.module.files', $files); + Drupal::state()->set('system.module.files', $files); } return $modules_cache; } @@ -2984,7 +2984,7 @@ function _system_update_bootstrap_status() { $bootstrap_modules[$module] = drupal_get_filename('module', $module); } } - \Drupal::state()->set('system.module.bootstrap', $bootstrap_modules); + Drupal::state()->set('system.module.bootstrap', $bootstrap_modules); } /** @@ -3131,11 +3131,11 @@ function system_rebuild_theme_data() { } // Replace last known theme data state. // @todo Obsolete with proper installation status for themes. - \Drupal::state()->set('system.theme.data', $themes); + Drupal::state()->set('system.theme.data', $themes); // Store filenames to allow system_list() and drupal_get_filename() to // retrieve them without having to rebuild or scan the filesystem. - \Drupal::state()->set('system.theme.files', $files); + Drupal::state()->set('system.theme.files', $files); return $themes; } @@ -3744,7 +3744,7 @@ function system_run_automated_cron() { // 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') { - $cron_last = \Drupal::state()->get('system.cron_last') ?: NULL; + $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/tests/modules/batch_test/batch_test.module b/core/modules/system/tests/modules/batch_test/batch_test.module index 2e52a1e..85ee47c 100644 --- a/core/modules/system/tests/modules/batch_test/batch_test.module +++ b/core/modules/system/tests/modules/batch_test/batch_test.module @@ -527,12 +527,12 @@ function _batch_test_theme_callback() { */ function batch_test_stack($data = NULL, $reset = FALSE) { if ($reset) { - \Drupal::state()->delete('batch_test.stack'); + Drupal::state()->delete('batch_test.stack'); } if (!isset($data)) { - return \Drupal::state()->get('batch_test.stack'); + return Drupal::state()->get('batch_test.stack'); } - $stack = \Drupal::state()->get('batch_test.stack'); + $stack = Drupal::state()->get('batch_test.stack'); $stack[] = $data; - \Drupal::state()->set('batch_test.stack', $stack); + Drupal::state()->set('batch_test.stack', $stack); } diff --git a/core/modules/system/tests/modules/common_test_cron_helper/common_test_cron_helper.module b/core/modules/system/tests/modules/common_test_cron_helper/common_test_cron_helper.module index ee280a3..ef3ac88 100644 --- a/core/modules/system/tests/modules/common_test_cron_helper/common_test_cron_helper.module +++ b/core/modules/system/tests/modules/common_test_cron_helper/common_test_cron_helper.module @@ -14,5 +14,5 @@ * @see common_test_cron() */ function common_test_cron_helper_cron() { - \Drupal::state()->set('common_test.cron', 'success'); + Drupal::state()->set('common_test.cron', 'success'); } diff --git a/core/modules/system/tests/modules/entity_cache_test/entity_cache_test.module b/core/modules/system/tests/modules/entity_cache_test/entity_cache_test.module index e7041c4..962114c 100644 --- a/core/modules/system/tests/modules/entity_cache_test/entity_cache_test.module +++ b/core/modules/system/tests/modules/entity_cache_test/entity_cache_test.module @@ -21,6 +21,6 @@ function entity_cache_test_watchdog($log_entry) { $info = entity_get_info('entity_cache_test'); // Store the information in a system variable to analyze it later in the // test case. - \Drupal::state()->set('entity_cache_test', $info); + Drupal::state()->set('entity_cache_test', $info); } } diff --git a/core/modules/system/tests/modules/entity_cache_test_dependency/entity_cache_test_dependency.module b/core/modules/system/tests/modules/entity_cache_test_dependency/entity_cache_test_dependency.module index 004f531..f2e9873 100644 --- a/core/modules/system/tests/modules/entity_cache_test_dependency/entity_cache_test_dependency.module +++ b/core/modules/system/tests/modules/entity_cache_test_dependency/entity_cache_test_dependency.module @@ -9,5 +9,5 @@ * Implements hook_entity_info_alter(). */ function entity_cache_test_dependency_entity_info_alter(&$info) { - $info['entity_cache_test']['label'] = \Drupal::state()->get('entity_cache_test.label') ?: 'Entity Cache Test'; + $info['entity_cache_test']['label'] = Drupal::state()->get('entity_cache_test.label') ?: 'Entity Cache Test'; } diff --git a/core/modules/system/tests/modules/entity_test/entity_test.module b/core/modules/system/tests/modules/entity_test/entity_test.module index 5b7f37a..f5959a3 100644 --- a/core/modules/system/tests/modules/entity_test/entity_test.module +++ b/core/modules/system/tests/modules/entity_test/entity_test.module @@ -56,7 +56,7 @@ function entity_test_entity_types($filter = NULL) { */ function entity_test_entity_info_alter(&$info) { // Optionally specify a translation handler for testing translations. - if (\Drupal::state()->get('entity_test.translation')) { + if (Drupal::state()->get('entity_test.translation')) { foreach(entity_test_entity_types() as $entity_type) { $info[$entity_type]['translation'][$entity_type] = TRUE; } @@ -147,7 +147,7 @@ function entity_test_menu() { */ function entity_test_form_node_form_alter(&$form, &$form_state, $form_id) { $langcode = $form_state['controller']->getFormLangcode($form_state); - \Drupal::state()->set('entity_test.form_langcode', $langcode); + Drupal::state()->set('entity_test.form_langcode', $langcode); } /** 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 a0878db..6405a03 100644 --- a/core/modules/system/tests/modules/menu_test/menu_test.module +++ b/core/modules/system/tests/modules/menu_test/menu_test.module @@ -492,7 +492,7 @@ function menu_test_callback() { * Callback that test menu_test_menu_tree_set_path(). */ function menu_test_menu_trail_callback() { - $menu_path = \Drupal::state()->get('menu_test.menu_tree_set_path') ?: array(); + $menu_path = Drupal::state()->get('menu_test.menu_tree_set_path') ?: array(); if (!empty($menu_path)) { menu_tree_set_path($menu_path['menu_name'], $menu_path['path']); } @@ -506,8 +506,8 @@ function menu_test_init() { // When requested by one of the MenuTrailTestCase tests, record the initial // active trail during Drupal's bootstrap (before the user is redirected to a // custom 403 or 404 page). See menu_test_custom_403_404_callback(). - if (\Drupal::state()->get('menu_test.record_active_trail') ?: FALSE) { - \Drupal::state()->set('menu_test.active_trail_initial', menu_get_active_trail()); + if (Drupal::state()->get('menu_test.record_active_trail') ?: FALSE) { + Drupal::state()->set('menu_test.active_trail_initial', menu_get_active_trail()); } } @@ -518,8 +518,8 @@ function menu_test_custom_403_404_callback() { // When requested by one of the MenuTrailTestCase tests, record the final // active trail now that the user has been redirected to the custom 403 or // 404 page. See menu_test_init(). - if (\Drupal::state()->get('menu_test.record_active_trail') ?: FALSE) { - \Drupal::state()->set('menu_test.active_trail_final', menu_get_active_trail()); + if (Drupal::state()->get('menu_test.record_active_trail') ?: FALSE) { + Drupal::state()->set('menu_test.active_trail_final', menu_get_active_trail()); } return 'This is menu_test_custom_403_404_callback().'; @@ -585,7 +585,7 @@ function menu_test_custom_theme() { // If an appropriate variable has been set in the database, request the theme // that is stored there. Otherwise, do not attempt to dynamically set the // theme. - if ($theme = \Drupal::state()->get('menu_test.hook_custom_theme_name') ?: FALSE) { + if ($theme = Drupal::state()->get('menu_test.hook_custom_theme_name') ?: FALSE) { return $theme; } } diff --git a/core/modules/system/tests/modules/module_test/module_test.module b/core/modules/system/tests/modules/module_test/module_test.module index fece25b..39caf92 100644 --- a/core/modules/system/tests/modules/module_test/module_test.module +++ b/core/modules/system/tests/modules/module_test/module_test.module @@ -15,7 +15,7 @@ function module_test_permission() { * Manipulate module dependencies to test dependency chains. */ function module_test_system_info_alter(&$info, $file, $type) { - if (\Drupal::state()->get('module_test.dependency') == 'missing dependency') { + if (Drupal::state()->get('module_test.dependency') == 'missing dependency') { if ($file->name == 'forum') { // Make forum module depend on ban. $info['dependencies'][] = 'ban'; @@ -25,7 +25,7 @@ function module_test_system_info_alter(&$info, $file, $type) { $info['dependencies'][] = 'foo'; } } - elseif (\Drupal::state()->get('module_test.dependency') == 'dependency') { + elseif (Drupal::state()->get('module_test.dependency') == 'dependency') { if ($file->name == 'forum') { // Make the forum module depend on ban. $info['dependencies'][] = 'ban'; @@ -35,7 +35,7 @@ function module_test_system_info_alter(&$info, $file, $type) { $info['dependencies'][] = 'php'; } } - elseif (\Drupal::state()->get('module_test.dependency') == 'version dependency') { + elseif (Drupal::state()->get('module_test.dependency') == 'version dependency') { if ($file->name == 'forum') { // Make the forum module depend on ban. $info['dependencies'][] = 'ban'; @@ -155,7 +155,7 @@ function module_test_class_loading() { function module_test_modules_enabled($modules) { // Record the ordered list of modules that were passed in to this hook so we // can check that the modules were enabled in the correct sequence. - \Drupal::state()->set('system_test.module_enable_order', $modules); + Drupal::state()->set('system_test.module_enable_order', $modules); } /** @@ -164,7 +164,7 @@ function module_test_modules_enabled($modules) { function module_test_modules_disabled($modules) { // Record the ordered list of modules that were passed in to this hook so we // can check that the modules were disabled in the correct sequence. - \Drupal::state()->set('module_test.disable_order', $modules); + Drupal::state()->set('module_test.disable_order', $modules); } /** @@ -173,5 +173,5 @@ function module_test_modules_disabled($modules) { function module_test_modules_uninstalled($modules) { // Record the ordered list of modules that were passed in to this hook so we // can check that the modules were uninstalled in the correct sequence. - \Drupal::state()->set('module_test.uninstall_order', $modules); + Drupal::state()->set('module_test.uninstall_order', $modules); } diff --git a/core/modules/system/tests/modules/path_test/path_test.module b/core/modules/system/tests/modules/path_test/path_test.module index df03931..6f4d580 100644 --- a/core/modules/system/tests/modules/path_test/path_test.module +++ b/core/modules/system/tests/modules/path_test/path_test.module @@ -9,14 +9,14 @@ * Resets the path test results. */ function path_test_reset() { - \Drupal::state()->set('path_test.results', array()); + Drupal::state()->set('path_test.results', array()); } /** * Implements hook_path_update(). */ function path_test_path_update($path) { - $results = \Drupal::state()->get('path_test.results') ?: array(); + $results = Drupal::state()->get('path_test.results') ?: array(); $results['hook_path_update'] = $path; - \Drupal::state()->set('path_test.results', $results); + Drupal::state()->set('path_test.results', $results); } diff --git a/core/modules/system/tests/modules/system_test/system_test.module b/core/modules/system/tests/modules/system_test/system_test.module index e578f97..55c0b9e 100644 --- a/core/modules/system/tests/modules/system_test/system_test.module +++ b/core/modules/system/tests/modules/system_test/system_test.module @@ -177,7 +177,7 @@ function system_test_redirect_invalid_scheme() { * Implements hook_modules_installed(). */ function system_test_modules_installed($modules) { - if (\Drupal::state()->get('system_test.verbose_module_hooks')) { + if (Drupal::state()->get('system_test.verbose_module_hooks')) { foreach ($modules as $module) { drupal_set_message(t('hook_modules_installed fired for @module', array('@module' => $module))); } @@ -188,7 +188,7 @@ function system_test_modules_installed($modules) { * Implements hook_modules_enabled(). */ function system_test_modules_enabled($modules) { - if (\Drupal::state()->get('system_test.verbose_module_hooks')) { + if (Drupal::state()->get('system_test.verbose_module_hooks')) { foreach ($modules as $module) { drupal_set_message(t('hook_modules_enabled fired for @module', array('@module' => $module))); } @@ -199,7 +199,7 @@ function system_test_modules_enabled($modules) { * Implements hook_modules_disabled(). */ function system_test_modules_disabled($modules) { - if (\Drupal::state()->get('system_test.verbose_module_hooks')) { + if (Drupal::state()->get('system_test.verbose_module_hooks')) { foreach ($modules as $module) { drupal_set_message(t('hook_modules_disabled fired for @module', array('@module' => $module))); } @@ -210,7 +210,7 @@ function system_test_modules_disabled($modules) { * Implements hook_modules_uninstalled(). */ function system_test_modules_uninstalled($modules) { - if (\Drupal::state()->get('system_test.verbose_module_hooks')) { + if (Drupal::state()->get('system_test.verbose_module_hooks')) { foreach ($modules as $module) { drupal_set_message(t('hook_modules_uninstalled fired for @module', array('@module' => $module))); } @@ -222,7 +222,7 @@ function system_test_modules_uninstalled($modules) { */ function system_test_init() { // Used by FrontPageTestCase to get the results of drupal_is_front_page(). - $frontpage = \Drupal::state()->get('system_test.front_page_output') ?: 0; + $frontpage = Drupal::state()->get('system_test.front_page_output') ?: 0; if ($frontpage && drupal_is_front_page()) { drupal_set_message(t('On front page.')); } @@ -241,11 +241,11 @@ function system_test_exit() { function system_test_system_info_alter(&$info, $file, $type) { // We need a static otherwise the last test will fail to alter common_test. static $test; - if (($dependencies = \Drupal::state()->get('system_test.dependencies')) || $test) { + if (($dependencies = Drupal::state()->get('system_test.dependencies')) || $test) { if ($file->name == 'module_test') { $info['hidden'] = FALSE; $info['dependencies'][] = array_shift($dependencies); - \Drupal::state()->set('system_test.dependencies', $dependencies); + Drupal::state()->set('system_test.dependencies', $dependencies); $test = TRUE; } if ($file->name == 'common_test') { diff --git a/core/modules/system/tests/modules/update_test_1/update_test_1.install b/core/modules/system/tests/modules/update_test_1/update_test_1.install index bfb7170..3ac73db 100644 --- a/core/modules/system/tests/modules/update_test_1/update_test_1.install +++ b/core/modules/system/tests/modules/update_test_1/update_test_1.install @@ -11,7 +11,7 @@ * @see update_test_2_update_dependencies() */ function update_test_1_update_dependencies() { - \Drupal::state()->set('update_test_1_update_dependencies_run', TRUE); + Drupal::state()->set('update_test_1_update_dependencies_run', TRUE); // These dependencies are used in combination with those declared in // update_test_2_update_dependencies() for the sole purpose of testing that // the results of hook_update_dependencies() are collected correctly and have diff --git a/core/modules/toolbar/js/toolbar.js b/core/modules/toolbar/js/toolbar.js index b828cc6..446f1e6 100644 --- a/core/modules/toolbar/js/toolbar.js +++ b/core/modules/toolbar/js/toolbar.js @@ -303,7 +303,7 @@ function toggleOrientationToggle (orientation) { */ function updatePeripherals () { // Adjust the body to accommodate trays. - setBody\Drupal::state(); + setBodyState(); // Adjust the tray width for vertical trays. Drupal.toolbar.setTrayWidth(); } diff --git a/core/modules/tracker/tracker.install b/core/modules/tracker/tracker.install index daa2983..841d74a 100644 --- a/core/modules/tracker/tracker.install +++ b/core/modules/tracker/tracker.install @@ -9,7 +9,7 @@ * Implements hook_uninstall(). */ function tracker_uninstall() { - \Drupal::state()->delete('tracker.index_nid'); + Drupal::state()->delete('tracker.index_nid'); } /** @@ -18,7 +18,7 @@ function tracker_uninstall() { function tracker_enable() { $max_nid = db_query('SELECT MAX(nid) FROM {node}')->fetchField(); if ($max_nid != 0) { - \Drupal::state()->set('tracker.index_nid', $max_nid); + Drupal::state()->set('tracker.index_nid', $max_nid); // To avoid timing out while attempting to do a complete indexing, we // simply call our cron job to remove stale records and begin the process. tracker_cron(); diff --git a/core/modules/tracker/tracker.module b/core/modules/tracker/tracker.module index 7220cd0..b0cb9f8 100644 --- a/core/modules/tracker/tracker.module +++ b/core/modules/tracker/tracker.module @@ -79,7 +79,7 @@ function tracker_menu() { * process, 'tracker.index_nid' will be 0. */ function tracker_cron() { - $state = \Drupal::state(); + $state = Drupal::state(); $max_nid = $state->get('tracker.index_nid') ?: 0; if ($max_nid > 0) { $batch_size = config('tracker.settings')->get('cron_index_limit'); diff --git a/core/modules/update/update.fetch.inc b/core/modules/update/update.fetch.inc index 961c302..65894f1 100644 --- a/core/modules/update/update.fetch.inc +++ b/core/modules/update/update.fetch.inc @@ -184,7 +184,7 @@ function _update_process_fetch_task($project) { Drupal::keyValueExpirable('update')->setWithExpire('fetch_failures', $fail, $request_time_difference + (60 * 5)); // Whether this worked or not, we did just (try to) check for updates. - \Drupal::state()->set('update.last_check', REQUEST_TIME + $request_time_difference); + Drupal::state()->set('update.last_check', REQUEST_TIME + $request_time_difference); // Now that we processed the fetch task for this project, clear out the // record for this task so we're willing to fetch again. @@ -359,7 +359,7 @@ function _update_cron_notify() { // Track when the last mail was successfully sent to avoid sending // too many e-mails. if ($message['result']) { - \Drupal::state()->set('update.last_email_notification', REQUEST_TIME); + Drupal::state()->set('update.last_email_notification', REQUEST_TIME); } } } diff --git a/core/modules/update/update.manager.inc b/core/modules/update/update.manager.inc index 14ef05f..96590e0 100644 --- a/core/modules/update/update.manager.inc +++ b/core/modules/update/update.manager.inc @@ -278,7 +278,7 @@ function update_manager_update_form($form, $form_state = array(), $context) { */ function theme_update_manager_update_form($variables) { $form = $variables['form']; - $last = \Drupal::state()->get('update.last_check') ?: 0; + $last = Drupal::state()->get('update.last_check') ?: 0; $output = theme('update_last_check', array('last' => $last)); $output .= drupal_render_children($form); return $output; diff --git a/core/modules/update/update.module b/core/modules/update/update.module index 4ffa918..ec14858 100644 --- a/core/modules/update/update.module +++ b/core/modules/update/update.module @@ -283,7 +283,7 @@ function update_cron() { $update_config = config('update.settings'); $frequency = $update_config->get('check.interval_days'); $interval = 60 * 60 * 24 * $frequency; - $last_check = \Drupal::state()->get('update.last_check') ?: 0; + $last_check = Drupal::state()->get('update.last_check') ?: 0; if ((REQUEST_TIME - $last_check) > $interval) { // If the configured update interval has elapsed, we want to invalidate // the data for all projects, attempt to re-fetch, and trigger any @@ -296,7 +296,7 @@ function update_cron() { // missing data, and if so, try to fetch the data. update_get_available(TRUE); } - $last_email_notice = \Drupal::state()->get('update.last_email_notification') ?: 0; + $last_email_notice = Drupal::state()->get('update.last_email_notification') ?: 0; if ((REQUEST_TIME - $last_email_notice) > $interval) { // If configured time between notifications elapsed, send email about // updates possibly available. diff --git a/core/modules/update/update.report.inc b/core/modules/update/update.report.inc index 73dd091..7a79394 100644 --- a/core/modules/update/update.report.inc +++ b/core/modules/update/update.report.inc @@ -33,7 +33,7 @@ function update_status() { function theme_update_report($variables) { $data = $variables['data']; - $last = \Drupal::state()->get('update.last_check') ?: 0; + $last = Drupal::state()->get('update.last_check') ?: 0; $output = theme('update_last_check', array('last' => $last)); if (!is_array($data)) { diff --git a/core/modules/views/tests/views_test_data/views_test_data.install b/core/modules/views/tests/views_test_data/views_test_data.install index da99c0b..6b1a868 100644 --- a/core/modules/views/tests/views_test_data/views_test_data.install +++ b/core/modules/views/tests/views_test_data/views_test_data.install @@ -9,7 +9,7 @@ * Implements hook_schema(). */ function views_test_data_schema() { - return \Drupal::state()->get('views_test_data_schema'); + return Drupal::state()->get('views_test_data_schema'); } /** diff --git a/core/modules/views/tests/views_test_data/views_test_data.module b/core/modules/views/tests/views_test_data/views_test_data.module index 63b0d95..0412396 100644 --- a/core/modules/views/tests/views_test_data/views_test_data.module +++ b/core/modules/views/tests/views_test_data/views_test_data.module @@ -24,7 +24,7 @@ function views_test_data_test_static_access_callback($access) { } function views_test_data_test_dynamic_access_callback($access, $argument1, $argument2) { - return $access && $argument1 == \Drupal::state()->get('test_dynamic_access_argument1') && $argument2 == \Drupal::state()->get('test_dynamic_access_argument2'); + return $access && $argument1 == Drupal::state()->get('test_dynamic_access_argument1') && $argument2 == Drupal::state()->get('test_dynamic_access_argument2'); } /** @@ -85,9 +85,9 @@ function views_test_data_views_pre_render(ViewExecutable $view) { */ function views_test_data_preprocess_views_view_table(&$variables) { if ($variables['view']->storage->id() == 'test_view_render') { - $views_render_test = \Drupal::state()->get('views_render.test'); + $views_render_test = Drupal::state()->get('views_render.test'); $views_render_test++; - \Drupal::state()->set('views_render.test', $views_render_test); + Drupal::state()->set('views_render.test', $views_render_test); } } diff --git a/core/modules/views/views.module b/core/modules/views/views.module index 5b14645..e765bbb 100644 --- a/core/modules/views/views.module +++ b/core/modules/views/views.module @@ -685,7 +685,7 @@ function views_invalidate_cache() { Cache::deleteTags(array('content' => TRUE)); // Set the menu as needed to be rebuilt. - \Drupal::state()->set('menu_rebuild_needed', TRUE); + Drupal::state()->set('menu_rebuild_needed', TRUE); // Invalidate the block cache to update views block derivatives. if (module_exists('block')) { diff --git a/core/modules/views/views_ui/lib/Drupal/views_ui/Form/Ajax/Display.php b/core/modules/views/views_ui/lib/Drupal/views_ui/Form/Ajax/Display.php index 1122054..5642e86 100644 --- a/core/modules/views/views_ui/lib/Drupal/views_ui/Form/Ajax/Display.php +++ b/core/modules/views/views_ui/lib/Drupal/views_ui/Form/Ajax/Display.php @@ -29,7 +29,7 @@ public function getFormKey() { } /** - * Overrides \Drupal\views_ui\Form\Ajax\ViewsFormBase::getForm\Drupal::state(). + * Overrides \Drupal\views_ui\Form\Ajax\ViewsFormBase::getFormState(). * * @todo Remove this and switch all usage of $form_state['section'] to * $form_state['type']. diff --git a/core/modules/views/views_ui/lib/Drupal/views_ui/Form/Ajax/ViewsFormBase.php b/core/modules/views/views_ui/lib/Drupal/views_ui/Form/Ajax/ViewsFormBase.php index 0fb6c98..b5ce81c 100644 --- a/core/modules/views/views_ui/lib/Drupal/views_ui/Form/Ajax/ViewsFormBase.php +++ b/core/modules/views/views_ui/lib/Drupal/views_ui/Form/Ajax/ViewsFormBase.php @@ -57,7 +57,7 @@ protected function setType($type) { } /** - * Implements \Drupal\views_ui\Form\Ajax\ViewsFormInterface::getForm\Drupal::state(). + * Implements \Drupal\views_ui\Form\Ajax\ViewsFormInterface::getFormState(). */ public function getFormState(ViewStorageInterface $view, $display_id, $js) { // $js may already have been converted to a Boolean. diff --git a/core/modules/xmlrpc/tests/modules/xmlrpc_test/xmlrpc_test.module b/core/modules/xmlrpc/tests/modules/xmlrpc_test/xmlrpc_test.module index 3207040..4a772ab 100644 --- a/core/modules/xmlrpc/tests/modules/xmlrpc_test/xmlrpc_test.module +++ b/core/modules/xmlrpc/tests/modules/xmlrpc_test/xmlrpc_test.module @@ -68,7 +68,7 @@ function xmlrpc_test_xmlrpc() { * Hide (or not) the system.methodSignature() service depending on a variable. */ function xmlrpc_test_xmlrpc_alter(&$services) { - $xmlprc_alter = \Drupal::state()->get('xmlrpc_test.alter') ?: FALSE; + $xmlprc_alter = Drupal::state()->get('xmlrpc_test.alter') ?: FALSE; if ($xmlprc_alter) { $remove = NULL; foreach ($services as $key => $value) {