diff --git a/core/modules/locale/lib/Drupal/locale/PoDatabaseReader.php b/core/modules/locale/lib/Drupal/locale/PoDatabaseReader.php
index 019ce95..2909e6f 100644
--- a/core/modules/locale/lib/Drupal/locale/PoDatabaseReader.php
+++ b/core/modules/locale/lib/Drupal/locale/PoDatabaseReader.php
@@ -145,11 +145,11 @@ private function loadStrings() {
// Filter for string with translation.
$conditions['translated'] = TRUE;
}
- return \Drupal::service('locale.storage')->getTranslations($conditions);
+ return \\Drupal::service('locale.storage')->getTranslations($conditions);
}
else {
// If no language, we don't need any of the target fields.
- return \Drupal::service('locale.storage')->getStrings($conditions);
+ return \\Drupal::service('locale.storage')->getStrings($conditions);
}
}
diff --git a/core/modules/locale/lib/Drupal/locale/PoDatabaseWriter.php b/core/modules/locale/lib/Drupal/locale/PoDatabaseWriter.php
index dd44492..f3d3866 100644
--- a/core/modules/locale/lib/Drupal/locale/PoDatabaseWriter.php
+++ b/core/modules/locale/lib/Drupal/locale/PoDatabaseWriter.php
@@ -155,8 +155,8 @@ function getHeader() {
*/
function setHeader(PoHeader $header) {
$this->_header = $header;
- $config = \Drupal::config('locale.settings');
- $locale_plurals = \Drupal::state()->get('locale.translation.plurals') ?: array();
+ $config = \\Drupal::config('locale.settings');
+ $locale_plurals = \\Drupal::state()->get('locale.translation.plurals') ?: array();
// Check for options.
$options = $this->getOptions();
@@ -180,7 +180,7 @@ function setHeader(PoHeader $header) {
'plurals' => $nplurals,
'formula' => $formula,
);
- \Drupal::state()->set('locale.translation.plurals', $locale_plurals);
+ \\Drupal::state()->set('locale.translation.plurals', $locale_plurals);
}
}
}
@@ -229,7 +229,7 @@ private function importString(PoItem $item) {
$translation = $item->getTranslation();
// Look up the source string and any existing translation.
- $strings = \Drupal::service('locale.storage')->getTranslations(array(
+ $strings = \\Drupal::service('locale.storage')->getTranslations(array(
'language' => $this->_langcode,
'source' => $source,
'context' => $context
@@ -265,9 +265,9 @@ private function importString(PoItem $item) {
}
else {
// No such source string in the database yet.
- $string = \Drupal::service('locale.storage')->createString(array('source' => $source, 'context' => $context))
+ $string = \\Drupal::service('locale.storage')->createString(array('source' => $source, 'context' => $context))
->save();
- $target = \Drupal::service('locale.storage')->createTranslation(array(
+ $target = \\Drupal::service('locale.storage')->createTranslation(array(
'lid' => $string->getId(),
'language' => $this->_langcode,
'translation' => $translation,
diff --git a/core/modules/locale/lib/Drupal/locale/StringDatabaseStorage.php b/core/modules/locale/lib/Drupal/locale/StringDatabaseStorage.php
index b1c5571..0fad579 100644
--- a/core/modules/locale/lib/Drupal/locale/StringDatabaseStorage.php
+++ b/core/modules/locale/lib/Drupal/locale/StringDatabaseStorage.php
@@ -83,7 +83,7 @@ public function findTranslation(array $conditions) {
if (!empty($values)) {
$string = new TranslationString($values);
- $this->checkVersion($string, \Drupal::VERSION);
+ $this->checkVersion($string, \\Drupal::VERSION);
$string->setStorage($this);
return $string;
}
@@ -156,7 +156,7 @@ protected function updateLocation($string) {
// This is a new location to add, take care not to duplicate.
$this->connection->merge('locales_location', $this->options)
->key(array('sid' => $string->getId(), 'type' => $type, 'name' => $name))
- ->fields(array('version' => \Drupal::VERSION))
+ ->fields(array('version' => \\Drupal::VERSION))
->execute();
$created = TRUE;
}
@@ -165,7 +165,7 @@ protected function updateLocation($string) {
}
if ($created) {
// As we've set a new location, check string version too.
- $this->checkVersion($string, \Drupal::VERSION);
+ $this->checkVersion($string, \\Drupal::VERSION);
}
}
}
diff --git a/core/modules/locale/lib/Drupal/locale/Tests/LocaleConfigTranslationTest.php b/core/modules/locale/lib/Drupal/locale/Tests/LocaleConfigTranslationTest.php
index 6a7ee1c..096a306 100644
--- a/core/modules/locale/lib/Drupal/locale/Tests/LocaleConfigTranslationTest.php
+++ b/core/modules/locale/lib/Drupal/locale/Tests/LocaleConfigTranslationTest.php
@@ -136,7 +136,7 @@ function testConfigTranslation() {
$this->assertEqual($property->getValue(), $image_style_label, 'Got the right translation for image style name after translation');
// Quick test to ensure translation file exists.
- $this->assertEqual(\Drupal::config('locale.config.xx.image.style.medium')->get('label'), $image_style_label);
+ $this->assertEqual(\\Drupal::config('locale.config.xx.image.style.medium')->get('label'), $image_style_label);
// Disable and uninstall the module.
$this->drupalPostForm('admin/modules', array('modules[Core][image][enable]' => FALSE), t('Save configuration'));
@@ -144,7 +144,7 @@ function testConfigTranslation() {
$this->drupalPostForm(NULL, array(), t('Uninstall'));
// Ensure that the translated configuration has been removed.
- $this->assertFalse(\Drupal::config('locale.config.xx.image.style.medium')->get('label'), 'Translated configuration for image module removed.');
+ $this->assertFalse(\\Drupal::config('locale.config.xx.image.style.medium')->get('label'), 'Translated configuration for image module removed.');
}
}
diff --git a/core/modules/locale/lib/Drupal/locale/Tests/LocaleImportFunctionalTest.php b/core/modules/locale/lib/Drupal/locale/Tests/LocaleImportFunctionalTest.php
index 8cd217b..70d0540 100644
--- a/core/modules/locale/lib/Drupal/locale/Tests/LocaleImportFunctionalTest.php
+++ b/core/modules/locale/lib/Drupal/locale/Tests/LocaleImportFunctionalTest.php
@@ -53,7 +53,7 @@ function testStandalonePoFile() {
$this->importPoFile($this->getPoFile(), array(
'langcode' => 'fr',
));
- $config = \Drupal::config('locale.settings');
+ $config = \\Drupal::config('locale.settings');
// The import should automatically create the corresponding language.
$this->assertRaw(t('The language %language has been created.', array('%language' => 'French')), 'The language has been automatically created.');
@@ -61,7 +61,7 @@ function testStandalonePoFile() {
$this->assertRaw(t('One translation file imported. %number translations were added, %update translations were updated and %delete translations were removed.', array('%number' => 8, '%update' => 0, '%delete' => 0)), 'The translation file was successfully imported.');
// This import should have saved plural forms to have 2 variants.
- $locale_plurals = \Drupal::state()->get('locale.translation.plurals') ?: array();
+ $locale_plurals = \\Drupal::state()->get('locale.translation.plurals') ?: array();
$this->assert($locale_plurals['fr']['plurals'] == 2, 'Plural number initialized.');
// Ensure we were redirected correctly.
@@ -115,7 +115,7 @@ function testStandalonePoFile() {
$this->assertText(t('No strings available.'), 'String not overwritten by imported string.');
// This import should not have changed number of plural forms.
- $locale_plurals = \Drupal::state()->get('locale.translation.plurals') ?: array();
+ $locale_plurals = \\Drupal::state()->get('locale.translation.plurals') ?: array();
$this->assert($locale_plurals['fr']['plurals'] == 2, 'Plural numbers untouched.');
// Try importing a .po file with overriding strings, and ensure existing
@@ -136,7 +136,7 @@ function testStandalonePoFile() {
$this->drupalPostForm('admin/config/regional/translate', $search, t('Filter'));
$this->assertNoText(t('No strings available.'), 'String overwritten by imported string.');
// This import should have changed number of plural forms.
- $locale_plurals = \Drupal::state()->get('locale.translation.plurals') ?: array();
+ $locale_plurals = \\Drupal::state()->get('locale.translation.plurals') ?: array();
$this->assert($locale_plurals['fr']['plurals'] == 3, 'Plural numbers changed.');
// Importing a .po file and mark its strings as customized strings.
diff --git a/core/modules/locale/lib/Drupal/locale/Tests/LocalePathTest.php b/core/modules/locale/lib/Drupal/locale/Tests/LocalePathTest.php
index 931212d..9208226 100644
--- a/core/modules/locale/lib/Drupal/locale/Tests/LocalePathTest.php
+++ b/core/modules/locale/lib/Drupal/locale/Tests/LocalePathTest.php
@@ -34,7 +34,7 @@ function setUp() {
parent::setUp();
$this->drupalCreateContentType(array('type' => 'page', 'name' => 'Basic page'));
- \Drupal::config('system.site')->set('page.front', 'node')->save();
+ \\Drupal::config('system.site')->set('page.front', 'node')->save();
}
/**
diff --git a/core/modules/locale/lib/Drupal/locale/Tests/LocaleStringTest.php b/core/modules/locale/lib/Drupal/locale/Tests/LocaleStringTest.php
index caf19ce..3026546 100644
--- a/core/modules/locale/lib/Drupal/locale/Tests/LocaleStringTest.php
+++ b/core/modules/locale/lib/Drupal/locale/Tests/LocaleStringTest.php
@@ -73,7 +73,7 @@ function testStringCRUDAPI() {
// Check version handling and updating.
$this->assertEqual($source->version, 'none', 'String originally created without version.');
$string = $this->storage->findTranslation(array('lid' => $source->lid));
- $this->assertEqual($string->version, \Drupal::VERSION, 'Checked and updated string version to Drupal version.');
+ $this->assertEqual($string->version, \\Drupal::VERSION, 'Checked and updated string version to Drupal version.');
// Create translation and find it by lid and source.
$langcode = 'es';
diff --git a/core/modules/locale/lib/Drupal/locale/Tests/LocaleTranslationUiTest.php b/core/modules/locale/lib/Drupal/locale/Tests/LocaleTranslationUiTest.php
index 06b6ed4..f2f62b4 100644
--- a/core/modules/locale/lib/Drupal/locale/Tests/LocaleTranslationUiTest.php
+++ b/core/modules/locale/lib/Drupal/locale/Tests/LocaleTranslationUiTest.php
@@ -216,7 +216,7 @@ function testStringTranslation() {
function testJavaScriptTranslation() {
$user = $this->drupalCreateUser(array('translate interface', 'administer languages', 'access administration pages'));
$this->drupalLogin($user);
- $config = \Drupal::config('locale.settings');
+ $config = \\Drupal::config('locale.settings');
$langcode = 'xx';
// The English name for the language. This will be translated.
@@ -260,7 +260,7 @@ function testJavaScriptTranslation() {
// Trigger JavaScript translation parsing and building.
_locale_rebuild_js($langcode);
- $locale_javascripts = \Drupal::state()->get('locale.translation.javascript') ?: array();
+ $locale_javascripts = \\Drupal::state()->get('locale.translation.javascript') ?: array();
$js_file = 'public://' . $config->get('javascript.directory') . '/' . $langcode . '_' . $locale_javascripts[$langcode] . '.js';
$this->assertTrue($result = file_exists($js_file), String::format('JavaScript file created: %file', array('%file' => $result ? $js_file : 'not found')));
diff --git a/core/modules/locale/lib/Drupal/locale/Tests/LocaleUninstallTest.php b/core/modules/locale/lib/Drupal/locale/Tests/LocaleUninstallTest.php
index 85b7450..27ba064 100644
--- a/core/modules/locale/lib/Drupal/locale/Tests/LocaleUninstallTest.php
+++ b/core/modules/locale/lib/Drupal/locale/Tests/LocaleUninstallTest.php
@@ -50,7 +50,7 @@ function setUp() {
*/
function testUninstallProcess() {
$locale_module = array('locale', 'language');
- $config = \Drupal::config('locale.settings');
+ $config = \\Drupal::config('locale.settings');
$language = new Language(array(
'id' => 'fr',
'name' => 'French',
@@ -87,7 +87,7 @@ function testUninstallProcess() {
$edit = array('strings[' . $string->lid . '][translations][0]' => 'french translation');
$this->drupalPostForm('admin/config/regional/translate', $edit, t('Save translations'));
_locale_rebuild_js('fr');
- $config = \Drupal::config('locale.settings');
+ $config = \\Drupal::config('locale.settings');
$locale_javascripts = $this->container->get('state')->get('locale.translation.javascript') ?: array();
$js_file = 'public://' . $config->get('javascript.directory') . '/fr_' . $locale_javascripts['fr'] . '.js';
$this->assertTrue($result = file_exists($js_file), String::format('JavaScript file created: %file', array('%file' => $result ? $js_file : 'none')));
@@ -97,13 +97,13 @@ function testUninstallProcess() {
// Change language negotiation options.
drupal_load('module', 'locale');
- \Drupal::config('system.language.types')->set('configurable', language_types_get_default() + array('language_custom' => TRUE))->save();
+ \\Drupal::config('system.language.types')->set('configurable', language_types_get_default() + array('language_custom' => TRUE))->save();
variable_set('language_negotiation_' . Language::TYPE_INTERFACE, language_language_negotiation_info());
variable_set('language_negotiation_' . Language::TYPE_CONTENT, language_language_negotiation_info());
variable_set('language_negotiation_' . Language::TYPE_URL, language_language_negotiation_info());
// Change language negotiation settings.
- \Drupal::config('language.negotiation')
+ \\Drupal::config('language.negotiation')
->set('url.source', LANGUAGE_NEGOTIATION_URL_PREFIX)
->set('session.parameter', TRUE)
->save();
@@ -136,8 +136,8 @@ function testUninstallProcess() {
$this->assertTrue($language_negotiation, String::format('URL language negotiation: %setting', array('%setting' => $language_negotiation ? 'none' : 'set')));
// Check language negotiation method settings.
- $this->assertFalse(\Drupal::config('language.negotiation')->get('url.source'), 'URL language negotiation method indicator settings cleared.');
- $this->assertFalse(\Drupal::config('language.negotiation')->get('session.parameter'), 'Visit language negotiation method settings cleared.');
+ $this->assertFalse(\\Drupal::config('language.negotiation')->get('url.source'), 'URL language negotiation method indicator settings cleared.');
+ $this->assertFalse(\\Drupal::config('language.negotiation')->get('session.parameter'), 'Visit language negotiation method settings cleared.');
// Check JavaScript parsed.
$javascript_parsed_count = count($this->container->get('state')->get('system.javascript_parsed') ?: array());
diff --git a/core/modules/locale/lib/Drupal/locale/Tests/LocaleUpdateBase.php b/core/modules/locale/lib/Drupal/locale/Tests/LocaleUpdateBase.php
index d61128d..6b39249 100644
--- a/core/modules/locale/lib/Drupal/locale/Tests/LocaleUpdateBase.php
+++ b/core/modules/locale/lib/Drupal/locale/Tests/LocaleUpdateBase.php
@@ -70,7 +70,7 @@ function setUp() {
protected function setTranslationsDirectory($path) {
$this->tranlations_directory = $path;
file_prepare_directory($path, FILE_CREATE_DIRECTORY);
- \Drupal::config('locale.settings')->set('translation.path', $path)->save();
+ \\Drupal::config('locale.settings')->set('translation.path', $path)->save();
}
/**
@@ -166,11 +166,11 @@ protected function makePoFile($path, $filename, $timestamp = NULL, $translations
* imported.
*/
protected function setTranslationFiles() {
- $config = \Drupal::config('locale.settings');
+ $config = \\Drupal::config('locale.settings');
// A flag is set to let the locale_test module replace the project data with
// a set of test projects which match the below project files.
- \Drupal::state()->set('locale.test_projects_alter', TRUE);
+ \\Drupal::state()->set('locale.test_projects_alter', TRUE);
// Setup the environment.
$public_path = PublicStream::basePath();
diff --git a/core/modules/locale/lib/Drupal/locale/Tests/LocaleUpdateCronTest.php b/core/modules/locale/lib/Drupal/locale/Tests/LocaleUpdateCronTest.php
index d0da24e..bb2e7de 100644
--- a/core/modules/locale/lib/Drupal/locale/Tests/LocaleUpdateCronTest.php
+++ b/core/modules/locale/lib/Drupal/locale/Tests/LocaleUpdateCronTest.php
@@ -42,11 +42,11 @@ function setUp() {
function testUpdateCron() {
// Set a flag to let the locale_test module replace the project data with a
// set of test projects.
- \Drupal::state()->set('locale.test_projects_alter', TRUE);
+ \\Drupal::state()->set('locale.test_projects_alter', TRUE);
// Setup local and remote translations files.
$this->setTranslationFiles();
- \Drupal::config('locale.settings')->set('translation.default_filename', '%project-%version.%language._po')->save();
+ \\Drupal::config('locale.settings')->set('translation.default_filename', '%project-%version.%language._po')->save();
// Update translations using batch to ensure a clean test starting point.
$this->drupalGet('admin/reports/translations/check');
@@ -79,7 +79,7 @@ function testUpdateCron() {
locale_cron();
// Check whether no tasks are added to the queue.
- $queue = \Drupal::queue('locale_translation', TRUE);
+ $queue = \\Drupal::queue('locale_translation', TRUE);
$this->assertEqual($queue->numberOfItems(), 0, 'Queue is empty');
// Test: Enable cron update and check if update tasks are added to the
@@ -94,7 +94,7 @@ function testUpdateCron() {
locale_cron();
// Check whether tasks are added to the queue.
- $queue = \Drupal::queue('locale_translation', TRUE);
+ $queue = \\Drupal::queue('locale_translation', TRUE);
$this->assertEqual($queue->numberOfItems(), 3, 'Queue holds tasks for one project.');
$item = $queue->claimItem();
$queue->releaseItem($item);
@@ -105,7 +105,7 @@ function testUpdateCron() {
locale_cron();
// Check whether no more tasks are added to the queue.
- $queue = \Drupal::queue('locale_translation', TRUE);
+ $queue = \\Drupal::queue('locale_translation', TRUE);
$this->assertEqual($queue->numberOfItems(), 3, 'Queue holds tasks for one project.');
// Ensure last checked is updated to a greater time than the initial value.
diff --git a/core/modules/locale/lib/Drupal/locale/Tests/LocaleUpdateInterfaceTest.php b/core/modules/locale/lib/Drupal/locale/Tests/LocaleUpdateInterfaceTest.php
index 0a502b6..976e255 100644
--- a/core/modules/locale/lib/Drupal/locale/Tests/LocaleUpdateInterfaceTest.php
+++ b/core/modules/locale/lib/Drupal/locale/Tests/LocaleUpdateInterfaceTest.php
@@ -58,7 +58,7 @@ function testInterface() {
// mark Drupal core as translated and continue with the prepared modules.
$status = locale_translation_get_status();
$status['drupal']['de']->type = 'current';
- \Drupal::state()->set('locale.translation_status', $status);
+ \\Drupal::state()->set('locale.translation_status', $status);
// One language added, all translations up to date.
$this->drupalGet('admin/reports/status');
@@ -70,7 +70,7 @@ function testInterface() {
// Set locale_test_translate module to have a local translation available.
$status = locale_translation_get_status();
$status['locale_test_translate']['de']->type = 'local';
- \Drupal::state()->set('locale.translation_status', $status);
+ \\Drupal::state()->set('locale.translation_status', $status);
// Check if updates are available for German.
$this->drupalGet('admin/reports/status');
@@ -84,7 +84,7 @@ function testInterface() {
$status = locale_translation_get_status();
$status['locale_test_translate']['de']->version = '1.3-dev';
$status['locale_test_translate']['de']->type = '';
- \Drupal::state()->set('locale.translation_status', $status);
+ \\Drupal::state()->set('locale.translation_status', $status);
// Check if no updates were found.
$this->drupalGet('admin/reports/status');
diff --git a/core/modules/locale/lib/Drupal/locale/Tests/LocaleUpdateTest.php b/core/modules/locale/lib/Drupal/locale/Tests/LocaleUpdateTest.php
index 08c7a9a..3a43267 100644
--- a/core/modules/locale/lib/Drupal/locale/Tests/LocaleUpdateTest.php
+++ b/core/modules/locale/lib/Drupal/locale/Tests/LocaleUpdateTest.php
@@ -50,7 +50,7 @@ function testUpdateProjects() {
// Make the test modules look like a normal custom module. i.e. make the
// modules not hidden. locale_test_system_info_alter() modifies the project
// info of the locale_test and locale_test_translate modules.
- \Drupal::state()->set('locale.test_system_info_alter', TRUE);
+ \\Drupal::state()->set('locale.test_system_info_alter', TRUE);
$this->resetAll();
// Check if interface translation data is collected from hook_info.
@@ -65,10 +65,10 @@ function testUpdateProjects() {
*/
function testUpdateProjectsHidden() {
module_load_include('compare.inc', 'locale');
- $config = \Drupal::config('locale.settings');
+ $config = \\Drupal::config('locale.settings');
// Make the test modules look like a normal custom module.
- \Drupal::state()->set('locale.test_system_info_alter', TRUE);
+ \\Drupal::state()->set('locale.test_system_info_alter', TRUE);
$this->resetAll();
// Set test condition: include disabled modules when building a project list.
@@ -97,10 +97,10 @@ function testUpdateProjectsHidden() {
* for local files only, check for both local and remote files.
*/
function testUpdateCheckStatus() {
- $config = \Drupal::config('locale.settings');
+ $config = \\Drupal::config('locale.settings');
// Set a flag to let the locale_test module replace the project data with a
// set of test projects.
- \Drupal::state()->set('locale.test_projects_alter', TRUE);
+ \\Drupal::state()->set('locale.test_projects_alter', TRUE);
// Create local and remote translations files.
$this->setTranslationFiles();
@@ -149,7 +149,7 @@ function testUpdateCheckStatus() {
* - Import overwrite: all existing translations
*/
function testUpdateImportSourceRemote() {
- $config = \Drupal::config('locale.settings');
+ $config = \\Drupal::config('locale.settings');
// Build the test environment.
$this->setTranslationFiles();
@@ -211,7 +211,7 @@ function testUpdateImportSourceRemote() {
* - Import overwrite: all existing translations
*/
function testUpdateImportSourceLocal() {
- $config = \Drupal::config('locale.settings');
+ $config = \\Drupal::config('locale.settings');
// Build the test environment.
$this->setTranslationFiles();
@@ -265,7 +265,7 @@ function testUpdateImportSourceLocal() {
* - Import overwrite: only overwrite non-customized translations
*/
function testUpdateImportModeNonCustomized() {
- $config = \Drupal::config('locale.settings');
+ $config = \\Drupal::config('locale.settings');
// Build the test environment.
$this->setTranslationFiles();
@@ -301,7 +301,7 @@ function testUpdateImportModeNonCustomized() {
* - Import overwrite: don't overwrite any existing translation
*/
function testUpdateImportModeNone() {
- $config = \Drupal::config('locale.settings');
+ $config = \\Drupal::config('locale.settings');
// Build the test environment.
$this->setTranslationFiles();
@@ -334,7 +334,7 @@ function testUpdateImportModeNone() {
*/
function testEnableDisableModule() {
// Make the hidden test modules look like a normal custom module.
- \Drupal::state()->set('locale.test_system_info_alter', TRUE);
+ \\Drupal::state()->set('locale.test_system_info_alter', TRUE);
// Check if there is no translation yet.
$this->assertTranslation('Tuesday', '', 'de');
@@ -377,7 +377,7 @@ function testEnableDisableModule() {
*/
function testEnableDisableLanguage() {
// Make the hidden test modules look like a normal custom module.
- \Drupal::state()->set('locale.test_system_info_alter', TRUE);
+ \\Drupal::state()->set('locale.test_system_info_alter', TRUE);
// Enable a module.
$edit = array(
@@ -421,7 +421,7 @@ function testEnableDisableLanguage() {
*/
function testEnableCustomLanguage() {
// Make the hidden test modules look like a normal custom module.
- \Drupal::state()->set('locale.test_system_info_alter', TRUE);
+ \\Drupal::state()->set('locale.test_system_info_alter', TRUE);
// Enable a module.
$edit = array(
diff --git a/core/modules/locale/lib/Drupal/locale/TranslationsStream.php b/core/modules/locale/lib/Drupal/locale/TranslationsStream.php
index 5245bd4..25c3dd8 100644
--- a/core/modules/locale/lib/Drupal/locale/TranslationsStream.php
+++ b/core/modules/locale/lib/Drupal/locale/TranslationsStream.php
@@ -20,7 +20,7 @@ class TranslationsStream extends LocalStream {
* Implements Drupal\Core\StreamWrapper\LocalStream::getDirectoryPath()
*/
function getDirectoryPath() {
- return \Drupal::config('locale.settings')->get('translation.path');
+ return \\Drupal::config('locale.settings')->get('translation.path');
}
/**
diff --git a/core/modules/locale/locale.batch.inc b/core/modules/locale/locale.batch.inc
index 008cb50..d789ea2 100644
--- a/core/modules/locale/locale.batch.inc
+++ b/core/modules/locale/locale.batch.inc
@@ -94,7 +94,7 @@ function locale_translation_batch_status_check($project, $langcode, $options = a
function locale_translation_batch_status_finished($success, $results) {
if ($success) {
if (isset($results['failed_files'])) {
- if (Drupal::moduleHandler()->moduleExists('dblog')) {
+ if (\Drupal::moduleHandler()->moduleExists('dblog')) {
$message = format_plural(count($results['failed_files']), 'One translation file could not be checked. See the log for details.', '@count translation files could not be checked. See the log for details.', array('@url' => url('admin/reports/dblog')));
}
else {
@@ -112,7 +112,7 @@ function locale_translation_batch_status_finished($success, $results) {
if (!isset($results['failed_files']) && !isset($results['files'])) {
drupal_set_message(t('Nothing to check.'));
}
- Drupal::state()->set('locale.translation_last_checked', REQUEST_TIME);
+ \Drupal::state()->set('locale.translation_last_checked', REQUEST_TIME);
}
else {
drupal_set_message(t('An error occurred trying to check available interface translation updates.'), 'error');
@@ -210,7 +210,7 @@ function locale_translation_batch_fetch_import($project, $langcode, $options, &$
function locale_translation_batch_fetch_finished($success, $results) {
module_load_include('bulk.inc', 'locale');
if ($success) {
- Drupal::state()->set('locale.translation_last_checked', REQUEST_TIME);
+ \Drupal::state()->set('locale.translation_last_checked', REQUEST_TIME);
}
return locale_translate_batch_finished($success, $results);
}
@@ -231,7 +231,7 @@ function locale_translation_batch_fetch_finished($success, $results) {
function locale_translation_http_check($uri) {
try {
- $response = Drupal::httpClient()
+ $response = \Drupal::httpClient()
->head($uri)
->send();
$result = array();
diff --git a/core/modules/locale/locale.bulk.inc b/core/modules/locale/locale.bulk.inc
index 55c3aed..355ccb1 100644
--- a/core/modules/locale/locale.bulk.inc
+++ b/core/modules/locale/locale.bulk.inc
@@ -243,7 +243,7 @@ function locale_translate_export_form_submit($form, &$form_state) {
if (!empty($item)) {
$uri = tempnam('temporary://', 'po_');
$header = $reader->getHeader();
- $header->setProjectName(Drupal::config('system.site')->get('name'));
+ $header->setProjectName(\Drupal::config('system.site')->get('name'));
$header->setLanguageName($languageName);
$writer = new PoStreamWriter;
@@ -258,7 +258,7 @@ function locale_translate_export_form_submit($form, &$form_state) {
$response = new BinaryFileResponse($uri);
$response->setContentDisposition('attachment', $filename);
// @todo remove lines below once converted to new routing system.
- $response->prepare(Drupal::request())
+ $response->prepare(\Drupal::request())
->send();
}
else {
@@ -348,7 +348,7 @@ function locale_translate_get_interface_translation_files($projects = array(), $
// containing a project name and language code: {project}.{langcode}.po or
// {project}-{version}.{langcode}.po.
// Only files of known projects and languages will be returned.
- $directory = Drupal::config('locale.settings')->get('translation.path');
+ $directory = \Drupal::config('locale.settings')->get('translation.path');
$result = file_scan_directory($directory, '![a-z_]+(\-[0-9a-z\.\-\+]+|)\.[^\./]+\.po$!', array('recurse' => FALSE));
foreach ($result as $file) {
@@ -602,7 +602,7 @@ function locale_translate_batch_finished($success, $results) {
if ($success) {
$additions = $updates = $deletes = $skips = $config = 0;
if (isset($results['failed_files'])) {
- if (Drupal::moduleHandler()->moduleExists('dblog')) {
+ if (\Drupal::moduleHandler()->moduleExists('dblog')) {
$message = format_plural(count($results['failed_files']), 'One translation file could not be imported. See the log for details.', '@count translation files could not be imported. See the log for details.', array('@url' => url('admin/reports/dblog')));
}
else {
@@ -633,7 +633,7 @@ function locale_translate_batch_finished($success, $results) {
watchdog('locale', 'Translations imported: %number added, %update updated, %delete removed.', array('%number' => $additions, '%update' => $updates, '%delete' => $deletes));
if ($skips) {
- if (Drupal::moduleHandler()->moduleExists('dblog')) {
+ if (\Drupal::moduleHandler()->moduleExists('dblog')) {
$message = format_plural($skips, 'One translation string was skipped because of disallowed or malformed HTML. See the log for details.', '@count translation strings were skipped because of disallowed or malformed HTML. See the log for details.', array('@url' => url('admin/reports/dblog')));
}
else {
@@ -799,7 +799,7 @@ function locale_config_batch_build(array $names, array $langcodes, $options = ar
$batch_names[] = $name;
$i++;
// During installation the caching of configuration objects is disabled
- // so it is very expensive to initialize the Drupal::config() object on each request.
+ // so it is very expensive to initialize the \Drupal::config() object on each request.
// We batch a small number of configuration object upgrades together to
// improve the overall performance of the process.
if ($i % 20 == 0) {
diff --git a/core/modules/locale/locale.compare.inc b/core/modules/locale/locale.compare.inc
index db2918f..2760760 100644
--- a/core/modules/locale/locale.compare.inc
+++ b/core/modules/locale/locale.compare.inc
@@ -20,7 +20,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();
}
@@ -47,7 +47,7 @@ function locale_translation_flush_projects() {
*/
function locale_translation_build_projects() {
// This function depends on Update module. We degrade gracefully.
- if (!Drupal::moduleHandler()->moduleExists('update')) {
+ if (!\Drupal::moduleHandler()->moduleExists('update')) {
return array();
}
@@ -92,7 +92,7 @@ function locale_translation_build_projects() {
// For every project store information.
$data += array(
'version' => isset($data['info']['version']) ? $data['info']['version'] : '',
- 'core' => isset($data['info']['core']) ? $data['info']['core'] : Drupal::CORE_COMPATIBILITY,
+ 'core' => isset($data['info']['core']) ? $data['info']['core'] : \Drupal::CORE_COMPATIBILITY,
// A project can provide the path and filename pattern to download the
// gettext file. Use the default if not.
'server_pattern' => isset($data['info']['interface translation server pattern']) && $data['info']['interface translation server pattern'] ? $data['info']['interface translation server pattern'] : $default_server['pattern'],
@@ -130,7 +130,7 @@ function locale_translation_project_list() {
$projects = &drupal_static(__FUNCTION__, array());
if (empty($projects)) {
module_load_include('compare.inc', 'update');
- $config = Drupal::config('locale.settings');
+ $config = \Drupal::config('locale.settings');
$projects = array();
$additional_whitelist = array(
@@ -195,9 +195,9 @@ function _locale_translation_prepare_project_list($data, $type) {
* - "server_pattern": URI containing po file pattern.
*/
function locale_translation_default_translation_server() {
- $pattern = Drupal::config('locale.settings')->get('translation.default_server_pattern');
+ $pattern = \Drupal::config('locale.settings')->get('translation.default_server_pattern');
// An additional check is required here. During the upgrade process
- // Drupal::config()->get() returns NULL. We use the defined value as fallback.
+ // \Drupal::config()->get() returns NULL. We use the defined value as fallback.
$pattern = $pattern ? $pattern : LOCALE_TRANSLATION_DEFAULT_SERVER_PATTERN;
return array(
@@ -226,7 +226,7 @@ function locale_translation_check_projects($projects = array(), $langcodes = arr
else {
// Retrieve and save the status of local translations only.
locale_translation_check_projects_local($projects, $langcodes);
- Drupal::state()->set('locale.translation_last_checked', REQUEST_TIME);
+ \Drupal::state()->set('locale.translation_last_checked', REQUEST_TIME);
}
}
diff --git a/core/modules/locale/locale.install b/core/modules/locale/locale.install
index 1e62cd4..d10791c 100644
--- a/core/modules/locale/locale.install
+++ b/core/modules/locale/locale.install
@@ -12,9 +12,9 @@
*/
function locale_install() {
// Create the interface translations directory and ensure it's writable.
- if (!$directory = Drupal::config('locale.settings')->get('translation.path')) {
+ if (!$directory = \Drupal::config('locale.settings')->get('translation.path')) {
$directory = conf_path() . '/files/translations';
- Drupal::config('locale.settings')->set('translation.path', $directory)->save();
+ \Drupal::config('locale.settings')->set('translation.path', $directory)->save();
}
file_prepare_directory($directory, FILE_CREATE_DIRECTORY | FILE_MODIFY_PERMISSIONS);
}
@@ -23,12 +23,12 @@ function locale_install() {
* Implements hook_uninstall().
*/
function locale_uninstall() {
- $config = Drupal::config('locale.settings');
+ $config = \Drupal::config('locale.settings');
// Delete all JavaScript translation files.
$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');
@@ -41,9 +41,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.
@@ -468,7 +468,7 @@ function locale_update_8002() {
*/
function locale_update_8003() {
$message = '';
- $config = Drupal::config('language.negotiation');
+ $config = \Drupal::config('language.negotiation');
$domains = $config->get('url.domains') ?: array();
// $used_domains keeps track of the domain names in use.
@@ -953,7 +953,7 @@ function locale_update_8016() {
foreach ($result as $format) {
$language = $format->language;
// Create config objects for the language if not yet done.
- Drupal::config("locale.config.$language.system.date_format." . $format->type)
+ \Drupal::config("locale.config.$language.system.date_format." . $format->type)
->set('pattern.php', $format->format)
->save();
}
diff --git a/core/modules/locale/locale.module b/core/modules/locale/locale.module
index 1b34406..a7898f7 100644
--- a/core/modules/locale/locale.module
+++ b/core/modules/locale/locale.module
@@ -292,7 +292,7 @@ function locale_language_update($language) {
*/
function locale_language_delete($language) {
// Remove translations.
- Drupal::service('locale.storage')->deleteTranslations(array('language' => $language->id));
+ \Drupal::service('locale.storage')->deleteTranslations(array('language' => $language->id));
// Remove interface translation files.
module_load_include('inc', 'locale', 'locale.bulk');
@@ -354,7 +354,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
@@ -424,7 +424,7 @@ function locale_cron() {
// and a translatable language was set.
// Update tasks are added to the queue here but processed by Drupal's cron
// using the cron worker defined in locale_queue_info().
- if ($frequency = Drupal::config('locale.settings')->get('translation.update_interval_days') && locale_translatable_language_list()) {
+ if ($frequency = \Drupal::config('locale.settings')->get('translation.update_interval_days') && locale_translatable_language_list()) {
module_load_include('translation.inc', 'locale');
locale_cron_fill_queue();
}
@@ -494,7 +494,7 @@ function locale_translation_worker($data) {
// continue the task. This is typically the translation import task.
if ($batch_context['finished'] < 1) {
unset($batch_context['strings']);
- $queue = Drupal::queue('locale_translation', TRUE);
+ $queue = \Drupal::queue('locale_translation', TRUE);
$queue->createItem(array($function, $args));
}
}
@@ -516,7 +516,7 @@ function locale_system_update(array $components) {
// Skip running the translation imports if in the installer,
// because it would break out of the installer flow. We have
// built-in support for translation imports in the installer.
- if (!drupal_installation_attempted() && locale_translatable_language_list() && Drupal::config('locale.settings')->get('translation.import_enabled')) {
+ if (!drupal_installation_attempted() && locale_translatable_language_list() && \Drupal::config('locale.settings')->get('translation.import_enabled')) {
module_load_include('compare.inc', 'locale');
// Update the list of translatable projects and start the import batch.
@@ -530,7 +530,7 @@ function locale_system_update(array $components) {
$batch = locale_translation_batch_update_build($list, array(), $options);
batch_set($batch);
}
- Drupal::moduleHandler()->loadInclude('locale', 'bulk.inc');
+ \Drupal::moduleHandler()->loadInclude('locale', 'bulk.inc');
if ($batch = locale_config_batch_update_components(array(), array(), $components)) {
batch_set($batch);
}
@@ -553,7 +553,7 @@ function locale_system_remove($components) {
$list = array_merge($components['module'], $components['theme']);
if ($language_list = locale_translatable_language_list()) {
module_load_include('compare.inc', 'locale');
- Drupal::moduleHandler()->loadInclude('locale', 'bulk.inc');
+ \Drupal::moduleHandler()->loadInclude('locale', 'bulk.inc');
// Delete configuration translations.
\Drupal\locale\Locale::config()->deleteComponentTranslations($components, array_keys($language_list));
@@ -612,8 +612,8 @@ function locale_js_alter(&$javascript) {
function locale_js_translate(array $files = array()) {
$language_interface = language(Language::TYPE_INTERFACE);
- $dir = 'public://' . Drupal::config('locale.settings')->get('javascript.directory');
- $parsed = Drupal::state()->get('system.javascript_parsed') ?: array();
+ $dir = 'public://' . \Drupal::config('locale.settings')->get('javascript.directory');
+ $parsed = \Drupal::state()->get('system.javascript_parsed') ?: array();
$new_files = FALSE;
foreach ($files as $filepath) {
@@ -642,16 +642,16 @@ function locale_js_translate(array $files = array()) {
unset($parsed['refresh:' . $language_interface->id]);
}
// 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();
$translation_file = NULL;
if (!empty($files) && !empty($locale_javascripts[$language_interface->id])) {
// Add the translation JavaScript file to the page.
@@ -666,7 +666,7 @@ function locale_js_translate(array $files = array()) {
function locale_library_info() {
$libraries['drupal.locale.admin'] = array(
'title' => 'Locale',
- 'version' => Drupal::VERSION,
+ 'version' => \Drupal::VERSION,
'js' => array(
drupal_get_path('module', 'locale') . '/locale.admin.js' => array(),
),
@@ -678,7 +678,7 @@ function locale_library_info() {
);
$libraries['drupal.locale.datepicker'] = array(
'title' => 'Locale Datepicker UI',
- 'version' => Drupal::VERSION,
+ 'version' => \Drupal::VERSION,
'js' => array(
drupal_get_path('module', 'locale') . '/locale.datepicker.js' => array(),
),
@@ -710,7 +710,7 @@ function locale_library_info_alter(&$libraries, $module) {
'ui' => array(
'datepicker' => array(
'isRTL' => $language_interface->direction == Language::DIRECTION_RTL,
- 'firstDay' => Drupal::config('system.date')->get('first_day'),
+ 'firstDay' => \Drupal::config('system.date')->get('first_day'),
),
),
),
@@ -726,12 +726,12 @@ function locale_library_info_alter(&$libraries, $module) {
function locale_form_language_admin_overview_form_alter(&$form, &$form_state) {
$languages = $form['languages']['#languages'];
- $total_strings = Drupal::service('locale.storage')->countStrings();
+ $total_strings = \Drupal::service('locale.storage')->countStrings();
$stats = array_fill_keys(array_keys($languages), array());
// If we have source strings, count translations and calculate progress.
if (!empty($total_strings)) {
- $translations = Drupal::service('locale.storage')->countTranslations();
+ $translations = \Drupal::service('locale.storage')->countTranslations();
foreach ($translations as $langcode => $translated) {
$stats[$langcode]['translated'] = $translated;
if ($translated > 0) {
@@ -787,7 +787,7 @@ function locale_form_language_admin_add_form_alter(&$form, &$form_state) {
* Set a batch for a newly-added language.
*/
function locale_form_language_admin_add_form_alter_submit($form, $form_state) {
- if (Drupal::config('locale.settings')->get('translation.import_enabled')) {
+ if (\Drupal::config('locale.settings')->get('translation.import_enabled')) {
if (empty($form_state['values']['predefined_langcode']) || $form_state['values']['predefined_langcode'] == 'custom') {
$langcode = $form_state['values']['langcode'];
}
@@ -802,7 +802,7 @@ function locale_form_language_admin_add_form_alter_submit($form, $form_state) {
batch_set($batch);
// Create or update all configuration translations for this language.
- Drupal::moduleHandler()->loadInclude('locale', 'bulk.inc');
+ \Drupal::moduleHandler()->loadInclude('locale', 'bulk.inc');
if ($batch = locale_config_batch_update_components($options, array($langcode))) {
batch_set($batch);
}
@@ -849,7 +849,7 @@ function locale_form_system_file_system_settings_alter(&$form, $form_state) {
$form['translation_path'] = array(
'#type' => 'textfield',
'#title' => t('Interface translations directory'),
- '#default_value' => Drupal::config('locale.settings')->get('translation.path'),
+ '#default_value' => \Drupal::config('locale.settings')->get('translation.path'),
'#maxlength' => 255,
'#description' => t('A local file system path where interface translation files will be stored.'),
'#required' => TRUE,
@@ -874,7 +874,7 @@ function locale_system_file_system_settings_submit(&$form, $form_state) {
locale_translation_clear_status();
}
- Drupal::config('locale.settings')
+ \Drupal::config('locale.settings')
->set('translation.path', $form_state['values']['translation_path'])
->save();
}
@@ -975,7 +975,7 @@ function locale_translation_file_history_delete($projects = array(), $langcodes
*/
function locale_translation_get_status($projects = NULL, $langcodes = NULL) {
$result = array();
- $status = Drupal::state()->get('locale.translation_status');
+ $status = \Drupal::state()->get('locale.translation_status');
module_load_include('translation.inc', 'locale');
$projects = $projects ? $projects : array_keys(locale_translation_get_projects());
$langcodes = $langcodes ? $langcodes : array_keys(locale_translatable_language_list());
@@ -1052,8 +1052,8 @@ function locale_translation_status_save($project, $langcode, $type, $data) {
break;
}
- 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);
}
}
@@ -1072,7 +1072,7 @@ function locale_translation_status_delete_languages($langcodes) {
}
}
}
- Drupal::state()->set('locale.translation_status', $status);
+ \Drupal::state()->set('locale.translation_status', $status);
}
}
@@ -1090,15 +1090,15 @@ function locale_translation_status_delete_projects($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');
}
/**
@@ -1109,7 +1109,7 @@ function locale_translation_clear_status() {
* when checking or importing translation files, FALSE otherwise.
*/
function locale_translation_use_remote_source() {
- return Drupal::config('locale.settings')->get('translation.use_source') == LOCALE_TRANSLATION_USE_SOURCE_REMOTE_AND_LOCAL;
+ return \Drupal::config('locale.settings')->get('translation.use_source') == LOCALE_TRANSLATION_USE_SOURCE_REMOTE_AND_LOCAL;
}
/**
@@ -1147,7 +1147,7 @@ function _locale_refresh_translations($langcodes, $lids = array()) {
if (!empty($langcodes)) {
// Update javascript translations if any of the strings has a javascript
// location, or if no string ids were provided, update all languages.
- if (empty($lids) || ($strings = Drupal::service('locale.storage')->getStrings(array('lid' => $lids, 'type' => 'javascript')))) {
+ if (empty($lids) || ($strings = \Drupal::service('locale.storage')->getStrings(array('lid' => $lids, 'type' => 'javascript')))) {
array_map('_locale_invalidate_js', $langcodes);
}
}
@@ -1169,7 +1169,7 @@ function _locale_refresh_translations($langcodes, $lids = array()) {
*/
function _locale_refresh_configuration(array $langcodes, array $lids) {
if ($lids && $langcodes && $names = \Drupal\locale\Locale::config()->getStringNames($lids)) {
- Drupal::moduleHandler()->loadInclude('locale', 'bulk.inc');
+ \Drupal::moduleHandler()->loadInclude('locale', 'bulk.inc');
locale_config_update_multiple($names, $langcodes);
}
}
@@ -1267,11 +1267,11 @@ function _locale_parse_js_file($filepath) {
$string = implode('', preg_split('~(?findString(array('source' => $string, 'context' => $context));
+ $source = \Drupal::service('locale.storage')->findString(array('source' => $string, 'context' => $context));
if (!$source) {
// We don't have the source string yet, thus we insert it into the database.
- $source = Drupal::service('locale.storage')->createString(array(
+ $source = \Drupal::service('locale.storage')->createString(array(
'source' => $string,
'context' => $context,
));
@@ -1297,7 +1297,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.
@@ -1311,7 +1311,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;
}
@@ -1322,7 +1322,7 @@ function _locale_invalidate_js($langcode = NULL) {
* The language, the translation file should be (re)created for.
*/
function _locale_rebuild_js($langcode = NULL) {
- $config = Drupal::config('locale.settings');
+ $config = \Drupal::config('locale.settings');
if (!isset($langcode)) {
$language = language(Language::TYPE_INTERFACE);
}
@@ -1340,7 +1340,7 @@ function _locale_rebuild_js($langcode = NULL) {
'translated' => TRUE,
);
$translations = array();
- foreach (Drupal::service('locale.storage')->getTranslations($conditions) as $data) {
+ foreach (\Drupal::service('locale.storage')->getTranslations($conditions) as $data) {
$translations[$data->context][$data->source] = $data->translation;
}
@@ -1350,7 +1350,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->id])) {
$data .= "'pluralFormula': function (\$n) { return Number({$locale_plurals[$language->id]['formula']}); }, ";
}
@@ -1364,7 +1364,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->id]) || ($locale_javascripts[$language->id] != $data_hash);
if (!empty($locale_javascripts[$language->id]) && (!$data || $changed_hash)) {
file_unmanaged_delete($dir . '/' . $language->id . '_' . $locale_javascripts[$language->id] . '.js');
@@ -1408,7 +1408,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 fbc5c59..1e045fe 100644
--- a/core/modules/locale/locale.pages.inc
+++ b/core/modules/locale/locale.pages.inc
@@ -112,7 +112,7 @@ function locale_translation_status_form($form, &$form_state) {
});
}
- $last_checked = Drupal::state()->get('locale.translation_last_checked');
+ $last_checked = \Drupal::state()->get('locale.translation_last_checked');
$form['last_checked'] = array(
'#theme' => 'locale_translation_last_check',
'#last' => $last_checked,
@@ -197,7 +197,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 30c7b0f..bb91542 100644
--- a/core/modules/locale/locale.translation.inc
+++ b/core/modules/locale/locale.translation.inc
@@ -58,7 +58,7 @@ function locale_translation_get_projects($project_names = array()) {
// http://drupal.org/node/1777106 is a follow-up issue to make the check for
// possible out-of-date project information more robust.
- if ($result->rowCount() == 0 && Drupal::moduleHandler()->moduleExists('update')) {
+ if ($result->rowCount() == 0 && \Drupal::moduleHandler()->moduleExists('update')) {
module_load_include('compare.inc', 'locale');
// At least the core project should be in the database, so we build the
// data if none are found.
@@ -236,7 +236,7 @@ function locale_translation_source_build($project, $langcode, $filename = NULL)
$source->timestamp = 0;
$source->last_checked = 0;
- $filename = $filename ? $filename : Drupal::config('locale.settings')->get('translation.default_filename');
+ $filename = $filename ? $filename : \Drupal::config('locale.settings')->get('translation.default_filename');
// If the server_pattern contains a remote file path we will check for a
// remote file. The local version of this file will only be checked if a
@@ -322,7 +322,7 @@ function locale_translation_build_server_pattern($project, $template) {
*/
function locale_cron_fill_queue() {
$updates = array();
- $config = Drupal::config('locale.settings');
+ $config = \Drupal::config('locale.settings');
// Determine which project+language should be updated.
$last = REQUEST_TIME - $config->get('translation.update_interval_days') * 3600 * 24;
@@ -351,7 +351,7 @@ function locale_cron_fill_queue() {
if ($updates) {
module_load_include('fetch.inc', 'locale');
$options = _locale_translation_default_update_options();
- $queue = Drupal::queue('locale_translation', TRUE);
+ $queue = \Drupal::queue('locale_translation', TRUE);
foreach ($updates as $project => $languages) {
$batch = locale_translation_batch_update_build(array($project), $languages, $options);
@@ -425,7 +425,7 @@ function _locale_translation_source_compare($source1, $source2) {
* Array of translation import options.
*/
function _locale_translation_default_update_options() {
- $config = Drupal::config('locale.settings');
+ $config = \Drupal::config('locale.settings');
return array(
'customized' => LOCALE_NOT_CUSTOMIZED,
'overwrite_options' => array(
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 e820b9f..be5ad52 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 6de4ce6..166983a 100644
--- a/core/modules/locale/tests/modules/locale_test/locale_test.module
+++ b/core/modules/locale/tests/modules/locale_test/locale_test.module
@@ -17,7 +17,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;
@@ -38,7 +38,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/menu/lib/Drupal/menu/Tests/MenuTest.php b/core/modules/menu/lib/Drupal/menu/Tests/MenuTest.php
index f7e0690..452f05c 100644
--- a/core/modules/menu/lib/Drupal/menu/Tests/MenuTest.php
+++ b/core/modules/menu/lib/Drupal/menu/Tests/MenuTest.php
@@ -159,7 +159,7 @@ function addCustomMenu() {
$this->assertText($label, 'Menu created');
// Confirm that the custom menu block is available.
- $this->drupalGet('admin/structure/block/list/' . \Drupal::config('system.theme')->get('default'));
+ $this->drupalGet('admin/structure/block/list/' . \\Drupal::config('system.theme')->get('default'));
$this->assertText($label);
// Enable the block.
@@ -698,7 +698,7 @@ private function getStandardMenuLink() {
$mlid = 0;
// Retrieve menu link id of the Log out menu link, which will always be on
// the front page.
- $query = \Drupal::entityQuery('menu_link')
+ $query = \\Drupal::entityQuery('menu_link')
->condition('module', 'system')
->condition('router_path', 'user/logout');
$result = $query->execute();
diff --git a/core/modules/menu/lib/Drupal/menu/Tests/MenuUninstallTest.php b/core/modules/menu/lib/Drupal/menu/Tests/MenuUninstallTest.php
index 203768b..9e4bee0 100644
--- a/core/modules/menu/lib/Drupal/menu/Tests/MenuUninstallTest.php
+++ b/core/modules/menu/lib/Drupal/menu/Tests/MenuUninstallTest.php
@@ -33,8 +33,8 @@ public static function getInfo() {
* Tests Menu uninstall.
*/
public function testMenuUninstall() {
- \Drupal::moduleHandler()->disable(array('menu'));
- \Drupal::moduleHandler()->uninstall(array('menu'));
+ \\Drupal::moduleHandler()->disable(array('menu'));
+ \\Drupal::moduleHandler()->uninstall(array('menu'));
$this->assertTrue(entity_load('menu', 'admin', TRUE), 'The \'admin\' menu still exists after uninstalling menu module.');
}
diff --git a/core/modules/menu/lib/Drupal/menu/Tests/MenuWebTestBase.php b/core/modules/menu/lib/Drupal/menu/Tests/MenuWebTestBase.php
index e1c21a0..6e20cbc 100644
--- a/core/modules/menu/lib/Drupal/menu/Tests/MenuWebTestBase.php
+++ b/core/modules/menu/lib/Drupal/menu/Tests/MenuWebTestBase.php
@@ -34,7 +34,7 @@ function assertMenuLink($mlid, array $expected_item) {
$item = entity_load('menu_link', $mlid);
$options = $item->options;
if (!empty($options['query'])) {
- $item['link_path'] .= '?' . \Drupal::urlGenerator()->httpBuildQuery($options['query']);
+ $item['link_path'] .= '?' . \\Drupal::urlGenerator()->httpBuildQuery($options['query']);
}
if (!empty($options['fragment'])) {
$item['link_path'] .= '#' . $options['fragment'];
diff --git a/core/modules/menu/menu.install b/core/modules/menu/menu.install
index 36e6302..ac395f9 100644
--- a/core/modules/menu/menu.install
+++ b/core/modules/menu/menu.install
@@ -80,7 +80,7 @@ function menu_update_8004() {
$result = db_query('SELECT * FROM {menu_custom}');
foreach ($result as $menu) {
// Save the config object.
- Drupal::config('system.menu.' . $menu->menu_name)
+ \Drupal::config('system.menu.' . $menu->menu_name)
->set('id', $menu->menu_name)
->set('uuid', $uuid->generate())
->set('label', $menu->title)
diff --git a/core/modules/menu/menu.module b/core/modules/menu/menu.module
index 57f39b6..64dc0f8 100644
--- a/core/modules/menu/menu.module
+++ b/core/modules/menu/menu.module
@@ -143,7 +143,7 @@ function menu_entity_bundle_info() {
$bundles = array();
$config_names = config_get_storage_names_with_prefix('system.menu.');
foreach ($config_names as $config_name) {
- $config = Drupal::config($config_name);
+ $config = \Drupal::config($config_name);
$bundles['menu_link'][$config->get('id')] = array(
'label' => $config->get('label'),
);
@@ -182,7 +182,7 @@ function menu_theme() {
* Add a link for each custom menu.
*/
function menu_enable() {
- Drupal::service('router.builder')->rebuild();
+ \Drupal::service('router.builder')->rebuild();
menu_router_rebuild();
$system_link = entity_load_multiple_by_properties('menu_link', array('link_path' => 'admin/structure/menu', 'module' => 'system'));
$system_link = reset($system_link);
@@ -200,7 +200,7 @@ function menu_enable() {
$link->link_title = $menu->label();
$link->link_path = 'admin/structure/menu/manage/' . $menu->id();
- $query = Drupal::entityQuery('menu_link')
+ $query = \Drupal::entityQuery('menu_link')
->condition('link_path', $link->link_path)
->condition('plid', $link->plid);
$result = $query->execute();
@@ -231,12 +231,12 @@ function menu_menu_insert(Menu $menu) {
menu_cache_clear_all();
// Invalidate the block cache to update menu-based derivatives.
if (module_exists('block')) {
- Drupal::service('plugin.manager.block')->clearCachedDefinitions();
+ \Drupal::service('plugin.manager.block')->clearCachedDefinitions();
}
// Make sure the menu is present in the active menus variable so that its
// items may appear in the menu active trail.
// See menu_set_active_menu_names().
- $config = Drupal::config('system.menu');
+ $config = \Drupal::config('system.menu');
$active_menus = $config->get('active_menus_default') ?: array_keys(menu_get_menus());
if (!in_array($menu->id(), $active_menus)) {
@@ -254,7 +254,7 @@ function menu_menu_update(Menu $menu) {
menu_cache_clear_all();
// Invalidate the block cache to update menu-based derivatives.
if (module_exists('block')) {
- Drupal::service('plugin.manager.block')->clearCachedDefinitions();
+ \Drupal::service('plugin.manager.block')->clearCachedDefinitions();
}
}
@@ -283,7 +283,7 @@ function menu_menu_delete(Menu $menu) {
// Invalidate the block cache to update menu-based derivatives.
if (module_exists('block')) {
- Drupal::service('plugin.manager.block')->clearCachedDefinitions();
+ \Drupal::service('plugin.manager.block')->clearCachedDefinitions();
}
}
@@ -312,7 +312,7 @@ function menu_parent_options(array $menus, MenuLink $menu_link = NULL, $type = N
// allow contrib modules to provide more scalable pattern choosers.
// hook_form_alter is too late in itself because all the possible parents are
// retrieved here, unless override_parent_selector is set to TRUE.
- if (Drupal::config('menu.settings')->get('override_parent_selector')) {
+ if (\Drupal::config('menu.settings')->get('override_parent_selector')) {
return array();
}
@@ -444,7 +444,7 @@ function menu_node_save(EntityInterface $node) {
*/
function menu_node_predelete(EntityInterface $node) {
// Delete all menu module links that point to this node.
- $query = Drupal::entityQuery('menu_link')
+ $query = \Drupal::entityQuery('menu_link')
->condition('link_path', 'node/' . $node->id())
->condition('module', 'menu');
$result = $query->execute();
@@ -467,7 +467,7 @@ function menu_node_prepare_form(NodeInterface $node, $form_display, $operation,
// Give priority to the default menu
$type_menus = variable_get('menu_options_' . $node->getType(), array('main' => 'main'));
if (in_array($menu_name, $type_menus)) {
- $query = Drupal::entityQuery('menu_link')
+ $query = \Drupal::entityQuery('menu_link')
->condition('link_path', 'node/' . $node->id())
->condition('menu_name', $menu_name)
->condition('module', 'menu')
@@ -479,7 +479,7 @@ function menu_node_prepare_form(NodeInterface $node, $form_display, $operation,
}
// Check all allowed menus if a link does not exist in the default menu.
if (!$mlid && !empty($type_menus)) {
- $query = Drupal::entityQuery('menu_link')
+ $query = \Drupal::entityQuery('menu_link')
->condition('link_path', 'node/' . $node->id())
->condition('menu_name', array_values($type_menus), 'IN')
->condition('module', 'menu')
@@ -714,7 +714,7 @@ function menu_preprocess_block(&$variables) {
function menu_library_info() {
$libraries['drupal.menu'] = array(
'title' => 'Menu',
- 'version' => Drupal::VERSION,
+ 'version' => \Drupal::VERSION,
'js' => array(
drupal_get_path('module', 'menu') . '/menu.js' => array(),
),
@@ -726,7 +726,7 @@ function menu_library_info() {
);
$libraries['drupal.menu.admin'] = array(
'title' => 'Menu admin',
- 'version' => Drupal::VERSION,
+ 'version' => \Drupal::VERSION,
'js' => array(
drupal_get_path('module', 'menu') . '/menu.admin.js' => array(),
),
diff --git a/core/modules/menu_link/lib/Drupal/menu_link/Entity/MenuLink.php b/core/modules/menu_link/lib/Drupal/menu_link/Entity/MenuLink.php
index d6493f5..dedd433 100644
--- a/core/modules/menu_link/lib/Drupal/menu_link/Entity/MenuLink.php
+++ b/core/modules/menu_link/lib/Drupal/menu_link/Entity/MenuLink.php
@@ -301,7 +301,7 @@ public function getRoute() {
return NULL;
}
if (!($this->routeObject instanceof Route)) {
- $route_provider = \Drupal::service('router.route_provider');
+ $route_provider = \\Drupal::service('router.route_provider');
$this->routeObject = $route_provider->getRouteByName($this->route_name);
}
return $this->routeObject;
@@ -354,7 +354,7 @@ public static function buildFromRouterItem(array $item) {
'link_path' => $item['path'],
'options' => empty($item['description']) ? array() : array('attributes' => array('title' => $item['description'])),
);
- return \Drupal::entityManager()
+ return \\Drupal::entityManager()
->getStorageController('menu_link')->create($item);
}
@@ -529,7 +529,7 @@ public static function findRouteNameParameters($link_path) {
// Use router.dynamic instead of router, because router will call the
// legacy router which will call hook_menu() and you will get back to
// this method.
- $result = \Drupal::service('router.dynamic')->matchRequest($request);
+ $result = \\Drupal::service('router.dynamic')->matchRequest($request);
$return = array();
$return[] = isset($result['_route']) ? $result['_route'] : '';
$return[] = $result['_raw_variables']->all();
diff --git a/core/modules/menu_link/lib/Drupal/menu_link/MenuLinkStorageController.php b/core/modules/menu_link/lib/Drupal/menu_link/MenuLinkStorageController.php
index 7330147..783b996 100644
--- a/core/modules/menu_link/lib/Drupal/menu_link/MenuLinkStorageController.php
+++ b/core/modules/menu_link/lib/Drupal/menu_link/MenuLinkStorageController.php
@@ -279,7 +279,7 @@ public function updateParentalStatus(EntityInterface $entity, $exclude = FALSE)
// If plid == 0, there is nothing to update.
if ($entity->plid) {
// Check if at least one visible child exists in the table.
- $query = \Drupal::entityQuery($this->entityType);
+ $query = \\Drupal::entityQuery($this->entityType);
$query
->condition('menu_name', $entity->menu_name)
->condition('hidden', 0)
@@ -372,7 +372,7 @@ public function moveChildren(EntityInterface $entity) {
* {@inheritdoc}
*/
public function countMenuLinks($menu_name) {
- $query = \Drupal::entityQuery($this->entityType);
+ $query = \\Drupal::entityQuery($this->entityType);
$query
->condition('menu_name', $menu_name)
->count();
@@ -388,7 +388,7 @@ public function getParentFromHierarchy(EntityInterface $entity) {
$parent = FALSE;
$parent_path = substr($parent_path, 0, strrpos($parent_path, '/'));
- $query = \Drupal::entityQuery($this->entityType);
+ $query = \\Drupal::entityQuery($this->entityType);
$query
->condition('mlid', $entity->id(), '<>')
->condition('module', 'system')
diff --git a/core/modules/menu_link/menu_link.module b/core/modules/menu_link/menu_link.module
index 105e502..85d8e92 100644
--- a/core/modules/menu_link/menu_link.module
+++ b/core/modules/menu_link/menu_link.module
@@ -96,10 +96,10 @@ function menu_link_delete_multiple(array $mlids, $force = FALSE, $prevent_repare
return;
}
- $controller = Drupal::entityManager()
+ $controller = \Drupal::entityManager()
->getStorageController('menu_link');
if (!$force) {
- $entity_query = Drupal::entityQuery('menu_link');
+ $entity_query = \Drupal::entityQuery('menu_link');
$group = $entity_query->orConditionGroup()
->condition('module', 'system', '<>')
->condition('updated', 0, '<>');
@@ -151,7 +151,7 @@ function menu_link_save(MenuLink $menu_link) {
* The insert op returns the mlid of the new item. Others op return NULL.
*/
function menu_link_maintain($module, $op, $link_path, $link_title = NULL) {
- $menu_link_controller = Drupal::entityManager()
+ $menu_link_controller = \Drupal::entityManager()
->getStorageController('menu_link');
switch ($op) {
case 'insert':
@@ -188,7 +188,7 @@ function menu_link_maintain($module, $op, $link_path, $link_title = NULL) {
break;
case 'delete':
- $result = Drupal::entityQuery('menu_link')->condition('link_path', $link_path)->execute();
+ $result = \Drupal::entityQuery('menu_link')->condition('link_path', $link_path)->execute();
if (!empty($result)) {
menu_link_delete_multiple($result);
}
diff --git a/core/modules/menu_link/tests/Drupal/menu_link/Tests/Plugin/Core/Entity/MenuLinkTest.php b/core/modules/menu_link/tests/Drupal/menu_link/Tests/Plugin/Core/Entity/MenuLinkTest.php
index 5e97efd..c269032 100644
--- a/core/modules/menu_link/tests/Drupal/menu_link/Tests/Plugin/Core/Entity/MenuLinkTest.php
+++ b/core/modules/menu_link/tests/Drupal/menu_link/Tests/Plugin/Core/Entity/MenuLinkTest.php
@@ -41,7 +41,7 @@ public function testFindRouteNameParameters() {
$router = $this->getMock('Symfony\Component\Routing\Matcher\RequestMatcherInterface');
$container = new ContainerBuilder();
$container->set('router.dynamic', $router);
- \Drupal::setContainer($container);
+ \\Drupal::setContainer($container);
$router->expects($this->at(0))
->method('matchRequest')
diff --git a/core/modules/node/lib/Drupal/node/Entity/Node.php b/core/modules/node/lib/Drupal/node/Entity/Node.php
index f69bf1a..ec48ed2 100644
--- a/core/modules/node/lib/Drupal/node/Entity/Node.php
+++ b/core/modules/node/lib/Drupal/node/Entity/Node.php
@@ -117,7 +117,7 @@ public function postSave(EntityStorageControllerInterface $storage_controller, $
// default revision. There's no need to delete existing records if the node
// is new.
if ($this->isDefaultRevision()) {
- \Drupal::entityManager()->getAccessController('node')->writeGrants($this, $update);
+ \\Drupal::entityManager()->getAccessController('node')->writeGrants($this, $update);
}
}
@@ -147,7 +147,7 @@ public function access($operation = 'view', AccountInterface $account = NULL) {
return parent::access($operation, $account);
}
- return \Drupal::entityManager()
+ return \\Drupal::entityManager()
->getAccessController($this->entityType)
->access($this, $operation, $this->prepareLangcode(), $account);
}
@@ -159,11 +159,11 @@ public function prepareLangcode() {
$langcode = $this->language()->id;
// If the Language module is enabled, try to use the language from content
// negotiation.
- if (\Drupal::moduleHandler()->moduleExists('language')) {
+ if (\\Drupal::moduleHandler()->moduleExists('language')) {
// Load languages the node exists in.
$node_translations = $this->getTranslationLanguages();
// Load the language from content negotiation.
- $content_negotiation_langcode = \Drupal::languageManager()->getLanguage(Language::TYPE_CONTENT)->id;
+ $content_negotiation_langcode = \\Drupal::languageManager()->getLanguage(Language::TYPE_CONTENT)->id;
// If there is a translation available, use it.
if (isset($node_translations[$content_negotiation_langcode])) {
$langcode = $content_negotiation_langcode;
diff --git a/core/modules/node/lib/Drupal/node/Entity/NodeType.php b/core/modules/node/lib/Drupal/node/Entity/NodeType.php
index cc6021c..669e41c 100644
--- a/core/modules/node/lib/Drupal/node/Entity/NodeType.php
+++ b/core/modules/node/lib/Drupal/node/Entity/NodeType.php
@@ -163,7 +163,7 @@ public function getModuleSettings($module) {
* {@inheritdoc}
*/
public function isLocked() {
- $locked = \Drupal::state()->get('node.type.locked');
+ $locked = \\Drupal::state()->get('node.type.locked');
return isset($locked[$this->id()]) ? $locked[$this->id()] : FALSE;
}
@@ -173,7 +173,7 @@ public function isLocked() {
public function postSave(EntityStorageControllerInterface $storage_controller, $update = TRUE) {
if (!$update) {
// Clear the node type cache, so the new type appears.
- \Drupal::cache()->deleteTags(array('node_types' => TRUE));
+ \\Drupal::cache()->deleteTags(array('node_types' => TRUE));
entity_invoke_bundle_hook('create', 'node', $this->id());
@@ -185,7 +185,7 @@ public function postSave(EntityStorageControllerInterface $storage_controller, $
}
elseif ($this->getOriginalID() != $this->id()) {
// Clear the node type cache to reflect the rename.
- \Drupal::cache()->deleteTags(array('node_types' => TRUE));
+ \\Drupal::cache()->deleteTags(array('node_types' => TRUE));
$update_count = node_type_update_nodes($this->getOriginalID(), $this->id());
if ($update_count) {
diff --git a/core/modules/node/lib/Drupal/node/NodeFormController.php b/core/modules/node/lib/Drupal/node/NodeFormController.php
index 0609e9c..ee9e191 100644
--- a/core/modules/node/lib/Drupal/node/NodeFormController.php
+++ b/core/modules/node/lib/Drupal/node/NodeFormController.php
@@ -69,7 +69,7 @@ public function form(array $form, array &$form_state) {
drupal_set_title(t('Edit @type @title', array('@type' => node_get_type_label($node), '@title' => $node->label())), PASS_THROUGH);
}
- $user_config = \Drupal::config('user.settings');
+ $user_config = \\Drupal::config('user.settings');
// Some special stuff when previewing a node.
if (isset($form_state['node_preview'])) {
$form['#prefix'] = $form_state['node_preview'];
@@ -349,7 +349,7 @@ public function validate(array $form, array &$form_state) {
// Invoke hook_node_validate() for validation needed by modules.
// Can't use module_invoke_all(), because $form_state must
// be receivable by reference.
- foreach (\Drupal::moduleHandler()->getImplementations('node_validate') as $module) {
+ foreach (\\Drupal::moduleHandler()->getImplementations('node_validate') as $module) {
$function = $module . '_node_validate';
$function($node, $form, $form_state);
}
@@ -380,7 +380,7 @@ public function submit(array $form, array &$form_state) {
}
$node->validated = TRUE;
- foreach (\Drupal::moduleHandler()->getImplementations('node_submit') as $module) {
+ foreach (\\Drupal::moduleHandler()->getImplementations('node_submit') as $module) {
$function = $module . '_node_submit';
$function($node, $form, $form_state);
}
@@ -498,7 +498,7 @@ public function save(array $form, array &$form_state) {
*/
public function delete(array $form, array &$form_state) {
$destination = array();
- $query = \Drupal::request()->query;
+ $query = \\Drupal::request()->query;
if ($query->has('destination')) {
$destination = drupal_get_destination();
$query->remove('destination');
diff --git a/core/modules/node/lib/Drupal/node/NodeStorageController.php b/core/modules/node/lib/Drupal/node/NodeStorageController.php
index 1360af3..1852aac 100644
--- a/core/modules/node/lib/Drupal/node/NodeStorageController.php
+++ b/core/modules/node/lib/Drupal/node/NodeStorageController.php
@@ -57,7 +57,7 @@ protected function attachLoad(&$queried_entities, $load_revision = FALSE) {
$this->hookLoadArguments = array($argument);
// Call hook_entity_load().
- foreach (\Drupal::moduleHandler()->getImplementations('entity_load') as $module) {
+ foreach (\\Drupal::moduleHandler()->getImplementations('entity_load') as $module) {
$function = $module . '_entity_load';
$function($queried_entities, $this->entityType);
}
@@ -65,7 +65,7 @@ protected function attachLoad(&$queried_entities, $load_revision = FALSE) {
// always the queried entities, followed by additional arguments set in
// $this->hookLoadArguments.
$args = array_merge(array($queried_entities), $this->hookLoadArguments);
- foreach (\Drupal::moduleHandler()->getImplementations($this->entityType . '_load') as $module) {
+ foreach (\\Drupal::moduleHandler()->getImplementations($this->entityType . '_load') as $module) {
call_user_func_array($module . '_' . $this->entityType . '_load', $args);
}
}
diff --git a/core/modules/node/lib/Drupal/node/Plugin/entity_reference/selection/NodeSelection.php b/core/modules/node/lib/Drupal/node/Plugin/entity_reference/selection/NodeSelection.php
index 5a087a8..cb3972b 100644
--- a/core/modules/node/lib/Drupal/node/Plugin/entity_reference/selection/NodeSelection.php
+++ b/core/modules/node/lib/Drupal/node/Plugin/entity_reference/selection/NodeSelection.php
@@ -34,7 +34,7 @@ public function buildEntityQuery($match = NULL, $match_operator = 'CONTAINS') {
// 'unpublished'. We need to do that as long as there are no access control
// modules in use on the site. As long as one access control module is there,
// it is supposed to handle this check.
- if (!user_access('bypass node access') && !count(\Drupal::moduleHandler()->getImplementations('node_grants'))) {
+ if (!user_access('bypass node access') && !count(\\Drupal::moduleHandler()->getImplementations('node_grants'))) {
$query->condition('status', NODE_PUBLISHED);
}
return $query;
diff --git a/core/modules/node/lib/Drupal/node/Plugin/views/row/Rss.php b/core/modules/node/lib/Drupal/node/Plugin/views/row/Rss.php
index 4f7cac4..0622692 100644
--- a/core/modules/node/lib/Drupal/node/Plugin/views/row/Rss.php
+++ b/core/modules/node/lib/Drupal/node/Plugin/views/row/Rss.php
@@ -100,7 +100,7 @@ public function render($row) {
$display_mode = $this->options['item_length'];
if ($display_mode == 'default') {
- $display_mode = \Drupal::config('system.rss')->get('items.view_mode');
+ $display_mode = \\Drupal::config('system.rss')->get('items.view_mode');
}
// Load the specified node:
diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeAccessBaseTableTest.php b/core/modules/node/lib/Drupal/node/Tests/NodeAccessBaseTableTest.php
index 8fc72f6..60b3625 100644
--- a/core/modules/node/lib/Drupal/node/Tests/NodeAccessBaseTableTest.php
+++ b/core/modules/node/lib/Drupal/node/Tests/NodeAccessBaseTableTest.php
@@ -40,7 +40,7 @@ public function setUp() {
parent::setUp();
node_access_rebuild();
- \Drupal::state()->set('node_access_test.private', TRUE);
+ \\Drupal::state()->set('node_access_test.private', TRUE);
}
/**
diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeAccessLanguageTest.php b/core/modules/node/lib/Drupal/node/Tests/NodeAccessLanguageTest.php
index 353a687..476e8bd 100644
--- a/core/modules/node/lib/Drupal/node/Tests/NodeAccessLanguageTest.php
+++ b/core/modules/node/lib/Drupal/node/Tests/NodeAccessLanguageTest.php
@@ -36,7 +36,7 @@ function setUp() {
node_access_rebuild();
// Enable the private node feature of the node_access_test module.
- \Drupal::state()->set('node_access_test.private', TRUE);
+ \\Drupal::state()->set('node_access_test.private', TRUE);
// Add Hungarian and Catalan.
$language = new Language(array(
@@ -156,7 +156,7 @@ function testNodeAccessPrivate() {
// Reset the node access cache and turn on our test node_access() code.
entity_access_controller('node')->resetCache();
- \Drupal::state()->set('node_access_test_secret_catalan', 1);
+ \\Drupal::state()->set('node_access_test_secret_catalan', 1);
// Tests that access is not granted if requested with no language.
$this->assertNodeAccess($expected_node_access_no_access, $node_private_no_language, $web_user);
diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeAccessPagerTest.php b/core/modules/node/lib/Drupal/node/Tests/NodeAccessPagerTest.php
index 287ec65..a15944d 100644
--- a/core/modules/node/lib/Drupal/node/Tests/NodeAccessPagerTest.php
+++ b/core/modules/node/lib/Drupal/node/Tests/NodeAccessPagerTest.php
@@ -73,7 +73,7 @@ public function testCommentPager() {
*/
public function testForumPager() {
// Look up the forums vocabulary ID.
- $vid = \Drupal::config('forum.settings')->get('vocabulary');
+ $vid = \\Drupal::config('forum.settings')->get('vocabulary');
$this->assertTrue($vid, 'Forum navigation vocabulary ID is set.');
// Look up the general discussion term.
diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeCreationTest.php b/core/modules/node/lib/Drupal/node/Tests/NodeCreationTest.php
index 090a27e..af12003 100644
--- a/core/modules/node/lib/Drupal/node/Tests/NodeCreationTest.php
+++ b/core/modules/node/lib/Drupal/node/Tests/NodeCreationTest.php
@@ -103,10 +103,10 @@ function testFailedPageCreation() {
*/
function testUnpublishedNodeCreation() {
// Set the front page to the test page.
- \Drupal::config('system.site')->set('page.front', 'test-page')->save();
+ \\Drupal::config('system.site')->set('page.front', 'test-page')->save();
// Set "Basic page" content type to be unpublished by default.
- \Drupal::config('node.type.page')->set('settings.node.options', array())->save();
+ \\Drupal::config('node.type.page')->set('settings.node.options', array())->save();
// Create a node.
$edit = array();
diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeEntityViewModeAlterTest.php b/core/modules/node/lib/Drupal/node/Tests/NodeEntityViewModeAlterTest.php
index 7a1ed97..19db959 100644
--- a/core/modules/node/lib/Drupal/node/Tests/NodeEntityViewModeAlterTest.php
+++ b/core/modules/node/lib/Drupal/node/Tests/NodeEntityViewModeAlterTest.php
@@ -42,7 +42,7 @@ function testNodeViewModeChange() {
$node = $this->drupalGetNodeByTitle($edit["title"]);
// Set the flag to alter the view mode and view the node.
- \Drupal::state()->set('node_test_change_view_mode', 'teaser');
+ \\Drupal::state()->set('node_test_change_view_mode', 'teaser');
$this->drupalGet('node/' . $node->id());
// Check that teaser mode is viewed.
diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeFormButtonsTest.php b/core/modules/node/lib/Drupal/node/Tests/NodeFormButtonsTest.php
index d7e25d7..4366543 100644
--- a/core/modules/node/lib/Drupal/node/Tests/NodeFormButtonsTest.php
+++ b/core/modules/node/lib/Drupal/node/Tests/NodeFormButtonsTest.php
@@ -109,7 +109,7 @@ function testNodeFormButtons() {
// the initial order of buttons and/or status of the node when creating
// a node.
variable_set('node_options_article', array('promote'));
- \Drupal::config('node.type.article')->set('settings.node.options.status', 0)->save();
+ \\Drupal::config('node.type.article')->set('settings.node.options.status', 0)->save();
// Verify the buttons on a node add form for an administrator.
$this->drupalLogin($this->admin_user);
diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeQueryAlterTest.php b/core/modules/node/lib/Drupal/node/Tests/NodeQueryAlterTest.php
index 4d62136..01c6390 100644
--- a/core/modules/node/lib/Drupal/node/Tests/NodeQueryAlterTest.php
+++ b/core/modules/node/lib/Drupal/node/Tests/NodeQueryAlterTest.php
@@ -169,7 +169,7 @@ function testNodeQueryAlterOverride() {
// $account instead of the global $user, we will log in as
// noAccessUser2.
$this->drupalLogin($this->noAccessUser2);
- \Drupal::state()->set('node_access_test.no_access_uid', $this->noAccessUser->id());
+ \\Drupal::state()->set('node_access_test.no_access_uid', $this->noAccessUser->id());
drupal_static_reset('node_access_view_all_nodes');
try {
$query = db_select('node', 'mytab')
@@ -184,6 +184,6 @@ function testNodeQueryAlterOverride() {
catch (\Exception $e) {
$this->fail(t('Altered query is malformed'));
}
- \Drupal::state()->delete('node_access_test.no_access_uid');
+ \\Drupal::state()->delete('node_access_test.no_access_uid');
}
}
diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeTokenReplaceTest.php b/core/modules/node/lib/Drupal/node/Tests/NodeTokenReplaceTest.php
index 12a6bbf..255bc8f 100644
--- a/core/modules/node/lib/Drupal/node/Tests/NodeTokenReplaceTest.php
+++ b/core/modules/node/lib/Drupal/node/Tests/NodeTokenReplaceTest.php
@@ -25,7 +25,7 @@ public static function getInfo() {
* Creates a node, then tests the tokens generated from it.
*/
function testNodeTokenReplacement() {
- $token_service = \Drupal::token();
+ $token_service = \\Drupal::token();
$language_interface = language(Language::TYPE_INTERFACE);
$url_options = array(
'absolute' => TRUE,
diff --git a/core/modules/node/node.install b/core/modules/node/node.install
index 02cc7a0..7fb28bf 100644
--- a/core/modules/node/node.install
+++ b/core/modules/node/node.install
@@ -418,8 +418,8 @@ function node_uninstall() {
// Delete node type variables.
$types = config_get_storage_names_with_prefix('node.type.');
foreach ($types as $config_name) {
- $type = Drupal::config($config_name)->get('type');
- Drupal::config('language.settings')->clear('node. ' . $type . '.language.default_configuration')->save();
+ $type = \Drupal::config($config_name)->get('type');
+ \Drupal::config('language.settings')->clear('node. ' . $type . '.language.default_configuration')->save();
}
// Delete node search ranking variables.
@@ -429,11 +429,11 @@ 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_recent_block_count');
// Delete any stored state.
- Drupal::state()->delete('node.cron_last');
+ \Drupal::state()->delete('node.cron_last');
}
/**
@@ -639,7 +639,7 @@ function node_update_8007() {
$language_show = update_variable_get('node_type_language_show_' . $type, NULL);
if (isset($language_default) || isset($language_show)) {
$values = array('langcode' => $language_default, 'language_show' => $language_show);
- Drupal::config('language.settings')->set('node.' . $type . '.language.default_configuration', $values)->save();
+ \Drupal::config('language.settings')->set('node.' . $type . '.language.default_configuration', $values)->save();
}
}
}
@@ -1075,7 +1075,7 @@ function node_update_8020() {
$result = db_query('SELECT * FROM {node_type}')
->fetchAllAssoc('type', PDO::FETCH_ASSOC);
foreach ($result as $id => $node_type) {
- $config = Drupal::config('node.type.' . $id);
+ $config = \Drupal::config('node.type.' . $id);
// Node type.
$config->setData($node_type);
$config->set('uuid', $uuid->generate());
@@ -1110,7 +1110,7 @@ function node_update_8020() {
$locked[$id] = $node_type['base'];
}
}
- Drupal::state()->set('node.type.locked', $locked);
+ \Drupal::state()->set('node.type.locked', $locked);
}
/**
diff --git a/core/modules/node/node.module b/core/modules/node/node.module
index 80b2fed..aba2cfc 100644
--- a/core/modules/node/node.module
+++ b/core/modules/node/node.module
@@ -220,7 +220,7 @@ function node_uri(EntityInterface $node) {
* Implements hook_admin_paths().
*/
function node_admin_paths() {
- if (Drupal::config('node.settings')->get('use_admin_theme')) {
+ if (\Drupal::config('node.settings')->get('use_admin_theme')) {
$paths = array(
'node/*/edit' => TRUE,
'node/*/delete' => TRUE,
@@ -326,7 +326,7 @@ function node_type_get_names() {
$config_names = config_get_storage_names_with_prefix('node.type.');
$names = array();
foreach ($config_names as $config_name) {
- $config = Drupal::config($config_name);
+ $config = \Drupal::config($config_name);
$names[$config->get('type')] = $config->get('name');
}
cache()->set($cid, $names, CacheBackendInterface::CACHE_PERMANENT, array(
@@ -586,7 +586,7 @@ function node_show(EntityInterface $node, $message = FALSE) {
// Update the history table, stating that this user viewed this node.
global $user;
- if (Drupal::moduleHandler()->moduleExists('history') && $user->isAuthenticated()) {
+ if (\Drupal::moduleHandler()->moduleExists('history') && $user->isAuthenticated()) {
$page['#attached'] = array(
'js' => array(
// When the window's "load" event is triggered, mark the node as read.
@@ -684,7 +684,7 @@ function template_preprocess_node(&$variables) {
// Display post information only on certain node types.
// Avoid loading the entire node type config entity here.
- $submitted = Drupal::config('node.type.' . $node->bundle())->get('settings.node.submitted') ?: TRUE;
+ $submitted = \Drupal::config('node.type.' . $node->bundle())->get('settings.node.submitted') ?: TRUE;
if ($submitted) {
$variables['display_submitted'] = TRUE;
$variables['submitted'] = t('Submitted by !username on !datetime', array('!username' => $variables['name'], '!datetime' => $variables['date']));
@@ -808,7 +808,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
@@ -931,7 +931,7 @@ function theme_node_search_admin($variables) {
* @see node_menu()
*/
function _node_revision_access(EntityInterface $node, $op = 'view', $account = NULL, $langcode = NULL) {
- return Drupal::service('access_check.node.revision')->checkAccess($node, $op, $account, $langcode);
+ return \Drupal::service('access_check.node.revision')->checkAccess($node, $op, $account, $langcode);
}
/**
@@ -1308,7 +1308,7 @@ function node_modules_uninstalled($modules) {
// Remove module-specific settings from all node types.
$config_names = config_get_storage_names_with_prefix('node.type.');
foreach ($config_names as $config_name) {
- $config = Drupal::config($config_name);
+ $config = \Drupal::config($config_name);
$changed = FALSE;
foreach ($modules as $module) {
if ($config->get('settings.' . $module)) {
@@ -1391,7 +1391,7 @@ function node_block_access($block) {
function node_feed($nids = FALSE, $channel = array()) {
global $base_url;
$language_content = language(Language::TYPE_CONTENT);
- $rss_config = Drupal::config('system.rss');
+ $rss_config = \Drupal::config('system.rss');
if ($nids === FALSE) {
$nids = db_select('node_field_data', 'n')
@@ -1443,7 +1443,7 @@ function node_feed($nids = FALSE, $channel = array()) {
$channel_defaults = array(
'version' => '2.0',
- 'title' => Drupal::config('system.site')->get('name'),
+ 'title' => \Drupal::config('system.site')->get('name'),
'link' => $base_url,
'description' => $rss_config->get('channel.description'),
'language' => $language_content->id
@@ -1540,9 +1540,9 @@ function node_form_system_site_information_settings_form_alter(&$form, &$form_st
$form['front_page']['default_nodes_main'] = array(
'#type' => 'select',
'#title' => t('Number of posts on front page'),
- '#default_value' => Drupal::config('node.settings')->get('items_per_page'),
+ '#default_value' => \Drupal::config('node.settings')->get('items_per_page'),
'#options' => drupal_map_assoc(array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 20, 25, 30)),
- '#access' => (Drupal::config('system.site')->get('page.front') == 'node'),
+ '#access' => (\Drupal::config('system.site')->get('page.front') == 'node'),
'#description' => t('The maximum number of posts displayed on overview pages such as the front page.'),
);
$form['#submit'][] = 'node_form_system_site_information_settings_form_submit';
@@ -1554,7 +1554,7 @@ function node_form_system_site_information_settings_form_alter(&$form, &$form_st
* @see node_form_system_site_information_settings_form_alter()
*/
function node_form_system_site_information_settings_form_submit($form, &$form_state) {
- Drupal::config('node.settings')
+ \Drupal::config('node.settings')
->set('items_per_page', $form_state['values']['default_nodes_main'])
->save();
}
@@ -1570,7 +1570,7 @@ function node_form_system_themes_admin_form_alter(&$form, &$form_state, $form_id
$form['admin_theme']['use_admin_theme'] = array(
'#type' => 'checkbox',
'#title' => t('Use the administration theme when editing or creating content'),
- '#default_value' => Drupal::config('node.settings')->get('use_admin_theme'),
+ '#default_value' => \Drupal::config('node.settings')->get('use_admin_theme'),
);
$form['#submit'][] = 'node_form_system_themes_admin_form_submit';
}
@@ -1581,7 +1581,7 @@ function node_form_system_themes_admin_form_alter(&$form, &$form_state, $form_id
* @see node_form_system_themes_admin_form_alter()
*/
function node_form_system_themes_admin_form_submit($form, &$form_state) {
- Drupal::config('node.settings')
+ \Drupal::config('node.settings')
->set('use_admin_theme', $form_state['values']['use_admin_theme'])
->save();
}
@@ -1656,7 +1656,7 @@ function node_form_system_themes_admin_form_submit($form, &$form_state) {
* @see node_menu()
*/
function node_access($op, $node, $account = NULL, $langcode = NULL) {
- $access_controller = Drupal::entityManager()->getAccessController('node');
+ $access_controller = \Drupal::entityManager()->getAccessController('node');
if ($op == 'create') {
if (!$node instanceof EntityInterface) {
@@ -1801,7 +1801,7 @@ function node_access_grants($op, $account = NULL) {
}
// Fetch node access grants from other modules.
- $grants = Drupal::moduleHandler()->invokeAll('node_grants', array($account, $op));
+ $grants = \Drupal::moduleHandler()->invokeAll('node_grants', array($account, $op));
// Allow modules to alter the assigned grants.
drupal_alter('node_grants', $grants, $account, $op);
@@ -1843,11 +1843,11 @@ function node_access_view_all_nodes($account = NULL) {
}
// If no modules implement the node access system, access is always TRUE.
- if (!Drupal::moduleHandler()->getImplementations('node_grants')) {
+ if (!\Drupal::moduleHandler()->getImplementations('node_grants')) {
$access[$account->id()] = TRUE;
}
else {
- $access[$account->id()] = Drupal::entityManager()->getAccessController('node')->checkAllGrants($account);
+ $access[$account->id()] = \Drupal::entityManager()->getAccessController('node')->checkAllGrants($account);
}
return $access[$account->id()];
@@ -1887,7 +1887,7 @@ function node_query_node_access_alter(AlterableInterface $query) {
if (user_access('bypass node access', $account)) {
return;
}
- if (!count(Drupal::moduleHandler()->getImplementations('node_grants'))) {
+ if (!count(\Drupal::moduleHandler()->getImplementations('node_grants'))) {
return;
}
if ($op == 'view' && node_access_view_all_nodes($account)) {
@@ -1915,7 +1915,7 @@ function node_query_node_access_alter(AlterableInterface $query) {
}
// Update the query for the given storage method.
- Drupal::service('node.grant_storage')->alterQuery($query, $tables, $op, $account, $base_table);
+ \Drupal::service('node.grant_storage')->alterQuery($query, $tables, $op, $account, $base_table);
}
/**
@@ -1940,13 +1940,13 @@ function node_query_node_access_alter(AlterableInterface $query) {
*/
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');
}
}
@@ -1973,10 +1973,10 @@ function node_access_needs_rebuild($rebuild = NULL) {
* @see node_access_needs_rebuild()
*/
function node_access_rebuild($batch_mode = FALSE) {
- $access_controller = Drupal::entityManager()->getAccessController('node');
+ $access_controller = \Drupal::entityManager()->getAccessController('node');
$access_controller->deleteGrants();
// Only recalculate if the site is using a node_access module.
- if (count(Drupal::moduleHandler()->getImplementations('node_grants'))) {
+ if (count(\Drupal::moduleHandler()->getImplementations('node_grants'))) {
if ($batch_mode) {
$batch = array(
'title' => t('Rebuilding content access permissions'),
@@ -1992,7 +1992,7 @@ function node_access_rebuild($batch_mode = FALSE) {
drupal_set_time_limit(240);
// Rebuild newest nodes first so that recent content becomes available quickly.
- $entity_query = Drupal::entityQuery('node');
+ $entity_query = \Drupal::entityQuery('node');
$entity_query->sort('nid', 'DESC');
$nids = $entity_query->execute();
foreach ($nids as $nid) {
@@ -2032,12 +2032,12 @@ function _node_access_rebuild_batch_operation(&$context) {
// Initiate multistep processing.
$context['sandbox']['progress'] = 0;
$context['sandbox']['current_node'] = 0;
- $context['sandbox']['max'] = Drupal::entityQuery('node')->count()->execute();
+ $context['sandbox']['max'] = \Drupal::entityQuery('node')->count()->execute();
}
// Process the next 20 nodes.
$limit = 20;
- $nids = Drupal::entityQuery('node')
+ $nids = \Drupal::entityQuery('node')
->condition('nid', $context['sandbox']['current_node'], '>')
->sort('nid', 'DESC')
->range(0, $limit)
@@ -2047,7 +2047,7 @@ function _node_access_rebuild_batch_operation(&$context) {
// To preserve database integrity, only write grants if the node
// loads successfully.
if (!empty($node)) {
- Drupal::entityManager()->getAccessController('node')->writeGrants($node);
+ \Drupal::entityManager()->getAccessController('node')->writeGrants($node);
}
$context['sandbox']['progress']++;
$context['sandbox']['current_node'] = $nid;
@@ -2093,8 +2093,8 @@ function node_requirements($phase) {
// Only show rebuild button if there are either 0, or 2 or more, rows
// in the {node_access} table, or if there are modules that
// implement hook_node_grants().
- $grant_count = Drupal::entityManager()->getAccessController('node')->countGrants();
- if ($grant_count != 1 || count(Drupal::moduleHandler()->getImplementations('node_grants')) > 0) {
+ $grant_count = \Drupal::entityManager()->getAccessController('node')->countGrants();
+ if ($grant_count != 1 || count(\Drupal::moduleHandler()->getImplementations('node_grants')) > 0) {
$value = format_plural($grant_count, 'One permission in use', '@count permissions in use', array('@count' => $grant_count));
}
else {
@@ -2117,7 +2117,7 @@ function node_requirements($phase) {
function node_modules_enabled($modules) {
// Check if any of the newly enabled modules require the node_access table to
// be rebuilt.
- if (!node_access_needs_rebuild() && array_intersect($modules, Drupal::moduleHandler()->getImplementations('node_grants'))) {
+ if (!node_access_needs_rebuild() && array_intersect($modules, \Drupal::moduleHandler()->getImplementations('node_grants'))) {
node_access_needs_rebuild(TRUE);
}
}
@@ -2134,14 +2134,14 @@ function node_modules_disabled($modules) {
// check whether a hook implementation function exists and do not invoke it.
// Node access also needs to be rebuilt if language module is disabled to
// remove any language-specific grants.
- if (!node_access_needs_rebuild() && (Drupal::moduleHandler()->implementsHook($module, 'node_grants') || $module == 'language')) {
+ if (!node_access_needs_rebuild() && (\Drupal::moduleHandler()->implementsHook($module, 'node_grants') || $module == 'language')) {
node_access_needs_rebuild(TRUE);
}
}
// If there remains no more node_access module, rebuilding will be
// straightforward, we can do it right now.
- if (node_access_needs_rebuild() && count(Drupal::moduleHandler()->getImplementations('node_grants')) == 0) {
+ if (node_access_needs_rebuild() && count(\Drupal::moduleHandler()->getImplementations('node_grants')) == 0) {
node_access_rebuild();
}
}
@@ -2172,7 +2172,7 @@ function node_language_delete($language) {
function node_library_info() {
$libraries['drupal.node'] = array(
'title' => 'Node',
- 'version' => Drupal::VERSION,
+ 'version' => \Drupal::VERSION,
'js' => array(
drupal_get_path('module', 'node') . '/node.js' => array(),
),
@@ -2185,7 +2185,7 @@ function node_library_info() {
);
$libraries['drupal.node.preview'] = array(
'title' => 'Node preview',
- 'version' => Drupal::VERSION,
+ 'version' => \Drupal::VERSION,
'js' => array(
drupal_get_path('module', 'node') . '/node.preview.js' => array(),
),
@@ -2196,7 +2196,7 @@ function node_library_info() {
);
$libraries['drupal.content_types'] = array(
'title' => 'Content types',
- 'version' => Drupal::VERSION,
+ 'version' => \Drupal::VERSION,
'js' => array(
drupal_get_path('module', 'node') . '/content_types.js' => array(),
),
@@ -2222,7 +2222,7 @@ function node_library_info() {
*/
function node_system_info_alter(&$info, $file, $type) {
if ($type == 'module' && $file->name == 'translation') {
- $info['hidden'] = !module_exists('translation') && Drupal::config('system.module.disabled')->get('translation') === NULL;
+ $info['hidden'] = !module_exists('translation') && \Drupal::config('system.module.disabled')->get('translation') === NULL;
}
}
@@ -2233,7 +2233,7 @@ function node_system_info_alter(&$info, $file, $type) {
* The node ID.
*/
function node_reindex_node_search($nid) {
- if (Drupal::moduleHandler()->moduleExists('search')) {
+ if (\Drupal::moduleHandler()->moduleExists('search')) {
// Reindex node context indexed by the node module search plugin.
search_mark_for_reindex('node_search', $nid);
}
diff --git a/core/modules/node/node.pages.inc b/core/modules/node/node.pages.inc
index d80898e..1b6a1e5 100644
--- a/core/modules/node/node.pages.inc
+++ b/core/modules/node/node.pages.inc
@@ -93,7 +93,7 @@ function node_add($node_type) {
'langcode' => $langcode ? $langcode : language_default()->id,
));
drupal_set_title(t('Create @name', array('@name' => $node_type->name)), PASS_THROUGH);
- return Drupal::entityManager()->getForm($node);
+ return \Drupal::entityManager()->getForm($node);
}
/**
diff --git a/core/modules/node/node.tokens.inc b/core/modules/node/node.tokens.inc
index 397211f..89f265f 100644
--- a/core/modules/node/node.tokens.inc
+++ b/core/modules/node/node.tokens.inc
@@ -90,7 +90,7 @@ function node_token_info() {
* Implements hook_tokens().
*/
function node_tokens($type, $tokens, array $data = array(), array $options = array()) {
- $token_service = Drupal::token();
+ $token_service = \Drupal::token();
$url_options = array('absolute' => TRUE);
if (isset($options['langcode'])) {
@@ -160,7 +160,7 @@ function node_tokens($type, $tokens, array $data = array(), array $options = arr
$length = $display_options['settings']['trim_length'];
}
else {
- $settings = \Drupal::service('plugin.manager.field.formatter')->getDefaultSettings('text_summary_or_trimmed');
+ $settings = \\Drupal::service('plugin.manager.field.formatter')->getDefaultSettings('text_summary_or_trimmed');
$length = $settings['trim_length'];
}
diff --git a/core/modules/node/node.views.inc b/core/modules/node/node.views.inc
index edd8ec4..a3ad643 100644
--- a/core/modules/node/node.views.inc
+++ b/core/modules/node/node.views.inc
@@ -217,7 +217,7 @@ function node_views_data() {
);
}
- if (Drupal::moduleHandler()->moduleExists('content_translation')) {
+ if (\Drupal::moduleHandler()->moduleExists('content_translation')) {
$data['node']['translation_link'] = array(
'title' => t('Translation link'),
'help' => t('Provide a link to the translations overview for nodes.'),
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 abc18c6..793c595 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
@@ -23,7 +23,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->id() == $no_access_uid) {
$grants['node_access_all'] = array(0);
}
@@ -36,7 +36,7 @@ function node_access_test_node_grants($account, $op) {
function node_access_test_node_access_records(NodeInterface $node) {
$grants = array();
// For NodeAccessBaseTableTestCase, only set records for private nodes.
- if (!Drupal::state()->get('node_access_test.private') || $node->private->value) {
+ if (!\Drupal::state()->get('node_access_test.private') || $node->private->value) {
$grants[] = array(
'realm' => 'node_access_test',
'gid' => 8888,
@@ -97,7 +97,7 @@ function node_access_test_entity_field_info($entity_type) {
*/
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',
@@ -154,7 +154,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 835f82c..450f703 100644
--- a/core/modules/node/tests/modules/node_test/node_test.module
+++ b/core/modules/node/tests/modules/node_test/node_test.module
@@ -161,7 +161,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;
}
@@ -186,7 +186,7 @@ function node_test_node_insert(EntityInterface $node) {
* Implements hook_entity_info_alter().
*/
function node_test_entity_info_alter(&$entity_info) {
- if (Drupal::state()->get('node_test.storage_controller')) {
+ if (\Drupal::state()->get('node_test.storage_controller')) {
$entity_info['node']['class'] = 'Drupal\node_test\NodeTest';
}
}
diff --git a/core/modules/number/lib/Drupal/number/Plugin/field/field_type/NumberItemBase.php b/core/modules/number/lib/Drupal/number/Plugin/field/field_type/NumberItemBase.php
index 1d83bb7..b189bd8 100644
--- a/core/modules/number/lib/Drupal/number/Plugin/field/field_type/NumberItemBase.php
+++ b/core/modules/number/lib/Drupal/number/Plugin/field/field_type/NumberItemBase.php
@@ -74,7 +74,7 @@ public function isEmpty() {
* {@inheritdoc}
*/
public function getConstraints() {
- $constraint_manager = \Drupal::typedData()->getValidationConstraintManager();
+ $constraint_manager = \\Drupal::typedData()->getValidationConstraintManager();
$constraints = parent::getConstraints();
$settings = $this->getFieldSettings();
diff --git a/core/modules/options/lib/Drupal/options/Plugin/field/widget/OptionsWidgetBase.php b/core/modules/options/lib/Drupal/options/Plugin/field/widget/OptionsWidgetBase.php
index 5081195..a3e5c28 100644
--- a/core/modules/options/lib/Drupal/options/Plugin/field/widget/OptionsWidgetBase.php
+++ b/core/modules/options/lib/Drupal/options/Plugin/field/widget/OptionsWidgetBase.php
@@ -123,7 +123,7 @@ public static function validateElement(array $element, array &$form_state) {
protected function getOptions(FieldItemInterface $item) {
if (!isset($this->options)) {
// Limit the settable options for the current user account.
- $options = $item->getSettableOptions(\Drupal::currentUser());
+ $options = $item->getSettableOptions(\\Drupal::currentUser());
// Add an empty option if the widget needs one.
if ($empty_option = $this->getEmptyOption()) {
@@ -140,7 +140,7 @@ protected function getOptions(FieldItemInterface $item) {
$options = array('_none' => $label) + $options;
}
- $module_handler = \Drupal::moduleHandler();
+ $module_handler = \\Drupal::moduleHandler();
$context = array(
'fieldDefinition' => $this->fieldDefinition,
'entity' => $item->getEntity(),
diff --git a/core/modules/options/lib/Drupal/options/Tests/OptionsFieldTest.php b/core/modules/options/lib/Drupal/options/Tests/OptionsFieldTest.php
index c00cc63..964d648 100644
--- a/core/modules/options/lib/Drupal/options/Tests/OptionsFieldTest.php
+++ b/core/modules/options/lib/Drupal/options/Tests/OptionsFieldTest.php
@@ -35,7 +35,7 @@ public static function getInfo() {
function testUpdateAllowedValues() {
// All three options appear.
$entity = entity_create('entity_test', array());
- $form = \Drupal::entityManager()->getForm($entity);
+ $form = \\Drupal::entityManager()->getForm($entity);
$this->assertTrue(!empty($form[$this->fieldName]['widget'][1]), 'Option 1 exists');
$this->assertTrue(!empty($form[$this->fieldName]['widget'][2]), 'Option 2 exists');
$this->assertTrue(!empty($form[$this->fieldName]['widget'][3]), 'Option 3 exists');
@@ -61,7 +61,7 @@ function testUpdateAllowedValues() {
$this->field->settings['allowed_values'] = array(2 => 'Two');
$this->field->save();
$entity = entity_create('entity_test', array());
- $form = \Drupal::entityManager()->getForm($entity);
+ $form = \\Drupal::entityManager()->getForm($entity);
$this->assertTrue(empty($form[$this->fieldName]['widget'][1]), 'Option 1 does not exist');
$this->assertTrue(!empty($form[$this->fieldName]['widget'][2]), 'Option 2 exists');
$this->assertTrue(empty($form[$this->fieldName]['widget'][3]), 'Option 3 does not exist');
@@ -72,7 +72,7 @@ function testUpdateAllowedValues() {
// The entity holds an outdated field object with the old allowed values
// setting, so we need to reintialize the entity object.
$entity = entity_create('entity_test', array());
- $form = \Drupal::entityManager()->getForm($entity);
+ $form = \\Drupal::entityManager()->getForm($entity);
$this->assertTrue(empty($form[$this->fieldName]['widget'][1]), 'Option 1 does not exist');
$this->assertTrue(empty($form[$this->fieldName]['widget'][2]), 'Option 2 does not exist');
$this->assertTrue(empty($form[$this->fieldName]['widget'][3]), 'Option 3 does not exist');
@@ -93,7 +93,7 @@ function testUpdateAllowedValues() {
))
->save();
$entity = entity_create('entity_test', array());
- $form = \Drupal::entityManager()->getForm($entity);
+ $form = \\Drupal::entityManager()->getForm($entity);
$this->assertTrue(!empty($form[$this->fieldName]['widget'][1]), 'Option 1 exists');
$this->assertTrue(!empty($form[$this->fieldName]['widget'][2]), 'Option 2 exists');
$this->assertTrue(!empty($form[$this->fieldName]['widget'][3]), 'Option 3 exists');
diff --git a/core/modules/options/options.module b/core/modules/options/options.module
index 6dedc11..3c649c5 100644
--- a/core/modules/options/options.module
+++ b/core/modules/options/options.module
@@ -383,7 +383,7 @@ function options_field_update_forbid($field, $prior_field) {
function _options_values_in_use($field, $values) {
if ($values) {
$field = field_info_field_by_id($field['uuid']);
- $factory = Drupal::service('entity.query');
+ $factory = \Drupal::service('entity.query');
$result = $factory->get($field->entity_type)
->condition($field['field_name'] . '.value', $values)
->count()
diff --git a/core/modules/overlay/lib/Drupal/overlay/Tests/OverlaySettingTest.php b/core/modules/overlay/lib/Drupal/overlay/Tests/OverlaySettingTest.php
index 7ae4b1f..ecf6282 100644
--- a/core/modules/overlay/lib/Drupal/overlay/Tests/OverlaySettingTest.php
+++ b/core/modules/overlay/lib/Drupal/overlay/Tests/OverlaySettingTest.php
@@ -40,7 +40,7 @@ function testNodeCreation() {
$this->assertFieldChecked('edit-overlay');
$this->drupalPostForm(NULL, array('overlay' => FALSE), t('Save'));
$this->assertNoFieldChecked('edit-overlay');
- $this->assertFalse(\Drupal::service('user.data')->get('overlay', $user->id(), 'enabled'), 'Overlay disabled');
+ $this->assertFalse(\\Drupal::service('user.data')->get('overlay', $user->id(), 'enabled'), 'Overlay disabled');
}
}
diff --git a/core/modules/overlay/overlay.module b/core/modules/overlay/overlay.module
index 3788535..b6194a8 100644
--- a/core/modules/overlay/overlay.module
+++ b/core/modules/overlay/overlay.module
@@ -84,7 +84,7 @@ function overlay_field_extra_fields() {
function overlay_form_user_form_alter(&$form, &$form_state) {
$account = $form_state['controller']->getEntity();
if ($account->hasPermission('access overlay')) {
- $account_data = Drupal::service('user.data')->get('overlay', $account->id(), 'enabled');
+ $account_data = \Drupal::service('user.data')->get('overlay', $account->id(), 'enabled');
$form['overlay_control'] = array(
'#type' => 'details',
'#title' => t('Administrative overlay'),
@@ -106,7 +106,7 @@ function overlay_form_user_form_alter(&$form, &$form_state) {
function overlay_user_profile_form_submit($form, &$form_state) {
$account = $form_state['controller']->getEntity();
if ($account->id() && isset($form_state['values']['overlay'])) {
- Drupal::service('user.data')->set('overlay', $account->id(), 'enabled', (int) $form_state['values']['overlay']);
+ \Drupal::service('user.data')->set('overlay', $account->id(), 'enabled', (int) $form_state['values']['overlay']);
}
}
@@ -223,7 +223,7 @@ function overlay_disable_message() {
return $build;
}
- $user_data = Drupal::service('user.data')->get('overlay', $user->id());
+ $user_data = \Drupal::service('user.data')->get('overlay', $user->id());
if (empty($user_data['message_dismissed']) && (!isset($user_data['enabled']) || $user_data['enabled'])) {
$build = array(
'#theme' => 'overlay_disable_message',
@@ -474,14 +474,14 @@ function overlay_set_mode($mode = NULL) {
drupal_add_library('overlay', 'drupal.overlay.parent');
// Allow modules to act upon overlay events.
- Drupal::moduleHandler()->invokeAll('overlay_parent_initialize');
+ \Drupal::moduleHandler()->invokeAll('overlay_parent_initialize');
break;
case 'child':
drupal_add_library('overlay', 'drupal.overlay.child');
// Allow modules to act upon overlay events.
- Drupal::moduleHandler()->invokeAll('overlay_child_initialize');
+ \Drupal::moduleHandler()->invokeAll('overlay_child_initialize');
break;
}
return $overlay_mode;
@@ -494,13 +494,13 @@ function overlay_overlay_parent_initialize() {
// Let the client side know which paths are administrative.
$paths = path_get_admin_paths();
foreach ($paths as &$type) {
- $type = str_replace('', Drupal::config('system.site')->get('page.front'), $type);
+ $type = str_replace('', \Drupal::config('system.site')->get('page.front'), $type);
}
drupal_add_js(array('overlay' => array('paths' => $paths)), 'setting');
$path_prefixes = array();
if (module_exists('language')) {
language_negotiation_include();
- if (Drupal::config('language.negotiation')->get('url.source') == LANGUAGE_NEGOTIATION_URL_PREFIX) {
+ if (\Drupal::config('language.negotiation')->get('url.source') == LANGUAGE_NEGOTIATION_URL_PREFIX) {
// Skip the empty string indicating the default language. We always accept
// paths without a prefix.
$path_prefixes = language_negotiation_url_prefixes();
@@ -527,8 +527,8 @@ function overlay_overlay_child_initialize() {
// at the end of the page request. This allows us to check if anything
// actually did change, and, if so, trigger an immediate Ajax refresh
// of the parent window.
- $token = Drupal::request()->query->get('token');
- $post = Drupal::request()->request->count();
+ $token = \Drupal::request()->query->get('token');
+ $post = \Drupal::request()->request->count();
if (!empty($post) || isset($token)) {
foreach (overlay_supplemental_regions() as $region) {
overlay_store_rendered_content($region, overlay_render_region($region));
diff --git a/core/modules/path/path.admin.inc b/core/modules/path/path.admin.inc
index b03f8d6..200dbed 100644
--- a/core/modules/path/path.admin.inc
+++ b/core/modules/path/path.admin.inc
@@ -77,7 +77,7 @@ function path_admin_overview($keys = NULL) {
// If the system path maps to a different URL alias, highlight this table
// row to let the user know of old aliases.
- if ($data->alias != Drupal::service('path.alias_manager')->getPathAlias($data->source, $data->langcode)) {
+ if ($data->alias != \Drupal::service('path.alias_manager')->getPathAlias($data->source, $data->langcode)) {
$row['class'] = array('warning');
}
@@ -204,7 +204,7 @@ function path_admin_form($form, &$form_state, $path = array('source' => '', 'ali
*/
function path_admin_form_delete_submit($form, &$form_state) {
$destination = array();
- $query = Drupal::request()->query;
+ $query = \Drupal::request()->query;
if ($query->has('destination')) {
$destination = drupal_get_destination();
$query->remove('destination');
@@ -220,7 +220,7 @@ function path_admin_form_delete_submit($form, &$form_state) {
*/
function path_admin_form_validate($form, &$form_state) {
$source = &$form_state['values']['source'];
- $source = Drupal::service('path.alias_manager')->getSystemPath($source);
+ $source = \Drupal::service('path.alias_manager')->getSystemPath($source);
$alias = $form_state['values']['alias'];
$pid = isset($form_state['values']['pid']) ? $form_state['values']['pid'] : 0;
// Language is only set if language.module is enabled, otherwise save for all
@@ -254,13 +254,13 @@ function path_admin_form_submit($form, &$form_state) {
$pid = isset($form_state['values']['pid']) ? $form_state['values']['pid'] : 0;
$source = &$form_state['values']['source'];
- $source = Drupal::service('path.alias_manager')->getSystemPath($source);
+ $source = \Drupal::service('path.alias_manager')->getSystemPath($source);
$alias = $form_state['values']['alias'];
// Language is only set if language.module is enabled, otherwise save for all
// languages.
$langcode = isset($form_state['values']['langcode']) ? $form_state['values']['langcode'] : Language::LANGCODE_NOT_SPECIFIED;
- Drupal::service('path.crud')->save($source, $alias, $langcode, $pid);
+ \Drupal::service('path.crud')->save($source, $alias, $langcode, $pid);
drupal_set_message(t('The alias has been saved.'));
$form_state['redirect'] = 'admin/config/search/path';
diff --git a/core/modules/path/path.module b/core/modules/path/path.module
index a6d7fbd..c65afd7 100644
--- a/core/modules/path/path.module
+++ b/core/modules/path/path.module
@@ -102,7 +102,7 @@ function path_form_node_form_alter(&$form, $form_state) {
if ($node->language()->id != Language::LANGCODE_NOT_SPECIFIED) {
$conditions['langcode'] = $node->language()->id;
}
- $path = Drupal::service('path.crud')->load($conditions);
+ $path = \Drupal::service('path.crud')->load($conditions);
if ($path === FALSE) {
$path = array();
}
@@ -114,7 +114,7 @@ function path_form_node_form_alter(&$form, $form_state) {
'langcode' => $node->language()->id,
);
- $account = Drupal::currentUser();
+ $account = \Drupal::currentUser();
$form['path'] = array(
'#type' => 'details',
'#title' => t('URL path settings'),
@@ -184,11 +184,11 @@ function path_form_element_validate($element, &$form_state, $complete_form) {
* Implements hook_form_FORM_ID_alter() for taxonomy_term_form().
*/
function path_form_taxonomy_term_form_alter(&$form, $form_state) {
- $account = Drupal::currentUser();
+ $account = \Drupal::currentUser();
// Make sure this does not show up on the delete confirmation form.
if (empty($form_state['confirm_delete'])) {
$term = $form_state['controller']->getEntity();
- $path = ($term->id() ? Drupal::service('path.crud')->load(array('source' => 'taxonomy/term/' . $term->id())) : array());
+ $path = ($term->id() ? \Drupal::service('path.crud')->load(array('source' => 'taxonomy/term/' . $term->id())) : array());
if ($path === FALSE) {
$path = array();
}
@@ -245,7 +245,7 @@ function path_entity_insert(EntityInterface $entity) {
// Ensure fields for programmatic executions.
$uri = $entity->uri();
$langcode = $entity->language()->id;
- Drupal::service('path.crud')->save($uri['path'], $entity->path->alias, $langcode);
+ \Drupal::service('path.crud')->save($uri['path'], $entity->path->alias, $langcode);
}
}
}
@@ -258,7 +258,7 @@ function path_entity_update(EntityInterface $entity) {
$entity->path->alias = trim($entity->path->alias);
// Delete old alias if user erased it.
if ($entity->path->pid && !$entity->path->alias) {
- Drupal::service('path.crud')->delete(array('pid' => $entity->path->pid));
+ \Drupal::service('path.crud')->delete(array('pid' => $entity->path->pid));
}
// Only save a non-empty alias.
if ($entity->path->alias) {
@@ -266,7 +266,7 @@ function path_entity_update(EntityInterface $entity) {
// Ensure fields for programmatic executions.
$uri = $entity->uri();
$langcode = $entity->language()->id;
- Drupal::service('path.crud')->save($uri['path'], $entity->path->alias, $langcode, $pid);
+ \Drupal::service('path.crud')->save($uri['path'], $entity->path->alias, $langcode, $pid);
}
}
}
@@ -278,7 +278,7 @@ function path_entity_predelete(EntityInterface $entity) {
if ($entity->getPropertyDefinition('path')) {
// Delete all aliases associated with this term.
$uri = $entity->uri();
- Drupal::service('path.crud')->delete(array('source' => $uri['path']));
+ \Drupal::service('path.crud')->delete(array('source' => $uri['path']));
}
}
@@ -288,7 +288,7 @@ function path_entity_predelete(EntityInterface $entity) {
function path_library_info() {
$libraries['drupal.path'] = array(
'title' => 'Path',
- 'version' => Drupal::VERSION,
+ 'version' => \Drupal::VERSION,
'js' => array(
drupal_get_path('module', 'path') . '/path.js' => array(),
),
diff --git a/core/modules/picture/picture.module b/core/modules/picture/picture.module
index d2474d1..bdf1987 100644
--- a/core/modules/picture/picture.module
+++ b/core/modules/picture/picture.module
@@ -87,7 +87,7 @@ function picture_library_info() {
$libraries['picturefill'] = array(
'title' => t('Picturefill'),
'website' => 'http://drupal.org/node/1775530',
- 'version' => Drupal::VERSION,
+ 'version' => \Drupal::VERSION,
'js' => array(
drupal_get_path('module', 'picture') . '/picturefill/picturefill.js' => array('type' => 'file', 'weight' => -10, 'group' => JS_DEFAULT),
),
diff --git a/core/modules/rdf/rdf.install b/core/modules/rdf/rdf.install
index 117c910..bc984f5 100644
--- a/core/modules/rdf/rdf.install
+++ b/core/modules/rdf/rdf.install
@@ -23,7 +23,7 @@ function rdf_update_8000() {
$bundle = $row['bundle'];
// Create a config object for the mapping.
- $config = Drupal::config("rdf.mapping.$entity_type.$bundle")
+ $config = \Drupal::config("rdf.mapping.$entity_type.$bundle")
->set('id', "$entity_type.$bundle")
->set('uuid', $uuid->generate())
->set('targetEntityType', $entity_type)
diff --git a/core/modules/rdf/rdf.module b/core/modules/rdf/rdf.module
index 428f16b..5c39989 100644
--- a/core/modules/rdf/rdf.module
+++ b/core/modules/rdf/rdf.module
@@ -109,8 +109,8 @@ function rdf_rdf_namespaces() {
function rdf_get_namespaces() {
$namespaces = array();
// In order to resolve duplicate namespaces by using the earliest defined
- // namespace, do not use \Drupal::moduleHandler()->invokeAll().
- foreach (Drupal::moduleHandler()->getImplementations('rdf_namespaces') as $module) {
+ // namespace, do not use \\Drupal::moduleHandler()->invokeAll().
+ foreach (\Drupal::moduleHandler()->getImplementations('rdf_namespaces') as $module) {
$function = $module . '_rdf_namespaces';
if (function_exists($function)) {
$namespaces = NestedArray::mergeDeep($function(), $namespaces);
diff --git a/core/modules/rest/lib/Drupal/rest/Tests/RESTTestBase.php b/core/modules/rest/lib/Drupal/rest/Tests/RESTTestBase.php
index db8feb2..93fac28 100644
--- a/core/modules/rest/lib/Drupal/rest/Tests/RESTTestBase.php
+++ b/core/modules/rest/lib/Drupal/rest/Tests/RESTTestBase.php
@@ -197,7 +197,7 @@ protected function entityValues($entity_type) {
*/
protected function enableService($resource_type, $method = 'GET', $format = NULL, $auth = array()) {
// Enable REST API for this entity type.
- $config = \Drupal::config('rest.settings');
+ $config = \\Drupal::config('rest.settings');
$settings = array();
if ($resource_type) {
if ($format) {
diff --git a/core/modules/rest/rest.module b/core/modules/rest/rest.module
index a37bfe7..086961a 100644
--- a/core/modules/rest/rest.module
+++ b/core/modules/rest/rest.module
@@ -10,8 +10,8 @@
*/
function rest_permission() {
$permissions = array();
- $manager = Drupal::service('plugin.manager.rest');
- $resources = Drupal::config('rest.settings')->get('resources');
+ $manager = \Drupal::service('plugin.manager.rest');
+ $resources = \Drupal::config('rest.settings')->get('resources');
if ($resources && $enabled = array_intersect_key($manager->getDefinitions(), $resources)) {
foreach ($enabled as $key => $resource) {
$plugin = $manager->getInstance(array('id' => $key));
diff --git a/core/modules/rest/tests/Drupal/rest/Tests/CollectRoutesTest.php b/core/modules/rest/tests/Drupal/rest/Tests/CollectRoutesTest.php
index 7f27170..788c3f9 100644
--- a/core/modules/rest/tests/Drupal/rest/Tests/CollectRoutesTest.php
+++ b/core/modules/rest/tests/Drupal/rest/Tests/CollectRoutesTest.php
@@ -82,7 +82,7 @@ protected function setUp() {
->getMock();
$container->set('plugin.manager.views.style', $style_manager);
- \Drupal::setContainer($container);
+ \\Drupal::setContainer($container);
$this->restExport = RestExport::create($container, array(), "test_routes", array());
$this->restExport->view = $view_executable;
diff --git a/core/modules/search/lib/Drupal/search/Plugin/views/argument/Search.php b/core/modules/search/lib/Drupal/search/Plugin/views/argument/Search.php
index 96810a6..7a2afdb 100644
--- a/core/modules/search/lib/Drupal/search/Plugin/views/argument/Search.php
+++ b/core/modules/search/lib/Drupal/search/Plugin/views/argument/Search.php
@@ -65,7 +65,7 @@ public function query($group_by = FALSE) {
'left_table' => $search_index,
'left_field' => 'word',
);
- $join = \Drupal::service()->get('plugin.manager.views.join')->createInstance('standard', $definition);
+ $join = \\Drupal::service()->get('plugin.manager.views.join')->createInstance('standard', $definition);
$search_total = $this->query->addRelationship('search_total', $join, $search_index);
$this->search_score = $this->query->addField('', "SUM($search_index.score * $search_total.count)", 'score', array('aggregate' => TRUE));
diff --git a/core/modules/search/lib/Drupal/search/Plugin/views/filter/Search.php b/core/modules/search/lib/Drupal/search/Plugin/views/filter/Search.php
index 89b21e4..67fd0c6 100644
--- a/core/modules/search/lib/Drupal/search/Plugin/views/filter/Search.php
+++ b/core/modules/search/lib/Drupal/search/Plugin/views/filter/Search.php
@@ -85,7 +85,7 @@ public function validateExposed(&$form, &$form_state) {
if (!empty($form_state['values'][$key])) {
$this->query_parse_search_expression($form_state['values'][$key]);
if (count($this->search_query->words()) == 0) {
- form_set_error($key, format_plural(\Drupal::config('search.settings')->get('index.minimum_word_size'), 'You must include at least one positive keyword with 1 character or more.', 'You must include at least one positive keyword with @count characters or more.'));
+ form_set_error($key, format_plural(\\Drupal::config('search.settings')->get('index.minimum_word_size'), 'You must include at least one positive keyword with 1 character or more.', 'You must include at least one positive keyword with @count characters or more.'));
}
}
}
@@ -145,7 +145,7 @@ public function query() {
'left_table' => $search_index,
'left_field' => 'word',
);
- $join = \Drupal::service()->get('plugin.manager.views.join')->createInstance('standard', $definition);
+ $join = \\Drupal::service()->get('plugin.manager.views.join')->createInstance('standard', $definition);
$search_total = $this->query->addRelationship('search_total', $join, $search_index);
diff --git a/core/modules/search/lib/Drupal/search/SearchQuery.php b/core/modules/search/lib/Drupal/search/SearchQuery.php
index b49c06a..e381d19 100644
--- a/core/modules/search/lib/Drupal/search/SearchQuery.php
+++ b/core/modules/search/lib/Drupal/search/SearchQuery.php
@@ -174,7 +174,7 @@ protected function parseSearchExpression() {
// Classify tokens.
$or = FALSE;
$warning = '';
- $limit_combinations = \Drupal::config('search.settings')->get('and_or_limit');
+ $limit_combinations = \\Drupal::config('search.settings')->get('and_or_limit');
// The first search expression does not count as AND.
$and_count = -1;
$or_count = 0;
@@ -297,7 +297,7 @@ protected function parseWord($word) {
$split = explode(' ', $word);
foreach ($split as $s) {
$num = is_numeric($s);
- if ($num || drupal_strlen($s) >= \Drupal::config('search.settings')->get('index.minimum_word_size')) {
+ if ($num || drupal_strlen($s) >= \\Drupal::config('search.settings')->get('index.minimum_word_size')) {
if (!isset($this->words[$s])) {
$this->words[$s] = $s;
$num_new_scores++;
@@ -323,11 +323,11 @@ public function executeFirstPass() {
$this->parseSearchExpression();
if (count($this->words) == 0) {
- form_set_error('keys', format_plural(\Drupal::config('search.settings')->get('index.minimum_word_size'), 'You must include at least one positive keyword with 1 character or more.', 'You must include at least one positive keyword with @count characters or more.'));
+ form_set_error('keys', format_plural(\\Drupal::config('search.settings')->get('index.minimum_word_size'), 'You must include at least one positive keyword with 1 character or more.', 'You must include at least one positive keyword with @count characters or more.'));
return FALSE;
}
if ($this->expressionsIgnored) {
- drupal_set_message(t('Your search used too many AND/OR expressions. Only the first @count terms were included in this search.', array('@count' => \Drupal::config('search.settings')->get('and_or_limit'))), 'warning');
+ drupal_set_message(t('Your search used too many AND/OR expressions. Only the first @count terms were included in this search.', array('@count' => \\Drupal::config('search.settings')->get('and_or_limit'))), 'warning');
}
$this->executedFirstPass = TRUE;
diff --git a/core/modules/search/lib/Drupal/search/Tests/SearchEmbedFormTest.php b/core/modules/search/lib/Drupal/search/Tests/SearchEmbedFormTest.php
index 3cb0971..a58ed99 100644
--- a/core/modules/search/lib/Drupal/search/Tests/SearchEmbedFormTest.php
+++ b/core/modules/search/lib/Drupal/search/Tests/SearchEmbedFormTest.php
@@ -50,7 +50,7 @@ function setUp() {
search_update_totals();
// Set up a dummy initial count of times the form has been submitted.
- $this->submit_count = \Drupal::config('search_embedded_form.settings')->get('submitted');
+ $this->submit_count = \\Drupal::config('search_embedded_form.settings')->get('submitted');
$this->refreshVariables();
}
@@ -63,7 +63,7 @@ function testEmbeddedForm() {
array('name' => 'John'),
t('Send away'));
$this->assertText(t('Test form was submitted'), 'Form message appears');
- $count = \Drupal::config('search_embedded_form.settings')->get('submitted');
+ $count = \\Drupal::config('search_embedded_form.settings')->get('submitted');
$this->assertEqual($this->submit_count + 1, $count, 'Form submission count is correct');
$this->submit_count = $count;
@@ -74,7 +74,7 @@ function testEmbeddedForm() {
array('name' => 'John'),
t('Send away'));
$this->assertText(t('Test form was submitted'), 'Form message appears');
- $count = \Drupal::config('search_embedded_form.settings')->get('submitted');
+ $count = \\Drupal::config('search_embedded_form.settings')->get('submitted');
$this->assertEqual($this->submit_count + 1, $count, 'Form submission count is correct');
$this->submit_count = $count;
@@ -84,7 +84,7 @@ function testEmbeddedForm() {
array('keys' => 'foo'),
t('Search'));
$this->assertNoText(t('Test form was submitted'), 'Form message does not appear');
- $count = \Drupal::config('search_embedded_form.settings')->get('submitted');
+ $count = \\Drupal::config('search_embedded_form.settings')->get('submitted');
$this->assertEqual($this->submit_count, $count, 'Form submission count is correct');
$this->submit_count = $count;
}
diff --git a/core/modules/search/lib/Drupal/search/Tests/SearchKeywordsConditionsTest.php b/core/modules/search/lib/Drupal/search/Tests/SearchKeywordsConditionsTest.php
index a17c1c6..932e981 100644
--- a/core/modules/search/lib/Drupal/search/Tests/SearchKeywordsConditionsTest.php
+++ b/core/modules/search/lib/Drupal/search/Tests/SearchKeywordsConditionsTest.php
@@ -35,7 +35,7 @@ function setUp() {
// Login with sufficient privileges.
$this->drupalLogin($this->searching_user);
// Test with all search modules enabled.
- \Drupal::config('search.settings')->set('active_plugins', array('node_search', 'user_search', 'search_extra_type_search'))->save();
+ \\Drupal::config('search.settings')->set('active_plugins', array('node_search', 'user_search', 'search_extra_type_search'))->save();
menu_router_rebuild();
}
diff --git a/core/modules/search/lib/Drupal/search/Tests/SearchMatchTest.php b/core/modules/search/lib/Drupal/search/Tests/SearchMatchTest.php
index 76958c6..e439833 100644
--- a/core/modules/search/lib/Drupal/search/Tests/SearchMatchTest.php
+++ b/core/modules/search/lib/Drupal/search/Tests/SearchMatchTest.php
@@ -36,7 +36,7 @@ function testMatching() {
* Set up a small index of items to test against.
*/
function _setup() {
- \Drupal::config('search.settings')->set('index.minimum_word_size', 3)->save();
+ \\Drupal::config('search.settings')->set('index.minimum_word_size', 3)->save();
for ($i = 1; $i <= 7; ++$i) {
search_index($i, SEARCH_TYPE, $this->getText($i), Language::LANGCODE_NOT_SPECIFIED);
diff --git a/core/modules/search/lib/Drupal/search/Tests/SearchMultilingualEntityTest.php b/core/modules/search/lib/Drupal/search/Tests/SearchMultilingualEntityTest.php
index 29fa943..6484b0b 100644
--- a/core/modules/search/lib/Drupal/search/Tests/SearchMultilingualEntityTest.php
+++ b/core/modules/search/lib/Drupal/search/Tests/SearchMultilingualEntityTest.php
@@ -93,7 +93,7 @@ function setUp() {
*/
function testIndexingThrottle() {
// Index only 4 items per cron run.
- \Drupal::config('search.settings')->set('index.cron_limit', 4)->save();
+ \\Drupal::config('search.settings')->set('index.cron_limit', 4)->save();
// Update the index. This does the initial processing.
$plugin = $this->container->get('plugin.manager.search')->createInstance('node_search');
$plugin->updateIndex();
diff --git a/core/modules/search/lib/Drupal/search/Tests/SearchPageOverrideTest.php b/core/modules/search/lib/Drupal/search/Tests/SearchPageOverrideTest.php
index b8ead26..992098b 100644
--- a/core/modules/search/lib/Drupal/search/Tests/SearchPageOverrideTest.php
+++ b/core/modules/search/lib/Drupal/search/Tests/SearchPageOverrideTest.php
@@ -37,7 +37,7 @@ function setUp() {
$this->drupalLogin($this->search_user);
// Enable the extra type module for searching.
- \Drupal::config('search.settings')->set('active_plugins', array('node_search', 'user_search', 'search_extra_type_search'))->save();
+ \\Drupal::config('search.settings')->set('active_plugins', array('node_search', 'user_search', 'search_extra_type_search'))->save();
menu_router_rebuild();
}
diff --git a/core/modules/search/lib/Drupal/search/Tests/SearchPageTextTest.php b/core/modules/search/lib/Drupal/search/Tests/SearchPageTextTest.php
index 817f109..9c37e5f 100644
--- a/core/modules/search/lib/Drupal/search/Tests/SearchPageTextTest.php
+++ b/core/modules/search/lib/Drupal/search/Tests/SearchPageTextTest.php
@@ -60,7 +60,7 @@ function testSearchText() {
// Test a search input exceeding the limit of AND/OR combinations to test
// the Denial-of-Service protection.
- $limit = \Drupal::config('search.settings')->get('and_or_limit');
+ $limit = \\Drupal::config('search.settings')->get('and_or_limit');
$keys = array();
for ($i = 0; $i < $limit + 1; $i++) {
$keys[] = $this->randomName(3);
diff --git a/core/modules/search/lib/Drupal/search/Tests/SearchRankingTest.php b/core/modules/search/lib/Drupal/search/Tests/SearchRankingTest.php
index 895672d..7f76829 100644
--- a/core/modules/search/lib/Drupal/search/Tests/SearchRankingTest.php
+++ b/core/modules/search/lib/Drupal/search/Tests/SearchRankingTest.php
@@ -90,11 +90,11 @@ public function testRankings() {
$this->drupalPostForm(NULL, $edit, t('Save'));
// Enable counting of statistics.
- \Drupal::config('statistics.settings')->set('count_content_views', 1)->save();
+ \\Drupal::config('statistics.settings')->set('count_content_views', 1)->save();
// Then View one of the nodes a bunch of times.
// Manually calling statistics.php, simulating ajax behavior.
- $client = \Drupal::httpClient();
+ $client = \\Drupal::httpClient();
$client->setConfig(array('curl.options' => array(CURLOPT_TIMEOUT => 10)));
$nid = $nodes['views'][1]->id();
global $base_url;
diff --git a/core/modules/search/lib/Drupal/search/Tests/SearchTokenizerTest.php b/core/modules/search/lib/Drupal/search/Tests/SearchTokenizerTest.php
index 361cebf..e6617d3 100644
--- a/core/modules/search/lib/Drupal/search/Tests/SearchTokenizerTest.php
+++ b/core/modules/search/lib/Drupal/search/Tests/SearchTokenizerTest.php
@@ -30,7 +30,7 @@ public static function getInfo() {
function testTokenizer() {
// Set the minimum word size to 1 (to split all CJK characters) and make
// sure CJK tokenizing is turned on.
- \Drupal::config('search.settings')
+ \\Drupal::config('search.settings')
->set('index.minimum_word_size', 1)
->set('index.overlap_cjk', TRUE)
->save();
@@ -118,7 +118,7 @@ function testTokenizer() {
function testNoTokenizer() {
// Set the minimum word size to 1 (to split all CJK characters) and make
// sure CJK tokenizing is turned on.
- \Drupal::config('search.settings')
+ \\Drupal::config('search.settings')
->set('minimum_word_size', 1)
->set('overlap_cjk', TRUE)
->save();
diff --git a/core/modules/search/lib/Drupal/search/Tests/SearchUpgradePathTest.php b/core/modules/search/lib/Drupal/search/Tests/SearchUpgradePathTest.php
index e5678bc..669359f 100644
--- a/core/modules/search/lib/Drupal/search/Tests/SearchUpgradePathTest.php
+++ b/core/modules/search/lib/Drupal/search/Tests/SearchUpgradePathTest.php
@@ -37,7 +37,7 @@ public function setUp() {
public function testSearchUpgrade() {
$this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.');
$this->assertFalse(db_table_exists('search_node_links'), 'search_node_links table was dropped.');
- $config = \Drupal::config('search.settings');
+ $config = \\Drupal::config('search.settings');
// The starting database has user module as the only active search.
$this->assertEqual($config->get('active_plugins'), array('user_search' => 'user_search'));
$exists = db_query('SELECT 1 FROM {variable} WHERE name = :name', array(':name' => 'search_active_modules'))->fetchField();
diff --git a/core/modules/search/search.install b/core/modules/search/search.install
index 824a624..70d12db 100644
--- a/core/modules/search/search.install
+++ b/core/modules/search/search.install
@@ -131,7 +131,7 @@ function search_schema() {
function search_update_8000() {
// Run this first so the config is sure to be empty.
_search_update_8000_modules_mapto_plugins(array('user' => 'user_search', 'node' => 'node_search'));
- $active_plugins = \Drupal::config('search.settings')->get('active_plugins');
+ $active_plugins = \\Drupal::config('search.settings')->get('active_plugins');
update_variables_to_config('search.settings', array(
'minimum_word_size' => 'index.minimum_word_size',
'overlap_cjk' => 'index.overlap_cjk',
@@ -141,7 +141,7 @@ function search_update_8000() {
));
// update_variables_to_config() merges in all the default values from the YAML
// file, so we need re-save the list of active plugins we found.
- \Drupal::config('search.settings')->set('active_plugins', $active_plugins)->save();
+ \\Drupal::config('search.settings')->set('active_plugins', $active_plugins)->save();
}
/**
@@ -152,7 +152,7 @@ function search_update_8000() {
*/
function _search_update_8000_modules_mapto_plugins(array $map) {
$active_modules = update_variable_get('search_active_modules', array('node', 'user'));
- $config = \Drupal::config('search.settings');
+ $config = \\Drupal::config('search.settings');
$active_plugins = $config->get('active_plugins');
foreach($active_modules as $idx => $module) {
if (isset($map[$module])) {
diff --git a/core/modules/search/search.module b/core/modules/search/search.module
index a4830ad..9464279 100644
--- a/core/modules/search/search.module
+++ b/core/modules/search/search.module
@@ -179,7 +179,7 @@ function search_menu() {
$default_info = search_get_default_plugin_info();
if ($default_info) {
- foreach (Drupal::service('plugin.manager.search')->getActiveDefinitions() as $plugin_id => $search_info) {
+ foreach (\Drupal::service('plugin.manager.search')->getActiveDefinitions() as $plugin_id => $search_info) {
$path = 'search/' . $search_info['path'];
$items[$path] = array(
'title' => $search_info['title'],
@@ -218,8 +218,8 @@ function search_menu() {
*/
function search_is_active() {
// This path cannot be accessed if there are no active plugins.
- $account = Drupal::request()->attributes->get('_account');
- return !empty($account) && $account->hasPermission('search content') && Drupal::service('plugin.manager.search')->getActiveDefinitions();
+ $account = \Drupal::request()->attributes->get('_account');
+ return !empty($account) && $account->hasPermission('search content') && \Drupal::service('plugin.manager.search')->getActiveDefinitions();
}
/**
@@ -229,8 +229,8 @@ function search_is_active() {
* The search plugin definition for the default search plugin, if any.
*/
function search_get_default_plugin_info() {
- $info = Drupal::service('plugin.manager.search')->getActiveDefinitions();
- $default = Drupal::config('search.settings')->get('default_plugin');
+ $info = \Drupal::service('plugin.manager.search')->getActiveDefinitions();
+ $default = \Drupal::config('search.settings')->get('default_plugin');
if (isset($info[$default])) {
return $info[$default];
}
@@ -251,12 +251,12 @@ function search_get_default_plugin_info() {
* @see search_menu()
*/
function _search_menu_access($plugin_id) {
- $account = Drupal::request()->attributes->get('_account');
+ $account = \Drupal::request()->attributes->get('_account');
// @todo - remove the empty() check once we are more confident
// that the account will be populated, especially during tests.
// @see https://drupal.org/node/2032553
$access = !empty($account) && $account->hasPermission('search content');
- return $access && Drupal::service('plugin.manager.search')->pluginAccess($plugin_id, $account);
+ return $access && \Drupal::service('plugin.manager.search')->pluginAccess($plugin_id, $account);
}
/**
@@ -277,7 +277,7 @@ function _search_menu_access($plugin_id) {
*/
function search_reindex($sid = NULL, $type = NULL, $reindex = FALSE, $langcode = NULL) {
if ($type == NULL && $sid == NULL) {
- foreach (Drupal::service('plugin.manager.search')->getActiveIndexingPlugins() as $plugin) {
+ foreach (\Drupal::service('plugin.manager.search')->getActiveIndexingPlugins() as $plugin) {
$plugin->resetIndex();
}
}
@@ -328,7 +328,7 @@ function search_cron() {
// to date.
drupal_register_shutdown_function('search_update_totals');
- foreach (Drupal::service('plugin.manager.search')->getActiveIndexingPlugins() as $plugin) {
+ foreach (\Drupal::service('plugin.manager.search')->getActiveIndexingPlugins() as $plugin) {
$plugin->updateIndex();
}
}
@@ -388,7 +388,7 @@ function search_simplify($text, $langcode = NULL) {
search_invoke_preprocess($text, $langcode);
// Simple CJK handling
- if (Drupal::config('search.settings')->get('index.overlap_cjk')) {
+ if (\Drupal::config('search.settings')->get('index.overlap_cjk')) {
$text = preg_replace_callback('/[' . PREG_CLASS_CJK . ']+/u', 'search_expand_cjk', $text);
}
@@ -442,7 +442,7 @@ function search_simplify($text, $langcode = NULL) {
* Tokenized text, starting and ending with a space character.
*/
function search_expand_cjk($matches) {
- $min = Drupal::config('search.settings')->get('index.minimum_word_size');
+ $min = \Drupal::config('search.settings')->get('index.minimum_word_size');
$str = $matches[0];
$length = drupal_strlen($str);
// If the text is shorter than the minimum word size, don't tokenize it.
@@ -502,7 +502,7 @@ function _search_index_truncate(&$text) {
* Invokes hook_search_preprocess() in modules.
*/
function search_invoke_preprocess(&$text, $langcode = NULL) {
- foreach (Drupal::moduleHandler()->getImplementations('search_preprocess') as $module) {
+ foreach (\Drupal::moduleHandler()->getImplementations('search_preprocess') as $module) {
$text = module_invoke($module, 'search_preprocess', $text, $langcode);
}
}
@@ -522,12 +522,12 @@ function search_invoke_preprocess(&$text, $langcode = NULL) {
* @ingroup search
*/
function search_index($sid, $type, $text, $langcode) {
- $minimum_word_size = Drupal::config('search.settings')->get('index.minimum_word_size');
+ $minimum_word_size = \Drupal::config('search.settings')->get('index.minimum_word_size');
// Multipliers for scores of words inside certain HTML tags. The weights are
// stored in config so that modules can overwrite the default weights.
// Note: 'a' must be included for link ranking to work.
- $tags = Drupal::config('search.settings')->get('index.tag_weights');
+ $tags = \Drupal::config('search.settings')->get('index.tag_weights');
// Strip off all ignored tags to speed up processing, but insert space before
// and after them to keep word boundaries.
diff --git a/core/modules/search/search.pages.inc b/core/modules/search/search.pages.inc
index 804e4be..b9e06ab 100644
--- a/core/modules/search/search.pages.inc
+++ b/core/modules/search/search.pages.inc
@@ -25,7 +25,7 @@ function search_view($plugin_id = NULL, $keys = '') {
$keys = trim($_REQUEST['keys']);
}
- $manager = Drupal::service('plugin.manager.search');
+ $manager = \Drupal::service('plugin.manager.search');
if (!empty($plugin_id)) {
$active_plugin_info = $manager->getActiveDefinitions();
if (isset($active_plugin_info[$plugin_id])) {
@@ -46,7 +46,7 @@ function search_view($plugin_id = NULL, $keys = '') {
return new RedirectResponse(url($path, array('absolute' => TRUE)));
}
$plugin = $manager->createInstance($plugin_id);
- $request = Drupal::request();
+ $request = \Drupal::request();
$plugin->setSearch($keys, $request->query->all(), $request->attributes->all());
// Default results output is an empty string.
$results = array('#markup' => '');
diff --git a/core/modules/search/tests/modules/search_embedded_form/search_embedded_form.module b/core/modules/search/tests/modules/search_embedded_form/search_embedded_form.module
index d59f184..680322a 100644
--- a/core/modules/search/tests/modules/search_embedded_form/search_embedded_form.module
+++ b/core/modules/search/tests/modules/search_embedded_form/search_embedded_form.module
@@ -30,7 +30,7 @@ function search_embedded_form_menu() {
* @see search_embedded_form_form_submit().
*/
function search_embedded_form_form($form, &$form_state) {
- $count = Drupal::config('search_embedded_form.settings')->get('submitted');
+ $count = \Drupal::config('search_embedded_form.settings')->get('submitted');
$form['name'] = array(
'#type' => 'textfield',
@@ -56,7 +56,7 @@ function search_embedded_form_form($form, &$form_state) {
* Submit handler for search_embedded_form_form().
*/
function search_embedded_form_form_submit($form, &$form_state) {
- $config = Drupal::config('search_embedded_form.settings');
+ $config = \Drupal::config('search_embedded_form.settings');
$submit_count = (int) $config->get('submitted');
$config->set('submitted', $submit_count + 1)->save();
drupal_set_message(t('Test form was submitted'));
diff --git a/core/modules/shortcut/lib/Drupal/shortcut/Tests/ShortcutLinksTest.php b/core/modules/shortcut/lib/Drupal/shortcut/Tests/ShortcutLinksTest.php
index bd2d194..89478aa 100644
--- a/core/modules/shortcut/lib/Drupal/shortcut/Tests/ShortcutLinksTest.php
+++ b/core/modules/shortcut/lib/Drupal/shortcut/Tests/ShortcutLinksTest.php
@@ -73,7 +73,7 @@ function testShortcutLinkAdd() {
*/
function testShortcutQuickLink() {
theme_enable(array('seven'));
- \Drupal::config('system.theme')->set('admin', 'seven')->save();
+ \\Drupal::config('system.theme')->set('admin', 'seven')->save();
$this->container->get('config.factory')->get('node.settings')->set('use_admin_theme', '1')->save();
$link = reset($this->set->links);
@@ -145,7 +145,7 @@ function testShortcutLinkDelete() {
*/
function testNoShortcutLink() {
// Change to a theme that displays shortcuts.
- \Drupal::config('system.theme')
+ \\Drupal::config('system.theme')
->set('default', 'seven')
->save();
diff --git a/core/modules/shortcut/shortcut.admin.inc b/core/modules/shortcut/shortcut.admin.inc
index c230fb5..523fead 100644
--- a/core/modules/shortcut/shortcut.admin.inc
+++ b/core/modules/shortcut/shortcut.admin.inc
@@ -27,7 +27,7 @@
* @see shortcut_set_switch_submit()
*/
function shortcut_set_switch($form, &$form_state, $account = NULL) {
- $user = Drupal::currentUser();
+ $user = \Drupal::currentUser();
if (!isset($account)) {
$account = $user;
@@ -244,7 +244,7 @@ function _shortcut_link_form_elements($shortcut_link = NULL) {
));
}
else {
- $shortcut_link['link_path'] = ($shortcut_link['link_path'] == '') ? '' : Drupal::service('path.alias_manager')->getPathAlias($shortcut_link['link_path']);
+ $shortcut_link['link_path'] = ($shortcut_link['link_path'] == '') ? '' : \Drupal::service('path.alias_manager')->getPathAlias($shortcut_link['link_path']);
}
$form['shortcut_link']['#tree'] = TRUE;
@@ -291,7 +291,7 @@ function shortcut_link_edit_validate($form, &$form_state) {
*/
function shortcut_link_edit_submit($form, &$form_state) {
// Normalize the path in case it is an alias.
- $shortcut_path = Drupal::service('path.alias_manager')->getSystemPath($form_state['values']['shortcut_link']['link_path']);
+ $shortcut_path = \Drupal::service('path.alias_manager')->getSystemPath($form_state['values']['shortcut_link']['link_path']);
if (empty($shortcut_path)) {
$shortcut_path = '';
}
@@ -335,7 +335,7 @@ function shortcut_link_add_submit($form, &$form_state) {
*/
function shortcut_admin_add_link($shortcut_link, &$shortcut_set) {
// Normalize the path in case it is an alias.
- $shortcut_link['link_path'] = Drupal::service('path.alias_manager')->getSystemPath($shortcut_link['link_path']);
+ $shortcut_link['link_path'] = \Drupal::service('path.alias_manager')->getSystemPath($shortcut_link['link_path']);
if (empty($shortcut_link['link_path'])) {
$shortcut_link['link_path'] = '';
}
diff --git a/core/modules/shortcut/shortcut.api.php b/core/modules/shortcut/shortcut.api.php
index 27eecf3..fa93e96 100644
--- a/core/modules/shortcut/shortcut.api.php
+++ b/core/modules/shortcut/shortcut.api.php
@@ -32,7 +32,7 @@
*/
function hook_shortcut_default_set($account) {
// Use a special set of default shortcuts for administrators only.
- if (in_array(Drupal::config('user.settings')->get('admin_role'), $account->getRoles())) {
+ if (in_array(\Drupal::config('user.settings')->get('admin_role'), $account->getRoles())) {
return 'admin-shortcuts';
}
}
diff --git a/core/modules/shortcut/shortcut.install b/core/modules/shortcut/shortcut.install
index 76e7097..6c098a3 100644
--- a/core/modules/shortcut/shortcut.install
+++ b/core/modules/shortcut/shortcut.install
@@ -84,7 +84,7 @@ function shortcut_update_8000() {
->condition('menu_name', 'shortcut-set-1')
->execute();
}
- Drupal::config('shortcut.set.' . $set->set_name)
+ \Drupal::config('shortcut.set.' . $set->set_name)
->set('id', $set->set_name)
->set('label', $set->title)
->set('uuid', $uuid->generate())
diff --git a/core/modules/shortcut/shortcut.module b/core/modules/shortcut/shortcut.module
index 1d1a505..78d9f1c 100644
--- a/core/modules/shortcut/shortcut.module
+++ b/core/modules/shortcut/shortcut.module
@@ -12,7 +12,7 @@
* Implements hook_help().
*/
function shortcut_help($path, $arg) {
- $user = Drupal::currentUser();
+ $user = \Drupal::currentUser();
switch ($path) {
case 'admin/help#shortcut':
@@ -171,7 +171,7 @@ function shortcut_admin_paths() {
* otherwise.
*/
function shortcut_set_edit_access($shortcut_set = NULL) {
- $account = Drupal::currentUser();
+ $account = \Drupal::currentUser();
// Sufficiently-privileged users can edit their currently displayed shortcut
// set, but not other sets. Shortcut administrators can edit any set.
if ($account->hasPermission('administer shortcuts')) {
@@ -196,7 +196,7 @@ function shortcut_set_edit_access($shortcut_set = NULL) {
* provided account, FALSE otherwise.
*/
function shortcut_set_switch_access($account = NULL) {
- $user = Drupal::currentUser();
+ $user = \Drupal::currentUser();
if ($user->hasPermission('administer shortcuts')) {
// Administrators can switch anyone's shortcut set.
@@ -286,7 +286,7 @@ function shortcut_set_reset_link_weights(&$shortcut_set) {
* A user account that will be assigned to use the set.
*/
function shortcut_set_assign_user($shortcut_set, $account) {
- Drupal::entityManager()
+ \Drupal::entityManager()
->getStorageController('shortcut_set')
->assignUser($shortcut_set, $account);
}
@@ -305,7 +305,7 @@ function shortcut_set_assign_user($shortcut_set, $account) {
* to any set.
*/
function shortcut_set_unassign_user($account) {
- return (bool) Drupal::entityManager()
+ return (bool) \Drupal::entityManager()
->getStorageController('shortcut_set')
->unassignUser($account);
}
@@ -334,7 +334,7 @@ function shortcut_current_displayed_set($account = NULL) {
}
// If none was found, try to find a shortcut set that is explicitly assigned
// to this user.
- $shortcut_set_name = Drupal::entityManager()
+ $shortcut_set_name = \Drupal::entityManager()
->getStorageController('shortcut_set')
->getAssignedToUser($account);
if ($shortcut_set_name) {
@@ -370,7 +370,7 @@ function shortcut_default_set($account = NULL) {
// have one, we allow the last module which returns a valid result to take
// precedence. If no module returns a valid set, fall back on the site-wide
// default, which is the lowest-numbered shortcut set.
- $suggestions = array_reverse(Drupal::moduleHandler()->invokeAll('shortcut_default_set', array($account)));
+ $suggestions = array_reverse(\Drupal::moduleHandler()->invokeAll('shortcut_default_set', array($account)));
$suggestions[] = 'default';
foreach ($suggestions as $name) {
if ($shortcut_set = shortcut_set_load($name)) {
@@ -414,13 +414,13 @@ function shortcut_set_title_exists($title) {
*/
function shortcut_valid_link($path) {
// Do not use URL aliases.
- $normal_path = Drupal::service('path.alias_manager')->getSystemPath($path);
+ $normal_path = \Drupal::service('path.alias_manager')->getSystemPath($path);
if ($path != $normal_path) {
$path = $normal_path;
}
// An empty path is valid too and will be converted to .
- return (!url_is_external($path) && (Drupal::service('router.route_provider')->getRoutesByPattern('/' . $path)->count() > 0 || menu_get_item($path))) || empty($path) || $path == '';
+ return (!url_is_external($path) && (\Drupal::service('router.route_provider')->getRoutesByPattern('/' . $path)->count() > 0 || menu_get_item($path))) || empty($path) || $path == '';
}
/**
@@ -564,7 +564,7 @@ function shortcut_library_info() {
$path = drupal_get_path('module', 'shortcut');
$libraries['drupal.shortcut.admin'] = array(
'title' => 'Shortcut configuration',
- 'version' => Drupal::VERSION,
+ 'version' => \Drupal::VERSION,
'js' => array(
$path . '/shortcut.admin.js' => array(),
),
@@ -575,7 +575,7 @@ function shortcut_library_info() {
);
$libraries['drupal.shortcut'] = array(
'title' => 'Shortcut UI',
- 'version' => Drupal::VERSION,
+ 'version' => \Drupal::VERSION,
'css' => array(
$path . '/css/shortcut.module.css' => array(),
$path . '/css/shortcut.theme.css' => array(),
diff --git a/core/modules/simpletest/lib/Drupal/simpletest/DrupalUnitTestBase.php b/core/modules/simpletest/lib/Drupal/simpletest/DrupalUnitTestBase.php
index b55feee..f24f760 100644
--- a/core/modules/simpletest/lib/Drupal/simpletest/DrupalUnitTestBase.php
+++ b/core/modules/simpletest/lib/Drupal/simpletest/DrupalUnitTestBase.php
@@ -79,9 +79,9 @@ function __construct($test_id = NULL) {
protected function setUp() {
// Copy/prime extension file lists once to avoid filesystem scans.
if (!isset($this->moduleFiles)) {
- $this->moduleFiles = \Drupal::state()->get('system.module.files') ?: array();
- $this->themeFiles = \Drupal::state()->get('system.theme.files') ?: array();
- $this->themeData = \Drupal::state()->get('system.theme.data') ?: array();
+ $this->moduleFiles = \\Drupal::state()->get('system.module.files') ?: array();
+ $this->themeFiles = \\Drupal::state()->get('system.theme.files') ?: array();
+ $this->themeData = \\Drupal::state()->get('system.theme.data') ?: array();
}
$this->keyValueFactory = new KeyValueMemoryFactory();
@@ -92,9 +92,9 @@ protected function setUp() {
// Make sure it survives kernel rebuilds.
$GLOBALS['conf']['container_service_providers']['TestServiceProvider'] = 'Drupal\simpletest\TestServiceProvider';
- \Drupal::state()->set('system.module.files', $this->moduleFiles);
- \Drupal::state()->set('system.theme.files', $this->themeFiles);
- \Drupal::state()->set('system.theme.data', $this->themeData);
+ \\Drupal::state()->set('system.module.files', $this->moduleFiles);
+ \\Drupal::state()->set('system.theme.files', $this->themeFiles);
+ \\Drupal::state()->set('system.theme.data', $this->themeData);
// Bootstrap the kernel.
// No need to dump it; this test runs in-memory.
@@ -121,7 +121,7 @@ protected function setUp() {
$modules = call_user_func_array('array_merge_recursive', $modules);
$this->enableModules($modules, FALSE);
// In order to use theme functions default theme config needs to exist.
- \Drupal::config('system.theme')->set('default', 'stark');
+ \\Drupal::config('system.theme')->set('default', 'stark');
}
protected function tearDown() {
@@ -163,7 +163,7 @@ public function containerBuild(ContainerBuilder $container) {
// a kernel is overridden then there's no need to re-register the keyvalue
// service but when a test is happy with the superminimal container put
// together here, it still might a keyvalue storage for anything (for
- // eg. module_enable) using \Drupal::state() -- that's why a memory
+ // eg. module_enable) using \\Drupal::state() -- that's why a memory
// service was added in the first place.
$container
->register('keyvalue', 'Drupal\Core\KeyValueStore\KeyValueFactory')
diff --git a/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php b/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php
index c0a9102..708f92e 100644
--- a/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php
+++ b/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php
@@ -710,7 +710,7 @@ protected function verbose($message) {
*/
public function run(array $methods = array()) {
TestServiceProvider::$currentTest = $this;
- $simpletest_config = \Drupal::config('simpletest.settings');
+ $simpletest_config = \\Drupal::config('simpletest.settings');
$class = get_class($this);
if ($simpletest_config->get('verbose')) {
@@ -945,7 +945,7 @@ protected function prepareEnvironment() {
// @todo Remove this once this class has no calls to t() and format_plural()
$this->container->register('string_translation', 'Drupal\Core\StringTranslation\TranslationManager');
- \Drupal::setContainer($this->container);
+ \\Drupal::setContainer($this->container);
// Unset globals.
unset($GLOBALS['theme_key']);
@@ -991,7 +991,7 @@ protected function prepareConfigDirectories() {
}
/**
- * Rebuild Drupal::getContainer().
+ * Rebuild \Drupal::getContainer().
*
* Use this to build a new kernel and service container. For example, when the
* list of enabled modules is changed via the internal browser, in which case
@@ -1002,16 +1002,16 @@ protected function prepareConfigDirectories() {
* @see TestBase::tearDown()
*
* @todo Fix http://drupal.org/node/1708692 so that module enable/disable
- * changes are immediately reflected in Drupal::getContainer(). Until then,
+ * changes are immediately reflected in \Drupal::getContainer(). Until then,
* tests can invoke this workaround when requiring services from newly
* enabled modules to be immediately available in the same request.
*/
protected function rebuildContainer() {
$this->kernel = new DrupalKernel('testing', drupal_classloader(), FALSE);
$this->kernel->boot();
- // DrupalKernel replaces the container in Drupal::getContainer() with a
+ // DrupalKernel replaces the container in \Drupal::getContainer() with a
// different object, so we need to replace the instance on this test class.
- $this->container = \Drupal::getContainer();
+ $this->container = \\Drupal::getContainer();
// The global $user is set in TestBase::prepareEnvironment().
$this->container->get('request')->attributes->set('_account', $GLOBALS['user']);
}
@@ -1057,7 +1057,7 @@ protected function tearDown() {
// log to pick up any fatal errors.
simpletest_log_read($this->testId, $this->databasePrefix, get_class($this), TRUE);
if (($container = drupal_container()) && $container->has('keyvalue')) {
- $captured_emails = \Drupal::state()->get('system.test_email_collector') ?: array();
+ $captured_emails = \\Drupal::state()->get('system.test_email_collector') ?: array();
$emailCount = count($captured_emails);
if ($emailCount) {
$message = format_plural($emailCount, '1 e-mail was sent during this test.', '@count e-mails were sent during this test.');
@@ -1092,7 +1092,7 @@ protected function tearDown() {
new Settings($this->originalSettings);
// Restore original statics and globals.
- \Drupal::setContainer($this->originalContainer);
+ \\Drupal::setContainer($this->originalContainer);
$GLOBALS['config_directories'] = $this->originalConfigDirectories;
if (isset($this->originalPrefix)) {
drupal_valid_test_ua($this->originalPrefix);
diff --git a/core/modules/simpletest/lib/Drupal/simpletest/Tests/DrupalUnitTestBaseTest.php b/core/modules/simpletest/lib/Drupal/simpletest/Tests/DrupalUnitTestBaseTest.php
index 505ff33..4fb771d 100644
--- a/core/modules/simpletest/lib/Drupal/simpletest/Tests/DrupalUnitTestBaseTest.php
+++ b/core/modules/simpletest/lib/Drupal/simpletest/Tests/DrupalUnitTestBaseTest.php
@@ -39,8 +39,8 @@ function testSetUp() {
// Verify that specified $modules have been loaded.
$this->assertTrue(function_exists('entity_test_permission'), "$module.module was loaded.");
// Verify that there is a fixed module list.
- $this->assertIdentical(array_keys(\Drupal::moduleHandler()->getModuleList()), array($module));
- $this->assertIdentical(\Drupal::moduleHandler()->getImplementations('permission'), array($module));
+ $this->assertIdentical(array_keys(\\Drupal::moduleHandler()->getModuleList()), array($module));
+ $this->assertIdentical(\\Drupal::moduleHandler()->getImplementations('permission'), array($module));
// Verify that no modules have been installed.
$this->assertFalse(db_table_exists($table), "'$table' database table not found.");
@@ -54,20 +54,20 @@ function testEnableModulesLoad() {
// Verify that the module does not exist yet.
$this->assertFalse(module_exists($module), "$module module not found.");
- $list = array_keys(\Drupal::moduleHandler()->getModuleList());
+ $list = array_keys(\\Drupal::moduleHandler()->getModuleList());
$this->assertFalse(in_array($module, $list), "$module module not found in the extension handler's module list.");
- $list = \Drupal::moduleHandler()->getImplementations('permission');
- $this->assertFalse(in_array($module, $list), "{$module}_permission() in Drupal::moduleHandler()->getImplementations() not found.");
+ $list = \\Drupal::moduleHandler()->getImplementations('permission');
+ $this->assertFalse(in_array($module, $list), "{$module}_permission() in \Drupal::moduleHandler()->getImplementations() not found.");
// Enable the module.
$this->enableModules(array($module));
// Verify that the module exists.
$this->assertTrue(module_exists($module), "$module module found.");
- $list = array_keys(\Drupal::moduleHandler()->getModuleList());
+ $list = array_keys(\\Drupal::moduleHandler()->getModuleList());
$this->assertTrue(in_array($module, $list), "$module module found in the extension handler's module list.");
- $list = \Drupal::moduleHandler()->getImplementations('permission');
- $this->assertTrue(in_array($module, $list), "{$module}_permission() in Drupal::moduleHandler()->getImplementations() found.");
+ $list = \\Drupal::moduleHandler()->getImplementations('permission');
+ $this->assertTrue(in_array($module, $list), "{$module}_permission() in \Drupal::moduleHandler()->getImplementations() found.");
}
/**
@@ -79,10 +79,10 @@ function testEnableModulesInstall() {
// Verify that the module does not exist yet.
$this->assertFalse(module_exists($module), "$module module not found.");
- $list = array_keys(\Drupal::moduleHandler()->getModuleList());
+ $list = array_keys(\\Drupal::moduleHandler()->getModuleList());
$this->assertFalse(in_array($module, $list), "$module module not found in the extension handler's module list.");
- $list = \Drupal::moduleHandler()->getImplementations('permission');
- $this->assertFalse(in_array($module, $list), "{$module}_permission() in Drupal::moduleHandler()->getImplementations() not found.");
+ $list = \\Drupal::moduleHandler()->getImplementations('permission');
+ $this->assertFalse(in_array($module, $list), "{$module}_permission() in \Drupal::moduleHandler()->getImplementations() not found.");
$this->assertFalse(db_table_exists($table), "'$table' database table not found.");
$schema = drupal_get_schema($table);
@@ -93,10 +93,10 @@ function testEnableModulesInstall() {
// Verify that the enabled module exists.
$this->assertTrue(module_exists($module), "$module module found.");
- $list = array_keys(\Drupal::moduleHandler()->getModuleList());
+ $list = array_keys(\\Drupal::moduleHandler()->getModuleList());
$this->assertTrue(in_array($module, $list), "$module module found in the extension handler's module list.");
- $list = \Drupal::moduleHandler()->getImplementations('permission');
- $this->assertTrue(in_array($module, $list), "{$module}_permission() in Drupal::moduleHandler()->getImplementations() found.");
+ $list = \\Drupal::moduleHandler()->getImplementations('permission');
+ $this->assertTrue(in_array($module, $list), "{$module}_permission() in \Drupal::moduleHandler()->getImplementations() found.");
$this->assertTrue(db_table_exists($table), "'$table' database table found.");
$schema = drupal_get_schema($table);
@@ -112,7 +112,7 @@ function testEnableModulesInstallContainer() {
$this->installSchema('node', array('node', 'node_field_data'));
// Perform an entity query against node.
- $query = \Drupal::entityQuery('node');
+ $query = \\Drupal::entityQuery('node');
// Disable node access checks, since User module is not enabled.
$query->accessCheck(FALSE);
$query->condition('nid', 1);
@@ -191,7 +191,7 @@ function testInstallConfig() {
$this->enableModules(array('user'));
$this->installConfig(array('user'));
$this->assertTrue($this->container->get('config.storage')->exists('user.settings'));
- $this->assertTrue(\Drupal::config('user.settings')->get('register'));
+ $this->assertTrue(\\Drupal::config('user.settings')->get('register'));
}
/**
diff --git a/core/modules/simpletest/lib/Drupal/simpletest/Tests/SimpleTestTest.php b/core/modules/simpletest/lib/Drupal/simpletest/Tests/SimpleTestTest.php
index 1588b64..88e4e80 100644
--- a/core/modules/simpletest/lib/Drupal/simpletest/Tests/SimpleTestTest.php
+++ b/core/modules/simpletest/lib/Drupal/simpletest/Tests/SimpleTestTest.php
@@ -61,7 +61,7 @@ function testInternalBrowser() {
$this->drupalGet('test-page');
$this->assertTrue($this->drupalGetHeader('Date'), 'An HTTP header was received.');
$this->assertTitle(t('Test page | @site-name', array(
- '@site-name' => \Drupal::config('system.site')->get('name'),
+ '@site-name' => \\Drupal::config('system.site')->get('name'),
)));
$this->assertNoTitle('Foo');
diff --git a/core/modules/simpletest/lib/Drupal/simpletest/UnitTestBase.php b/core/modules/simpletest/lib/Drupal/simpletest/UnitTestBase.php
index dd725ed..350fa51 100644
--- a/core/modules/simpletest/lib/Drupal/simpletest/UnitTestBase.php
+++ b/core/modules/simpletest/lib/Drupal/simpletest/UnitTestBase.php
@@ -15,7 +15,7 @@
*
* These tests can not access the database nor files. Calling any Drupal
* function that needs the database will throw exceptions. These include
- * watchdog(), Drupal::moduleHandler()->getImplementations(), module_invoke_all() etc.
+ * watchdog(), \Drupal::moduleHandler()->getImplementations(), module_invoke_all() etc.
*/
abstract class UnitTestBase extends TestBase {
diff --git a/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php b/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php
index 52ca231..3a3ae05 100644
--- a/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php
+++ b/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php
@@ -203,7 +203,7 @@ function __construct($test_id = NULL) {
*/
function drupalGetNodeByTitle($title, $reset = FALSE) {
if ($reset) {
- \Drupal::entityManager()->getStorageController('node')->resetCache();
+ \\Drupal::entityManager()->getStorageController('node')->resetCache();
}
$nodes = entity_load_multiple_by_properties('node', array('title' => $title));
// Load the first node returned from the database.
@@ -374,7 +374,7 @@ protected function drupalPlaceBlock($plugin_id, array $settings = array()) {
'plugin' => $plugin_id,
'region' => 'sidebar_first',
'machine_name' => strtolower($this->randomName(8)),
- 'theme' => \Drupal::config('system.theme')->get('default'),
+ 'theme' => \\Drupal::config('system.theme')->get('default'),
'label' => $this->randomName(8),
'visibility' => array(),
'weight' => 0,
@@ -814,7 +814,7 @@ protected function setUp() {
// Set 'parent_profile' of simpletest to add the parent profile's
// search path to the child site's search paths.
// @see drupal_system_listing()
- \Drupal::config('simpletest.settings')->set('parent_profile', $this->originalProfile)->save();
+ \\Drupal::config('simpletest.settings')->set('parent_profile', $this->originalProfile)->save();
// Collect modules to install.
$class = get_class($this);
@@ -838,7 +838,7 @@ protected function setUp() {
// Now make sure that the file path configurations are saved. This is done
// after we install the modules to override default values.
foreach ($variable_groups as $config_base => $variables) {
- $config = \Drupal::config($config_base);
+ $config = \\Drupal::config($config_base);
foreach ($variables as $name => $value) {
$config->set($name, $value);
}
@@ -846,7 +846,7 @@ protected function setUp() {
}
// Use the test mail class instead of the default mail handler class.
- \Drupal::config('system.mail')->set('interface.default', 'Drupal\Core\Mail\VariableLog')->save();
+ \\Drupal::config('system.mail')->set('interface.default', 'Drupal\Core\Mail\VariableLog')->save();
drupal_set_time_limit($this->timeLimit);
// Temporary fix so that when running from run-tests.sh we don't get an
@@ -947,7 +947,7 @@ protected function rebuildContainer() {
protected function resetAll() {
// Clear all database and static caches and rebuild data structures.
drupal_flush_all_caches();
- $this->container = \Drupal::getContainer();
+ $this->container = \\Drupal::getContainer();
// Reload global $conf array and permissions.
$this->refreshVariables();
@@ -1763,7 +1763,7 @@ protected function serializePostValues($post = array()) {
* Runs cron in the Drupal installed by Simpletest.
*/
protected function cronRun() {
- $this->drupalGet('cron/' . \Drupal::state()->get('system.cron_key'));
+ $this->drupalGet('cron/' . \\Drupal::state()->get('system.cron_key'));
}
/**
@@ -2372,7 +2372,7 @@ protected function drupalGetSettings() {
* An array containing e-mail messages captured during the current test.
*/
protected function drupalGetMails($filter = array()) {
- $captured_emails = \Drupal::state()->get('system.test_email_collector') ?: array();
+ $captured_emails = \\Drupal::state()->get('system.test_email_collector') ?: array();
$filtered_emails = array();
foreach ($captured_emails as $message) {
@@ -3369,7 +3369,7 @@ protected function assertNoResponse($code, $message = '', $group = 'Browser') {
* TRUE on pass, FALSE on fail.
*/
protected function assertMail($name, $value = '', $message = '', $group = 'E-mail') {
- $captured_emails = \Drupal::state()->get('system.test_email_collector') ?: array();
+ $captured_emails = \\Drupal::state()->get('system.test_email_collector') ?: array();
$email = end($captured_emails);
return $this->assertTrue($email && isset($email[$name]) && $email[$name] == $value, $message, $group);
}
diff --git a/core/modules/simpletest/simpletest.module b/core/modules/simpletest/simpletest.module
index 8d441f4..02b0aa6 100644
--- a/core/modules/simpletest/simpletest.module
+++ b/core/modules/simpletest/simpletest.module
@@ -159,7 +159,7 @@ function simpletest_run_tests($test_list, $reporter = 'drupal') {
);
batch_set($batch);
- Drupal::moduleHandler()->invokeAll('test_group_started');
+ \Drupal::moduleHandler()->invokeAll('test_group_started');
return $test_id;
}
@@ -305,7 +305,7 @@ function _simpletest_batch_operation($test_list_init, $test_id, &$context) {
$size = count($test_list);
$info = $test->getInfo();
- Drupal::moduleHandler()->invokeAll('test_finished', array($test->results));
+ \Drupal::moduleHandler()->invokeAll('test_finished', array($test->results));
// Gather results and compose the report.
$test_results[$test_class] = $test->results;
@@ -352,7 +352,7 @@ function _simpletest_batch_finished($success, $results, $operations, $elapsed) {
drupal_set_message(t('The test run did not successfully finish.'), 'error');
drupal_set_message(t('Use the Clean environment button to clean-up temporary files and tables.'), 'warning');
}
- Drupal::moduleHandler()->invokeAll('test_group_finished');
+ \Drupal::moduleHandler()->invokeAll('test_group_finished');
}
/**
@@ -573,7 +573,7 @@ function simpletest_generate_file($filename, $width, $lines, $type = 'binary-tex
function simpletest_clean_environment() {
simpletest_clean_database();
simpletest_clean_temporary_directories();
- if (Drupal::config('simpletest.settings')->get('clear_results')) {
+ if (\Drupal::config('simpletest.settings')->get('clear_results')) {
$count = simpletest_clean_results_table();
drupal_set_message(format_plural($count, 'Removed 1 test result.', 'Removed @count test results.'));
}
@@ -643,7 +643,7 @@ function simpletest_clean_temporary_directories() {
* The number of results removed.
*/
function simpletest_clean_results_table($test_id = NULL) {
- if (Drupal::config('simpletest.settings')->get('clear_results')) {
+ if (\Drupal::config('simpletest.settings')->get('clear_results')) {
if ($test_id) {
$count = db_query('SELECT COUNT(test_id) FROM {simpletest_test_id} WHERE test_id = :test_id', array(':test_id' => $test_id))->fetchField();
@@ -686,7 +686,7 @@ function simpletest_mail_alter(&$message) {
function simpletest_library_info() {
$libraries['drupal.simpletest'] = array(
'title' => 'Simpletest',
- 'version' => Drupal::VERSION,
+ 'version' => \Drupal::VERSION,
'js' => array(
drupal_get_path('module', 'simpletest') . '/simpletest.js' => array(),
),
@@ -714,7 +714,7 @@ function simpletest_library_info() {
*/
function simpletest_phpunit_get_available_tests() {
// Try to load the class names array from cache.
- if ($cache = \Drupal::cache()->get('simpletest_phpunit')) {
+ if ($cache = \\Drupal::cache()->get('simpletest_phpunit')) {
$test_classes = $cache->data;
}
else {
@@ -741,7 +741,7 @@ function simpletest_phpunit_get_available_tests() {
}
// Since we have recalculated, we now need to store the new data into cache.
- \Drupal::cache()->set('simpletest_phpunit', $test_classes);
+ \\Drupal::cache()->set('simpletest_phpunit', $test_classes);
}
return $test_classes;
diff --git a/core/modules/statistics/lib/Drupal/statistics/StatisticsSettingsForm.php b/core/modules/statistics/lib/Drupal/statistics/StatisticsSettingsForm.php
index c2611cd..eeb512a 100644
--- a/core/modules/statistics/lib/Drupal/statistics/StatisticsSettingsForm.php
+++ b/core/modules/statistics/lib/Drupal/statistics/StatisticsSettingsForm.php
@@ -90,7 +90,7 @@ public function submitForm(array &$form, array &$form_state) {
// The popular statistics block is dependent on these settings, so clear the
// block plugin definitions cache.
if ($this->moduleHandler->moduleExists('block')) {
- \Drupal::service('plugin.manager.block')->clearCachedDefinitions();
+ \\Drupal::service('plugin.manager.block')->clearCachedDefinitions();
}
parent::submitForm($form, $form_state);
diff --git a/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsAdminTest.php b/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsAdminTest.php
index e8abd34..4c39a0f 100644
--- a/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsAdminTest.php
+++ b/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsAdminTest.php
@@ -62,7 +62,7 @@ function setUp() {
$this->privileged_user = $this->drupalCreateUser(array('administer statistics', 'view post access counter', 'create page content'));
$this->drupalLogin($this->privileged_user);
$this->test_node = $this->drupalCreateNode(array('type' => 'page', 'uid' => $this->privileged_user->id()));
- $this->client = \Drupal::httpClient();
+ $this->client = \\Drupal::httpClient();
$this->client->setConfig(array('curl.options' => array(CURLOPT_TIMEOUT => 10)));
}
@@ -70,13 +70,13 @@ function setUp() {
* Verifies that the statistics settings page works.
*/
function testStatisticsSettings() {
- $config = \Drupal::config('statistics.settings');
+ $config = \\Drupal::config('statistics.settings');
$this->assertFalse($config->get('count_content_views'), 'Count content view log is disabled by default.');
// Enable counter on content view.
$edit['statistics_count_content_views'] = 1;
$this->drupalPostForm('admin/config/system/statistics', $edit, t('Save configuration'));
- $config = \Drupal::config('statistics.settings');
+ $config = \\Drupal::config('statistics.settings');
$this->assertTrue($config->get('count_content_views'), 'Count content view log is enabled.');
// Hit the node.
@@ -103,7 +103,7 @@ function testStatisticsSettings() {
* Tests that when a node is deleted, the node counter is deleted too.
*/
function testDeleteNode() {
- \Drupal::config('statistics.settings')->set('count_content_views', 1)->save();
+ \\Drupal::config('statistics.settings')->set('count_content_views', 1)->save();
$this->drupalGet('node/' . $this->test_node->id());
// Manually calling statistics.php, simulating ajax behavior.
@@ -134,10 +134,10 @@ function testDeleteNode() {
* Tests that cron clears day counts and expired access logs.
*/
function testExpiredLogs() {
- \Drupal::config('statistics.settings')
+ \\Drupal::config('statistics.settings')
->set('count_content_views', 1)
->save();
- \Drupal::state()->set('statistics.day_timestamp', 8640000);
+ \\Drupal::state()->set('statistics.day_timestamp', 8640000);
$this->drupalGet('node/' . $this->test_node->id());
// Manually calling statistics.php, simulating ajax behavior.
diff --git a/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsLoggingTest.php b/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsLoggingTest.php
index 5c8fbbb..67a30e7 100644
--- a/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsLoggingTest.php
+++ b/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsLoggingTest.php
@@ -54,20 +54,20 @@ function setUp() {
$this->node = $this->drupalCreateNode(array('title' => $this->randomName(255), 'uid' => $this->auth_user->id()));
// Enable page caching.
- $config = \Drupal::config('system.performance');
+ $config = \\Drupal::config('system.performance');
$config->set('cache.page.use_internal', 1);
$config->set('cache.page.max_age', 300);
$config->save();
// Enable access logging.
- \Drupal::config('statistics.settings')
+ \\Drupal::config('statistics.settings')
->set('count_content_views', 1)
->save();
// Clear the logs.
db_truncate('node_counter');
- $this->client = \Drupal::httpClient();
+ $this->client = \\Drupal::httpClient();
$this->client->setConfig(array('curl.options' => array(CURLOPT_TIMEOUT => 10)));
}
diff --git a/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsReportsTest.php b/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsReportsTest.php
index e1dc9f6..ec7069b 100644
--- a/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsReportsTest.php
+++ b/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsReportsTest.php
@@ -36,7 +36,7 @@ function testPopularContentBlock() {
$headers = array('Content-Type' => 'application/x-www-form-urlencoded');
global $base_url;
$stats_path = $base_url . '/' . drupal_get_path('module', 'statistics'). '/statistics.php';
- $client = \Drupal::httpClient();
+ $client = \\Drupal::httpClient();
$client->setConfig(array('curl.options' => array(CURLOPT_TIMEOUT => 10)));
$client->post($stats_path, $headers, $post)->send();
diff --git a/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsTestBase.php b/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsTestBase.php
index 8ad4df2..5a7ef39 100644
--- a/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsTestBase.php
+++ b/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsTestBase.php
@@ -41,7 +41,7 @@ function setUp() {
$this->drupalLogin($this->blocking_user);
// Enable logging.
- \Drupal::config('statistics.settings')
+ \\Drupal::config('statistics.settings')
->set('count_content_views', 1)
->save();
}
diff --git a/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsTokenReplaceTest.php b/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsTokenReplaceTest.php
index f8fa0fe..fa3fe14 100644
--- a/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsTokenReplaceTest.php
+++ b/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsTokenReplaceTest.php
@@ -40,7 +40,7 @@ function testStatisticsTokenReplacement() {
$headers = array('Content-Type' => 'application/x-www-form-urlencoded');
global $base_url;
$stats_path = $base_url . '/' . drupal_get_path('module', 'statistics'). '/statistics.php';
- $client = \Drupal::httpClient();
+ $client = \\Drupal::httpClient();
$client->setConfig(array('curl.options' => array(CURLOPT_TIMEOUT => 10)));
$client->post($stats_path, $headers, $post)->send();
$statistics = statistics_get($node->id());
@@ -56,7 +56,7 @@ function testStatisticsTokenReplacement() {
$this->assertFalse(in_array(0, array_map('strlen', $tests)), 'No empty tokens generated.');
foreach ($tests as $input => $expected) {
- $output = \Drupal::token()->replace($input, array('node' => $node), array('langcode' => $language_interface->id));
+ $output = \\Drupal::token()->replace($input, array('node' => $node), array('langcode' => $language_interface->id));
$this->assertEqual($output, $expected, format_string('Statistics token %token replaced.', array('%token' => $input)));
}
}
diff --git a/core/modules/statistics/lib/Drupal/statistics/Tests/Views/IntegrationTest.php b/core/modules/statistics/lib/Drupal/statistics/Tests/Views/IntegrationTest.php
index a16f824..0ffb981 100644
--- a/core/modules/statistics/lib/Drupal/statistics/Tests/Views/IntegrationTest.php
+++ b/core/modules/statistics/lib/Drupal/statistics/Tests/Views/IntegrationTest.php
@@ -82,7 +82,7 @@ public function testNodeCounterIntegration() {
// @see \Drupal\statistics\Tests\StatisticsLoggingTest::testLogging().
global $base_url;
$stats_path = $base_url . '/' . drupal_get_path('module', 'statistics'). '/statistics.php';
- $client = \Drupal::httpClient();
+ $client = \\Drupal::httpClient();
$client->setConfig(array('curl.options' => array(CURLOPT_TIMEOUT => 10)));
$client->post($stats_path, array(), array('nid' => $this->node->id()))->send();
$this->drupalGet('test_statistics_integration');
diff --git a/core/modules/statistics/statistics.install b/core/modules/statistics/statistics.install
index 5706db3..9b443e5 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 853d139..5b11a09 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);
}
}
@@ -174,7 +174,7 @@ function statistics_get($nid) {
* A string as a link, truncated to the width, linked to the given $path.
*/
function _statistics_link($path, $width = 35) {
- $title = Drupal::service('path.alias_manager')->getPathAlias($path);
+ $title = \Drupal::service('path.alias_manager')->getPathAlias($path);
$title = truncate_utf8($title, $width, FALSE, TRUE);
return l($title, $path);
}
@@ -211,7 +211,7 @@ function statistics_node_predelete(EntityInterface $node) {
* Implements hook_ranking().
*/
function statistics_ranking() {
- if (Drupal::config('statistics.settings')->get('count_content_views')) {
+ if (\Drupal::config('statistics.settings')->get('count_content_views')) {
return array(
'views' => array(
'title' => t('Number of views'),
@@ -223,7 +223,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),
),
);
}
@@ -233,7 +233,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()));
}
/**
@@ -251,7 +251,7 @@ function statistics_preprocess_block(&$variables) {
function statistics_library_info() {
$libraries['drupal.statistics'] = array(
'title' => 'Statistics',
- 'version' => Drupal::VERSION,
+ 'version' => \Drupal::VERSION,
'js' => array(
drupal_get_path('module', 'statistics') . '/statistics.js' => array(
'scope' => 'footer'
@@ -274,7 +274,7 @@ function statistics_library_info() {
* to count content views.
*/
function statistics_block_alter(&$definitions) {
- $statistics_count_content_views = Drupal::config('statistics.settings')->get('count_content_views');
+ $statistics_count_content_views = \Drupal::config('statistics.settings')->get('count_content_views');
if (empty($statistics_count_content_views)) {
unset($definitions['statistics_popular_block']);
}
diff --git a/core/modules/statistics/statistics.php b/core/modules/statistics/statistics.php
index ed132e8..4719a23 100644
--- a/core/modules/statistics/statistics.php
+++ b/core/modules/statistics/statistics.php
@@ -13,7 +13,7 @@
require_once dirname(dirname(__DIR__)) . '/includes/bootstrap.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_VARIABLES);
-if (\Drupal::config('statistics.settings')->get('count_content_views')) {
+if (\\Drupal::config('statistics.settings')->get('count_content_views')) {
$nid = filter_input(INPUT_POST, 'nid', FILTER_VALIDATE_INT);
if ($nid) {
db_merge('node_counter')
diff --git a/core/modules/statistics/statistics.tokens.inc b/core/modules/statistics/statistics.tokens.inc
index 02de3a0..d2be86c 100644
--- a/core/modules/statistics/statistics.tokens.inc
+++ b/core/modules/statistics/statistics.tokens.inc
@@ -32,7 +32,7 @@ function statistics_token_info() {
* Implements hook_tokens().
*/
function statistics_tokens($type, $tokens, array $data = array(), array $options = array()) {
- $token_service = Drupal::token();
+ $token_service = \Drupal::token();
$replacements = array();
diff --git a/core/modules/syslog/syslog.install b/core/modules/syslog/syslog.install
index c9eb769..c36feeb 100644
--- a/core/modules/syslog/syslog.install
+++ b/core/modules/syslog/syslog.install
@@ -11,7 +11,7 @@
function syslog_install() {
// The default facility setting depends on the operating system, so it needs
// to be set dynamically during installation.
- Drupal::config('syslog.settings')->set('facility', defined('LOG_LOCAL0') ? LOG_LOCAL0 : LOG_USER)->save();
+ \Drupal::config('syslog.settings')->set('facility', defined('LOG_LOCAL0') ? LOG_LOCAL0 : LOG_USER)->save();
}
/**
diff --git a/core/modules/syslog/syslog.module b/core/modules/syslog/syslog.module
index c46f58a..51c5792 100644
--- a/core/modules/syslog/syslog.module
+++ b/core/modules/syslog/syslog.module
@@ -45,7 +45,7 @@ function syslog_help($path, $arg) {
* Implements hook_form_FORM_ID_alter().
*/
function syslog_form_system_logging_settings_alter(&$form, &$form_state) {
- $config = Drupal::config('syslog.settings');
+ $config = \Drupal::config('syslog.settings');
$help = module_exists('help') ? ' ' . l(t('More information'), 'admin/help/syslog') . '.' : NULL;
$form['syslog_identity'] = array(
'#type' => 'textfield',
@@ -78,7 +78,7 @@ function syslog_form_system_logging_settings_alter(&$form, &$form_state) {
* @see syslog_form_system_logging_settings_alter()
*/
function syslog_logging_settings_submit($form, &$form_state) {
- Drupal::config('syslog.settings')
+ \Drupal::config('syslog.settings')
->set('identity', $form_state['values']['syslog_identity'])
->set('facility', $form_state['values']['syslog_facility'])
->set('format', $form_state['values']['syslog_format'])
@@ -111,7 +111,7 @@ function syslog_watchdog(array $log_entry) {
global $base_url;
$log_init = &drupal_static(__FUNCTION__, FALSE);
- $config = Drupal::config('syslog.settings');
+ $config = \Drupal::config('syslog.settings');
if (!$log_init) {
$log_init = TRUE;
diff --git a/core/modules/system/language.api.php b/core/modules/system/language.api.php
index 2e8d91f..cfa42ec 100644
--- a/core/modules/system/language.api.php
+++ b/core/modules/system/language.api.php
@@ -199,7 +199,7 @@ function hook_language_fallback_candidates_alter(array &$fallback_candidates) {
* // Use the current default interface language.
* $langcode = language(\Drupal\Core\Language\Language::TYPE_INTERFACE)->id;
* // Instantiate the transliteration class.
- * $trans = Drupal::transliteration();
+ * $trans = \Drupal::transliteration();
* // Use this to transliterate some text.
* $transformed = $trans->transliterate($string, $langcode);
* @endcode
diff --git a/core/modules/system/lib/Drupal/system/Access/CronAccessCheck.php b/core/modules/system/lib/Drupal/system/Access/CronAccessCheck.php
index ccff863..f0ce535 100644
--- a/core/modules/system/lib/Drupal/system/Access/CronAccessCheck.php
+++ b/core/modules/system/lib/Drupal/system/Access/CronAccessCheck.php
@@ -28,11 +28,11 @@ public function appliesTo() {
*/
public function access(Route $route, Request $request) {
$key = $request->attributes->get('key');
- if ($key != \Drupal::state()->get('system.cron_key')) {
+ if ($key != \\Drupal::state()->get('system.cron_key')) {
watchdog('cron', 'Cron could not run because an invalid key was used.', array(), WATCHDOG_NOTICE);
return static::KILL;
}
- elseif (\Drupal::state()->get('system.maintenance_mode')) {
+ elseif (\\Drupal::state()->get('system.maintenance_mode')) {
watchdog('cron', 'Cron could not run because the site is in maintenance mode.', array(), WATCHDOG_NOTICE);
return static::KILL;
}
diff --git a/core/modules/system/lib/Drupal/system/Entity/Action.php b/core/modules/system/lib/Drupal/system/Entity/Action.php
index c390a76..b7489ba 100644
--- a/core/modules/system/lib/Drupal/system/Entity/Action.php
+++ b/core/modules/system/lib/Drupal/system/Entity/Action.php
@@ -91,7 +91,7 @@ class Action extends ConfigEntityBase implements ActionConfigEntityInterface {
public function __construct(array $values, $entity_type) {
parent::__construct($values, $entity_type);
- $this->pluginBag = new ActionBag(\Drupal::service('plugin.manager.action'), array($this->plugin), $this->configuration);
+ $this->pluginBag = new ActionBag(\\Drupal::service('plugin.manager.action'), array($this->plugin), $this->configuration);
}
/**
diff --git a/core/modules/system/lib/Drupal/system/Entity/DateFormat.php b/core/modules/system/lib/Drupal/system/Entity/DateFormat.php
index 7762b88..2d750cf 100644
--- a/core/modules/system/lib/Drupal/system/Entity/DateFormat.php
+++ b/core/modules/system/lib/Drupal/system/Entity/DateFormat.php
@@ -168,7 +168,7 @@ public function isLocked() {
*/
public function preSave(EntityStorageControllerInterface $storage_controller) {
if ($this->hasLocales()) {
- $config_factory = \Drupal::service('config.factory');
+ $config_factory = \\Drupal::service('config.factory');
$properties = $this->getExportProperties();
$languages = language_list();
// Check if the suggested language codes are configured.
@@ -187,12 +187,12 @@ public function preSave(EntityStorageControllerInterface $storage_controller) {
*/
public static function postDelete(EntityStorageControllerInterface $storage_controller, array $entities) {
// Clean up the localized entry if required.
- if (\Drupal::moduleHandler()->moduleExists('language')) {
+ if (\\Drupal::moduleHandler()->moduleExists('language')) {
$languages = language_list();
foreach ($entities as $entity) {
$format_id = $entity->id();
foreach ($languages as $langcode => $data) {
- \Drupal::config("locale.config.$langcode.system.date_format.$format_id")->delete();
+ \\Drupal::config("locale.config.$langcode.system.date_format.$format_id")->delete();
}
}
}
diff --git a/core/modules/system/lib/Drupal/system/Form/DateFormatFormBase.php b/core/modules/system/lib/Drupal/system/Form/DateFormatFormBase.php
index 2205942..9b82e60 100644
--- a/core/modules/system/lib/Drupal/system/Form/DateFormatFormBase.php
+++ b/core/modules/system/lib/Drupal/system/Form/DateFormatFormBase.php
@@ -101,7 +101,7 @@ public function exists($entity_id, array $element, array $form_state) {
public static function dateTimeLookup(array $form, array $form_state) {
$format = '';
if (!empty($form_state['values']['date_format_pattern'])) {
- $format = t('Displayed as %date_format', array('%date_format' => \Drupal::service('date')->format(REQUEST_TIME, 'custom', $form_state['values']['date_format_pattern'])));
+ $format = t('Displayed as %date_format', array('%date_format' => \\Drupal::service('date')->format(REQUEST_TIME, 'custom', $form_state['values']['date_format_pattern'])));
}
// Return a command instead of a string, since the Ajax framework
// automatically prepends an additional empty DIV element for a string, which
diff --git a/core/modules/system/lib/Drupal/system/Form/ModulesListForm.php b/core/modules/system/lib/Drupal/system/Form/ModulesListForm.php
index 6d4daef..85776aa 100644
--- a/core/modules/system/lib/Drupal/system/Form/ModulesListForm.php
+++ b/core/modules/system/lib/Drupal/system/Form/ModulesListForm.php
@@ -222,10 +222,10 @@ protected function buildRow(array $modules, $module, $distribution) {
$status = '';
// Check the core compatibility.
- if ($module->info['core'] != \Drupal::CORE_COMPATIBILITY) {
+ if ($module->info['core'] != \\Drupal::CORE_COMPATIBILITY) {
$compatible = FALSE;
$status .= $this->t('This version is not compatible with Drupal !core_version and should be replaced.', array(
- '!core_version' => \Drupal::CORE_COMPATIBILITY,
+ '!core_version' => \\Drupal::CORE_COMPATIBILITY,
));
}
@@ -259,7 +259,7 @@ protected function buildRow(array $modules, $module, $distribution) {
$name = $modules[$dependency]->info['name'];
// Disable the module's checkbox if it is incompatible with the
// dependency's version.
- if ($incompatible_version = drupal_check_incompatibility($version, str_replace(\Drupal::CORE_COMPATIBILITY . '-', '', $modules[$dependency]->info['version']))) {
+ if ($incompatible_version = drupal_check_incompatibility($version, str_replace(\\Drupal::CORE_COMPATIBILITY . '-', '', $modules[$dependency]->info['version']))) {
$row['#requires'][$dependency] = $this->t('@module (incompatible with version @version)', array(
'@module' => $name . $incompatible_version,
'@version' => $modules[$dependency]->info['version'],
@@ -268,7 +268,7 @@ protected function buildRow(array $modules, $module, $distribution) {
}
// Disable the checkbox if the dependency is incompatible with this
// version of Drupal core.
- elseif ($modules[$dependency]->info['core'] != \Drupal::CORE_COMPATIBILITY) {
+ elseif ($modules[$dependency]->info['core'] != \\Drupal::CORE_COMPATIBILITY) {
$row['#requires'][$dependency] = $this->t('@module (incompatible with this version of Drupal core)', array(
'@module' => $name,
));
diff --git a/core/modules/system/lib/Drupal/system/Plugin/Block/SystemBreadcrumbBlock.php b/core/modules/system/lib/Drupal/system/Plugin/Block/SystemBreadcrumbBlock.php
index ec239a6..00cde01 100644
--- a/core/modules/system/lib/Drupal/system/Plugin/Block/SystemBreadcrumbBlock.php
+++ b/core/modules/system/lib/Drupal/system/Plugin/Block/SystemBreadcrumbBlock.php
@@ -25,8 +25,8 @@ class SystemBreadcrumbBlock extends BlockBase {
* {@inheritdoc}
*/
public function build() {
- $breadcrumb_manager = \Drupal::service('breadcrumb');
- $request = \Drupal::service('request');
+ $breadcrumb_manager = \\Drupal::service('breadcrumb');
+ $request = \\Drupal::service('request');
$breadcrumb = $breadcrumb_manager->build($request->attributes->all());
if (!empty($breadcrumb)) {
// $breadcrumb is expected to be an array of rendered breadcrumb links.
diff --git a/core/modules/system/lib/Drupal/system/Plugin/ImageToolkit/GDToolkit.php b/core/modules/system/lib/Drupal/system/Plugin/ImageToolkit/GDToolkit.php
index 3219edb..5e17b14 100644
--- a/core/modules/system/lib/Drupal/system/Plugin/ImageToolkit/GDToolkit.php
+++ b/core/modules/system/lib/Drupal/system/Plugin/ImageToolkit/GDToolkit.php
@@ -33,7 +33,7 @@ public function settingsForm() {
'#description' => t('Define the image quality for JPEG manipulations. Ranges from 0 to 100. Higher values mean better image quality but bigger files.'),
'#min' => 0,
'#max' => 100,
- '#default_value' => \Drupal::config('system.image.gd')->get('jpeg_quality'),
+ '#default_value' => \\Drupal::config('system.image.gd')->get('jpeg_quality'),
'#field_suffix' => t('%'),
);
return $form;
@@ -43,7 +43,7 @@ public function settingsForm() {
* {@inheritdoc}
*/
public function settingsFormSubmit($form, &$form_state) {
- \Drupal::config('system.image.gd')
+ \\Drupal::config('system.image.gd')
->set('jpeg_quality', $form_state['values']['gd']['image_jpeg_quality'])
->save();
}
@@ -196,7 +196,7 @@ public function save(ImageInterface $image, $destination) {
return FALSE;
}
if ($extension == 'jpeg') {
- $success = $function($image->getResource(), $destination, \Drupal::config('system.image.gd')->get('jpeg_quality'));
+ $success = $function($image->getResource(), $destination, \\Drupal::config('system.image.gd')->get('jpeg_quality'));
}
else {
// Always save PNG images with full transparency.
diff --git a/core/modules/system/lib/Drupal/system/Plugin/ImageToolkitManager.php b/core/modules/system/lib/Drupal/system/Plugin/ImageToolkitManager.php
index 77e90c1..39a9f99 100644
--- a/core/modules/system/lib/Drupal/system/Plugin/ImageToolkitManager.php
+++ b/core/modules/system/lib/Drupal/system/Plugin/ImageToolkitManager.php
@@ -43,7 +43,7 @@ public function __construct(\Traversable $namespaces, CacheBackendInterface $cac
* Object of the default toolkit, or FALSE on error.
*/
public function getDefaultToolkit() {
- $toolkit_id = \Drupal::config('system.image')->get('toolkit');
+ $toolkit_id = \\Drupal::config('system.image')->get('toolkit');
$toolkits = $this->getAvailableToolkits();
if (!isset($toolkits[$toolkit_id]) || !class_exists($toolkits[$toolkit_id]['class'])) {
diff --git a/core/modules/system/lib/Drupal/system/Tests/Ajax/FrameworkTest.php b/core/modules/system/lib/Drupal/system/Tests/Ajax/FrameworkTest.php
index eb570ee..66e5f5b 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Ajax/FrameworkTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Ajax/FrameworkTest.php
@@ -201,7 +201,7 @@ public function testLazyLoadOverriddenCSS() {
// The test theme overrides system.module.css without an implementation,
// thereby removing it.
theme_enable(array('test_theme'));
- \Drupal::config('system.theme')
+ \\Drupal::config('system.theme')
->set('default', 'test_theme')
->save();
diff --git a/core/modules/system/lib/Drupal/system/Tests/Batch/PageTest.php b/core/modules/system/lib/Drupal/system/Tests/Batch/PageTest.php
index f268e02..c734ad5 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Batch/PageTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Batch/PageTest.php
@@ -35,11 +35,11 @@ public static function getInfo() {
function testBatchProgressPageTheme() {
// Make sure that the page which starts the batch (an administrative page)
// is using a different theme than would normally be used by the batch API.
- \Drupal::config('system.theme')
+ \\Drupal::config('system.theme')
->set('default', 'bartik')
->save();
theme_enable(array('seven'));
- \Drupal::config('system.theme')->set('admin', 'seven')->save();
+ \\Drupal::config('system.theme')->set('admin', 'seven')->save();
// Log in as an administrator who can see the administrative theme.
$admin_user = $this->drupalCreateUser(array('view the administration theme'));
$this->drupalLogin($admin_user);
diff --git a/core/modules/system/lib/Drupal/system/Tests/Bootstrap/PageCacheTest.php b/core/modules/system/lib/Drupal/system/Tests/Bootstrap/PageCacheTest.php
index 89d8ff4..f9d03e3 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Bootstrap/PageCacheTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Bootstrap/PageCacheTest.php
@@ -35,7 +35,7 @@ public static function getInfo() {
function setUp() {
parent::setUp();
- \Drupal::config('system.site')
+ \\Drupal::config('system.site')
->set('name', 'Drupal')
->set('page.front', 'test-page')
->save();
@@ -45,12 +45,12 @@ function setUp() {
* Tests support for different cache items with different Accept headers.
*/
function testAcceptHeaderRequests() {
- $config = \Drupal::config('system.performance');
+ $config = \\Drupal::config('system.performance');
$config->set('cache.page.use_internal', 1);
$config->set('cache.page.max_age', 300);
$config->save();
- $url_generator = \Drupal::urlGenerator();
+ $url_generator = \\Drupal::urlGenerator();
$url_generator->setContext(new RequestContext());
$accept_header_cache_uri = $url_generator->getPathFromRoute('system_test.page_cache_accept_header');
$json_accept_header = array('Accept: application/json');
@@ -72,7 +72,7 @@ function testAcceptHeaderRequests() {
* Tests support of requests with If-Modified-Since and If-None-Match headers.
*/
function testConditionalRequests() {
- $config = \Drupal::config('system.performance');
+ $config = \\Drupal::config('system.performance');
$config->set('cache.page.use_internal', 1);
$config->set('cache.page.max_age', 300);
$config->save();
@@ -117,7 +117,7 @@ function testConditionalRequests() {
* Tests cache headers.
*/
function testPageCache() {
- $config = \Drupal::config('system.performance');
+ $config = \\Drupal::config('system.performance');
$config->set('cache.page.use_internal', 1);
$config->set('cache.page.max_age', 300);
$config->set('response.gzip', 1);
@@ -177,7 +177,7 @@ function testPageCache() {
* mod_deflate Apache module.
*/
function testPageCompression() {
- $config = \Drupal::config('system.performance');
+ $config = \\Drupal::config('system.performance');
$config->set('cache.page.use_internal', 1);
$config->set('cache.page.max_age', 300);
$config->set('response.gzip', 1);
@@ -200,7 +200,7 @@ function testPageCompression() {
$this->drupalGet('');
$this->assertEqual($this->drupalGetHeader('X-Drupal-Cache'), 'HIT', 'Page was cached.');
$this->assertFalse($this->drupalGetHeader('Content-Encoding'), 'A Content-Encoding header was not sent.');
- $this->assertTitle(t('Test page | @site-name', array('@site-name' => \Drupal::config('system.site')->get('name'))), 'Site title matches.');
+ $this->assertTitle(t('Test page | @site-name', array('@site-name' => \\Drupal::config('system.site')->get('name'))), 'Site title matches.');
$this->assertRaw('