Commit 5bb0d5e6 authored by webchick's avatar webchick

Issue #2053489 by chx, tim.plunkett: Standardize on \Drupal throughout core.

parent 1024ba83
......@@ -74,7 +74,7 @@ function authorize_access_allowed() {
drupal_bootstrap(DRUPAL_BOOTSTRAP_VARIABLES);
$request = Request::createFromGlobals();
Drupal::getContainer()->set('request', $request);
\Drupal::getContainer()->set('request', $request);
// This must go after drupal_bootstrap(), which unsets globals!
global $conf;
......@@ -83,9 +83,9 @@ function authorize_access_allowed() {
// display errors via the maintenance theme.
$module_list['system'] = 'core/modules/system/system.module';
$module_list['user'] = 'core/modules/user/user.module';
Drupal::moduleHandler()->setModuleList($module_list);
Drupal::moduleHandler()->load('system');
Drupal::moduleHandler()->load('user');
\Drupal::moduleHandler()->setModuleList($module_list);
\Drupal::moduleHandler()->load('system');
\Drupal::moduleHandler()->load('user');
// Initialize the language system.
drupal_language_initialize();
......
......@@ -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 === Drupal::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(Drupal::config('system.maintenance')->get('message'), array('@site' => Drupal::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;
}
}
......
......@@ -27,7 +27,7 @@ function authorize_filetransfer_form($form, &$form_state) {
}
$available_backends = $_SESSION['authorize_filetransfer_info'];
if (!Drupal::request()->isSecure()) {
if (!\Drupal::request()->isSecure()) {
$form['information']['https_warning'] = array(
'#prefix' => '<div class="messages messages--error">',
'#markup' => t('WARNING: You are not using an encrypted connection, so your password will be sent in plain text. <a href="@https-link">Learn more</a>.', array('@https-link' => 'http://drupal.org/https-information')),
......@@ -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 = Drupal::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 = Drupal::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.
Drupal::config('system.authorize')->set('filetransfer_default', $filetransfer_backend);
\Drupal::config('system.authorize')->set('filetransfer_default', $filetransfer_backend);
// Save the connection settings minus the password.
Drupal::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]);
......
......@@ -36,7 +36,7 @@ function _batch_page(Request $request) {
// Retrieve the current state of the batch.
if (!$batch) {
$batch = Drupal::service('batch.storage')->load($request_id);
$batch = \Drupal::service('batch.storage')->load($request_id);
if (!$batch) {
drupal_set_message(t('No active batch.'), 'error');
return new RedirectResponse(url('<front>', array('absolute' => TRUE)));
......@@ -394,7 +394,7 @@ function _batch_finished() {
// Clean up the batch table and unset the static $batch variable.
if ($batch['progressive']) {
Drupal::service('batch.storage')->delete($batch['id']);
\Drupal::service('batch.storage')->delete($batch['id']);
foreach ($batch['sets'] as $batch_set) {
if ($queue = _batch_queue($batch_set)) {
$queue->deleteQueue();
......@@ -415,7 +415,7 @@ function _batch_finished() {
if ($_batch['progressive']) {
// Revert the 'destination' that was saved in batch_process().
if (isset($_batch['destination'])) {
Drupal::request()->query->set('destination', $_batch['destination']);
\Drupal::request()->query->set('destination', $_batch['destination']);
}
// Determine the target path to redirect to.
......@@ -463,6 +463,6 @@ function _batch_finished() {
*/
function _batch_shutdown() {
if ($batch = batch_get()) {
Drupal::service('batch.storage')->update($batch);
\Drupal::service('batch.storage')->update($batch);
}
}
This diff is collapsed.
......@@ -26,7 +26,7 @@
* @see Drupal\Core\Cache\CacheBackendInterface
*/
function cache($bin = 'cache') {
return Drupal::cache($bin);
return \Drupal::cache($bin);
}
/**
......
This diff is collapsed.
......@@ -66,17 +66,17 @@ function ($value) use ($name) {
$config_to_install = array_merge($config_to_install, $other_module_config);
}
if (!empty($config_to_install)) {
$storage_comparer = new ExtensionInstallStorageComparer($source_storage, Drupal::service('config.storage'));
$storage_comparer = new ExtensionInstallStorageComparer($source_storage, \Drupal::service('config.storage'));
$storage_comparer->setSourceNames($config_to_install);
// Only import new config. Changed config is from previous enables and
// should not be overwritten.
$storage_comparer->addChangelistCreate();
$installer = new ConfigInstaller(
$storage_comparer,
Drupal::service('event_dispatcher'),
Drupal::service('config.factory'),
Drupal::entityManager(),
Drupal::lock()
\Drupal::service('event_dispatcher'),
\Drupal::service('config.factory'),
\Drupal::entityManager(),
\Drupal::lock()
);
$installer->import();
}
......@@ -94,7 +94,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) {
Drupal::config($config_name)->delete();
\Drupal::config($config_name)->delete();
}
}
......@@ -126,7 +126,7 @@ function config_get_storage_names_with_prefix($prefix = '') {
* A configuration object.
*/
function config($name) {
return Drupal::config($name);
return \Drupal::config($name);
}
/**
......@@ -134,7 +134,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 Drupal::config() until
* Calling this function affects all subsequent calls to \Drupal::config() until
* config_context_leave() is called.
*
* @see config_context_leave()
......
......@@ -91,7 +91,7 @@ function hook_entity_bundle_info_alter(&$bundles) {
function hook_entity_bundle_create($entity_type, $bundle) {
// When a new bundle is created, the menu needs to be rebuilt to add the
// Field UI menu item tabs.
Drupal::state()->set('menu_rebuild_needed', TRUE);
\Drupal::state()->set('menu_rebuild_needed', TRUE);
}
/**
......@@ -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 = Drupal::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 = Drupal::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]);
......
......@@ -29,10 +29,10 @@
*/
function entity_get_info($entity_type = NULL) {
if (empty($entity_type)) {
return Drupal::entityManager()->getDefinitions();
return \Drupal::entityManager()->getDefinitions();
}
else {
return Drupal::entityManager()->getDefinition($entity_type);
return \Drupal::entityManager()->getDefinition($entity_type);
}
}
......@@ -42,8 +42,8 @@ function entity_get_info($entity_type = NULL) {
function entity_info_cache_clear() {
drupal_static_reset('entity_get_view_modes');
// Clear all languages.
Drupal::entityManager()->clearCachedDefinitions();
Drupal::entityManager()->clearCachedFieldDefinitions();
\Drupal::entityManager()->clearCachedDefinitions();
\Drupal::entityManager()->clearCachedFieldDefinitions();
}
/**
......@@ -61,10 +61,10 @@ function entity_info_cache_clear() {
*/
function entity_get_bundles($entity_type = NULL) {
if (isset($entity_type)) {
return Drupal::entityManager()->getBundleInfo($entity_type);
return \Drupal::entityManager()->getBundleInfo($entity_type);
}
else {
return Drupal::entityManager()->getAllBundleInfo();
return \Drupal::entityManager()->getAllBundleInfo();
}
}
......@@ -86,10 +86,10 @@ function entity_invoke_bundle_hook($hook, $entity_type, $bundle, $bundle_new = N
// Notify the entity storage controller.
$method = 'onBundle' . ucfirst($hook);
Drupal::entityManager()->getStorageController($entity_type)->$method($bundle, $bundle_new);
\Drupal::entityManager()->getStorageController($entity_type)->$method($bundle, $bundle_new);
// Invoke hook_entity_bundle_*() hooks.
Drupal::moduleHandler()->invokeAll('entity_bundle_' . $hook, array($entity_type, $bundle, $bundle_new));
\Drupal::moduleHandler()->invokeAll('entity_bundle_' . $hook, array($entity_type, $bundle, $bundle_new));
}
/**
......@@ -187,7 +187,7 @@ function entity_get_view_modes($entity_type = NULL) {
* @see \Drupal\Core\Entity\Query\QueryInterface
*/
function entity_load($entity_type, $id, $reset = FALSE) {
$controller = Drupal::entityManager()->getStorageController($entity_type);
$controller = \Drupal::entityManager()->getStorageController($entity_type);
if ($reset) {
$controller->resetCache(array($id));
}
......@@ -211,7 +211,7 @@ function entity_load($entity_type, $id, $reset = FALSE) {
* @see \Drupal\Core\Entity\DatabaseStorageController
*/
function entity_revision_load($entity_type, $revision_id) {
return Drupal::entityManager()
return \Drupal::entityManager()
->getStorageController($entity_type)
->loadRevision($revision_id);
}
......@@ -225,7 +225,7 @@ function entity_revision_load($entity_type, $revision_id) {
* The revision ID to delete.
*/
function entity_revision_delete($entity_type, $revision_id) {
Drupal::entityManager()
\Drupal::entityManager()
->getStorageController($entity_type)
->deleteRevision($revision_id);
}
......@@ -257,7 +257,7 @@ function entity_load_by_uuid($entity_type, $uuid, $reset = FALSE) {
}
$uuid_key = $entity_info['entity_keys']['uuid'];
$controller = Drupal::entityManager()->getStorageController($entity_type);
$controller = \Drupal::entityManager()->getStorageController($entity_type);
if ($reset) {
$controller->resetCache();
}
......@@ -299,7 +299,7 @@ function entity_load_by_uuid($entity_type, $uuid, $reset = FALSE) {
* @see \Drupal\Core\Entity\Query\QueryInterface
*/
function entity_load_multiple($entity_type, array $ids = NULL, $reset = FALSE) {
$controller = Drupal::entityManager()->getStorageController($entity_type);
$controller = \Drupal::entityManager()->getStorageController($entity_type);
if ($reset) {
$controller->resetCache($ids);
}
......@@ -319,7 +319,7 @@ function entity_load_multiple($entity_type, array $ids = NULL, $reset = FALSE) {
* An array of entity objects indexed by their ids.
*/
function entity_load_multiple_by_properties($entity_type, array $values) {
return Drupal::entityManager()
return \Drupal::entityManager()
->getStorageController($entity_type)
->loadByProperties($values);
}
......@@ -341,7 +341,7 @@ function entity_load_multiple_by_properties($entity_type, array $values) {
* The unchanged entity, or FALSE if the entity cannot be loaded.
*/
function entity_load_unchanged($entity_type, $id) {
return Drupal::entityManager()
return \Drupal::entityManager()
->getStorageController($entity_type)
->loadUnchanged($id);
}
......@@ -355,7 +355,7 @@ function entity_load_unchanged($entity_type, $id) {
* An array of entity IDs of the entities to delete.
*/
function entity_delete_multiple($entity_type, array $ids) {
$controller = Drupal::entityManager()->getStorageController($entity_type);
$controller = \Drupal::entityManager()->getStorageController($entity_type);
$entities = $controller->loadMultiple($ids);
$controller->delete($entities);
}
......@@ -373,7 +373,7 @@ function entity_delete_multiple($entity_type, array $ids) {
* A new entity object.
*/
function entity_create($entity_type, array $values) {
return Drupal::entityManager()
return \Drupal::entityManager()
->getStorageController($entity_type)
->create($values);
}
......@@ -386,7 +386,7 @@ function entity_create($entity_type, array $values) {
* @deprecated Use \Drupal\Core\Entity\EntityManager::getStorageController().
*/
function entity_get_controller($entity_type) {
return Drupal::entityManager()
return \Drupal::entityManager()
->getStorageController($entity_type);
}
......@@ -424,7 +424,7 @@ function entity_page_label(EntityInterface $entity, $langcode = NULL) {
* @deprecated Use \Drupal\Core\Entity\EntityManager::getRenderController().
*/
function entity_access_controller($entity_type) {
return Drupal::entityManager()
return \Drupal::entityManager()
->getAccessController($entity_type);
}
......@@ -452,7 +452,7 @@ function entity_access_controller($entity_type) {
* @deprecated Use \Drupal\Core\Entity\EntityManager::getFormController().
*/
function entity_form_controller($entity_type, $operation = 'default') {
return Drupal::entityManager()
return \Drupal::entityManager()
->getFormController($entity_type, $operation);
}
......@@ -469,7 +469,7 @@ function entity_form_controller($entity_type, $operation = 'default') {
*/
function entity_form_state_defaults(EntityInterface $entity, $operation = 'default') {
$form_state = array();
$controller = Drupal::entityManager()->getFormController($entity->entityType(), $operation);
$controller = \Drupal::entityManager()->getFormController($entity->entityType(), $operation);
$controller->setEntity($entity);
$form_state['build_info']['callback_object'] = $controller;
$form_state['build_info']['base_form_id'] = $controller->getBaseFormID();
......@@ -514,11 +514,11 @@ function entity_form_submit(EntityInterface $entity, $operation = 'default', &$f
* @return
* The processed form for the given entity and operation.
*
* @deprecated Use Drupal::entityManager()->getForm() or _entity_form from a
* @deprecated Use \Drupal::entityManager()->getForm() or _entity_form from a
* routing.yml file instead of a page callback.
*/
function entity_get_form(EntityInterface $entity, $operation = 'default', array $form_state = array()) {
return Drupal::entityManager()->getForm($entity, $operation, $form_state);
return \Drupal::entityManager()->getForm($entity, $operation, $form_state);
}
/**
......@@ -579,7 +579,7 @@ function entity_form_submit_build_entity($entity_type, $entity, $form, &$form_st
* @deprecated Use \Drupal\Core\Entity\EntityManager::getFormController().
*/
function entity_list_controller($entity_type) {
return Drupal::entityManager()
return \Drupal::entityManager()
->getListController($entity_type);
}
......@@ -595,7 +595,7 @@ function entity_list_controller($entity_type) {
* @deprecated Use \Drupal\Core\Entity\EntityManager::getFormController().
*/
function entity_render_controller($entity_type) {
return Drupal::entityManager()
return \Drupal::entityManager()
->getRenderController($entity_type);
}
......@@ -614,7 +614,7 @@ function entity_render_controller($entity_type) {
* A render array for the entity.
*/
function entity_view(EntityInterface $entity, $view_mode, $langcode = NULL) {
return Drupal::entityManager()
return \Drupal::entityManager()
->getRenderController($entity->entityType())
->view($entity, $view_mode, $langcode);
}
......@@ -635,7 +635,7 @@ function entity_view(EntityInterface $entity, $view_mode, $langcode = NULL) {
* entities array passed in $entities.
*/
function entity_view_multiple(array $entities, $view_mode, $langcode = NULL) {
return Drupal::entityManager()
return \Drupal::entityManager()
->getRenderController(reset($entities)->entityType())
->viewMultiple($entities, $view_mode, $langcode);
}
......@@ -858,5 +858,5 @@ function entity_page_access(EntityInterface $entity, $operation = 'view') {
* TRUE if the access is granted. FALSE if access is denied.
*/
function entity_page_create_access($entity_type, $bundle = NULL) {
return Drupal::entityManager()->getAccessController($entity_type)->createAccess($bundle);
return \Drupal::entityManager()->getAccessController($entity_type)->createAccess($bundle);
}
......@@ -222,7 +222,7 @@ function _drupal_log_error($error, $fatal = FALSE) {
}
}
if (Drupal::request()->isXmlHttpRequest()) {
if (\Drupal::request()->isXmlHttpRequest()) {
if ($fatal) {
if (error_displayable($error)) {
// When called from JavaScript, simply output the error message.
......@@ -295,7 +295,7 @@ function _drupal_log_error($error, $fatal = FALSE) {
* DRUPAL_BOOTSTRAP_KERNEL or before Drupal is installed. In all other
* situations the following code is preferred:
* @code
* Drupal::config('system.logging')->get('error_level');
* \Drupal::config('system.logging')->get('error_level');
* @endcode
*
* @return string
......@@ -303,7 +303,7 @@ function _drupal_log_error($error, $fatal = FALSE) {
*/
function _drupal_get_error_level() {
try {
return Drupal::config('system.logging')->get('error_level');
return \Drupal::config('system.logging')->get('error_level');
}
catch (Exception $e) {
// During very early install the cache_config table does not exist.
......
......@@ -190,7 +190,7 @@ function file_get_stream_wrappers($filter = STREAM_WRAPPERS_ALL) {
$wrappers_storage = &drupal_static(__FUNCTION__);
if (!isset($wrappers_storage)) {
$wrappers = Drupal::moduleHandler()->invokeAll('stream_wrappers');
$wrappers = \Drupal::moduleHandler()->invokeAll('stream_wrappers');
foreach ($wrappers as $scheme => $info) {
// Add defaults.
$wrappers[$scheme] += array('type' => STREAM_WRAPPERS_NORMAL);
......@@ -313,7 +313,7 @@ function file_uri_target($uri) {
* 'public', 'private' or any other file scheme defined as the default.
*/
function file_default_scheme() {
return Drupal::config('system.file')->get('default_scheme');
return \Drupal::config('system.file')->get('default_scheme');
}
/**
......@@ -515,7 +515,7 @@ function file_prepare_directory(&$directory, $options = FILE_MODIFY_PERMISSIONS)
*/
function file_ensure_htaccess() {
file_save_htaccess('public://', FALSE);
$private_path = Drupal::config('system.file')->get('path.private');
$private_path = \Drupal::config('system.file')->get('path.private');
if (!empty($private_path)) {
file_save_htaccess('private://', TRUE);
}
......@@ -802,7 +802,7 @@ function file_munge_filename($filename, $extensions, $alerts = TRUE) {
$original = $filename;
// Allow potentially insecure uploads for very savvy users and admin
if (!Drupal::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);
......@@ -1272,13 +1272,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(Drupal::config('system.file')->get('chmod.directory'));
$mode = octdec(\Drupal::config('system.file')->get('chmod.directory'));
if (!$mode) {
$mode = 0775;
}
}
else {
$mode = octdec(Drupal::config('system.file')->get('chmod.file'));
$mode = octdec(\Drupal::config('system.file')->get('chmod.file'));
if (!$mode) {
$mode = 0664;
}
......@@ -1455,8 +1455,8 @@ function drupal_mkdir($uri, $mode = NULL, $recursive = FALSE, $context = NULL) {
// Configuration system stores default mode as strings.
$mode = FALSE;
// During early update there's no container.
if (is_object(Drupal::getContainer())) {
$mode = octdec(Drupal::config('system.file')->get('chmod.directory'));
if (is_object(\Drupal::getContainer())) {
$mode = octdec(\Drupal::config('system.file')->get('chmod.directory'));
}
if (!$mode) {
$mode = 0775;
......@@ -1608,7 +1608,7 @@ function drupal_tempnam($directory, $prefix) {
* A string containing the path to the temporary directory.
*/
function file_directory_temp() {
$config = Drupal::config('system.file');
$config = \Drupal::config('system.file');
$temporary_directory = $config->get('path.temporary');
if (empty($temporary_directory)) {
$temporary_directory = file_directory_os_temp();
......
......@@ -545,10 +545,10 @@ function drupal_rebuild_form($form_id, &$form_state, $old_form = NULL) {
* Fetches a form from the cache.
*/
function form_get_cache($form_build_id, &$form_state) {
if ($form = Drupal::keyValueExpirable('form')->get($form_build_id)) {
if ($form = \Drupal::keyValueExpirable('form')->get($form_build_id)) {
global $user;
if ((isset($form['#cache_token']) && drupal_valid_token($form['#cache_token'])) || (!isset($form['#cache_token']) && $user->isAnonymous())) {
if ($stored_form_state = Drupal::keyValueExpirable('form_state')->get($form_build_id)) {
if ($stored_form_state = \Drupal::keyValueExpirable('form_state')->get($form_build_id)) {
// Re-populate $form_state for subsequent rebuilds.
$form_state = $stored_form_state + $form_state;
......@@ -582,12 +582,12 @@ function form_set_cache($form_build_id, $form, $form_state) {
if ($GLOBALS['user']->isAuthenticated()) {
$form['#cache_token'] = drupal_get_token();
}
Drupal::keyValueExpirable('form')->setWithExpire($form_build_id, $form, $expire);
\Drupal::keyValueExpirable('form')->setWithExpire($form_build_id, $form, $expire);
}
// Cache form state.
if ($data = array_diff_key($form_state, array_flip(form_state_keys_no_cache()))) {
Drupal::keyValueExpirable('form_state')->setWithExpire($form_build_id, $data, $expire);
\Drupal::keyValueExpirable('form_state')->setWithExpire($form_build_id, $data, $expire);
}
}
......@@ -820,7 +820,7 @@ function drupal_retrieve_form($form_id, &$form_state) {
// So, we call the hook if $forms isn't yet populated, OR if it doesn't
// yet have an entry for the requested form_id.
if (!isset($forms) || !isset($forms[$form_id])) {
$forms = Drupal::moduleHandler()->invokeAll('forms', array($form_id, $args));
$forms = \Drupal::moduleHandler()->invokeAll('forms', array($form_id, $args));
}
$form_definition = $forms[$form_id];
if (isset($form_definition['callback arguments'])) {
......@@ -1346,8 +1346,8 @@ function drupal_redirect_form($form_state) {
}
}
}
$url = url(Drupal::request()->attributes->get('_system_path'), array(
'query' => Drupal::request()->query->all(),
$url = url(\Drupal::request()->attributes->get('_system_path'), array(
'query' => \Drupal::request()->query->all(),
'absolute' => TRUE,
));
return new RedirectResponse($url);
......@@ -4106,8 +4106,8 @@ function form_process_autocomplete($element, &$form_state) {
if (!empty($element['#autocomplete_route_name'])) {
$parameters = isset($element['#autocomplete_route_parameters']) ? $element['#autocomplete_route_parameters'] : array();
$path = Drupal::urlGenerator()->generate($element['#autocomplete_route_name'], $parameters);
$access = Drupal::service('access_manager')->checkNamedRoute($element['#autocomplete_route_name'], $parameters);
$path = \Drupal::urlGenerator()->generate($element['#autocomplete_route_name'], $parameters);
$access = \Drupal::service('access_manager')->checkNamedRoute($element['#autocomplete_route_name'], $parameters);
}
elseif (!empty($element['#autocomplete_path'])) {
$path = url($element['#autocomplete_path'], array('absolute' => TRUE));
......@@ -4600,7 +4600,7 @@ function form_process_weight($element) {
$element['#is_weight'] = TRUE;
// If the number of options is small enough, use a select field.
$max_elements = Drupal::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++) {
......@@ -4881,11 +4881,11 @@ function _form_set_attributes(&$element, $class = array()) {
* A response object.
*/
function _drupal_form_send_response(Response $response) {
$request = Drupal::request();
$kernel = Drupal::service('http_kernel');
$request = \Drupal::request();
$kernel = \Drupal::service('http_kernel');
$event = new FilterResponseEvent($kernel, $request, $kernel::MASTER_REQUEST, $response);
Drupal::service('event_dispatcher')->dispatch(KernelEvents::RESPONSE, $event);
\Drupal::service('event_dispatcher')->dispatch(KernelEvents::RESPONSE, $event);
// Prepare and send the response.
$event->getResponse()
->prepare($request)
......@@ -5173,14 +5173,14 @@ function batch_process($redirect = NULL, $url = 'batch', $redirect_callback = NU
// Clear the way for the redirection to the batch processing page, by
// saving and unsetting the 'destination', if there is any.
$request = Drupal::request();
$request = \Drupal::request();
if ($request->query->has('destination')) {
$batch['destination'] = $request->query->get('destination');
$request->query->remove('destination');
}
// Store the batch.
Drupal::service('batch.storage')->create($batch);
\Drupal::service('batch.storage')->create($batch);
// Set the batch number in the session to guarantee that it will stay alive.
$_SESSION['batches'][$batch['id']] = TRUE;
......
......@@ -329,7 +329,7 @@ function install_begin_request(&$install_state) {
$container = new ContainerBuilder();
// Register the translation services.
install_register_translation_service($container);
Drupal::setContainer($container);
\Drupal::setContainer($container);
// Check existing settings.php.
$install_state['database_verified'] = install_verify_database_settings();
......@@ -444,18 +444,18 @@ function install_begin_request(&$install_state) {
// so it is available to the rest of the installation process.
$container->set('request', $request);
Drupal::setContainer($container);
\Drupal::setContainer($container);
// Set up $language, so t() caller functions will still work.
drupal_language_initialize();
// Add in installation language if present.
if (isset($install_state['parameters']['langcode'])) {
Drupal::translation()->setDefaultLangcode($install_state['parameters']['langcode']);
\Drupal::translation()->setDefaultLangcode($install_state['parameters']['langcode']);
}
require_once __DIR__ . '/ajax.inc';
$module_handler = Drupal::moduleHandler();
$module_handler = \Drupal::moduleHandler();
if (!$module_handler->moduleExists('system')) {
// Override the module list with a minimal set of modules.
$module_handler->setModuleList(array('system' => 'core/modules/system/system.module'));
......@@ -652,7 +652,7 @@ function install_run_task($task, &$install_state) {