summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwebchick2013-08-14 16:54:28 (GMT)
committerwebchick2013-08-14 16:54:28 (GMT)
commit3cf100dfcd11b2d3c0250364d1d5dd1ed7875423 (patch)
treecdf357e070da9d65cdc4f98a1475cc4c7c00e730
parent858674f0d1c4205a181686f82202eb03aa01835d (diff)
Issue #1957142 by damiankloip, fubhy, cosmicdreams: Replace config() with Drupal::config().
-rw-r--r--core/includes/ajax.inc4
-rw-r--r--core/includes/authorize.inc8
-rw-r--r--core/includes/bootstrap.inc12
-rw-r--r--core/includes/common.inc8
-rw-r--r--core/includes/config.inc9
-rw-r--r--core/includes/entity.api.php4
-rw-r--r--core/includes/file.inc14
-rw-r--r--core/includes/form.inc2
-rw-r--r--core/includes/install.core.inc8
-rw-r--r--core/includes/install.inc2
-rw-r--r--core/includes/language.inc6
-rw-r--r--core/includes/mail.inc4
-rw-r--r--core/includes/menu.inc8
-rw-r--r--core/includes/module.inc8
-rw-r--r--core/includes/path.inc4
-rw-r--r--core/includes/theme.inc18
-rw-r--r--core/includes/update.inc28
-rw-r--r--core/lib/Drupal.php6
-rw-r--r--core/lib/Drupal/Core/Asset/AssetDumper.php2
-rw-r--r--core/lib/Drupal/Core/Config/Context/ContextInterface.php2
-rw-r--r--core/lib/Drupal/Core/Config/Entity/Query/Query.php2
-rw-r--r--core/lib/Drupal/Core/Controller/ExceptionController.php6
-rw-r--r--core/lib/Drupal/Core/Datetime/DrupalDateTime.php2
-rw-r--r--core/lib/Drupal/Core/EventSubscriber/FinishResponseSubscriber.php2
-rw-r--r--core/lib/Drupal/Core/EventSubscriber/MaintenanceModeSubscriber.php2
-rw-r--r--core/lib/Drupal/Core/Executable/ExecutablePluginBase.php2
-rw-r--r--core/lib/Drupal/Core/Extension/ModuleHandler.php10
-rw-r--r--core/lib/Drupal/Core/Extension/UpdateModuleHandler.php4
-rw-r--r--core/lib/Drupal/Core/StreamWrapper/PrivateStream.php2
-rw-r--r--core/lib/Drupal/Core/SystemListingInfo.php2
-rw-r--r--core/modules/aggregator/aggregator.module4
-rw-r--r--core/modules/aggregator/aggregator.pages.inc6
-rw-r--r--core/modules/aggregator/lib/Drupal/aggregator/Plugin/Core/Entity/Feed.php2
-rw-r--r--core/modules/aggregator/lib/Drupal/aggregator/Plugin/aggregator/processor/DefaultProcessor.php6
-rw-r--r--core/modules/aggregator/lib/Drupal/aggregator/Tests/AggregatorTestBase.php4
-rw-r--r--core/modules/aggregator/lib/Drupal/aggregator/Tests/FeedParserTest.php2
-rw-r--r--core/modules/aggregator/tests/modules/aggregator_test/lib/Drupal/aggregator_test/Plugin/aggregator/processor/TestProcessor.php6
-rw-r--r--core/modules/block/block.module12
-rw-r--r--core/modules/block/custom_block/custom_block.module2
-rw-r--r--core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockFormController.php2
-rw-r--r--core/modules/block/lib/Drupal/block/BlockPluginInterface.php2
-rw-r--r--core/modules/block/lib/Drupal/block/Tests/BlockHiddenRegionTest.php2
-rw-r--r--core/modules/block/lib/Drupal/block/Tests/BlockLanguageTest.php2
-rw-r--r--core/modules/block/lib/Drupal/block/Tests/BlockStorageUnitTest.php2
-rw-r--r--core/modules/block/lib/Drupal/block/Tests/BlockTemplateSuggestionsUnitTest.php2
-rw-r--r--core/modules/block/lib/Drupal/block/Tests/BlockTest.php12
-rw-r--r--core/modules/block/lib/Drupal/block/Tests/BlockTestBase.php4
-rw-r--r--core/modules/block/lib/Drupal/block/Tests/BlockTitleXSSTest.php2
-rw-r--r--core/modules/block/lib/Drupal/block/Tests/NewDefaultThemeBlocksTest.php4
-rw-r--r--core/modules/block/lib/Drupal/block/Tests/Views/DisplayBlockTest.php2
-rw-r--r--core/modules/book/book.install2
-rw-r--r--core/modules/book/book.module8
-rw-r--r--core/modules/book/lib/Drupal/book/Tests/BookTest.php14
-rw-r--r--core/modules/breakpoint/breakpoint.module6
-rw-r--r--core/modules/ckeditor/ckeditor.module2
-rw-r--r--core/modules/color/color.install2
-rw-r--r--core/modules/color/color.module12
-rw-r--r--core/modules/color/lib/Drupal/color/Tests/ColorTest.php10
-rw-r--r--core/modules/comment/comment.module6
-rw-r--r--core/modules/comment/comment.tokens.inc2
-rw-r--r--core/modules/comment/lib/Drupal/comment/CommentFormController.php4
-rw-r--r--core/modules/comment/lib/Drupal/comment/Plugin/views/argument/UserUid.php2
-rw-r--r--core/modules/comment/lib/Drupal/comment/Plugin/views/row/Rss.php2
-rw-r--r--core/modules/comment/lib/Drupal/comment/Tests/CommentLinksTest.php4
-rw-r--r--core/modules/comment/lib/Drupal/comment/Tests/CommentPreviewTest.php2
-rw-r--r--core/modules/config/lib/Drupal/config/Tests/ConfigCRUDTest.php32
-rw-r--r--core/modules/config/lib/Drupal/config/Tests/ConfigFileContentTest.php14
-rw-r--r--core/modules/config/lib/Drupal/config/Tests/ConfigImportUITest.php8
-rw-r--r--core/modules/config/lib/Drupal/config/Tests/ConfigImporterTest.php18
-rw-r--r--core/modules/config/lib/Drupal/config/Tests/ConfigInstallTest.php8
-rw-r--r--core/modules/config/lib/Drupal/config/Tests/ConfigInstallWebTest.php22
-rw-r--r--core/modules/config/lib/Drupal/config/Tests/ConfigLocaleOverride.php42
-rw-r--r--core/modules/config/lib/Drupal/config/Tests/ConfigLocaleOverrideWebTest.php2
-rw-r--r--core/modules/config/lib/Drupal/config/Tests/ConfigOverrideTest.php10
-rw-r--r--core/modules/config/lib/Drupal/config/Tests/ConfigSnapshotTest.php4
-rw-r--r--core/modules/config/lib/Drupal/config/Tests/ConfigUpgradeTest.php8
-rw-r--r--core/modules/config/lib/Drupal/config/Tests/Storage/FileStorageTest.php2
-rw-r--r--core/modules/contact/contact.install8
-rw-r--r--core/modules/contact/contact.module12
-rw-r--r--core/modules/contact/contact.pages.inc4
-rw-r--r--core/modules/contact/lib/Drupal/contact/CategoryFormController.php4
-rw-r--r--core/modules/contact/lib/Drupal/contact/CategoryListController.php2
-rw-r--r--core/modules/contact/lib/Drupal/contact/MessageFormController.php2
-rw-r--r--core/modules/contact/lib/Drupal/contact/Tests/ContactPersonalTest.php8
-rw-r--r--core/modules/contact/lib/Drupal/contact/Tests/ContactSitewideTest.php16
-rw-r--r--core/modules/contact/lib/Drupal/contact/Tests/ContactUpgradePathTest.php2
-rw-r--r--core/modules/content_translation/content_translation.module4
-rw-r--r--core/modules/datetime/lib/Drupal/datetime/DateHelper.php2
-rw-r--r--core/modules/dblog/dblog.module6
-rw-r--r--core/modules/dblog/lib/Drupal/dblog/Tests/DbLogTest.php2
-rw-r--r--core/modules/entity/entity.install4
-rw-r--r--core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceSelectionAccessTest.php2
-rw-r--r--core/modules/field/field.module2
-rw-r--r--core/modules/field/field.multilingual.inc2
-rw-r--r--core/modules/field/lib/Drupal/field/Tests/CrudTest.php2
-rw-r--r--core/modules/field/lib/Drupal/field/Tests/FormTest.php2
-rw-r--r--core/modules/field_sql_storage/field_sql_storage.install2
-rw-r--r--core/modules/field_ui/lib/Drupal/field_ui/FieldOverview.php4
-rw-r--r--core/modules/file/file.field.inc2
-rw-r--r--core/modules/file/file.install2
-rw-r--r--core/modules/file/file.module4
-rw-r--r--core/modules/file/lib/Drupal/file/Tests/RemoteFileSaveUploadTest.php2
-rw-r--r--core/modules/file/lib/Drupal/file/Tests/SaveUploadTest.php4
-rw-r--r--core/modules/filter/filter.install2
-rw-r--r--core/modules/filter/filter.module6
-rw-r--r--core/modules/filter/lib/Drupal/filter/Plugin/Filter/FilterHtml.php2
-rw-r--r--core/modules/filter/lib/Drupal/filter/Tests/FilterAdminTest.php4
-rw-r--r--core/modules/filter/lib/Drupal/filter/Tests/FilterUnitTest.php2
-rw-r--r--core/modules/forum/forum.admin.inc2
-rw-r--r--core/modules/forum/forum.install2
-rw-r--r--core/modules/forum/forum.module16
-rw-r--r--core/modules/forum/forum.pages.inc2
-rw-r--r--core/modules/forum/lib/Drupal/forum/Tests/ForumTest.php8
-rw-r--r--core/modules/image/image.admin.inc2
-rw-r--r--core/modules/image/image.install2
-rw-r--r--core/modules/image/lib/Drupal/image/Tests/ImageStylesPathAndUrlTest.php6
-rw-r--r--core/modules/language/language.admin.inc6
-rw-r--r--core/modules/language/language.module10
-rw-r--r--core/modules/language/language.negotiation.inc18
-rw-r--r--core/modules/language/lib/Drupal/language/Tests/LanguageUILanguageNegotiationTest.php6
-rw-r--r--core/modules/language/lib/Drupal/language/Tests/LanguageUrlRewritingTest.php2
-rw-r--r--core/modules/language/tests/language_test/language_test.module4
-rw-r--r--core/modules/layout/lib/Drupal/layout/Config/DisplayInterface.php2
-rw-r--r--core/modules/locale/lib/Drupal/locale/Form/LocaleSettingsForm.php2
-rw-r--r--core/modules/locale/lib/Drupal/locale/LocaleLookup.php2
-rw-r--r--core/modules/locale/lib/Drupal/locale/PoDatabaseWriter.php2
-rw-r--r--core/modules/locale/lib/Drupal/locale/Tests/LocaleConfigTranslationTest.php4
-rw-r--r--core/modules/locale/lib/Drupal/locale/Tests/LocaleImportFunctionalTest.php2
-rw-r--r--core/modules/locale/lib/Drupal/locale/Tests/LocalePathTest.php2
-rw-r--r--core/modules/locale/lib/Drupal/locale/Tests/LocaleTranslationUiTest.php2
-rw-r--r--core/modules/locale/lib/Drupal/locale/Tests/LocaleUninstallTest.php10
-rw-r--r--core/modules/locale/lib/Drupal/locale/Tests/LocaleUpdateBase.php4
-rw-r--r--core/modules/locale/lib/Drupal/locale/Tests/LocaleUpdateCronTest.php2
-rw-r--r--core/modules/locale/lib/Drupal/locale/Tests/LocaleUpdateTest.php12
-rw-r--r--core/modules/locale/lib/Drupal/locale/TranslationsStream.php2
-rw-r--r--core/modules/locale/locale.bulk.inc6
-rw-r--r--core/modules/locale/locale.compare.inc6
-rw-r--r--core/modules/locale/locale.install10
-rw-r--r--core/modules/locale/locale.module18
-rw-r--r--core/modules/locale/locale.translation.inc6
-rw-r--r--core/modules/menu/lib/Drupal/menu/Tests/MenuTest.php2
-rw-r--r--core/modules/menu/menu.install2
-rw-r--r--core/modules/menu/menu.module6
-rw-r--r--core/modules/node/lib/Drupal/node/NodeFormController.php2
-rw-r--r--core/modules/node/lib/Drupal/node/Plugin/views/row/Rss.php2
-rw-r--r--core/modules/node/lib/Drupal/node/Tests/NodeAccessPagerTest.php2
-rw-r--r--core/modules/node/lib/Drupal/node/Tests/NodeCreationTest.php4
-rw-r--r--core/modules/node/lib/Drupal/node/Tests/NodeFormButtonsTest.php2
-rw-r--r--core/modules/node/node.install8
-rw-r--r--core/modules/node/node.module18
-rw-r--r--core/modules/overlay/overlay.module4
-rw-r--r--core/modules/php/php.module2
-rw-r--r--core/modules/rdf/rdf.install2
-rw-r--r--core/modules/rest/lib/Drupal/rest/Tests/RESTTestBase.php2
-rw-r--r--core/modules/rest/rest.module2
-rw-r--r--core/modules/search/lib/Drupal/search/Plugin/views/filter/Search.php2
-rw-r--r--core/modules/search/lib/Drupal/search/SearchQuery.php8
-rw-r--r--core/modules/search/lib/Drupal/search/Tests/SearchEmbedFormTest.php8
-rw-r--r--core/modules/search/lib/Drupal/search/Tests/SearchKeywordsConditionsTest.php2
-rw-r--r--core/modules/search/lib/Drupal/search/Tests/SearchMatchTest.php2
-rw-r--r--core/modules/search/lib/Drupal/search/Tests/SearchMultilingualEntityTest.php2
-rw-r--r--core/modules/search/lib/Drupal/search/Tests/SearchPageOverrideTest.php2
-rw-r--r--core/modules/search/lib/Drupal/search/Tests/SearchPageTextTest.php2
-rw-r--r--core/modules/search/lib/Drupal/search/Tests/SearchRankingTest.php2
-rw-r--r--core/modules/search/lib/Drupal/search/Tests/SearchTokenizerTest.php4
-rw-r--r--core/modules/search/search.api.php8
-rw-r--r--core/modules/search/search.module14
-rw-r--r--core/modules/search/tests/modules/search_embedded_form/search_embedded_form.module4
-rw-r--r--core/modules/search/tests/modules/search_extra_type/search_extra_type.module4
-rw-r--r--core/modules/shortcut/lib/Drupal/shortcut/Tests/ShortcutLinksTest.php4
-rw-r--r--core/modules/shortcut/shortcut.api.php2
-rw-r--r--core/modules/shortcut/shortcut.install2
-rw-r--r--core/modules/simpletest/lib/Drupal/simpletest/DrupalUnitTestBase.php2
-rw-r--r--core/modules/simpletest/lib/Drupal/simpletest/TestBase.php2
-rw-r--r--core/modules/simpletest/lib/Drupal/simpletest/Tests/DrupalUnitTestBaseTest.php2
-rw-r--r--core/modules/simpletest/lib/Drupal/simpletest/Tests/SimpleTestTest.php2
-rw-r--r--core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php8
-rw-r--r--core/modules/simpletest/simpletest.module4
-rw-r--r--core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsAdminTest.php8
-rw-r--r--core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsLoggingTest.php4
-rw-r--r--core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsTestBase.php2
-rw-r--r--core/modules/statistics/statistics.module4
-rw-r--r--core/modules/statistics/statistics.php2
-rw-r--r--core/modules/syslog/syslog.install2
-rw-r--r--core/modules/syslog/syslog.module6
-rw-r--r--core/modules/system/lib/Drupal/system/Access/CronAccessCheck.php2
-rw-r--r--core/modules/system/lib/Drupal/system/Plugin/Core/Entity/DateFormat.php2
-rw-r--r--core/modules/system/lib/Drupal/system/Plugin/ImageToolkit/GDToolkit.php6
-rw-r--r--core/modules/system/lib/Drupal/system/Plugin/ImageToolkitManager.php2
-rw-r--r--core/modules/system/lib/Drupal/system/Tests/Ajax/FrameworkTest.php2
-rw-r--r--core/modules/system/lib/Drupal/system/Tests/Batch/PageTest.php4
-rw-r--r--core/modules/system/lib/Drupal/system/Tests/Bootstrap/PageCacheTest.php10
-rw-r--r--core/modules/system/lib/Drupal/system/Tests/Common/FormatDateTest.php2
-rw-r--r--core/modules/system/lib/Drupal/system/Tests/Common/JavaScriptTest.php10
-rw-r--r--core/modules/system/lib/Drupal/system/Tests/Common/RenderTest.php2
-rw-r--r--core/modules/system/lib/Drupal/system/Tests/Datetime/DrupalDateTimeTest.php6
-rw-r--r--core/modules/system/lib/Drupal/system/Tests/File/DirectoryTest.php4
-rw-r--r--core/modules/system/lib/Drupal/system/Tests/File/NameMungingTest.php4
-rw-r--r--core/modules/system/lib/Drupal/system/Tests/File/RemoteFileDirectoryTest.php2
-rw-r--r--core/modules/system/lib/Drupal/system/Tests/File/RemoteFileScanDirectoryTest.php2
-rw-r--r--core/modules/system/lib/Drupal/system/Tests/File/RemoteFileUnmanagedCopyTest.php2
-rw-r--r--core/modules/system/lib/Drupal/system/Tests/File/RemoteFileUnmanagedDeleteRecursiveTest.php2
-rw-r--r--core/modules/system/lib/Drupal/system/Tests/File/RemoteFileUnmanagedDeleteTest.php2
-rw-r--r--core/modules/system/lib/Drupal/system/Tests/File/RemoteFileUnmanagedSaveDataTest.php2
-rw-r--r--core/modules/system/lib/Drupal/system/Tests/File/StreamWrapperTest.php2
-rw-r--r--core/modules/system/lib/Drupal/system/Tests/File/UnmanagedCopyTest.php4
-rw-r--r--core/modules/system/lib/Drupal/system/Tests/File/UnmanagedMoveTest.php2
-rw-r--r--core/modules/system/lib/Drupal/system/Tests/File/UnmanagedSaveDataTest.php2
-rw-r--r--core/modules/system/lib/Drupal/system/Tests/Installer/InstallerTranslationTest.php4
-rw-r--r--core/modules/system/lib/Drupal/system/Tests/InstallerTest.php4
-rw-r--r--core/modules/system/lib/Drupal/system/Tests/Mail/MailTest.php2
-rw-r--r--core/modules/system/lib/Drupal/system/Tests/Menu/BreadcrumbTest.php2
-rw-r--r--core/modules/system/lib/Drupal/system/Tests/Menu/LocalTasksTest.php4
-rw-r--r--core/modules/system/lib/Drupal/system/Tests/Menu/MenuRouterTest.php12
-rw-r--r--core/modules/system/lib/Drupal/system/Tests/Menu/TrailTest.php2
-rw-r--r--core/modules/system/lib/Drupal/system/Tests/Module/ModuleEnableTest.php2
-rw-r--r--core/modules/system/lib/Drupal/system/Tests/Module/ModuleTestBase.php2
-rw-r--r--core/modules/system/lib/Drupal/system/Tests/Path/MatchPathTest.php2
-rw-r--r--core/modules/system/lib/Drupal/system/Tests/Path/UrlAlterFunctionalTest.php2
-rw-r--r--core/modules/system/lib/Drupal/system/Tests/Session/SessionTest.php2
-rw-r--r--core/modules/system/lib/Drupal/system/Tests/System/AccessDeniedTest.php2
-rw-r--r--core/modules/system/lib/Drupal/system/Tests/System/CronRunTest.php2
-rw-r--r--core/modules/system/lib/Drupal/system/Tests/System/DateTimeTest.php4
-rw-r--r--core/modules/system/lib/Drupal/system/Tests/System/ErrorHandlerTest.php4
-rw-r--r--core/modules/system/lib/Drupal/system/Tests/System/FrontPageTest.php2
-rw-r--r--core/modules/system/lib/Drupal/system/Tests/System/SiteMaintenanceTest.php4
-rw-r--r--core/modules/system/lib/Drupal/system/Tests/System/SystemConfigFormTestBase.php2
-rw-r--r--core/modules/system/lib/Drupal/system/Tests/System/ThemeTest.php4
-rw-r--r--core/modules/system/lib/Drupal/system/Tests/System/TokenReplaceTest.php10
-rw-r--r--core/modules/system/lib/Drupal/system/Tests/Theme/EntityFilteringThemeTest.php2
-rw-r--r--core/modules/system/lib/Drupal/system/Tests/Theme/FunctionsTest.php2
-rw-r--r--core/modules/system/lib/Drupal/system/Tests/Theme/ThemeInfoStylesTest.php2
-rw-r--r--core/modules/system/lib/Drupal/system/Tests/Theme/ThemeTest.php8
-rw-r--r--core/modules/system/lib/Drupal/system/Tests/Theme/ThemeTestPhpTemplate.php2
-rw-r--r--core/modules/system/lib/Drupal/system/Tests/Theme/ThemeTestTwig.php2
-rw-r--r--core/modules/system/lib/Drupal/system/Tests/Theme/TwigDebugMarkupTest.php2
-rw-r--r--core/modules/system/lib/Drupal/system/Tests/Theme/TwigExtensionTest.php4
-rw-r--r--core/modules/system/lib/Drupal/system/Tests/Theme/TwigSettingsTest.php2
-rw-r--r--core/modules/system/lib/Drupal/system/Tests/Update/UpdateScriptTest.php6
-rw-r--r--core/modules/system/lib/Drupal/system/Tests/Upgrade/BareMinimalUpgradePathTest.php4
-rw-r--r--core/modules/system/lib/Drupal/system/Tests/Upgrade/BlockUpgradePathTest.php4
-rw-r--r--core/modules/system/lib/Drupal/system/Tests/Upgrade/DateUpgradePathTest.php2
-rw-r--r--core/modules/system/lib/Drupal/system/Tests/Upgrade/FieldUpgradePathTest.php8
-rw-r--r--core/modules/system/lib/Drupal/system/Tests/Upgrade/ImageUpgradePathTest.php2
-rw-r--r--core/modules/system/lib/Drupal/system/Tests/Upgrade/MailUpgradePathTest.php2
-rw-r--r--core/modules/system/lib/Drupal/system/Tests/Upgrade/SystemUpgradePathTest.php2
-rw-r--r--core/modules/system/system.admin.inc14
-rw-r--r--core/modules/system/system.api.php8
-rw-r--r--core/modules/system/system.install16
-rw-r--r--core/modules/system/system.module26
-rw-r--r--core/modules/system/system.tokens.inc6
-rw-r--r--core/modules/system/tests/modules/design_test/design_test.module2
-rw-r--r--core/modules/system/tests/modules/form_test/lib/Drupal/form_test/FormTestArgumentsObject.php2
-rw-r--r--core/modules/system/tests/modules/form_test/lib/Drupal/form_test/FormTestControllerObject.php2
-rw-r--r--core/modules/system/tests/modules/form_test/lib/Drupal/form_test/FormTestObject.php2
-rw-r--r--core/modules/system/tests/modules/form_test/lib/Drupal/form_test/FormTestServiceObject.php2
-rw-r--r--core/modules/system/tests/modules/menu_test/menu_test.module6
-rw-r--r--core/modules/system/tests/modules/plugin_test/lib/Drupal/plugin_test/Plugin/plugin_test/mock_block/MockLayoutBlockDeriver.php2
-rw-r--r--core/modules/system/tests/modules/system_mail_failure_test/lib/Drupal/system_mail_failure_test/TestPhpMailFailure.php2
-rw-r--r--core/modules/system/tests/modules/update_script_test/update_script_test.install2
-rw-r--r--core/modules/taxonomy/lib/Drupal/taxonomy/TermFormController.php2
-rw-r--r--core/modules/taxonomy/lib/Drupal/taxonomy/Tests/ThemeTest.php4
-rw-r--r--core/modules/taxonomy/lib/Drupal/taxonomy/Tests/VocabularyTest.php2
-rw-r--r--core/modules/taxonomy/taxonomy.admin.inc2
-rw-r--r--core/modules/taxonomy/taxonomy.install4
-rw-r--r--core/modules/taxonomy/taxonomy.module10
-rw-r--r--core/modules/taxonomy/taxonomy.pages.inc6
-rw-r--r--core/modules/text/text.module2
-rw-r--r--core/modules/tracker/tracker.module2
-rw-r--r--core/modules/translation/translation.module4
-rw-r--r--core/modules/translation/translation.pages.inc2
-rw-r--r--core/modules/update/lib/Drupal/update/Tests/UpdateContribTest.php20
-rw-r--r--core/modules/update/lib/Drupal/update/Tests/UpdateCoreTest.php24
-rw-r--r--core/modules/update/lib/Drupal/update/Tests/UpdateTestBase.php4
-rw-r--r--core/modules/update/lib/Drupal/update/Tests/UpdateUploadTest.php4
-rw-r--r--core/modules/update/tests/modules/update_test/update_test.module6
-rw-r--r--core/modules/update/update.api.php2
-rw-r--r--core/modules/update/update.authorize.inc8
-rw-r--r--core/modules/update/update.compare.inc2
-rw-r--r--core/modules/update/update.fetch.inc8
-rw-r--r--core/modules/update/update.manager.inc4
-rw-r--r--core/modules/update/update.module6
-rw-r--r--core/modules/update/update.report.inc2
-rw-r--r--core/modules/user/lib/Drupal/user/Access/RegisterAccessCheck.php2
-rw-r--r--core/modules/user/lib/Drupal/user/AccountFormController.php2
-rw-r--r--core/modules/user/lib/Drupal/user/Plugin/Block/UserLoginBlock.php2
-rw-r--r--core/modules/user/lib/Drupal/user/Plugin/views/argument/Uid.php2
-rw-r--r--core/modules/user/lib/Drupal/user/Plugin/views/argument_validator/User.php2
-rw-r--r--core/modules/user/lib/Drupal/user/RegisterFormController.php4
-rw-r--r--core/modules/user/lib/Drupal/user/Tests/UserAdminTest.php4
-rw-r--r--core/modules/user/lib/Drupal/user/Tests/UserAutocompleteTest.php2
-rw-r--r--core/modules/user/lib/Drupal/user/Tests/UserCancelTest.php22
-rw-r--r--core/modules/user/lib/Drupal/user/Tests/UserCreateFailMailTest.php2
-rw-r--r--core/modules/user/lib/Drupal/user/Tests/UserCreateTest.php2
-rw-r--r--core/modules/user/lib/Drupal/user/Tests/UserEditTest.php2
-rw-r--r--core/modules/user/lib/Drupal/user/Tests/UserEditedOwnAccountTest.php2
-rw-r--r--core/modules/user/lib/Drupal/user/Tests/UserEntityCallbacksTest.php2
-rw-r--r--core/modules/user/lib/Drupal/user/Tests/UserLoginTest.php6
-rw-r--r--core/modules/user/lib/Drupal/user/Tests/UserPasswordResetTest.php6
-rw-r--r--core/modules/user/lib/Drupal/user/Tests/UserRegistrationTest.php10
-rw-r--r--core/modules/user/lib/Drupal/user/Tests/UserSignatureTest.php2
-rw-r--r--core/modules/user/lib/Drupal/user/Tests/UserTimeZoneTest.php2
-rw-r--r--core/modules/user/lib/Drupal/user/Tests/Views/BulkFormTest.php2
-rw-r--r--core/modules/user/lib/Drupal/user/Tests/Views/HandlerFieldUserNameTest.php2
-rw-r--r--core/modules/user/user.api.php2
-rw-r--r--core/modules/user/user.install8
-rw-r--r--core/modules/user/user.module22
-rw-r--r--core/modules/user/user.pages.inc12
-rw-r--r--core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php2
-rw-r--r--core/modules/views/lib/Drupal/views/Plugin/views/display/Embed.php2
-rw-r--r--core/modules/views/lib/Drupal/views/Plugin/views/field/FieldPluginBase.php2
-rw-r--r--core/modules/views/lib/Drupal/views/Tests/Handler/HandlerTest.php8
-rw-r--r--core/modules/views/lib/Drupal/views/Tests/Plugin/DisplayExtenderTest.php2
-rw-r--r--core/modules/views/lib/Drupal/views/Tests/Plugin/DisplayTest.php6
-rw-r--r--core/modules/views/lib/Drupal/views/Tests/ViewStorageTest.php6
-rw-r--r--core/modules/views/lib/Drupal/views/Tests/Wizard/BasicTest.php2
-rw-r--r--core/modules/views/lib/Drupal/views/Tests/Wizard/ItemsPerPageTest.php2
-rw-r--r--core/modules/views/lib/Drupal/views/ViewExecutable.php6
-rw-r--r--core/modules/views/tests/modules/views_test_data/views_test_data.install2
-rw-r--r--core/modules/views/tests/modules/views_test_data/views_test_data.module4
-rw-r--r--core/modules/views/views.module6
-rw-r--r--core/modules/views/views.theme.inc2
-rw-r--r--core/modules/views_ui/lib/Drupal/views_ui/Tests/DefaultViewsTest.php2
-rw-r--r--core/modules/views_ui/lib/Drupal/views_ui/Tests/DisplayExtenderUITest.php2
-rw-r--r--core/modules/views_ui/lib/Drupal/views_ui/Tests/DisplayTest.php4
-rw-r--r--core/modules/views_ui/lib/Drupal/views_ui/Tests/OverrideDisplaysTest.php4
-rw-r--r--core/modules/views_ui/lib/Drupal/views_ui/ViewEditFormController.php4
-rw-r--r--core/modules/views_ui/lib/Drupal/views_ui/ViewFormControllerBase.php2
-rw-r--r--core/modules/views_ui/lib/Drupal/views_ui/ViewPreviewFormController.php2
-rw-r--r--core/modules/views_ui/lib/Drupal/views_ui/ViewUI.php2
-rw-r--r--core/modules/views_ui/views_ui.theme.inc2
-rw-r--r--core/profiles/minimal/minimal.install2
-rw-r--r--core/profiles/standard/standard.install8
-rw-r--r--core/themes/bartik/bartik.theme4
334 files changed, 823 insertions, 824 deletions
diff --git a/core/includes/ajax.inc b/core/includes/ajax.inc
index 1bced44..ac1d4cb 100644
--- a/core/includes/ajax.inc
+++ b/core/includes/ajax.inc
@@ -332,7 +332,7 @@ function ajax_base_page_theme() {
// to see the default theme, token validation isn't required for that, and
// bypassing it allows most use-cases to work even when accessed from the
// page cache.
- if ($theme === config('system.theme')->get('default') || drupal_valid_token($token, $theme)) {
+ if ($theme === Drupal::config('system.theme')->get('default') || drupal_valid_token($token, $theme)) {
return $theme;
}
}
@@ -368,7 +368,7 @@ function ajax_prepare_response($page_callback_result) {
break;
case MENU_SITE_OFFLINE:
- $commands[] = ajax_command_alert(filter_xss_admin(t(config('system.maintenance')->get('message'), array('@site' => config('system.site')->get('name')))));
+ $commands[] = ajax_command_alert(filter_xss_admin(t(Drupal::config('system.maintenance')->get('message'), array('@site' => Drupal::config('system.site')->get('name')))));
break;
}
}
diff --git a/core/includes/authorize.inc b/core/includes/authorize.inc
index 96d77d6..8b6ef01 100644
--- a/core/includes/authorize.inc
+++ b/core/includes/authorize.inc
@@ -39,7 +39,7 @@ function authorize_filetransfer_form($form, &$form_state) {
if (isset($form_state['values']['connection_settings']['authorize_filetransfer_default'])) {
$authorize_filetransfer_default = $form_state['values']['connection_settings']['authorize_filetransfer_default'];
}
- elseif ($authorize_filetransfer_default = config('system.authorize')->get('filetransfer_default'));
+ elseif ($authorize_filetransfer_default = Drupal::config('system.authorize')->get('filetransfer_default'));
else {
$authorize_filetransfer_default = key($available_backends);
}
@@ -138,7 +138,7 @@ function authorize_filetransfer_form($form, &$form_state) {
* @see hook_filetransfer_backends()
*/
function _authorize_filetransfer_connection_settings($backend) {
- $auth_connection_config = config('system.authorize')->get('filetransfer_connection_settings_' . $backend);
+ $auth_connection_config = Drupal::config('system.authorize')->get('filetransfer_connection_settings_' . $backend);
$defaults = $auth_connection_config ? $auth_connection_config : array();
$form = array();
@@ -253,9 +253,9 @@ function authorize_filetransfer_form_submit($form, &$form_state) {
}
}
// Set this one as the default authorize method.
- config('system.authorize')->set('filetransfer_default', $filetransfer_backend);
+ Drupal::config('system.authorize')->set('filetransfer_default', $filetransfer_backend);
// Save the connection settings minus the password.
- config('system.authorize')->set('filetransfer_connection_settings_' . $filetransfer_backend, $connection_settings);
+ Drupal::config('system.authorize')->set('filetransfer_connection_settings_' . $filetransfer_backend, $connection_settings);
$filetransfer = authorize_get_filetransfer($filetransfer_backend, $form_state['values']['connection_settings'][$filetransfer_backend]);
diff --git a/core/includes/bootstrap.inc b/core/includes/bootstrap.inc
index 086e26c..71425e8 100644
--- a/core/includes/bootstrap.inc
+++ b/core/includes/bootstrap.inc
@@ -1220,7 +1220,7 @@ function drupal_page_header() {
* response is sent.
*/
function drupal_serve_page_from_cache(stdClass $cache, Response $response, Request $request) {
- $config = config('system.performance');
+ $config = Drupal::config('system.performance');
// First half: we must determine if we should be returning a 304.
@@ -1878,7 +1878,7 @@ function drupal_handle_request($test_only = FALSE) {
*/
function drupal_get_user_timezone() {
global $user;
- $config = config('system.date');
+ $config = Drupal::config('system.date');
if ($user && $config->get('timezone.user.configurable') && $user->isAuthenticated() && $user->getTimezone()) {
return $user->getTimezone();
@@ -1975,7 +1975,7 @@ function _drupal_bootstrap_configuration() {
// Load the procedural configuration system helper functions.
require_once __DIR__ . '/config.inc';
- // Set the Drupal custom error handler. (requires config())
+ // Set the Drupal custom error handler. (requires Drupal::config())
set_error_handler('_drupal_error_handler');
set_exception_handler('_drupal_exception_handler');
@@ -2013,7 +2013,7 @@ function _drupal_bootstrap_page_cache() {
}
else {
drupal_bootstrap(DRUPAL_BOOTSTRAP_VARIABLES, FALSE);
- $config = config('system.performance');
+ $config = Drupal::config('system.performance');
$cache_enabled = $config->get('cache.page.use_internal');
}
@@ -2382,7 +2382,7 @@ function language($type) {
* name and its value is its configurability (TRUE/FALSE).
*/
function language_types_get_all() {
- $types = \Drupal::config('system.language.types')->get('all');
+ $types = Drupal::config('system.language.types')->get('all');
return $types ? $types : array_keys(language_types_get_default());
}
@@ -2442,7 +2442,7 @@ function language_list($flags = Language::STATE_CONFIGURABLE) {
// save the same object without data loss.
foreach ($language_entities as $langcode_config_name) {
$langcode = substr($langcode_config_name, strlen('language.entity.'));
- $info = config($langcode_config_name)->get();
+ $info = Drupal::config($langcode_config_name)->get();
$languages[$langcode] = new Language(array(
'default' => ($info['id'] == $default->id),
'name' => $info['label'],
diff --git a/core/includes/common.inc b/core/includes/common.inc
index 1931f0b..90b9412 100644
--- a/core/includes/common.inc
+++ b/core/includes/common.inc
@@ -1860,7 +1860,7 @@ function drupal_pre_render_styles($elements) {
$css_assets = $elements['#items'];
// Aggregate the CSS if necessary, but only during normal site operation.
- if (!defined('MAINTENANCE_MODE') && config('system.performance')->get('css.preprocess')) {
+ if (!defined('MAINTENANCE_MODE') && Drupal::config('system.performance')->get('css.preprocess')) {
$css_assets = \Drupal::service('asset.css.collection_optimizer')->optimize($css_assets);
}
return \Drupal::service('asset.css.collection_renderer')->render($css_assets);
@@ -1883,7 +1883,7 @@ function drupal_clear_css_cache() {
*/
function drupal_delete_file_if_stale($uri) {
// Default stale file threshold is 30 days.
- if (REQUEST_TIME - filemtime($uri) > config('system.performance')->get('stale_file_threshold')) {
+ if (REQUEST_TIME - filemtime($uri) > Drupal::config('system.performance')->get('stale_file_threshold')) {
file_unmanaged_delete($uri);
}
}
@@ -2487,7 +2487,7 @@ function drupal_pre_render_scripts($elements) {
// Aggregate the JavaScript if necessary, but only during normal site
// operation.
- if (!defined('MAINTENANCE_MODE') && config('system.performance')->get('js.preprocess')) {
+ if (!defined('MAINTENANCE_MODE') && Drupal::config('system.performance')->get('js.preprocess')) {
$js_assets = \Drupal::service('asset.js.collection_optimizer')->optimize($js_assets);
}
return \Drupal::service('asset.js.collection_renderer')->render($js_assets);
@@ -3119,7 +3119,7 @@ function _drupal_bootstrap_code() {
}
// Set the allowed protocols once we have the config available.
- $allowed_protocols = \Drupal::config('system.filter')->get('protocols');
+ $allowed_protocols = Drupal::config('system.filter')->get('protocols');
if (!isset($allowed_protocols)) {
// filter_xss_admin() is called by the installer and update.php, in which
// case the configuration may not exist (yet). Provide a minimal default set
diff --git a/core/includes/config.inc b/core/includes/config.inc
index 9e2b6dd..cede3bc 100644
--- a/core/includes/config.inc
+++ b/core/includes/config.inc
@@ -52,7 +52,7 @@ function config_uninstall_default_config($type, $name) {
$storage = drupal_container()->get('config.storage');
$config_names = $storage->listAll($name . '.');
foreach ($config_names as $config_name) {
- config($config_name)->delete();
+ Drupal::config($config_name)->delete();
}
}
@@ -72,8 +72,7 @@ function config_get_storage_names_with_prefix($prefix = '') {
* @code config('book.admin') @endcode will return a configuration object in
* which the book module can store its administrative settings.
*
- * @deprecated This function has been replaced by the \Drupal::config() method.
- * Use that instead.
+ * @deprecated as of Drupal 8.0. Use \Drupal::config() instead.
*
* @param string $name
* The name of the configuration object to retrieve. The name corresponds to
@@ -84,7 +83,7 @@ function config_get_storage_names_with_prefix($prefix = '') {
* A configuration object.
*/
function config($name) {
- return drupal_container()->get('config.factory')->get($name);
+ return Drupal::config($name);
}
/**
@@ -92,7 +91,7 @@ function config($name) {
*
* This allows configuration objects to be created using special configuration
* contexts eg. global override free or locale using a user preferred language.
- * Calling this function affects all subsequent calls to config() until
+ * Calling this function affects all subsequent calls to Drupal::config() until
* config_context_leave() is called.
*
* @see config_context_leave()
diff --git a/core/includes/entity.api.php b/core/includes/entity.api.php
index 8b97b74a..0517568 100644
--- a/core/includes/entity.api.php
+++ b/core/includes/entity.api.php
@@ -108,7 +108,7 @@ function hook_entity_bundle_create($entity_type, $bundle) {
*/
function hook_entity_bundle_rename($entity_type, $bundle_old, $bundle_new) {
// Update the settings associated with the bundle in my_module.settings.
- $config = config('my_module.settings');
+ $config = Drupal::config('my_module.settings');
$bundle_settings = $config->get('bundle_settings');
if (isset($bundle_settings[$entity_type][$bundle_old])) {
$bundle_settings[$entity_type][$bundle_new] = $bundle_settings[$entity_type][$bundle_old];
@@ -129,7 +129,7 @@ function hook_entity_bundle_rename($entity_type, $bundle_old, $bundle_new) {
*/
function hook_entity_bundle_delete($entity_type, $bundle) {
// Remove the settings associated with the bundle in my_module.settings.
- $config = config('my_module.settings');
+ $config = Drupal::config('my_module.settings');
$bundle_settings = $config->get('bundle_settings');
if (isset($bundle_settings[$entity_type][$bundle])) {
unset($bundle_settings[$entity_type][$bundle]);
diff --git a/core/includes/file.inc b/core/includes/file.inc
index ec329e1..9319755 100644
--- a/core/includes/file.inc
+++ b/core/includes/file.inc
@@ -312,7 +312,7 @@ function file_uri_target($uri) {
* 'public', 'private' or any other file scheme defined as the default.
*/
function file_default_scheme() {
- return config('system.file')->get('default_scheme');
+ return Drupal::config('system.file')->get('default_scheme');
}
/**
@@ -514,7 +514,7 @@ function file_prepare_directory(&$directory, $options = FILE_MODIFY_PERMISSIONS)
*/
function file_ensure_htaccess() {
file_save_htaccess('public://', FALSE);
- $private_path = config('system.file')->get('path.private');
+ $private_path = Drupal::config('system.file')->get('path.private');
if (!empty($private_path)) {
file_save_htaccess('private://', TRUE);
}
@@ -801,7 +801,7 @@ function file_munge_filename($filename, $extensions, $alerts = TRUE) {
$original = $filename;
// Allow potentially insecure uploads for very savvy users and admin
- if (!config('system.file')->get('allow_insecure_uploads')) {
+ if (!Drupal::config('system.file')->get('allow_insecure_uploads')) {
// Remove any null bytes. See http://php.net/manual/en/security.filesystem.nullbytes.php
$filename = str_replace(chr(0), '', $filename);
@@ -1271,13 +1271,13 @@ function drupal_chmod($uri, $mode = NULL) {
// that the octal permission numbers can be expressed as integers or strings
// and will be converted correctly in both cases.
if (is_dir($uri)) {
- $mode = octdec(config('system.file')->get('chmod.directory'));
+ $mode = octdec(Drupal::config('system.file')->get('chmod.directory'));
if (!$mode) {
$mode = 0775;
}
}
else {
- $mode = octdec(config('system.file')->get('chmod.file'));
+ $mode = octdec(Drupal::config('system.file')->get('chmod.file'));
if (!$mode) {
$mode = 0664;
}
@@ -1455,7 +1455,7 @@ function drupal_mkdir($uri, $mode = NULL, $recursive = FALSE, $context = NULL) {
$mode = FALSE;
// During early update there's no container.
if (is_object(Drupal::getContainer())) {
- $mode = octdec(config('system.file')->get('chmod.directory'));
+ $mode = octdec(Drupal::config('system.file')->get('chmod.directory'));
}
if (!$mode) {
$mode = 0775;
@@ -1607,7 +1607,7 @@ function drupal_tempnam($directory, $prefix) {
* A string containing the path to the temporary directory.
*/
function file_directory_temp() {
- $config = config('system.file');
+ $config = Drupal::config('system.file');
$temporary_directory = $config->get('path.temporary');
if (empty($temporary_directory)) {
$temporary_directory = file_directory_os_temp();
diff --git a/core/includes/form.inc b/core/includes/form.inc
index d63596e..c793f11 100644
--- a/core/includes/form.inc
+++ b/core/includes/form.inc
@@ -4574,7 +4574,7 @@ function form_process_weight($element) {
$element['#is_weight'] = TRUE;
// If the number of options is small enough, use a select field.
- $max_elements = config('system.site')->get('weight_select_max');
+ $max_elements = Drupal::config('system.site')->get('weight_select_max');
if ($element['#delta'] <= $max_elements) {
$element['#type'] = 'select';
for ($n = (-1 * $element['#delta']); $n <= $element['#delta']; $n++) {
diff --git a/core/includes/install.core.inc b/core/includes/install.core.inc
index 8789366..8e4b66e 100644
--- a/core/includes/install.core.inc
+++ b/core/includes/install.core.inc
@@ -2442,7 +2442,7 @@ function _install_configure_form($form, &$form_state, &$install_state) {
'#type' => 'select',
'#title' => t('Default country'),
'#empty_value' => '',
- '#default_value' => config('system.date')->get('country.default'),
+ '#default_value' => Drupal::config('system.date')->get('country.default'),
'#options' => $countries,
'#description' => t('Select the default country for the site.'),
'#weight' => 0,
@@ -2509,13 +2509,13 @@ function install_configure_form_validate($form, &$form_state) {
function install_configure_form_submit($form, &$form_state) {
global $user;
- config('system.site')
+ Drupal::config('system.site')
->set('name', $form_state['values']['site_name'])
->set('mail', $form_state['values']['site_mail'])
->set('langcode', language_default()->id)
->save();
- config('system.date')
+ Drupal::config('system.date')
->set('timezone.default', $form_state['values']['date_default_timezone'])
->set('country.default', $form_state['values']['site_default_country'])
->save();
@@ -2527,7 +2527,7 @@ function install_configure_form_submit($form, &$form_state) {
// Add the site maintenance account's email address to the list of
// addresses to be notified when updates are available, if selected.
if ($form_state['values']['update_status_module'][2]) {
- config('update.settings')->set('notification.emails', array($form_state['values']['account']['mail']))->save();
+ Drupal::config('update.settings')->set('notification.emails', array($form_state['values']['account']['mail']))->save();
}
}
diff --git a/core/includes/install.inc b/core/includes/install.inc
index 8acddc2..c308a2d 100644
--- a/core/includes/install.inc
+++ b/core/includes/install.inc
@@ -633,7 +633,7 @@ function drupal_install_system() {
// reset first in order to allow config_install_default_config() to invoke
// config import callbacks.
// @todo Installation profiles may override the system.module config object.
- config('system.module')
+ Drupal::config('system.module')
->set('enabled.system', 0)
->save();
diff --git a/core/includes/language.inc b/core/includes/language.inc
index a3ee24d..44e91c1 100644
--- a/core/includes/language.inc
+++ b/core/includes/language.inc
@@ -192,7 +192,7 @@ function language_types_get_configurable() {
*/
function language_types_disable($types) {
$configurable = language_types_get_configurable();
- config('system.language.types')->set('configurable', array_diff($configurable, $types))->save();
+ Drupal::config('system.language.types')->set('configurable', array_diff($configurable, $types))->save();
}
/**
@@ -252,7 +252,7 @@ function language_types_set(array $configurable_language_types) {
}
// Store the language type configuration.
- $config = config('system.language.types');
+ $config = Drupal::config('system.language.types');
$config->set('configurable', array_keys(array_filter($language_types)))->save();
$config->set('all', array_keys($language_types))->save();
@@ -493,7 +493,7 @@ function language_negotiation_method_invoke($method_id, $method = NULL, $request
* A valid language code on success, FALSE otherwise.
*/
function language_from_selected($languages) {
- $langcode = (string) config('language.negotiation')->get('selected_langcode');
+ $langcode = (string) Drupal::config('language.negotiation')->get('selected_langcode');
// Replace the site's default langcode by its real value.
if ($langcode == 'site_default') {
$langcode = language_default()->id;
diff --git a/core/includes/mail.inc b/core/includes/mail.inc
index c9ff601..ce1df77 100644
--- a/core/includes/mail.inc
+++ b/core/includes/mail.inc
@@ -119,7 +119,7 @@ define('MAIL_LINE_ENDINGS', isset($_SERVER['WINDIR']) || strpos($_SERVER['SERVER
* accepted at php-level, which still doesn't guarantee it to be delivered.)
*/
function drupal_mail($module, $key, $to, $langcode, $params = array(), $from = NULL, $send = TRUE) {
- $site_config = config('system.site');
+ $site_config = Drupal::config('system.site');
$site_mail = $site_config->get('mail');
if (empty($site_mail)) {
$site_mail = ini_get('sendmail_from');
@@ -268,7 +268,7 @@ function drupal_mail_system($module, $key) {
$id = $module . '_' . $key;
- $configuration = config('system.mail')->get('interface');
+ $configuration = Drupal::config('system.mail')->get('interface');
// Look for overrides for the default class, starting from the most specific
// id, and falling back to the module name.
diff --git a/core/includes/menu.inc b/core/includes/menu.inc
index f6188cd..915f809 100644
--- a/core/includes/menu.inc
+++ b/core/includes/menu.inc
@@ -1821,7 +1821,7 @@ function menu_list_system_menus() {
* Returns an array of links to be rendered as the Main menu.
*/
function menu_main_menu() {
- $config = config('menu.settings');
+ $config = Drupal::config('menu.settings');
$menu_enabled = module_exists('menu');
// When menu module is not enabled, we need a hardcoded default value.
$main_links_source = $menu_enabled ? $config->get('main_links') : 'main';
@@ -1832,7 +1832,7 @@ function menu_main_menu() {
* Returns an array of links to be rendered as the Secondary links.
*/
function menu_secondary_menu() {
- $config = config('menu.settings');
+ $config = Drupal::config('menu.settings');
$menu_enabled = module_exists('menu');
// When menu module is not enabled, we need a hardcoded default value.
$main_links_source = $menu_enabled ? $config->get('main_links') : 'main';
@@ -2376,7 +2376,7 @@ function menu_set_active_menu_names($menu_names = NULL) {
$active = $menu_names;
}
elseif (!isset($active)) {
- $config = config('system.menu');
+ $config = Drupal::config('system.menu');
$active = $config->get('active_menus_default') ?: array_keys(menu_list_system_menus());
}
return $active;
@@ -3398,7 +3398,7 @@ function _menu_router_save($menu, $masks) {
*/
function _menu_site_is_offline($check_only = FALSE) {
// Check if site is in maintenance mode.
- if (config('system.maintenance')->get('enabled')) {
+ if (Drupal::config('system.maintenance')->get('enabled')) {
if (user_access('access site in maintenance mode')) {
// Ensure that the maintenance mode message is displayed only once
// (allowing for page redirects) and specifically suppress its display on
diff --git a/core/includes/module.inc b/core/includes/module.inc
index cdd3ddd..1a32c09 100644
--- a/core/includes/module.inc
+++ b/core/includes/module.inc
@@ -24,7 +24,7 @@
* @see list_themes()
*
* @todo There are too many layers/levels of caching involved for system_list()
- * data. Consider to add a config($name, $cache = TRUE) argument to allow
+ * data. Consider to add a Drupal::config($name, $cache = TRUE) argument to allow
* callers like system_list() to force-disable a possible configuration
* storage controller cache or some other way to circumvent it/take it over.
*/
@@ -39,7 +39,7 @@ function system_list($type) {
'filepaths' => array(),
);
// Build a list of themes.
- $enabled_themes = (array) config('system.theme')->get('enabled');
+ $enabled_themes = (array) Drupal::config('system.theme')->get('enabled');
// @todo Themes include all themes, including disabled/uninstalled. This
// system.theme.data state will go away entirely as soon as themes have
// a proper installation status.
@@ -324,7 +324,7 @@ function drupal_required_modules() {
*/
function module_set_weight($module, $weight) {
// Update the module weight in the config file that contains it.
- $module_config = config('system.module');
+ $module_config = Drupal::config('system.module');
if ($module_config->get("enabled.$module") !== NULL) {
$module_config
->set("enabled.$module", $weight)
@@ -345,7 +345,7 @@ function module_set_weight($module, $weight) {
$module_handler->setModuleList($module_filenames);
return;
}
- $disabled_config = config('system.module.disabled');
+ $disabled_config = Drupal::config('system.module.disabled');
if ($disabled_config->get($module) !== NULL) {
$disabled_config
->set($module, $weight)
diff --git a/core/includes/path.inc b/core/includes/path.inc
index 9a48f47..ba1da88 100644
--- a/core/includes/path.inc
+++ b/core/includes/path.inc
@@ -22,7 +22,7 @@ function drupal_is_front_page() {
$is_front_page = &$drupal_static_fast['is_front_page'];
if (!isset($is_front_page)) {
- $is_front_page = (current_path() == config('system.site')->get('page.front'));
+ $is_front_page = (current_path() == Drupal::config('system.site')->get('page.front'));
}
return $is_front_page;
@@ -53,7 +53,7 @@ function drupal_match_path($path, $patterns) {
$replacements = array(
'|',
'.*',
- '\1' . preg_quote(config('system.site')->get('page.front'), '/') . '\2'
+ '\1' . preg_quote(Drupal::config('system.site')->get('page.front'), '/') . '\2'
);
$patterns_quoted = preg_quote($patterns, '/');
$regexps[$patterns] = '/^(' . preg_replace($to_replace, $replacements, $patterns_quoted) . ')$/';
diff --git a/core/includes/theme.inc b/core/includes/theme.inc
index 5296b08..d0161ab 100644
--- a/core/includes/theme.inc
+++ b/core/includes/theme.inc
@@ -96,7 +96,7 @@ function drupal_theme_initialize() {
// Only select the user selected theme if it is available in the
// list of themes that can be accessed.
- $theme = !empty($user->theme) && drupal_theme_access($user->theme) ? $user->theme : config('system.theme')->get('default');
+ $theme = !empty($user->theme) && drupal_theme_access($user->theme) ? $user->theme : Drupal::config('system.theme')->get('default');
// Allow modules to override the theme. Validation has already been performed
// inside menu_get_custom_theme(), so we do not need to check it again here.
@@ -1463,8 +1463,8 @@ function theme_settings_convert_to_config(array $theme_settings, Config $config)
*/
function theme_enable($theme_list) {
drupal_clear_css_cache();
- $theme_config = config('system.theme');
- $disabled_themes = config('system.theme.disabled');
+ $theme_config = Drupal::config('system.theme');
+ $disabled_themes = Drupal::config('system.theme.disabled');
foreach ($theme_list as $key) {
// Throw an exception if the theme name is too long.
if (strlen($key) > DRUPAL_EXTENSION_NAME_MAX_LENGTH) {
@@ -1500,7 +1500,7 @@ function theme_enable($theme_list) {
*/
function theme_disable($theme_list) {
// Don't disable the default theme.
- if ($pos = array_search(config('system.theme')->get('default'), $theme_list) !== FALSE) {
+ if ($pos = array_search(Drupal::config('system.theme')->get('default'), $theme_list) !== FALSE) {
unset($theme_list[$pos]);
if (empty($theme_list)) {
return;
@@ -1509,8 +1509,8 @@ function theme_disable($theme_list) {
drupal_clear_css_cache();
- $theme_config = config('system.theme');
- $disabled_themes = config('system.theme.disabled');
+ $theme_config = Drupal::config('system.theme');
+ $disabled_themes = Drupal::config('system.theme.disabled');
foreach ($theme_list as $key) {
// The value is not used; the weight is ignored for themes currently.
$theme_config->clear("enabled.$key");
@@ -2551,7 +2551,7 @@ function template_preprocess_html(&$variables) {
drupal_add_html_head_link(array('rel' => 'shortcut icon', 'href' => drupal_strip_dangerous_protocols($favicon), 'type' => $type));
}
- $site_config = config('system.site');
+ $site_config = Drupal::config('system.site');
// Construct page title.
if (drupal_get_title()) {
$head_title = array(
@@ -2643,7 +2643,7 @@ function template_preprocess_html(&$variables) {
*/
function template_preprocess_page(&$variables) {
$language_interface = language(Language::TYPE_INTERFACE);
- $site_config = config('system.site');
+ $site_config = Drupal::config('system.site');
// Move some variables to the top level for themer convenience and template cleanliness.
$variables['show_messages'] = $variables['page']['#show_messages'];
@@ -2840,7 +2840,7 @@ function template_preprocess_maintenance_page(&$variables) {
$variables['layout'] = ($variables['layout'] == 'first') ? 'both' : 'second';
}
- $site_config = config('system.site');
+ $site_config = Drupal::config('system.site');
$site_name = $site_config->get('name');
$site_slogan = $site_config->get('slogan');
diff --git a/core/includes/update.inc b/core/includes/update.inc
index b106258..5e8ff4e 100644
--- a/core/includes/update.inc
+++ b/core/includes/update.inc
@@ -32,7 +32,7 @@ const REQUIRED_D7_SCHEMA_VERSION = '7069';
*/
function update_fix_compatibility() {
foreach (array('module', 'theme') as $type) {
- $config = config("system.$type");
+ $config = Drupal::config("system.$type");
$save = FALSE;
foreach ($config->get('enabled') as $name => $weight) {
if (update_check_incompatibility($name, $type)) {
@@ -334,10 +334,10 @@ function update_prepare_d8_bootstrap() {
variable_set('language_default', (array) $language_default);
}
- $module_config = config('system.module');
- $disabled_modules = config('system.module.disabled');
- $theme_config = config('system.theme');
- $disabled_themes = config('system.theme.disabled');
+ $module_config = Drupal::config('system.module');
+ $disabled_modules = Drupal::config('system.module.disabled');
+ $theme_config = Drupal::config('system.theme');
+ $disabled_themes = Drupal::config('system.theme.disabled');
$schema_store = Drupal::keyValue('system.schema');
// Load system.module, because update_prepare_d8_bootstrap() is called in
@@ -494,7 +494,7 @@ function update_prepare_d8_language() {
}
Drupal::state()->set('locale.translation.plurals', $plurals);
Drupal::state()->set('locale.translation.javascript', $javascript);
- config('language.negotiation')
+ Drupal::config('language.negotiation')
->set('url.prefixes', $prefixes)
->set('url.domains', $domains)
->save();
@@ -573,7 +573,7 @@ function update_prepare_d8_language() {
$result = db_query('SELECT * FROM {language}');
$uuid = new Uuid();
foreach ($result as $language) {
- config('language.entity.' . $language->langcode)
+ Drupal::config('language.entity.' . $language->langcode)
->set('id', $language->langcode)
->set('uuid', $uuid->generate())
->set('label', $language->name)
@@ -710,7 +710,7 @@ function update_fix_d8_requirements() {
// views configurations.
// Like any other module APIs and services, Views' services are not available
// in update.php. Existing listings are migrated into configuration, using
- // the limited standard tools of raw database queries and config().
+ // the limited standard tools of raw database queries and Drupal::config().
module_enable(array('views'));
update_variable_set('update_d8_requirements', TRUE);
@@ -858,7 +858,7 @@ function update_do_one($module, $number, $dependency_map, &$context) {
function update_batch($start, $redirect = NULL, $url = NULL, $batch = array(), $redirect_callback = NULL) {
// During the update, bring the site offline so that schema changes do not
// affect visiting users.
- $maintenance_mode = config('system.maintenance')->get('enabled');
+ $maintenance_mode = Drupal::config('system.maintenance')->get('enabled');
if (isset($maintenance_mode)) {
$_SESSION['maintenance_mode'] = $maintenance_mode;
}
@@ -867,7 +867,7 @@ function update_batch($start, $redirect = NULL, $url = NULL, $batch = array(), $
// @todo This is borderline state, not config. Or a global system
// "maintenance lock".
if (db_table_exists('config')) {
- config('system.maintenance')->set('enabled', TRUE)->save();
+ Drupal::config('system.maintenance')->set('enabled', TRUE)->save();
}
}
@@ -941,7 +941,7 @@ function update_finished($success, $results, $operations) {
if (isset($_SESSION['maintenance_mode'])) {
$GLOBALS['conf']['system.maintenance']['enabled'] = FALSE;
// At this point, the configuration system should exist.
- config('system.maintenance')->set('enabled', FALSE)->save();
+ Drupal::config('system.maintenance')->set('enabled', FALSE)->save();
unset($_SESSION['maintenance_mode']);
}
}
@@ -1405,7 +1405,7 @@ function update_variables_to_config($config_name, array $variable_map) {
// Build the new configuration object.
// This potentially loads an existing configuration object, in case another
// update function migrated configuration values into $config_name already.
- $config = config($config_name);
+ $config = Drupal::config($config_name);
$original_data = $config->get();
// Extract the module namespace/owner from the configuration object name.
@@ -1435,7 +1435,7 @@ function update_variables_to_config($config_name, array $variable_map) {
// This function migrates variables regardless of their value, including
// NULL values. Any possibly required customizations need to be performed
// manually, either via variable_set() before calling this function or via
- // config() after calling this function.
+ // Drupal::config() after calling this function.
if (isset($variables[$variable_name])) {
$value = unserialize($variables[$variable_name]);
$config->set($config_key, $value);
@@ -1636,7 +1636,7 @@ function update_language_list($flags = Language::STATE_CONFIGURABLE) {
// save the same object without data loss.
foreach ($language_entities as $langcode_config_name) {
$langcode = substr($langcode_config_name, strlen('language.entity.'));
- $info = config($langcode_config_name)->get();
+ $info = Drupal::config($langcode_config_name)->get();
$languages[$langcode] = new Language(array(
'default' => ($info['id'] == $default->id),
'name' => $info['label'],
diff --git a/core/lib/Drupal.php b/core/lib/Drupal.php
index e2996a3..6034a57 100644
--- a/core/lib/Drupal.php
+++ b/core/lib/Drupal.php
@@ -207,12 +207,12 @@ class Drupal {
* Retrieves a configuration object.
*
* This is the main entry point to the configuration API. Calling
- * @code Drupal::config('book.admin') @endcode will return a configuration
+ * @code \Drupal::config('book.admin') @endcode will return a configuration
* object in which the book module can store its administrative settings.
*
* @param string $name
* The name of the configuration object to retrieve. The name corresponds to
- * a configuration file. For @code config('book.admin') @endcode, the config
+ * a configuration file. For @code \Drupal::config('book.admin') @endcode, the config
* object returned will contain the contents of book.admin configuration file.
*
* @return \Drupal\Core\Config\Config
@@ -267,7 +267,7 @@ class Drupal {
* that does not need deploying and does not need human editing; for example,
* the last time cron was run. Data which needs to be edited by humans and
* needs to be the same across development, production, etc. environments
- * (for example, the system maintenance message) should use config() instead.
+ * (for example, the system maintenance message) should use \Drupal::config() instead.
*
* @return \Drupal\Core\KeyValueStore\KeyValueStoreInterface
*/
diff --git a/core/lib/Drupal/Core/Asset/AssetDumper.php b/core/lib/Drupal/Core/Asset/AssetDumper.php
index b21beda..7ff85ed 100644
--- a/core/lib/Drupal/Core/Asset/AssetDumper.php
+++ b/core/lib/Drupal/Core/Asset/AssetDumper.php
@@ -41,7 +41,7 @@ class AssetDumper implements AssetDumperInterface {
// file) in generating the file anyway. Sites on servers where rewrite rules
// aren't working can set css.gzip to FALSE in order to skip
// generating a file that won't be used.
- if (config('system.performance')->get($file_extension . '.gzip') && extension_loaded('zlib')) {
+ if (\Drupal::config('system.performance')->get($file_extension . '.gzip') && extension_loaded('zlib')) {
if (!file_exists($uri . '.gz') && !file_unmanaged_save_data(gzencode($data, 9, FORCE_GZIP), $uri . '.gz', FILE_EXISTS_REPLACE)) {
return FALSE;
}
diff --git a/core/lib/Drupal/Core/Config/Context/ContextInterface.php b/core/lib/Drupal/Core/Config/Context/ContextInterface.php
index 46dbcbb..e7e4904 100644
--- a/core/lib/Drupal/Core/Config/Context/ContextInterface.php
+++ b/core/lib/Drupal/Core/Config/Context/ContextInterface.php
@@ -18,7 +18,7 @@ use Drupal\Core\Config\Config;
*
* @see Drupal\Core\Config\Config
* @see Drupal\Core\Config\ConfigFactory
- * @see config()
+ * @see \Drupal::config()
*/
interface ContextInterface {
diff --git a/core/lib/Drupal/Core/Config/Entity/Query/Query.php b/core/lib/Drupal/Core/Config/Entity/Query/Query.php
index c6320f3..7d1a020 100644
--- a/core/lib/Drupal/Core/Config/Entity/Query/Query.php
+++ b/core/lib/Drupal/Core/Config/Entity/Query/Query.php
@@ -88,7 +88,7 @@ class Query extends QueryBase implements QueryInterface {
$names = $this->configStorage->listAll($prefix);
$configs = array();
foreach ($names as $name) {
- $configs[substr($name, $prefix_length)] = config($name)->get();
+ $configs[substr($name, $prefix_length)] = \Drupal::config($name)->get();
}
$result = $this->condition->compile($configs);
diff --git a/core/lib/Drupal/Core/Controller/ExceptionController.php b/core/lib/Drupal/Core/Controller/ExceptionController.php
index fee1294..8515af0 100644
--- a/core/lib/Drupal/Core/Controller/ExceptionController.php
+++ b/core/lib/Drupal/Core/Controller/ExceptionController.php
@@ -84,7 +84,7 @@ class ExceptionController extends ContainerAware {
$system_path = $request->attributes->get('_system_path');
watchdog('access denied', $system_path, NULL, WATCHDOG_WARNING);
- $path = $this->container->get('path.alias_manager')->getSystemPath(config('system.site')->get('page.403'));
+ $path = $this->container->get('path.alias_manager')->getSystemPath(\Drupal::config('system.site')->get('page.403'));
if ($path && $path != $system_path) {
// Keep old path for reference, and to allow forms to redirect to it.
if (!isset($_GET['destination'])) {
@@ -139,7 +139,7 @@ class ExceptionController extends ContainerAware {
watchdog('page not found', check_plain($request->attributes->get('_system_path')), NULL, WATCHDOG_WARNING);
// Check for and return a fast 404 page if configured.
- $config = config('system.performance');
+ $config = \Drupal::config('system.performance');
$exclude_paths = $config->get('fast_404.exclude_paths');
if ($config->get('fast_404.enabled') && $exclude_paths && !preg_match($exclude_paths, $request->getPathInfo())) {
@@ -158,7 +158,7 @@ class ExceptionController extends ContainerAware {
$_GET['destination'] = $system_path;
}
- $path = $this->container->get('path.alias_manager')->getSystemPath(config('system.site')->get('page.404'));
+ $path = $this->container->get('path.alias_manager')->getSystemPath(\Drupal::config('system.site')->get('page.404'));
if ($path && $path != $system_path) {
// @todo Um, how do I specify an override URL again? Totally not clear. Do
// that and sub-call the kernel rather than using meah().
diff --git a/core/lib/Drupal/Core/Datetime/DrupalDateTime.php b/core/lib/Drupal/Core/Datetime/DrupalDateTime.php
index 18545b4..de6c0f8 100644
--- a/core/lib/Drupal/Core/Datetime/DrupalDateTime.php
+++ b/core/lib/Drupal/Core/Datetime/DrupalDateTime.php
@@ -57,7 +57,7 @@ class DrupalDateTime extends DateTimePlus {
}
if (!isset($settings['country'])) {
- $settings['country'] = config('system.date')->get('country.default');
+ $settings['country'] = \Drupal::config('system.date')->get('country.default');
}
// Instantiate the parent class.
diff --git a/core/lib/Drupal/Core/EventSubscriber/FinishResponseSubscriber.php b/core/lib/Drupal/Core/EventSubscriber/FinishResponseSubscriber.php
index 0c7307e..112644f 100644
--- a/core/lib/Drupal/Core/EventSubscriber/FinishResponseSubscriber.php
+++ b/core/lib/Drupal/Core/EventSubscriber/FinishResponseSubscriber.php
@@ -100,7 +100,7 @@ class FinishResponseSubscriber implements EventSubscriberInterface {
$response->headers->set($name, $value, FALSE);
}
- $max_age = config('system.performance')->get('cache.page.max_age');
+ $max_age = \Drupal::config('system.performance')->get('cache.page.max_age');
if ($max_age > 0 && ($cache = drupal_page_set_cache($response, $request))) {
drupal_serve_page_from_cache($cache, $response, $request);
}
diff --git a/core/lib/Drupal/Core/EventSubscriber/MaintenanceModeSubscriber.php b/core/lib/Drupal/Core/EventSubscriber/MaintenanceModeSubscriber.php
index c4d2f74..39aad11 100644
--- a/core/lib/Drupal/Core/EventSubscriber/MaintenanceModeSubscriber.php
+++ b/core/lib/Drupal/Core/EventSubscriber/MaintenanceModeSubscriber.php
@@ -48,7 +48,7 @@ class MaintenanceModeSubscriber implements EventSubscriberInterface {
$maintenance_page = array(
'#theme' => 'maintenance_page',
'#content' => filter_xss_admin(
- t(config('system.maintenance')->get('message'), array('@site' => config('system.site')->get('name')))
+ t(\Drupal::config('system.maintenance')->get('message'), array('@site' => \Drupal::config('system.site')->get('name')))
),
);
$content = drupal_render($maintenance_page);
diff --git a/core/lib/Drupal/Core/Executable/ExecutablePluginBase.php b/core/lib/Drupal/Core/Executable/ExecutablePluginBase.php
index 4cd50dd..36b11c4 100644
--- a/core/lib/Drupal/Core/Executable/ExecutablePluginBase.php
+++ b/core/lib/Drupal/Core/Executable/ExecutablePluginBase.php
@@ -88,7 +88,7 @@ abstract class ExecutablePluginBase extends ContextAwarePluginBase implements Ex
*
* @todo This doesn't belong here. Move this into a new base class in
* http://drupal.org/node/1764380.
- * @todo This does not set a value in config(), so the name is confusing.
+ * @todo This does not set a value in \Drupal::config(), so the name is confusing.
*
* @return \Drupal\Core\Executable\ExecutablePluginBase.
* The executable object for chaining.
diff --git a/core/lib/Drupal/Core/Extension/ModuleHandler.php b/core/lib/Drupal/Core/Extension/ModuleHandler.php
index a2ffc36..b9e5724 100644
--- a/core/lib/Drupal/Core/Extension/ModuleHandler.php
+++ b/core/lib/Drupal/Core/Extension/ModuleHandler.php
@@ -555,8 +555,8 @@ class ModuleHandler implements ModuleHandlerInterface {
$modules_installed = array();
$modules_enabled = array();
- $module_config = config('system.module');
- $disabled_config = config('system.module.disabled');
+ $module_config = \Drupal::config('system.module');
+ $disabled_config = \Drupal::config('system.module.disabled');
foreach ($module_list as $module) {
// Only process modules that are not already enabled.
// A module is only enabled if it is configured as enabled. Custom or
@@ -720,8 +720,8 @@ class ModuleHandler implements ModuleHandlerInterface {
$invoke_modules = array();
- $module_config = config('system.module');
- $disabled_config = config('system.module.disabled');
+ $module_config = \Drupal::config('system.module');
+ $disabled_config = \Drupal::config('system.module.disabled');
foreach ($module_list as $module) {
// Only process modules that are enabled.
// A module is only enabled if it is configured as enabled. Custom or
@@ -811,7 +811,7 @@ class ModuleHandler implements ModuleHandlerInterface {
}
$schema_store = \Drupal::keyValue('system.schema');
- $disabled_config = config('system.module.disabled');
+ $disabled_config = \Drupal::config('system.module.disabled');
foreach ($module_list as $module) {
// Uninstall the module.
module_load_install($module);
diff --git a/core/lib/Drupal/Core/Extension/UpdateModuleHandler.php b/core/lib/Drupal/Core/Extension/UpdateModuleHandler.php
index 0e5a57b..78553d9 100644
--- a/core/lib/Drupal/Core/Extension/UpdateModuleHandler.php
+++ b/core/lib/Drupal/Core/Extension/UpdateModuleHandler.php
@@ -75,13 +75,13 @@ class UpdateModuleHandler extends ModuleHandler {
}
}
// Enable the module with a weight of 0.
- $module_config = config('system.module');
+ $module_config = \Drupal::config('system.module');
$module_config
->set("enabled.$module", 0)
->set('enabled', module_config_sort($module_config->get('enabled')))
->save();
// Ensure the module is not contained in disabled modules.
- config('system.module.disabled')
+ \Drupal::config('system.module.disabled')
->clear($module)
->save();
diff --git a/core/lib/Drupal/Core/StreamWrapper/PrivateStream.php b/core/lib/Drupal/Core/StreamWrapper/PrivateStream.php
index 833580f..39b3f28 100644
--- a/core/lib/Drupal/Core/StreamWrapper/PrivateStream.php
+++ b/core/lib/Drupal/Core/StreamWrapper/PrivateStream.php
@@ -19,7 +19,7 @@ class PrivateStream extends LocalStream {
* Implements Drupal\Core\StreamWrapper\LocalStream::getDirectoryPath()
*/
public function getDirectoryPath() {
- return config('system.file')->get('path.private');
+ return \Drupal::config('system.file')->get('path.private');
}
/**
diff --git a/core/lib/Drupal/Core/SystemListingInfo.php b/core/lib/Drupal/Core/SystemListingInfo.php
index 989b0f2..3c34a5e 100644
--- a/core/lib/Drupal/Core/SystemListingInfo.php
+++ b/core/lib/Drupal/Core/SystemListingInfo.php
@@ -29,7 +29,7 @@ class SystemListingInfo extends SystemListing {
// distribution we need to include the profile of the parent site (in
// which test runs are triggered).
if (drupal_valid_test_ua() && !drupal_installation_attempted()) {
- $testing_profile = config('simpletest.settings')->get('parent_profile');
+ $testing_profile = \Drupal::config('simpletest.settings')->get('parent_profile');
if ($testing_profile && $testing_profile != $profile) {
$searchdir[] = drupal_get_path('profile', $testing_profile) . '/' . $directory;
}
diff --git a/core/modules/aggregator/aggregator.module b/core/modules/aggregator/aggregator.module
index 416571d..b52abd8 100644
--- a/core/modules/aggregator/aggregator.module
+++ b/core/modules/aggregator/aggregator.module
@@ -360,7 +360,7 @@ function aggregator_refresh(Feed $feed) {
// Store feed URL to track changes.
$feed_url = $feed->url->value;
- $config = config('aggregator.settings');
+ $config = Drupal::config('aggregator.settings');
// Fetch the feed.
$fetcher_manager = Drupal::service('plugin.manager.aggregator.fetcher');
try {
@@ -492,7 +492,7 @@ function theme_aggregator_block_item($variables) {
* The filtered content.
*/
function aggregator_filter_xss($value) {
- return filter_xss($value, preg_split('/\s+|<|>/', config('aggregator.settings')->get('items.allowed_html'), -1, PREG_SPLIT_NO_EMPTY));
+ return filter_xss($value, preg_split('/\s+|<|>/', Drupal::config('aggregator.settings')->get('items.allowed_html'), -1, PREG_SPLIT_NO_EMPTY));
}
/**
diff --git a/core/modules/aggregator/aggregator.pages.inc b/core/modules/aggregator/aggregator.pages.inc
index 0fa2bd8..6579703 100644
--- a/core/modules/aggregator/aggregator.pages.inc
+++ b/core/modules/aggregator/aggregator.pages.inc
@@ -59,7 +59,7 @@ function aggregator_page_source_form($form, $form_state, $feed) {
* @ingroup forms
*/
function aggregator_page_category($category) {
- drupal_add_feed('aggregator/rss/' . $category->cid, config('system.site')->get('name') . ' ' . t('aggregator - @title', array('@title' => $category->title)));
+ drupal_add_feed('aggregator/rss/' . $category->cid, Drupal::config('system.site')->get('name') . ' ' . t('aggregator - @title', array('@title' => $category->title)));
// It is safe to include the cid in the query because it's loaded from the
// database by aggregator_category_load().
@@ -206,7 +206,7 @@ function aggregator_categorize_items($items, $feed_source = '') {
$done = TRUE;
$form['items'][$iid]['item'] = $form_items[$iid];
$form['items'][$iid]['categories'] = array(
- '#type' => config('aggregator.settings')->get('source.category_selector'),
+ '#type' => Drupal::config('aggregator.settings')->get('source.category_selector'),
'#default_value' => $selected,
'#options' => $categories,
'#size' => 10,
@@ -349,7 +349,7 @@ function theme_aggregator_page_opml($variables) {
$output = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
$output .= "<opml version=\"1.1\">\n";
$output .= "<head>\n";
- $output .= '<title>' . check_plain(config('system.site')->get('name')) . "</title>\n";
+ $output .= '<title>' . check_plain(Drupal::config('system.site')->get('name')) . "</title>\n";
$output .= '<dateModified>' . gmdate(DATE_RFC2822, REQUEST_TIME) . "</dateModified>\n";
$output .= "</head>\n";
$output .= "<body>\n";
diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Plugin/Core/Entity/Feed.php b/core/modules/aggregator/lib/Drupal/aggregator/Plugin/Core/Entity/Feed.php
index 73c015d..bf2ecc3 100644
--- a/core/modules/aggregator/lib/Drupal/aggregator/Plugin/Core/Entity/Feed.php
+++ b/core/modules/aggregator/lib/Drupal/aggregator/Plugin/Core/Entity/Feed.php
@@ -230,7 +230,7 @@ class Feed extends EntityNG implements FeedInterface {
// Make sure there is no active block for this feed.
$block_configs = config_get_storage_names_with_prefix('plugin.core.block');
foreach ($block_configs as $config_id) {
- $config = config($config_id);
+ $config = \Drupal::config($config_id);
if ($config->get('id') == 'aggregator_feed_block:' . $entity->id()) {
$config->delete();
}
diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Plugin/aggregator/processor/DefaultProcessor.php b/core/modules/aggregator/lib/Drupal/aggregator/Plugin/aggregator/processor/DefaultProcessor.php
index 8373fa9..9085fc1 100644
--- a/core/modules/aggregator/lib/Drupal/aggregator/Plugin/aggregator/processor/DefaultProcessor.php
+++ b/core/modules/aggregator/lib/Drupal/aggregator/Plugin/aggregator/processor/DefaultProcessor.php
@@ -31,7 +31,7 @@ class DefaultProcessor extends PluginBase implements ProcessorInterface {
* Implements \Drupal\aggregator\Plugin\ProcessorInterface::settingsForm().
*/
public function settingsForm(array $form, array &$form_state) {
- $config = config('aggregator.settings');
+ $config = \Drupal::config('aggregator.settings');
$processors = $config->get('processors');
$info = $this->getPluginDefinition();
$items = drupal_map_assoc(array(3, 5, 10, 15, 20, 25), array($this, 'formatItems'));
@@ -87,7 +87,7 @@ class DefaultProcessor extends PluginBase implements ProcessorInterface {
* Implements \Drupal\aggregator\Plugin\ProcessorInterface::settingsSubmit().
*/
public function settingsSubmit(array $form, array &$form_state) {
- $config = config('aggregator.settings');
+ $config = \Drupal::config('aggregator.settings');
$config->set('items.expire', $form_state['values']['aggregator_clear'])
->set('items.teaser_length', $form_state['values']['aggregator_teaser_length'])
->set('source.list_max', $form_state['values']['aggregator_summary_items'])
@@ -164,7 +164,7 @@ class DefaultProcessor extends PluginBase implements ProcessorInterface {
* Expires items from a feed depending on expiration settings.
*/
public function postProcess(Feed $feed) {
- $aggregator_clear = config('aggregator.settings')->get('items.expire');
+ $aggregator_clear = \Drupal::config('aggregator.settings')->get('items.expire');
if ($aggregator_clear != AGGREGATOR_CLEAR_NEVER) {
// Remove all items that are older than flush item timer.
diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Tests/AggregatorTestBase.php b/core/modules/aggregator/lib/Drupal/aggregator/Tests/AggregatorTestBase.php
index 6450975..ae2d198 100644
--- a/core/modules/aggregator/lib/Drupal/aggregator/Tests/AggregatorTestBase.php
+++ b/core/modules/aggregator/lib/Drupal/aggregator/Tests/AggregatorTestBase.php
@@ -137,7 +137,7 @@ abstract class AggregatorTestBase extends WebTestBase {
*/
function getDefaultFeedItemCount() {
// Our tests are based off of rss.xml, so let's find out how many elements should be related.
- $feed_count = db_query_range('SELECT COUNT(DISTINCT nid) FROM {node_field_data} n WHERE n.promote = 1 AND n.status = 1', 0, config('system.rss')->get('items.limit'))->fetchField();
+ $feed_count = db_query_range('SELECT COUNT(DISTINCT nid) FROM {node_field_data} n WHERE n.promote = 1 AND n.status = 1', 0, \Drupal::config('system.rss')->get('items.limit'))->fetchField();
return $feed_count > 10 ? 10 : $feed_count;
}
@@ -370,7 +370,7 @@ EOF;
* Enable the plugins coming with aggregator_test module.
*/
function enableTestPlugins() {
- config('aggregator.settings')
+ \Drupal::config('aggregator.settings')
->set('fetcher', 'aggregator_test_fetcher')
->set('parser', 'aggregator_test_parser')
->set('processors', array(
diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Tests/FeedParserTest.php b/core/modules/aggregator/lib/Drupal/aggregator/Tests/FeedParserTest.php
index bdbe11f..0b36708 100644
--- a/core/modules/aggregator/lib/Drupal/aggregator/Tests/FeedParserTest.php
+++ b/core/modules/aggregator/lib/Drupal/aggregator/Tests/FeedParserTest.php
@@ -26,7 +26,7 @@ class FeedParserTest extends AggregatorTestBase {
// Do not remove old aggregator items during these tests, since our sample
// feeds have hardcoded dates in them (which may be expired when this test
// is run).
- config('aggregator.settings')->set('items.expire', AGGREGATOR_CLEAR_NEVER)->save();
+ \Drupal::config('aggregator.settings')->set('items.expire', AGGREGATOR_CLEAR_NEVER)->save();
// Reset any reader cache between tests.
Reader::reset();
// Set our bridge extension manager to Zend Feed.
diff --git a/core/modules/aggregator/tests/modules/aggregator_test/lib/Drupal/aggregator_test/Plugin/aggregator/processor/TestProcessor.php b/core/modules/aggregator/tests/modules/aggregator_test/lib/Drupal/aggregator_test/Plugin/aggregator/processor/TestProcessor.php
index d08a272..85738b8 100644
--- a/core/modules/aggregator/tests/modules/aggregator_test/lib/Drupal/aggregator_test/Plugin/aggregator/processor/TestProcessor.php
+++ b/core/modules/aggregator/tests/modules/aggregator_test/lib/Drupal/aggregator_test/Plugin/aggregator/processor/TestProcessor.php
@@ -30,7 +30,7 @@ class TestProcessor extends PluginBase implements ProcessorInterface {
* Implements \Drupal\aggregator\Plugin\ProcessorInterface::settingsForm().
*/
public function settingsForm(array $form, array &$form_state) {
- $config = config('aggregator.settings');
+ $config = \Drupal::config('aggregator.settings');
$processors = $config->get('processors');
$info = $this->getPluginDefinition();
@@ -46,7 +46,7 @@ class TestProcessor extends PluginBase implements ProcessorInterface {
'#type' => 'number',
'#min' => 1,
'#max' => 1000,
- '#default_value' => config('aggregator_test.settings')->get('items.dummy_length'),
+ '#default_value' => \Drupal::config('aggregator_test.settings')->get('items.dummy_length'),
);
return $form;
}
@@ -55,7 +55,7 @@ class TestProcessor extends PluginBase implements ProcessorInterface {
* Implements \Drupal\aggregator\Plugin\ProcessorInterface::settingsSubmit().
*/
public function settingsSubmit(array $form, array &$form_state) {
- config('aggregator_test.settings')
+ \Drupal::config('aggregator_test.settings')
->set('items.dummy_length', $form_state['values']['dummy_length'])
->save();
}
diff --git a/core/modules/block/block.module b/core/modules/block/block.module
index b78729f..db3a82a 100644
--- a/core/modules/block/block.module
+++ b/core/modules/block/block.module
@@ -61,7 +61,7 @@ function block_help($path, $arg) {
$output .= '<dd>' . t('Blocks can be configured to be visible only on certain pages, only to users of certain roles, or only on pages displaying certain <a href="@content-type">content types</a>. Some dynamic blocks, such as those generated by modules, will be displayed only on certain pages.', array('@content-type' => url('admin/structure/types'), '@user' => url('user'))) . '</dd>';
if (module_exists('custom_block')) {
$output .= '<dt>' . t('Creating custom blocks') . '</dt>';
- $output .= '<dd>' . t('Users with the <em>Administer blocks</em> permission can <a href="@block-add">add custom blocks</a>, which are then listed on the <a href="@blocks">Blocks administration page</a>. Once created, custom blocks behave just like default and module-generated blocks.', array('@blocks' => url('admin/structure/block'), '@block-add' => url('admin/structure/block/list/' . config('system.theme')->get('default') . '/add/custom_blocks'))) . '</dd>';
+ $output .= '<dd>' . t('Users with the <em>Administer blocks</em> permission can <a href="@block-add">add custom blocks</a>, which are then listed on the <a href="@blocks">Blocks administration page</a>. Once created, custom blocks behave just like default and module-generated blocks.', array('@blocks' => url('admin/structure/block'), '@block-add' => url('admin/structure/block/list/' . Drupal::config('system.theme')->get('default') . '/add/custom_blocks'))) . '</dd>';
}
$output .= '</dl>';
return $output;
@@ -71,7 +71,7 @@ function block_help($path, $arg) {
$demo_theme = $arg[4];
}
else {
- $demo_theme = config('system.theme')->get('default');
+ $demo_theme = Drupal::config('system.theme')->get('default');
}
$themes = list_themes();
$output = '<p>' . t('This page provides a drag-and-drop interface for assigning a block to a region, and for controlling the order of blocks within regions. Since not all themes implement the same regions, or display regions in the same way, blocks are positioned on a per-theme basis. Remember that your changes will not be saved until you click the <em>Save blocks</em> button at the bottom of the page. Click the <em>configure</em> link next to each block to configure its specific title and visibility settings.') . '</p>';
@@ -109,7 +109,7 @@ function block_permission() {
* @todo Clarify the documentation for the per-plugin block admin links.
*/
function block_menu() {
- $default_theme = config('system.theme')->get('default');
+ $default_theme = Drupal::config('system.theme')->get('default');
$items['admin/structure/block'] = array(
'title' => 'Blocks',
'description' => 'Configure what block content appears in your site\'s sidebars and other regions.',
@@ -248,7 +248,7 @@ function block_page_build(&$page) {
$page['page_top']['backlink'] = array(
'#type' => 'link',
'#title' => t('Exit block region demonstration'),
- '#href' => 'admin/structure/block' . (config('system.theme')->get('default') == $theme ? '' : '/list/' . $theme),
+ '#href' => 'admin/structure/block' . (Drupal::config('system.theme')->get('default') == $theme ? '' : '/list/' . $theme),
// Add the "overlay-restore" class to indicate this link should restore
// the context in which the region demonstration page was opened.
'#options' => array('attributes' => array('class' => array('block-demo-backlink', 'overlay-restore'))),
@@ -348,7 +348,7 @@ function _block_get_renderable_region($list = array()) {
* Blocks currently exported by modules.
*/
function _block_rehash($theme = NULL) {
- $theme = $theme ? $theme : config('system.theme')->get('default');
+ $theme = $theme ? $theme : Drupal::config('system.theme')->get('default');
$regions = system_region_list($theme);
$blocks = entity_load_multiple_by_properties('block', array('theme' => $theme));
foreach ($blocks as $block_id => $block) {
@@ -397,7 +397,7 @@ function block_theme_initialize($theme) {
// Initialize theme's blocks if none already registered.
$has_blocks = entity_load_multiple_by_properties('block', array('theme' => $theme));
if (!$has_blocks) {
- $default_theme = config('system.theme')->get('default');
+ $default_theme = Drupal::config('system.theme')->get('default');
// Apply only to new theme's visible regions.
$regions = system_region_list($theme, REGIONS_VISIBLE);
$default_theme_blocks = entity_load_multiple_by_properties('block', array('theme' => $default_theme));
diff --git a/core/modules/block/custom_block/custom_block.module b/core/modules/block/custom_block/custom_block.module
index 318796d..e7d96f4 100644
--- a/core/modules/block/custom_block/custom_block.module
+++ b/core/modules/block/custom_block/custom_block.module
@@ -188,7 +188,7 @@ function custom_block_entity_info_alter(&$types) {
function custom_block_entity_bundle_info() {
$bundles = array();
foreach (config_get_storage_names_with_prefix('custom_block.type.') as $config_name) {
- $config = config($config_name);
+ $config = Drupal::config($config_name);
$bundles['custom_block'][$config->get('id')]['label'] = $config->get('label');
}
return $bundles;
diff --git a/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockFormController.php b/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockFormController.php
index 20d748d..eb58dd6 100644
--- a/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockFormController.php
+++ b/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockFormController.php
@@ -187,7 +187,7 @@ class CustomBlockFormController extends EntityFormControllerNG {
$form_state['redirect'] = 'admin/structure/block/add/custom_block:' . $block->uuid->value . '/' . $theme;
}
else {
- $form_state['redirect'] = 'admin/structure/block/add/custom_block:' . $block->uuid->value . '/' . config('system.theme')->get('default');
+ $form_state['redirect'] = 'admin/structure/block/add/custom_block:' . $block->uuid->value . '/' . \Drupal::config('system.theme')->get('default');
}
}
else {
diff --git a/core/modules/block/lib/Drupal/block/BlockPluginInterface.php b/core/modules/block/lib/Drupal/block/BlockPluginInterface.php
index 5f353a4..d94d934 100644
--- a/core/modules/block/lib/Drupal/block/BlockPluginInterface.php
+++ b/core/modules/block/lib/Drupal/block/BlockPluginInterface.php
@@ -66,7 +66,7 @@ interface BlockPluginInterface extends ConfigurablePluginInterface, PluginFormIn
*
* @todo This doesn't belong here. Move this into a new base class in
* http://drupal.org/node/1764380.
- * @todo This does not set a value in config(), so the name is confusing.
+ * @todo This does not set a value in \Drupal::config(), so the name is confusing.
*
* @see \Drupal\Component\Plugin\PluginBase::$configuration
*/
diff --git a/core/modules/block/lib/Drupal/block/Tests/BlockHiddenRegionTest.php b/core/modules/block/lib/Drupal/block/Tests/BlockHiddenRegionTest.php
index 710c53f..208710e 100644
--- a/core/modules/block/lib/Drupal/block/Tests/BlockHiddenRegionTest.php
+++ b/core/modules/block/lib/Drupal/block/Tests/BlockHiddenRegionTest.php
@@ -61,7 +61,7 @@ class BlockHiddenRegionTest extends WebTestBase {
// Enable "block_test_theme" and set it as the default theme.
$theme = 'block_test_theme';
theme_enable(array($theme));
- config('system.theme')
+ \Drupal::config('system.theme')
->set('default', $theme)
->save();
\Drupal::service('router.builder')->rebuild();
diff --git a/core/modules/block/lib/Drupal/block/Tests/BlockLanguageTest.php b/core/modules/block/lib/Drupal/block/Tests/BlockLanguageTest.php
index 69d5ccd..a078821 100644
--- a/core/modules/block/lib/Drupal/block/Tests/BlockLanguageTest.php
+++ b/core/modules/block/lib/Drupal/block/Tests/BlockLanguageTest.php
@@ -54,7 +54,7 @@ class BlockLanguageTest extends WebTestBase {
*/
public function testLanguageBlockVisibility() {
// Check if the visibility setting is available.
- $default_theme = config('system.theme')->get('default');
+ $default_theme = \Drupal::config('system.theme')->get('default');
$this->drupalGet('admin/structure/block/add/system_powered_by_block' . '/' . $default_theme);
$this->assertField('visibility[language][langcodes][en]', 'Language visibility field is visible.');
diff --git a/core/modules/block/lib/Drupal/block/Tests/BlockStorageUnitTest.php b/core/modules/block/lib/Drupal/block/Tests/BlockStorageUnitTest.php
index 41b5f4d..d787a3d 100644
--- a/core/modules/block/lib/Drupal/block/Tests/BlockStorageUnitTest.php
+++ b/core/modules/block/lib/Drupal/block/Tests/BlockStorageUnitTest.php
@@ -88,7 +88,7 @@ class BlockStorageUnitTest extends DrupalUnitTestBase {
$this->assertTrue($entity instanceof Block, 'The newly created entity is a Block.');
// Verify all of the block properties.
- $actual_properties = config('block.block.stark.test_block')->get();
+ $actual_properties = \Drupal::config('block.block.stark.test_block')->get();
$this->assertTrue(!empty($actual_properties['uuid']), 'The block UUID is set.');
unset($actual_properties['uuid']);
diff --git a/core/modules/block/lib/Drupal/block/Tests/BlockTemplateSuggestionsUnitTest.php b/core/modules/block/lib/Drupal/block/Tests/BlockTemplateSuggestionsUnitTest.php
index 3042b5b..9c2966f 100644
--- a/core/modules/block/lib/Drupal/block/Tests/BlockTemplateSuggestionsUnitTest.php
+++ b/core/modules/block/lib/Drupal/block/Tests/BlockTemplateSuggestionsUnitTest.php
@@ -40,7 +40,7 @@ class BlockTemplateSuggestionsUnitTest extends WebTestBase {
$block = entity_create('block', array(
'plugin' => 'system_menu_block:menu-admin',
'region' => 'footer',
- 'id' => config('system.theme')->get('default') . '.machinename',
+ 'id' => \Drupal::config('system.theme')->get('default') . '.machinename',
));
$variables = array();
diff --git a/core/modules/block/lib/Drupal/block/Tests/BlockTest.php b/core/modules/block/lib/Drupal/block/Tests/BlockTest.php
index c766053..9ed99f1 100644
--- a/core/modules/block/lib/Drupal/block/Tests/BlockTest.php
+++ b/core/modules/block/lib/Drupal/block/Tests/BlockTest.php
@@ -30,7 +30,7 @@ class BlockTest extends BlockTestBase {
// Create a random title for the block.
$title = $this->randomName(8);
// Enable a standard block.
- $default_theme = config('system.theme')->get('default');
+ $default_theme = \Drupal::config('system.theme')->get('default');
$edit = array(
'machine_name' => strtolower($this->randomName(8)),
'region' => 'sidebar_first',
@@ -71,7 +71,7 @@ class BlockTest extends BlockTestBase {
// Create a random title for the block.
$title = $this->randomName(8);
// Enable a standard block.
- $default_theme = config('system.theme')->get('default');
+ $default_theme = \Drupal::config('system.theme')->get('default');
$edit = array(
'machine_name' => strtolower($this->randomName(8)),
'region' => 'sidebar_first',
@@ -104,7 +104,7 @@ class BlockTest extends BlockTestBase {
$block['id'] = 'system_powered_by_block';
$block['settings[label]'] = $this->randomName(8);
$block['machine_name'] = strtolower($this->randomName(8));
- $block['theme'] = config('system.theme')->get('default');
+ $block['theme'] = \Drupal::config('system.theme')->get('default');
$block['region'] = 'header';
// Set block title to confirm that interface works and override any custom titles.
@@ -182,7 +182,7 @@ class BlockTest extends BlockTestBase {
*/
function moveBlockToRegion(array $block, $region) {
// Set the created block to a specific region.
- $block += array('theme' => config('system.theme')->get('default'));
+ $block += array('theme' => \Drupal::config('system.theme')->get('default'));
$edit = array();
$edit['blocks[' . $block['theme'] . '.' . $block['machine_name'] . '][region]'] = $region;
$this->drupalPost('admin/structure/block', $edit, t('Save blocks'));
@@ -216,7 +216,7 @@ class BlockTest extends BlockTestBase {
$block = array();
$block['id'] = 'test_cache';
$block['machine_name'] = strtolower($this->randomName(8));
- $block['theme'] = config('system.theme')->get('default');
+ $block['theme'] = \Drupal::config('system.theme')->get('default');
$block['region'] = 'header';
$block = $this->drupalPlaceBlock('test_cache', array('region' => 'header'));
@@ -274,7 +274,7 @@ class BlockTest extends BlockTestBase {
}
// Ensure that the disabled module's block plugin is no longer available.
- $this->drupalGet('admin/structure/block/list/' . config('system.theme')->get('default') . '/add');
+ $this->drupalGet('admin/structure/block/list/' . \Drupal::config('system.theme')->get('default') . '/add');
$this->assertNoText(t('Test block caching'));
// Confirm that the block is no longer displayed on the front page.
diff --git a/core/modules/block/lib/Drupal/block/Tests/BlockTestBase.php b/core/modules/block/lib/Drupal/block/Tests/BlockTestBase.php
index 1f8a4e9..01fb6c9 100644
--- a/core/modules/block/lib/Drupal/block/Tests/BlockTestBase.php
+++ b/core/modules/block/lib/Drupal/block/Tests/BlockTestBase.php
@@ -39,7 +39,7 @@ abstract class BlockTestBase extends WebTestBase {
parent::setUp();
// Use the test page as the front page.
- config('system.site')->set('page.front', 'test-page')->save();
+ \Drupal::config('system.site')->set('page.front', 'test-page')->save();
// Create Full HTML text format.
$full_html_format = entity_create('filter_format', array(
@@ -71,7 +71,7 @@ abstract class BlockTestBase extends WebTestBase {
$manager = $this->container->get('plugin.manager.block');
$instances = config_get_storage_names_with_prefix('plugin.core.block.' . $default_theme);
foreach ($instances as $plugin_id) {
- config($plugin_id)->delete();
+ \Drupal::config($plugin_id)->delete();
}
}
diff --git a/core/modules/block/lib/Drupal/block/Tests/BlockTitleXSSTest.php b/core/modules/block/lib/Drupal/block/Tests/BlockTitleXSSTest.php
index 3036ecd..c17de30 100644
--- a/core/modules/block/lib/Drupal/block/Tests/BlockTitleXSSTest.php
+++ b/core/modules/block/lib/Drupal/block/Tests/BlockTitleXSSTest.php
@@ -44,7 +44,7 @@ class BlockTitleXSSTest extends WebTestBase {
$this->assertNoRaw('<script>alert("XSS label");</script>', 'The block title was properly sanitized when rendered.');
$this->drupalLogin($this->drupalCreateUser(array('administer blocks', 'access administration pages')));
- $default_theme = config('system.theme')->get('default');
+ $default_theme = \Drupal::config('system.theme')->get('default');
$this->drupalGet('admin/structure/block/list/' . $default_theme . '/add');
$this->assertNoRaw("<script>alert('XSS subject');</script>", 'The block title was properly sanitized in Block Plugin UI Admin page.');
}
diff --git a/core/modules/block/lib/Drupal/block/Tests/NewDefaultThemeBlocksTest.php b/core/modules/block/lib/Drupal/block/Tests/NewDefaultThemeBlocksTest.php
index f9a7792..00fccc3 100644
--- a/core/modules/block/lib/Drupal/block/Tests/NewDefaultThemeBlocksTest.php
+++ b/core/modules/block/lib/Drupal/block/Tests/NewDefaultThemeBlocksTest.php
@@ -33,7 +33,7 @@ class NewDefaultThemeBlocksTest extends WebTestBase {
* Check the enabled Bartik blocks are correctly copied over.
*/
function testNewDefaultThemeBlocks() {
- $default_theme = config('system.theme')->get('default');
+ $default_theme = \Drupal::config('system.theme')->get('default');
// Add several block instances.
$this->adminUser = $this->drupalCreateUser(array('administer blocks'));
@@ -51,7 +51,7 @@ class NewDefaultThemeBlocksTest extends WebTestBase {
$new_theme = 'bartik';
$this->assertFalse($new_theme == $default_theme, 'The new theme is different from the previous default theme.');
theme_enable(array($new_theme));
- config('system.theme')
+ \Drupal::config('system.theme')
->set('default', $new_theme)
->save();
diff --git a/core/modules/block/lib/Drupal/block/Tests/Views/DisplayBlockTest.php b/core/modules/block/lib/Drupal/block/Tests/Views/DisplayBlockTest.php
index 5213b57..8da0d69 100644
--- a/core/modules/block/lib/Drupal/block/Tests/Views/DisplayBlockTest.php
+++ b/core/modules/block/lib/Drupal/block/Tests/Views/DisplayBlockTest.php
@@ -104,7 +104,7 @@ class DisplayBlockTest extends ViewTestBase {
*/
public function testViewsBlockForm() {
$this->drupalLogin($this->drupalCreateUser(array('administer blocks')));
- $default_theme = config('system.theme')->get('default');
+ $default_theme = \Drupal::config('system.theme')->get('default');
$this->drupalGet('admin/structure/block/add/views_block:test_view_block-block_1/' . $default_theme);
$elements = $this->xpath('//input[@name="label"]');
$this->assertTrue(empty($elements), 'The label field is not found for Views blocks.');
diff --git a/core/modules/book/book.install b/core/modules/book/book.install
index 610808b..786a1cf 100644
--- a/core/modules/book/book.install
+++ b/core/modules/book/book.install
@@ -73,7 +73,7 @@ function book_update_8000() {
// @see book_admin_settings_submit()
sort($allowed_types);
- config('book.settings')
+ Drupal::config('book.settings')
->set('allowed_types', $allowed_types)
->save();
}
diff --git a/core/modules/book/book.module b/core/modules/book/book.module
index e113661..ac26714 100644
--- a/core/modules/book/book.module
+++ b/core/modules/book/book.module
@@ -125,7 +125,7 @@ function book_node_view_link(EntityInterface $node, $view_mode) {
if (isset($node->book['depth'])) {
if ($view_mode == 'full' && node_is_page($node)) {
- $child_type = config('book.settings')->get('child_type');
+ $child_type = Drupal::config('book.settings')->get('child_type');
if ((user_access('add content to books') || user_access('administer book outlines')) && node_access('create', $child_type) && $node->status == 1 && $node->book['depth'] < MENU_MAX_DEPTH) {
$links['book_add_child'] = array(
'title' => t('Add child page'),
@@ -362,7 +362,7 @@ function book_pick_book_nojs_submit($form, &$form_state) {
* A parent selection form element.
*/
function _book_parent_select($book_link) {
- if (config('menu.settings')->get('override_parent_selector')) {
+ if (Drupal::config('menu.settings')->get('override_parent_selector')) {
return array();
}
// Offer a message or a drop-down to choose a different parent page.
@@ -1223,7 +1223,7 @@ function template_preprocess_book_node_export_html(&$variables) {
* A Boolean TRUE if the node type can be included in books; otherwise, FALSE.
*/
function book_type_is_allowed($type) {
- return in_array($type, config('book.settings')->get('allowed_types'));
+ return in_array($type, Drupal::config('book.settings')->get('allowed_types'));
}
/**
@@ -1234,7 +1234,7 @@ function book_type_is_allowed($type) {
*/
function book_node_type_update(NodeTypeInterface $type) {
if ($type->getOriginalID() != $type->id()) {
- $config = config('book.settings');
+ $config = Drupal::config('book.settings');
// Update the list of node types that are allowed to be added to books.
$allowed_types = $config->get('allowed_types');
$old_key = array_search($type->getOriginalID(), $allowed_types);
diff --git a/core/modules/book/lib/Drupal/book/Tests/BookTest.php b/core/modules/book/lib/Drupal/book/Tests/BookTest.php
index c1ed99d..85c8c85 100644
--- a/core/modules/book/lib/Drupal/book/Tests/BookTest.php
+++ b/core/modules/book/lib/Drupal/book/Tests/BookTest.php
@@ -435,9 +435,9 @@ class BookTest extends WebTestBase {
// 'page',
// );
// @endcode
- $current_config = config('book.settings')->init()->get();
+ $current_config = \Drupal::config('book.settings')->init()->get();
$this->drupalPost('admin/structure/book/settings', array(), t('Save configuration'));
- $this->assertIdentical($current_config, config('book.settings')->init()->get());
+ $this->assertIdentical($current_config, \Drupal::config('book.settings')->init()->get());
// Change the name, machine name and description.
$edit = array(
@@ -456,9 +456,9 @@ class BookTest extends WebTestBase {
// 'zebra',
// );
// @endcode
- $current_config = config('book.settings')->init()->get();
+ $current_config = \Drupal::config('book.settings')->init()->get();
$this->drupalPost('admin/structure/book/settings', array(), t('Save configuration'));
- $this->assertIdentical($current_config, config('book.settings')->init()->get());
+ $this->assertIdentical($current_config, \Drupal::config('book.settings')->init()->get());
$edit = array(
'name' => 'Animal book',
@@ -474,13 +474,13 @@ class BookTest extends WebTestBase {
// 'zebra',
// );
// @endcode
- $current_config = config('book.settings')->init()->get();
+ $current_config = \Drupal::config('book.settings')->init()->get();
$this->drupalPost('admin/structure/book/settings', array(), t('Save configuration'));
- $this->assertIdentical($current_config, config('book.settings')->init()->get());
+ $this->assertIdentical($current_config, \Drupal::config('book.settings')->init()->get());
// Ensure that after all the node type changes book.settings:child_type has
// the expected value.
- $this->assertEqual(config('book.settings')->get('child_type'), 'zebra');
+ $this->assertEqual(\Drupal::config('book.settings')->get('child_type'), 'zebra');
}
/**
diff --git a/core/modules/breakpoint/breakpoint.module b/core/modules/breakpoint/breakpoint.module
index 2b819af..6cda5e9 100644
--- a/core/modules/breakpoint/breakpoint.module
+++ b/core/modules/breakpoint/breakpoint.module
@@ -156,7 +156,7 @@ function _breakpoint_import_media_queries($group_name, $label, $source_type, $me
* Either Breakpoint::SOURCE_TYPE_THEME or Breakpoint::SOURCE_TYPE_MODULE.
*/
function _breakpoint_import_breakpoint_groups($source, $source_type) {
- $breakpoint_groups = config($source . '.breakpoint_groups');
+ $breakpoint_groups = Drupal::config($source . '.breakpoint_groups');
if ($breakpoint_groups) {
foreach ($breakpoint_groups->get() as $group_name => $data) {
// Breakpoints is mandatory, extra check since this is coming from config.
@@ -260,7 +260,7 @@ function breakpoint_get_theme_media_queries($theme_key) {
throw new \Exception('Illegal theme_key passed.');
}
- $config = config($theme_key . '.breakpoints');
+ $config = Drupal::config($theme_key . '.breakpoints');
if ($config) {
return $config->get();
}
@@ -281,7 +281,7 @@ function breakpoint_get_module_media_queries($module) {
throw new \Exception('Illegal module name passed.');
}
- $config = config($module . '.breakpoints');
+ $config = Drupal::config($module . '.breakpoints');
if ($config) {
return $config->get();
}
diff --git a/core/modules/ckeditor/ckeditor.module b/core/modules/ckeditor/ckeditor.module
index 62f2e85..f13d307 100644
--- a/core/modules/ckeditor/ckeditor.module
+++ b/core/modules/ckeditor/ckeditor.module
@@ -109,7 +109,7 @@ function ckeditor_theme() {
function _ckeditor_theme_css($theme = NULL) {
$css = array();
if (!isset($theme)) {
- $theme = config('system.theme')->get('default');
+ $theme = Drupal::config('system.theme')->get('default');
}
if ($theme_path = drupal_get_path('theme', $theme)) {
$info = system_get_info('theme', $theme);
diff --git a/core/modules/color/color.install b/core/modules/color/color.install
index 5a2c3d1..f896938 100644
--- a/core/modules/color/color.install
+++ b/core/modules/color/color.install
@@ -52,7 +52,7 @@ function color_update_8001() {
// Get theme name from color palette variable.
preg_match('/color_(.*)_palette/', $theme_palette, $matches);
$theme_key = $matches[1];
- $config = config('color.' . $theme_key);
+ $config = Drupal::config('color.' . $theme_key);
$config->set('palette', update_variable_get('color_' . $theme_key . '_palette'));
$config->set('logo', update_variable_get('color_' . $theme_key . '_logo'));
$config->set('stylesheets', update_variable_get('color_' . $theme_key . '_stylesheets'));
diff --git a/core/modules/color/color.module b/core/modules/color/color.module
index dc8be4a..233c5c5 100644
--- a/core/modules/color/color.module
+++ b/core/modules/color/color.module
@@ -64,7 +64,7 @@ function color_css_alter(&$css) {
$themes = list_themes();
// Override stylesheets.
- $color_paths = config('color.' . $theme_key)->get('stylesheets');
+ $color_paths = Drupal::config('color.' . $theme_key)->get('stylesheets');
if (!empty($color_paths) && !empty($themes[$theme_key]->stylesheets['all'])) {
@@ -93,7 +93,7 @@ function color_preprocess_page(&$variables) {
global $theme_key;
// Override logo.
- $logo = config('color.' . $theme_key)->get('logo');
+ $logo = Drupal::config('color.' . $theme_key)->get('logo');
if ($logo && $variables['logo'] && preg_match('!' . $theme_key . '/logo.png$!', $variables['logo'])) {
$variables['logo'] = file_create_url($logo);
}
@@ -132,7 +132,7 @@ function color_get_palette($theme, $default = FALSE) {
// Load variable.
// @todo Default color config should be moved to yaml in the theme.
- return config('color.' . $theme)->get('palette') ?: $palette;
+ return Drupal::config('color.' . $theme)->get('palette') ?: $palette;
}
/**
@@ -160,7 +160,7 @@ function color_scheme_form($complete_form, &$form_state, $theme) {
// See if we're using a predefined scheme.
// Note: we use the original theme when the default scheme is chosen.
- $current_scheme = config('color.' . $theme)->get('palette');
+ $current_scheme = Drupal::config('color.' . $theme)->get('palette');
foreach ($schemes as $key => $scheme) {
if ($current_scheme == $scheme) {
$scheme_name = $key;
@@ -281,7 +281,7 @@ function color_scheme_form_submit($form, &$form_state) {
$theme = $form_state['values']['theme'];
$info = $form_state['values']['info'];
- $config = config('color.' . $theme);
+ $config = Drupal::config('color.' . $theme);
// Resolve palette.
$palette = $form_state['values']['palette'];
@@ -544,7 +544,7 @@ function _color_render_images($theme, &$info, &$paths, $palette) {
if ($file == 'screenshot.png') {
$slice = imagecreatetruecolor(150, 90);
imagecopyresampled($slice, $target, 0, 0, $x, $y, 150, 90, $width, $height);
- config('color.' . $theme)
+ Drupal::config('color.' . $theme)
->set('screenshot', $image)
->save();
}
diff --git a/core/modules/color/lib/Drupal/color/Tests/ColorTest.php b/core/modules/color/lib/Drupal/color/Tests/ColorTest.php
index 13627cc..897943c 100644
--- a/core/modules/color/lib/Drupal/color/Tests/ColorTest.php
+++ b/core/modules/color/lib/Drupal/color/Tests/ColorTest.php
@@ -78,7 +78,7 @@ class ColorTest extends WebTestBase {
* Tests the Color module functionality using the given theme.
*/
function _testColor($theme, $test_values) {
- config('system.theme')
+ \Drupal::config('system.theme')
->set('default', $theme)
->save();
$settings_path = 'admin/appearance/settings/' . $theme;
@@ -91,7 +91,7 @@ class ColorTest extends WebTestBase {
$this->drupalPost($settings_path, $edit, t('Save configuration'));
$this->drupalGet('<front>');
- $stylesheets = config('color.' . $theme)->get('stylesheets');
+ $stylesheets = \Drupal::config('color.' . $theme)->get('stylesheets');
$this->assertPattern('|' . file_create_url($stylesheets[0]) . '|', 'Make sure the color stylesheet is included in the content. (' . $theme . ')');
$stylesheet_content = join("\n", file($stylesheets[0]));
@@ -103,12 +103,12 @@ class ColorTest extends WebTestBase {
$this->drupalPost($settings_path, $edit, t('Save configuration'));
$this->drupalGet('<front>');
- $stylesheets = config('color.' . $theme)->get('stylesheets');
+ $stylesheets = \Drupal::config('color.' . $theme)->get('stylesheets');
$stylesheet_content = join("\n", file($stylesheets[0]));
$this->assertTrue(strpos($stylesheet_content, 'color: ' . $test_values['scheme_color']) !== FALSE, 'Make sure the color we changed is in the color stylesheet. (' . $theme . ')');
// Test with aggregated CSS turned on.
- $config = config('system.performance');
+ $config = \Drupal::config('system.performance');
$config->set('css.preprocess', 1);
$config->save();
$this->drupalGet('<front>');
@@ -126,7 +126,7 @@ class ColorTest extends WebTestBase {
* Tests whether the provided color is valid.
*/
function testValidColor() {
- config('system.theme')
+ \Drupal::config('system.theme')
->set('default', 'bartik')
->save();
$settings_path = 'admin/appearance/settings/bartik';
diff --git a/core/modules/comment/comment.module b/core/modules/comment/comment.module
index b38892d..a68f39b 100644
--- a/core/modules/comment/comment.module
+++ b/core/modules/comment/comment.module
@@ -1432,7 +1432,7 @@ function comment_preview(Comment $comment) {
$comment->name->value = check_plain($account->getUsername());
}
elseif (empty($comment->name->value)) {
- $comment->name->value = config('user.settings')->get('anonymous');
+ $comment->name->value = Drupal::config('user.settings')->get('anonymous');
}
$comment->created->value = !empty($comment->created->value) ? $comment->created->value : REQUEST_TIME;
@@ -1530,7 +1530,7 @@ function template_preprocess_comment(&$variables) {
$variables['user_picture'] = array();
}
- if (config('user.settings')->get('signatures') && $account->getSignature()) {
+ if (Drupal::config('user.settings')->get('signatures') && $account->getSignature()) {
$variables['signature'] = check_markup($account->getSignature(), $account->getSignatureFormat(), '', TRUE) ;
}
else {
@@ -1658,7 +1658,7 @@ function theme_comment_post_forbidden($variables) {
$destination = array('destination' => 'node/' . $node->id() . '#comment-form');
}
- if (config('user.settings')->get('register') != USER_REGISTER_ADMINISTRATORS_ONLY) {
+ if (Drupal::config('user.settings')->get('register') != USER_REGISTER_ADMINISTRATORS_ONLY) {
// Users can register themselves.
return t('<a href="@login">Log in</a> or <a href="@register">register</a> to post comments', array('@login' => url('user/login', array('query' => $destination)), '@register' => url('user/register', array('query' => $destination))));
}
diff --git a/core/modules/comment/comment.tokens.inc b/core/modules/comment/comment.tokens.inc
index d5a3bad..8002162 100644
--- a/core/modules/comment/comment.tokens.inc
+++ b/core/modules/comment/comment.tokens.inc
@@ -133,7 +133,7 @@ function comment_tokens($type, $tokens, array $data = array(), array $options =
break;
case 'name':
- $name = ($comment->uid->target_id == 0) ? config('user.settings')->get('anonymous') : $comment->name->value;
+ $name = ($comment->uid->target_id == 0) ? Drupal::config('user.settings')->get('anonymous') : $comment->name->value;
$replacements[$original] = $sanitize ? filter_xss($name) : $name;
break;
diff --git a/core/modules/comment/lib/Drupal/comment/CommentFormController.php b/core/modules/comment/lib/Drupal/comment/CommentFormController.php
index 6d7c39b..d5a4a50 100644
--- a/core/modules/comment/lib/Drupal/comment/CommentFormController.php
+++ b/core/modules/comment/lib/Drupal/comment/CommentFormController.php
@@ -86,7 +86,7 @@ class CommentFormController extends EntityFormControllerNG {
);
if ($is_admin) {
$form['author']['name']['#title'] = t('Authored by');
- $form['author']['name']['#description'] = t('Leave blank for %anonymous.', array('%anonymous' => config('user.settings')->get('anonymous')));
+ $form['author']['name']['#description'] = t('Leave blank for %anonymous.', array('%anonymous' => \Drupal::config('user.settings')->get('anonymous')));
$form['author']['name']['#autocomplete_path'] = 'user/autocomplete';
}
elseif ($user->isAuthenticated()) {
@@ -274,7 +274,7 @@ class CommentFormController extends EntityFormControllerNG {
// If the comment was posted by an anonymous user and no author name was
// required, use "Anonymous" by default.
if ($comment->is_anonymous && (!isset($comment->name->value) || $comment->name->value === '')) {
- $comment->name->value = config('user.settings')->get('anonymous');
+ $comment->name->value = \Drupal::config('user.settings')->get('anonymous');
}
// Validate the comment's subject. If not specified, extract from comment
diff --git a/core/modules/comment/lib/Drupal/comment/Plugin/views/argument/UserUid.php b/core/modules/comment/lib/Drupal/comment/Plugin/views/argument/UserUid.php
index 0b10dca..be6c4c3 100644
--- a/core/modules/comment/lib/Drupal/comment/Plugin/views/argument/UserUid.php
+++ b/core/modules/comment/lib/Drupal/comment/Plugin/views/argument/UserUid.php
@@ -56,7 +56,7 @@ class UserUid extends ArgumentPluginBase {
function title() {
if (!$this->argument) {
- $title = config('user.settings')->get('anonymous');
+ $title = \Drupal::config('user.settings')->get('anonymous');
}
else {
$title = $this->database->query('SELECT u.name FROM {users} u WHERE u.uid = :uid', array(':uid' => $this->argument))->fetchField();
diff --git a/core/modules/comment/lib/Drupal/comment/Plugin/views/row/Rss.php b/core/modules/comment/lib/Drupal/comment/Plugin/views/row/Rss.php
index eeaec0b..6cc187c 100644
--- a/core/modules/comment/lib/Drupal/comment/Plugin/views/row/Rss.php
+++ b/core/modules/comment/lib/Drupal/comment/Plugin/views/row/Rss.php
@@ -97,7 +97,7 @@ class Rss extends RowPluginBase {
$item_length = $this->options['item_length'];
if ($item_length == 'default') {
- $item_length = config('system.rss')->get('items.view_mode');
+ $item_length = \Drupal::config('system.rss')->get('items.view_mode');
}
// Load the specified comment and its associated node:
diff --git a/core/modules/comment/lib/Drupal/comment/Tests/CommentLinksTest.php b/core/modules/comment/lib/Drupal/comment/Tests/CommentLinksTest.php
index 4f11307..5e40a7b 100644
--- a/core/modules/comment/lib/Drupal/comment/Tests/CommentLinksTest.php
+++ b/core/modules/comment/lib/Drupal/comment/Tests/CommentLinksTest.php
@@ -46,7 +46,7 @@ class CommentLinksTest extends CommentTestBase {
function testCommentLinks() {
// Bartik theme alters comment links, so use a different theme.
theme_enable(array('stark'));
- config('system.theme')
+ \Drupal::config('system.theme')
->set('default', 'stark')
->save();
@@ -175,7 +175,7 @@ class CommentLinksTest extends CommentTestBase {
}
// Change user settings.
- config('user.settings')->set('register', $info['user_register'])->save();
+ \Drupal::config('user.settings')->set('register', $info['user_register'])->save();
// Change user permissions.
$rid = ($this->loggedInUser ? DRUPAL_AUTHENTICATED_RID : DRUPAL_ANONYMOUS_RID);
diff --git a/core/modules/comment/lib/Drupal/comment/Tests/CommentPreviewTest.php b/core/modules/comment/lib/Drupal/comment/Tests/CommentPreviewTest.php
index c82ee51..88a0d7c 100644
--- a/core/modules/comment/lib/Drupal/comment/Tests/CommentPreviewTest.php
+++ b/core/modules/comment/lib/Drupal/comment/Tests/CommentPreviewTest.php
@@ -73,7 +73,7 @@ class CommentPreviewTest extends CommentTestBase {
// Login as web user and add a signature and a user picture.
$this->drupalLogin($this->web_user);
- config('user.settings')->set('signatures', 1)->save();
+ \Drupal::config('user.settings')->set('signatures', 1)->save();
$test_signature = $this->randomName();
$edit['signature[value]'] = '<a href="http://example.com/">' . $test_signature. '</a>';
$image = current($this->drupalGetTestFiles('image'));
diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigCRUDTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigCRUDTest.php
index d4c170c..a8ca042 100644
--- a/core/modules/config/lib/Drupal/config/Tests/ConfigCRUDTest.php
+++ b/core/modules/config/lib/Drupal/config/Tests/ConfigCRUDTest.php
@@ -37,7 +37,7 @@ class ConfigCRUDTest extends DrupalUnitTestBase {
$storage = $this->container->get('config.storage');
$name = 'config_test.crud';
- $config = config($name);
+ $config = \Drupal::config($name);
$this->assertIdentical($config->isNew(), TRUE);
// Create a new configuration object.
@@ -58,8 +58,8 @@ class ConfigCRUDTest extends DrupalUnitTestBase {
$actual_data = $storage->read($name);
$this->assertIdentical($actual_data, array('value' => 'instance-update'));
- // Verify a call to config() immediately returns the updated value.
- $new_config = config($name);
+ // Verify a call to \Drupal::config() immediately returns the updated value.
+ $new_config = \Drupal::config($name);
$this->assertIdentical($new_config->get(), $config->get());
$this->assertIdentical($config->isNew(), FALSE);
@@ -74,8 +74,8 @@ class ConfigCRUDTest extends DrupalUnitTestBase {
$actual_data = $storage->read($name);
$this->assertIdentical($actual_data, FALSE);
- // Verify config() returns no data.
- $new_config = config($name);
+ // Verify \Drupal::config() returns no data.
+ $new_config = \Drupal::config($name);
$this->assertIdentical($new_config->get(), $config->get());
$this->assertIdentical($config->isNew(), TRUE);
@@ -88,36 +88,36 @@ class ConfigCRUDTest extends DrupalUnitTestBase {
$actual_data = $storage->read($name);
$this->assertIdentical($actual_data, array('value' => 're-created'));
- // Verify a call to config() immediately returns the updated value.
- $new_config = config($name);
+ // Verify a call to \Drupal::config() immediately returns the updated value.
+ $new_config = \Drupal::config($name);
$this->assertIdentical($new_config->get(), $config->get());
$this->assertIdentical($config->isNew(), FALSE);
// Rename the configuration object.
$new_name = 'config_test.crud_rename';
$this->container->get('config.factory')->rename($name, $new_name);
- $renamed_config = config($new_name);
+ $renamed_config = \Drupal::config($new_name);
$this->assertIdentical($renamed_config->get(), $config->get());
$this->assertIdentical($renamed_config->isNew(), FALSE);
// Ensure that the old configuration object is removed from both the cache
// and the configuration storage.
- $config = config($name);
+ $config = \Drupal::config($name);
$this->assertIdentical($config->get(), array());
$this->assertIdentical($config->isNew(), TRUE);
// Test renaming when config.factory does not have the object in its static
// cache.
$name = 'config_test.crud_rename';
- $config = config($name);
+ $config = \Drupal::config($name);
$new_name = 'config_test.crud_rename_no_cache';
$this->container->get('config.factory')->clearStaticCache()->rename($name, $new_name);
- $renamed_config = config($new_name);
+ $renamed_config = \Drupal::config($new_name);
$this->assertIdentical($renamed_config->get(), $config->get());
$this->assertIdentical($renamed_config->isNew(), FALSE);
// Merge data into the configuration object.
- $new_config = config($new_name);
+ $new_config = \Drupal::config($new_name);
$expected_values = array(
'value' => 'herp',
'404' => 'derp',
@@ -136,7 +136,7 @@ class ConfigCRUDTest extends DrupalUnitTestBase {
$name = 'nonamespace';
$message = 'Expected ConfigNameException was thrown for a name without a namespace.';
try {
- config($name)->save();
+ \Drupal::config($name)->save();
$this->fail($message);
}
catch (ConfigNameException $e) {
@@ -147,7 +147,7 @@ class ConfigCRUDTest extends DrupalUnitTestBase {
$name = 'config_test.herman_melville.moby_dick_or_the_whale.harper_1851.now_small_fowls_flew_screaming_over_the_yet_yawning_gulf_a_sullen_white_surf_beat_against_its_steep_sides_then_all_collapsed_and_the_great_shroud_of_the_sea_rolled_on_as_it_rolled_five_thousand_years_ago';
$message = 'Expected ConfigNameException was thrown for a name longer than Config::MAX_NAME_LENGTH.';
try {
- config($name)->save();
+ \Drupal::config($name)->save();
$this->fail($message);
}
catch (ConfigNameException $e) {
@@ -159,7 +159,7 @@ class ConfigCRUDTest extends DrupalUnitTestBase {
foreach ($test_characters as $i => $c) {
try {
$name = 'namespace.object' . $c;
- $config = config($name);
+ $config = \Drupal::config($name);
$config->save();
}
catch (ConfigNameException $e) {
@@ -174,7 +174,7 @@ class ConfigCRUDTest extends DrupalUnitTestBase {
$name = 'namespace.object';
$message = 'ConfigNameException was not thrown for a valid object name.';
try {
- $config = config($name);
+ $config = \Drupal::config($name);
$config->save();
$this->pass($message);
}
diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigFileContentTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigFileContentTest.php
index f2e7965..ef840b3 100644
--- a/core/modules/config/lib/Drupal/config/Tests/ConfigFileContentTest.php
+++ b/core/modules/config/lib/Drupal/config/Tests/ConfigFileContentTest.php
@@ -52,7 +52,7 @@ class ConfigFileContentTest extends DrupalUnitTestBase {
$false_key = 'false';
// Attempt to read non-existing configuration.
- $config = config($name);
+ $config = \Drupal::config($name);
// Verify an configuration object is returned.
$this->assertEqual($config->getName(), $name);
@@ -66,7 +66,7 @@ class ConfigFileContentTest extends DrupalUnitTestBase {
$this->assertIdentical($data, FALSE);
// Add a top level value
- $config = config($name);
+ $config = \Drupal::config($name);
$config->set($key, $value);
// Add a nested value
@@ -96,7 +96,7 @@ class ConfigFileContentTest extends DrupalUnitTestBase {
$this->assertTrue($data);
// Read top level value
- $config = config($name);
+ $config = \Drupal::config($name);
$this->assertEqual($config->getName(), $name);
$this->assertTrue($config, 'Config object created.');
$this->assertEqual($config->get($key), 'bar', 'Top level configuration value found.');
@@ -134,7 +134,7 @@ class ConfigFileContentTest extends DrupalUnitTestBase {
// Unset a nested value
$config->clear($nested_key);
$config->save();
- $config = config($name);
+ $config = \Drupal::config($name);
// Read unset top level value
$this->assertNull($config->get($key), 'Top level value unset.');
@@ -143,13 +143,13 @@ class ConfigFileContentTest extends DrupalUnitTestBase {
$this->assertNull($config->get($nested_key), 'Nested value unset.');
// Create two new configuration files to test listing
- $config = config('foo.baz');
+ $config = \Drupal::config('foo.baz');
$config->set($key, $value);
$config->save();
// Test chained set()->save()
$chained_name = 'biff.bang';
- $config = config($chained_name);
+ $config = \Drupal::config($chained_name);
$config->set($key, $value)->save();
// Verify the database entry exists from a chained save.
@@ -177,7 +177,7 @@ class ConfigFileContentTest extends DrupalUnitTestBase {
$this->assertEqual($files, array(), 'No files listed with the prefix \'bar\'.');
// Delete the configuration.
- $config = config($name);
+ $config = \Drupal::config($name);
$config->delete();
// Verify the database entry no longer exists.
diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigImportUITest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigImportUITest.php
index 9184bfb..59cd19c 100644
--- a/core/modules/config/lib/Drupal/config/Tests/ConfigImportUITest.php
+++ b/core/modules/config/lib/Drupal/config/Tests/ConfigImportUITest.php
@@ -80,10 +80,10 @@ class ConfigImportUITest extends WebTestBase {
$this->assertText(t('There are no configuration changes.'));
// Verify site name has changed.
- $this->assertIdentical($new_site_name, config('system.site')->get('name'));
+ $this->assertIdentical($new_site_name, \Drupal::config('system.site')->get('name'));
// Verify that new config entity exists.
- $this->assertIdentical($original_dynamic_data, config($dynamic_name)->get());
+ $this->assertIdentical($original_dynamic_data, \Drupal::config($dynamic_name)->get());
// Verify the cache got cleared.
$this->assertTrue(isset($GLOBALS['hook_cache_flush']));
@@ -113,7 +113,7 @@ class ConfigImportUITest extends WebTestBase {
$this->container->get('lock')->release($config_importer_lock);
// Verify site name has not changed.
- $this->assertNotEqual($new_site_name, config('system.site')->get('name'));
+ $this->assertNotEqual($new_site_name, \Drupal::config('system.site')->get('name'));
}
/**
@@ -163,7 +163,7 @@ class ConfigImportUITest extends WebTestBase {
function prepareSiteNameUpdate($new_site_name) {
$staging = $this->container->get('config.storage.staging');
// Create updated configuration object.
- $config_data = config('system.site')->get();
+ $config_data = \Drupal::config('system.site')->get();
$config_data['name'] = $new_site_name;
$staging->write('system.site', $config_data);
}
diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigImporterTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigImporterTest.php
index 05d8919..f51e221 100644
--- a/core/modules/config/lib/Drupal/config/Tests/ConfigImporterTest.php
+++ b/core/modules/config/lib/Drupal/config/Tests/ConfigImporterTest.php
@@ -72,10 +72,10 @@ class ConfigImporterTest extends DrupalUnitTestBase {
$dynamic_name = 'config_test.dynamic.dotted.default';
// Verify the default configuration values exist.
- $config = config($dynamic_name);
+ $config = \Drupal::config($dynamic_name);
$this->assertIdentical($config->get('id'), 'dotted.default');
- // Verify that a bare config() does not involve module APIs.
+ // Verify that a bare \Drupal::config() does not involve module APIs.
$this->assertFalse(isset($GLOBALS['hook_config_test']));
}
@@ -103,7 +103,7 @@ class ConfigImporterTest extends DrupalUnitTestBase {
$staging = $this->container->get('config.storage.staging');
// Verify the default configuration values exist.
- $config = config($dynamic_name);
+ $config = \Drupal::config($dynamic_name);
$this->assertIdentical($config->get('id'), 'dotted.default');
// Delete the file from the staging directory.
@@ -115,7 +115,7 @@ class ConfigImporterTest extends DrupalUnitTestBase {
// Verify the file has been removed.
$this->assertIdentical($storage->read($dynamic_name), FALSE);
- $config = config($dynamic_name);
+ $config = \Drupal::config($dynamic_name);
$this->assertIdentical($config->get('id'), NULL);
// Verify that appropriate module API hooks have been invoked.
@@ -160,7 +160,7 @@ class ConfigImporterTest extends DrupalUnitTestBase {
$this->configImporter->reset()->import();
// Verify the values appeared.
- $config = config($dynamic_name);
+ $config = \Drupal::config($dynamic_name);
$this->assertIdentical($config->get('label'), $original_dynamic_data['label']);
// Verify that appropriate module API hooks have been invoked.
@@ -199,18 +199,18 @@ class ConfigImporterTest extends DrupalUnitTestBase {
$staging->write($dynamic_name, $original_dynamic_data);
// Verify the active configuration still returns the default values.
- $config = config($name);
+ $config = \Drupal::config($name);
$this->assertIdentical($config->get('foo'), 'bar');
- $config = config($dynamic_name);
+ $config = \Drupal::config($dynamic_name);
$this->assertIdentical($config->get('label'), 'Default');
// Import.
$this->configImporter->reset()->import();
// Verify the values were updated.
- $config = config($name);
+ $config = \Drupal::config($name);
$this->assertIdentical($config->get('foo'), 'beer');
- $config = config($dynamic_name);
+ $config = \Drupal::config($dynamic_name);
$this->assertIdentical($config->get('label'), 'Updated');
// Verify that the original file content is still the same.
diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigInstallTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigInstallTest.php
index 3d4093d..f9c79e3 100644
--- a/core/modules/config/lib/Drupal/config/Tests/ConfigInstallTest.php
+++ b/core/modules/config/lib/Drupal/config/Tests/ConfigInstallTest.php
@@ -37,9 +37,9 @@ class ConfigInstallTest extends DrupalUnitTestBase {
$default_configuration_entity = 'config_test.dynamic.dotted.default';
// Verify that default module config does not exist before installation yet.
- $config = config($default_config);
+ $config = \Drupal::config($default_config);
$this->assertIdentical($config->isNew(), TRUE);
- $config = config($default_configuration_entity);
+ $config = \Drupal::config($default_configuration_entity);
$this->assertIdentical($config->isNew(), TRUE);
// Install the test module.
@@ -47,9 +47,9 @@ class ConfigInstallTest extends DrupalUnitTestBase {
$this->installConfig(array('config_test'));
// Verify that default module config exists.
- $config = config($default_config);
+ $config = \Drupal::config($default_config);
$this->assertIdentical($config->isNew(), FALSE);
- $config = config($default_configuration_entity);
+ $config = \Drupal::config($default_configuration_entity);
$this->assertIdentical($config->isNew(), FALSE);
// Verify that configuration import callback was invoked for the dynamic
diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigInstallWebTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigInstallWebTest.php
index ff48bf4..5431a96 100644
--- a/core/modules/config/lib/Drupal/config/Tests/ConfigInstallWebTest.php
+++ b/core/modules/config/lib/Drupal/config/Tests/ConfigInstallWebTest.php
@@ -40,19 +40,19 @@ class ConfigInstallWebTest extends WebTestBase {
module_enable(array('config_test'));
// Verify the configuration does not exist prior to installation.
- $config_static = config($default_config);
+ $config_static = \Drupal::config($default_config);
$this->assertIdentical($config_static->isNew(), TRUE);
- $config_entity = config($default_configuration_entity);
+ $config_entity = \Drupal::config($default_configuration_entity);
$this->assertIdentical($config_entity->isNew(), TRUE);
// Install the integration module.
module_enable(array('config_integration_test'));
// Verify that default module config exists.
- $config_static = config($default_config);
+ $config_static = \Drupal::config($default_config);
$this->assertIdentical($config_static->isNew(), FALSE);
$this->assertIdentical($config_static->get('foo'), 'default setting');
- $config_entity = config($default_configuration_entity);
+ $config_entity = \Drupal::config($default_configuration_entity);
$this->assertIdentical($config_entity->isNew(), FALSE);
$this->assertIdentical($config_entity->get('label'), 'Default integration config label');
@@ -61,7 +61,7 @@ class ConfigInstallWebTest extends WebTestBase {
$config_entity->set('label', 'Customized integration config label')->save();
// @todo FIXME: Setting config keys WITHOUT SAVING retains the changed config
- // object in memory. Every new call to config() MUST revert in-memory changes
+ // object in memory. Every new call to \Drupal::config() MUST revert in-memory changes
// that haven't been saved!
// In other words: This test passes even without this reset, but it shouldn't.
$this->container->get('config.factory')->reset();
@@ -71,10 +71,10 @@ class ConfigInstallWebTest extends WebTestBase {
module_enable(array('config_integration_test'));
// Verify that customized config exists.
- $config_static = config($default_config);
+ $config_static = \Drupal::config($default_config);
$this->assertIdentical($config_static->isNew(), FALSE);
$this->assertIdentical($config_static->get('foo'), 'customized setting');
- $config_entity = config($default_configuration_entity);
+ $config_entity = \Drupal::config($default_configuration_entity);
$this->assertIdentical($config_entity->isNew(), FALSE);
$this->assertIdentical($config_entity->get('label'), 'Customized integration config label');
@@ -83,11 +83,11 @@ class ConfigInstallWebTest extends WebTestBase {
module_uninstall(array('config_integration_test'));
// Verify the integration module's config was uninstalled.
- $config_static = config($default_config);
+ $config_static = \Drupal::config($default_config);
$this->assertIdentical($config_static->isNew(), TRUE);
// Verify the integration config still exists.
- $config_entity = config($default_configuration_entity);
+ $config_entity = \Drupal::config($default_configuration_entity);
$this->assertIdentical($config_entity->isNew(), FALSE);
$this->assertIdentical($config_entity->get('label'), 'Customized integration config label');
@@ -95,12 +95,12 @@ class ConfigInstallWebTest extends WebTestBase {
module_enable(array('config_integration_test'));
// Verify the integration module's config was re-installed.
- $config_static = config($default_config);
+ $config_static = \Drupal::config($default_config);
$this->assertIdentical($config_static->isNew(), FALSE);
$this->assertIdentical($config_static->get('foo'), 'default setting');
// Verify the customized integration config still exists.
- $config_entity = config($default_configuration_entity);
+ $config_entity = \Drupal::config($default_configuration_entity);
$this->assertIdentical($config_entity->isNew(), FALSE);
$this->assertIdentical($config_entity->get('label'), 'Customized integration config label');
}
diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigLocaleOverride.php b/core/modules/config/lib/Drupal/config/Tests/ConfigLocaleOverride.php
index 79f22a9..224340c 100644
--- a/core/modules/config/lib/Drupal/config/Tests/ConfigLocaleOverride.php
+++ b/core/modules/config/lib/Drupal/config/Tests/ConfigLocaleOverride.php
@@ -42,19 +42,19 @@ class ConfigLocaleOverride extends DrupalUnitTestBase {
function testConfigLocaleOverride() {
$name = 'config_test.system';
// The default language is en so the config key should be localised.
- $config = config($name);
+ $config = \Drupal::config($name);
$this->assertIdentical($config->get('foo'), 'en bar');
$this->assertIdentical($config->get('404'), 'herp');
// Ensure that we get the expected value when we avoid overrides.
config_context_enter('config.context.free');
- $config_admin = config($name);
+ $config_admin = \Drupal::config($name);
$this->assertIdentical($config_admin->get('foo'), 'bar');
$this->assertIdentical($config_admin->get('404'), 'herp');
// Leave the non override context.
config_context_leave();
- $config = config($name);
+ $config = \Drupal::config($name);
$this->assertIdentical($config->get('foo'), 'en bar');
$this->assertIdentical($config->get('404'), 'herp');
}
@@ -89,7 +89,7 @@ class ConfigLocaleOverride extends DrupalUnitTestBase {
$user_config_context = config_context_enter('Drupal\user\UserConfigContext');
$user_config_context->setAccount($account);
- $config = config('config_test.system');
+ $config = \Drupal::config('config_test.system');
$this->assertIdentical($config->get('foo'), 'fr bar');
// Ensure the non-overriden value is still the same.
$this->assertIdentical($config->get('404'), 'herp');
@@ -99,7 +99,7 @@ class ConfigLocaleOverride extends DrupalUnitTestBase {
// in a user based language override context, the English language override
// applies due to the negotiated language for the page.
config_context_leave();
- $config = config('config_test.system');
+ $config = \Drupal::config('config_test.system');
$this->assertIdentical($config->get('foo'), 'en bar');
$account = entity_create('user', array(
@@ -114,7 +114,7 @@ class ConfigLocaleOverride extends DrupalUnitTestBase {
$config_factory->enterContext($user_config_context->setAccount($account));
// Should not have to re-initialize the configuration object to get new
// overrides as the new context will have a different uuid.
- $config = config('config_test.system');
+ $config = \Drupal::config('config_test.system');
$this->assertIdentical($config->get('foo'), 'de bar');
// Enter an english context on top of the german context.
@@ -128,24 +128,24 @@ class ConfigLocaleOverride extends DrupalUnitTestBase {
// Create a new user config context to stack on top of the existign one.
$en_user_config_context = config_context_enter('Drupal\user\UserConfigContext');
$en_user_config_context->setAccount($account);
- $config = config('config_test.system');
+ $config = \Drupal::config('config_test.system');
$this->assertIdentical($config->get('foo'), 'en bar');
// Ensure that we get the expected value when we leave the english user
// context.
config_context_leave();
- $config = config('config_test.system');
+ $config = \Drupal::config('config_test.system');
$this->assertIdentical($config->get('foo'), 'de bar');
// Ensure that we get the expected value when we leave the german user
// context.
config_context_leave();
- $config = config('config_test.system');
+ $config = \Drupal::config('config_test.system');
$this->assertIdentical($config->get('foo'), 'en bar');
// Ensure that we cannot leave the default context.
config_context_leave();
- $config = config('config_test.system');
+ $config = \Drupal::config('config_test.system');
$this->assertIdentical($config->get('foo'), 'en bar');
}
@@ -171,7 +171,7 @@ class ConfigLocaleOverride extends DrupalUnitTestBase {
$language = language_load('fr');
$language_config_context = config_context_enter('Drupal\language\LanguageConfigContext');
$language_config_context->setLanguage($language);
- $config = config('config_test.system');
+ $config = \Drupal::config('config_test.system');
$this->assertIdentical($config->get('foo'), 'fr bar');
// Ensure the non-overridden value is still the same.
$this->assertIdentical($config->get('404'), 'herp');
@@ -181,7 +181,7 @@ class ConfigLocaleOverride extends DrupalUnitTestBase {
// in a language override context, the English language override
// applies due to the negotiated language for the page.
config_context_leave();
- $config = config('config_test.system');
+ $config = \Drupal::config('config_test.system');
$this->assertIdentical($config->get('foo'), 'en bar');
$config_factory = \Drupal::service('config.factory');
@@ -189,7 +189,7 @@ class ConfigLocaleOverride extends DrupalUnitTestBase {
$config_factory->enterContext($language_config_context->setLanguage($language));
// Should not have to re-initialize the configuration object to get new
// overrides as the new context will have a different uuid.
- $config = config('config_test.system');
+ $config = \Drupal::config('config_test.system');
$this->assertIdentical($config->get('foo'), 'de bar');
// Enter an english context on top of the german context.
@@ -197,24 +197,24 @@ class ConfigLocaleOverride extends DrupalUnitTestBase {
// Create a new language config context to stack on top of the existing one.
$en_language_config_context = config_context_enter('Drupal\language\LanguageConfigContext');
$en_language_config_context->setLanguage($language);
- $config = config('config_test.system');
+ $config = \Drupal::config('config_test.system');
$this->assertIdentical($config->get('foo'), 'en bar');
// Ensure that we get the expected value when we leave the english
// language context.
config_context_leave();
- $config = config('config_test.system');
+ $config = \Drupal::config('config_test.system');
$this->assertIdentical($config->get('foo'), 'de bar');
// Ensure that we get the expected value when we leave the german
// language context.
config_context_leave();
- $config = config('config_test.system');
+ $config = \Drupal::config('config_test.system');
$this->assertIdentical($config->get('foo'), 'en bar');
// Ensure that we cannot leave the default context.
config_context_leave();
- $config = config('config_test.system');
+ $config = \Drupal::config('config_test.system');
$this->assertIdentical($config->get('foo'), 'en bar');
}
@@ -248,7 +248,7 @@ class ConfigLocaleOverride extends DrupalUnitTestBase {
$user_config_context = config_context_enter('Drupal\user\UserConfigContext');
$user_config_context->setAccount($account);
- $config = config('config_test.system');
+ $config = \Drupal::config('config_test.system');
$this->assertIdentical($config->get('foo'), 'fr bar');
// Ensure the value overriden from global $conf works.
$this->assertIdentical($config->get('404'), 'global herp');
@@ -258,21 +258,21 @@ class ConfigLocaleOverride extends DrupalUnitTestBase {
// in a user based language override context, the English language override
// applies due to the negotiated language for the page.
config_context_leave();
- $config = config('config_test.system');
+ $config = \Drupal::config('config_test.system');
$this->assertIdentical($config->get('foo'), 'en bar');
// Global override should still apply.
$this->assertIdentical($config->get('404'), 'global herp');
// Ensure that we cannot leave the default context.
config_context_leave();
- $config = config('config_test.system');
+ $config = \Drupal::config('config_test.system');
$this->assertIdentical($config->get('foo'), 'en bar');
// Global override should still apply.
$this->assertIdentical($config->get('404'), 'global herp');
// Ensure that we get the expected value when we avoid overrides.
config_context_enter('config.context.free');
- $config_admin = config('config_test.system');
+ $config_admin = \Drupal::config('config_test.system');
// Language override should not apply anymore.
$this->assertIdentical($config_admin->get('foo'), 'bar');
// Global override should not apply.
diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigLocaleOverrideWebTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigLocaleOverrideWebTest.php
index 204e274..99bee07 100644
--- a/core/modules/config/lib/Drupal/config/Tests/ConfigLocaleOverrideWebTest.php
+++ b/core/modules/config/lib/Drupal/config/Tests/ConfigLocaleOverrideWebTest.php
@@ -47,7 +47,7 @@ class ConfigLocaleOverrideWebTest extends WebTestBase {
$this->drupalPost('admin/config/regional/language/add', $edit, t('Add custom language'));
// Save an override for the XX language.
- config('locale.config.xx.system.site')->set('name', 'XX site name')->save();
+ \Drupal::config('locale.config.xx.system.site')->set('name', 'XX site name')->save();
$this->drupalLogout();
diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigOverrideTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigOverrideTest.php
index e0748a7..a6016c3 100644
--- a/core/modules/config/lib/Drupal/config/Tests/ConfigOverrideTest.php
+++ b/core/modules/config/lib/Drupal/config/Tests/ConfigOverrideTest.php
@@ -63,7 +63,7 @@ class ConfigOverrideTest extends DrupalUnitTestBase {
// Enter an override-free context to ensure the original data remains.
config_context_enter('config.context.free');
- $config = config('config_test.system');
+ $config = \Drupal::config('config_test.system');
$this->assertIdentical($config->get('foo'), $expected_original_data['foo']);
$this->assertIdentical($config->get('baz'), $expected_original_data['baz']);
$this->assertIdentical($config->get('404'), $expected_original_data['404']);
@@ -71,7 +71,7 @@ class ConfigOverrideTest extends DrupalUnitTestBase {
// Get the configuration object in an overriden context (the one set by
// default).
- $config = config('config_test.system');
+ $config = \Drupal::config('config_test.system');
// Verify that it contains the overridden data from $conf.
$this->assertIdentical($config->get('foo'), $conf['config_test.system']['foo']);
@@ -95,14 +95,14 @@ class ConfigOverrideTest extends DrupalUnitTestBase {
$config->save();
// Reload it and verify that it still contains overridden data from $conf.
- $config = config('config_test.system');
+ $config = \Drupal::config('config_test.system');
$this->assertIdentical($config->get('foo'), $conf['config_test.system']['foo']);
$this->assertIdentical($config->get('baz'), $conf['config_test.system']['baz']);
$this->assertIdentical($config->get('404'), $conf['config_test.system']['404']);
// Enter an override-free context to ensure the original data remains saved.
config_context_enter('config.context.free');
- $config = config('config_test.system');
+ $config = \Drupal::config('config_test.system');
$this->assertIdentical($config->get('foo'), $expected_original_data['foo']);
$this->assertIdentical($config->get('baz'), $expected_original_data['baz']);
$this->assertIdentical($config->get('404'), $expected_original_data['404']);
@@ -127,7 +127,7 @@ class ConfigOverrideTest extends DrupalUnitTestBase {
$this->assertIdentical($data['404'], $expected_new_data['404']);
// Verifiy the overrides are still working.
- $config = config('config_test.system');
+ $config = \Drupal::config('config_test.system');
$this->assertIdentical($config->get('foo'), $conf['config_test.system']['foo']);
$this->assertIdentical($config->get('baz'), $conf['config_test.system']['baz']);
$this->assertIdentical($config->get('404'), $conf['config_test.system']['404']);
diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigSnapshotTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigSnapshotTest.php
index 7315c53..d9504b2 100644
--- a/core/modules/config/lib/Drupal/config/Tests/ConfigSnapshotTest.php
+++ b/core/modules/config/lib/Drupal/config/Tests/ConfigSnapshotTest.php
@@ -66,7 +66,7 @@ class ConfigSnapshotTest extends DrupalUnitTestBase {
$this->assertFalse($active_snapshot_comparer->reset()->hasChanges());
// Change a configuration value in staging.
- $staging_data = config($config_name)->get();
+ $staging_data = \Drupal::config($config_name)->get();
$staging_data[$config_key] = $new_data;
$staging->write($config_name, $staging_data);
@@ -79,7 +79,7 @@ class ConfigSnapshotTest extends DrupalUnitTestBase {
$this->configImporter()->import();
// Verify changed config was properly imported.
- $this->assertIdentical(config($config_name)->get($config_key), $new_data);
+ $this->assertIdentical(\Drupal::config($config_name)->get($config_key), $new_data);
// Verify that a new snapshot was created which and that it matches
// the active config.
diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigUpgradeTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigUpgradeTest.php
index f55921e..e95f134 100644
--- a/core/modules/config/lib/Drupal/config/Tests/ConfigUpgradeTest.php
+++ b/core/modules/config/lib/Drupal/config/Tests/ConfigUpgradeTest.php
@@ -59,7 +59,7 @@ class ConfigUpgradeTest extends WebTestBase {
));
// Verify that variables have been converted and default values exist.
- $config = config('config_upgrade.test');
+ $config = \Drupal::config('config_upgrade.test');
$this->assertIdentical($config->get('foo'), $this->testContent);
$this->assertIdentical($config->get('parent.bar'), $this->testContent);
$this->assertIdentical($config->get('parent.baz'), 'Baz');
@@ -80,7 +80,7 @@ class ConfigUpgradeTest extends WebTestBase {
));
// Verify that new variables have been converted and existing still exist.
- $config = config('config_upgrade.test');
+ $config = \Drupal::config('config_upgrade.test');
$this->assertIdentical($config->get('foo'), $this->testContent);
$this->assertIdentical($config->get('parent.bar'), $this->testContent);
$this->assertIdentical($config->get('parent.baz'), 'Baz');
@@ -101,7 +101,7 @@ class ConfigUpgradeTest extends WebTestBase {
// For this test it is essential that update_variables_to_config has already
// run on the config object.
- config('config_upgrade.test')
+ \Drupal::config('config_upgrade.test')
->set('numeric_keys.403', '')
->set('numeric_keys.404', '')
->save();
@@ -118,6 +118,6 @@ class ConfigUpgradeTest extends WebTestBase {
'config_upgrade_404' => 'numeric_keys.404',
));
- $this->assertIdentical(config('config_upgrade.test')->get('numeric_keys'), array(403 => 'custom403', 404 => 'custom404'));
+ $this->assertIdentical(\Drupal::config('config_upgrade.test')->get('numeric_keys'), array(403 => 'custom403', 404 => 'custom404'));
}
}
diff --git a/core/modules/config/lib/Drupal/config/Tests/Storage/FileStorageTest.php b/core/modules/config/lib/Drupal/config/Tests/Storage/FileStorageTest.php
index d4d492a..60ce433 100644
--- a/core/modules/config/lib/Drupal/config/Tests/Storage/FileStorageTest.php
+++ b/core/modules/config/lib/Drupal/config/Tests/Storage/FileStorageTest.php
@@ -28,7 +28,7 @@ class FileStorageTest extends ConfigStorageTestBase {
$this->invalidStorage = new FileStorage($this->configDirectories[CONFIG_ACTIVE_DIRECTORY] . '/nonexisting');
// FileStorage::listAll() requires other configuration data to exist.
- $this->storage->write('system.performance', config('system.performance')->get());
+ $this->storage->write('system.performance', \Drupal::config('system.performance')->get());
}
protected function read($name) {
diff --git a/core/modules/contact/contact.install b/core/modules/contact/contact.install
index eaac51c..60b51b0 100644
--- a/core/modules/contact/contact.install
+++ b/core/modules/contact/contact.install
@@ -12,11 +12,11 @@ use Drupal\Core\Language\Language;
* Implements hook_install().
*/
function contact_install() {
- $site_mail = config('system.site')->get('mail');
+ $site_mail = Drupal::config('system.site')->get('mail');
if (empty($site_mail)) {
$site_mail = ini_get('sendmail_from');
}
- config('contact.category.feedback')->set('recipients', array($site_mail))->save();
+ Drupal::config('contact.category.feedback')->set('recipients', array($site_mail))->save();
}
/**
@@ -61,12 +61,12 @@ function contact_update_8001() {
$category->id = $category->cid;
// Save default category setting.
if ($category->selected) {
- config('contact.settings')
+ Drupal::config('contact.settings')
->set('default_category', $category->id)
->save();
}
// Save the config object.
- config('contact.category.' . $category->id)
+ Drupal::config('contact.category.' . $category->id)
->set('id', $category->id)
->set('uuid', $uuid->generate())
->set('label', $category->category)
diff --git a/core/modules/contact/contact.module b/core/modules/contact/contact.module
index d8984e8..74cfb1e 100644
--- a/core/modules/contact/contact.module
+++ b/core/modules/contact/contact.module
@@ -154,7 +154,7 @@ function _contact_personal_tab_access(UserInterface $account) {
}
// If the requested user did not save a preference yet, deny access if the
// configured default is disabled.
- elseif (!config('contact.settings')->get('user_default_enabled')) {
+ elseif (!Drupal::config('contact.settings')->get('user_default_enabled')) {
return FALSE;
}
@@ -167,7 +167,7 @@ function _contact_personal_tab_access(UserInterface $account) {
function contact_entity_bundle_info() {
$bundles = array();
foreach (config_get_storage_names_with_prefix('contact.category.') as $config_name) {
- $config = config($config_name);
+ $config = Drupal::config($config_name);
$bundles['contact_message'][$config->get('id')]['label'] = $config->get('label');
}
return $bundles;
@@ -264,7 +264,7 @@ function contact_mail($key, &$message, $params) {
$language = language_load($message['langcode']);
$variables = array(
- '!site-name' => config('system.site')->get('name'),
+ '!site-name' => Drupal::config('system.site')->get('name'),
'!subject' => $contact_message->getSubject(),
'!category' => !empty($params['contact_category']) ? $params['contact_category']->label() : NULL,
'!form-url' => url(current_path(), array('absolute' => TRUE, 'language' => $language)),
@@ -328,7 +328,7 @@ function contact_form_user_form_alter(&$form, &$form_state) {
$form['contact']['contact'] = array(
'#type' => 'checkbox',
'#title' => t('Personal contact form'),
- '#default_value' => isset($account_data) ? $account_data : config('contact.settings')->get('user_default_enabled'),
+ '#default_value' => isset($account_data) ? $account_data : Drupal::config('contact.settings')->get('user_default_enabled'),
'#description' => t('Allow other users to contact you via a personal contact form which keeps your e-mail address hidden. Note that some privileged users such as site administrators are still able to contact you even if you choose to disable this feature.'),
);
$form['actions']['submit']['#submit'][] = 'contact_user_profile_form_submit';
@@ -361,7 +361,7 @@ function contact_form_user_admin_settings_alter(&$form, &$form_state) {
'#type' => 'checkbox',
'#title' => t('Enable the personal contact form by default for new users.'),
'#description' => t('Changing this setting will not affect existing users.'),
- '#default_value' => config('contact.settings')->get('user_default_enabled'),
+ '#default_value' => Drupal::config('contact.settings')->get('user_default_enabled'),
);
// Add submit handler to save contact configuration.
$form['#submit'][] = 'contact_form_user_admin_settings_submit';
@@ -373,7 +373,7 @@ function contact_form_user_admin_settings_alter(&$form, &$form_state) {
* @see contact_form_user_admin_settings_alter()
*/
function contact_form_user_admin_settings_submit($form, &$form_state) {
- config('contact.settings')
+ Drupal::config('contact.settings')
->set('user_default_enabled', $form_state['values']['contact_default_status'])
->save();
}
diff --git a/core/modules/contact/contact.pages.inc b/core/modules/contact/contact.pages.inc
index 52afd28..c7b7539 100644
--- a/core/modules/contact/contact.pages.inc
+++ b/core/modules/contact/contact.pages.inc
@@ -30,7 +30,7 @@ function contact_site_page(Category $category = NULL) {
if (!isset($category)) {
$categories = entity_load_multiple('contact_category');
- $default_category = config('contact.settings')->get('default_category');
+ $default_category = Drupal::config('contact.settings')->get('default_category');
if (isset($categories[$default_category])) {
$category = $categories[$default_category];
}
@@ -93,7 +93,7 @@ function contact_personal_page($recipient) {
* @see contact_personal_page()
*/
function contact_flood_control() {
- $config = config('contact.settings');
+ $config = Drupal::config('contact.settings');
$limit = $config->get('flood.limit');
$interval = $config->get('flood.interval');
if (!Drupal::service('flood')->isAllowed('contact', $limit, $interval)) {
diff --git a/core/modules/contact/lib/Drupal/contact/CategoryFormController.php b/core/modules/contact/lib/Drupal/contact/CategoryFormController.php
index 5f2e78c..bd12a66 100644
--- a/core/modules/contact/lib/Drupal/contact/CategoryFormController.php
+++ b/core/modules/contact/lib/Drupal/contact/CategoryFormController.php
@@ -21,7 +21,7 @@ class CategoryFormController extends EntityFormController {
$form = parent::form($form, $form_state);
$category = $this->entity;
- $default_category = config('contact.settings')->get('default_category');
+ $default_category = \Drupal::config('contact.settings')->get('default_category');
$form['label'] = array(
'#type' => 'textfield',
@@ -108,7 +108,7 @@ class CategoryFormController extends EntityFormController {
}
// Update the default category.
- $contact_config = config('contact.settings');
+ $contact_config = \Drupal::config('contact.settings');
if ($form_state['values']['selected']) {
$contact_config
->set('default_category', $category->id())
diff --git a/core/modules/contact/lib/Drupal/contact/CategoryListController.php b/core/modules/contact/lib/Drupal/contact/CategoryListController.php
index 820010f..7a6a513 100644
--- a/core/modules/contact/lib/Drupal/contact/CategoryListController.php
+++ b/core/modules/contact/lib/Drupal/contact/CategoryListController.php
@@ -66,7 +66,7 @@ class CategoryListController extends ConfigEntityListController {
}
else {
$row['recipients'] = check_plain(implode(', ', $entity->recipients));
- $default_category = config('contact.settings')->get('default_category');
+ $default_category = \Drupal::config('contact.settings')->get('default_category');
$row['selected'] = ($default_category == $entity->id() ? t('Yes') : t('No'));
}
$row['operations']['data'] = $this->buildOperations($entity);
diff --git a/core/modules/contact/lib/Drupal/contact/MessageFormController.php b/core/modules/contact/lib/Drupal/contact/MessageFormController.php
index 5f2ede7..d41c959 100644
--- a/core/modules/contact/lib/Drupal/contact/MessageFormController.php
+++ b/core/modules/contact/lib/Drupal/contact/MessageFormController.php
@@ -187,7 +187,7 @@ class MessageFormController extends EntityFormControllerNG {
drupal_mail('contact', 'page_autoreply', $sender->getEmail(), $language_interface->id, $params);
}
- \Drupal::service('flood')->register('contact', config('contact.settings')->get('flood.interval'));
+ \Drupal::service('flood')->register('contact', \Drupal::config('contact.settings')->get('flood.interval'));
if (!$message->isPersonal()) {
watchdog('contact', '%sender-name (@sender-from) sent an e-mail regarding %category.', array(
'%sender-name' => $sender->name,
diff --git a/core/modules/contact/lib/Drupal/contact/Tests/ContactPersonalTest.php b/core/modules/contact/lib/Drupal/contact/Tests/ContactPersonalTest.php
index 61f1fb9..7e1bd71 100644
--- a/core/modules/contact/lib/Drupal/contact/Tests/ContactPersonalTest.php
+++ b/core/modules/contact/lib/Drupal/contact/Tests/ContactPersonalTest.php
@@ -57,7 +57,7 @@ class ContactPersonalTest extends WebTestBase {
$this->admin_user = $this->drupalCreateUser(array('administer contact forms', 'administer users'));
// Create some normal users with their contact forms enabled by default.
- config('contact.settings')->set('user_default_enabled', 1)->save();
+ \Drupal::config('contact.settings')->set('user_default_enabled', 1)->save();
$this->web_user = $this->drupalCreateUser(array('access user contact forms'));
$this->contact_user = $this->drupalCreateUser();
}
@@ -76,7 +76,7 @@ class ContactPersonalTest extends WebTestBase {
$this->assertEqual($mail['from'], $this->web_user->getEmail());
$this->assertEqual($mail['key'], 'user_mail');
$variables = array(
- '!site-name' => config('system.site')->get('name'),
+ '!site-name' => \Drupal::config('system.site')->get('name'),
'!subject' => $message['subject'],
'!recipient-name' => $this->contact_user->getUsername(),
);
@@ -181,7 +181,7 @@ class ContactPersonalTest extends WebTestBase {
*/
function testPersonalContactFlood() {
$flood_limit = 3;
- config('contact.settings')->set('flood.limit', $flood_limit)->save();
+ \Drupal::config('contact.settings')->set('flood.limit', $flood_limit)->save();
// Clear flood table in preparation for flood test and allow other checks to complete.
db_delete('flood')->execute();
@@ -198,7 +198,7 @@ class ContactPersonalTest extends WebTestBase {
// Submit contact form one over limit.
$this->drupalGet('user/' . $this->contact_user->id(). '/contact');
- $this->assertRaw(t('You cannot send more than %number messages in @interval. Try again later.', array('%number' => $flood_limit, '@interval' => format_interval(config('contact.settings')->get('flood.interval')))), 'Normal user denied access to flooded contact form.');
+ $this->assertRaw(t('You cannot send more than %number messages in @interval. Try again later.', array('%number' => $flood_limit, '@interval' => format_interval(\Drupal::config('contact.settings')->get('flood.interval')))), 'Normal user denied access to flooded contact form.');
// Test that the admin user can still access the contact form even though
// the flood limit was reached.
diff --git a/core/modules/contact/lib/Drupal/contact/Tests/ContactSitewideTest.php b/core/modules/contact/lib/Drupal/contact/Tests/ContactSitewideTest.php
index 42f4423..56b902e 100644
--- a/core/modules/contact/lib/Drupal/contact/Tests/ContactSitewideTest.php
+++ b/core/modules/contact/lib/Drupal/contact/Tests/ContactSitewideTest.php
@@ -44,7 +44,7 @@ class ContactSitewideTest extends WebTestBase {
$this->drupalLogin($admin_user);
$flood_limit = 3;
- config('contact.settings')
+ \Drupal::config('contact.settings')
->set('flood.limit', $flood_limit)
->set('flood.interval', 600)
->save();
@@ -110,7 +110,7 @@ class ContactSitewideTest extends WebTestBase {
$this->assertRaw(t('Category %label has been added.', array('%label' => $label)));
// Check that the category was created in site default language.
- $langcode = config('contact.category.' . $id)->get('langcode');
+ $langcode = \Drupal::config('contact.category.' . $id)->get('langcode');
$default_langcode = language_default()->id;
$this->assertEqual($langcode, $default_langcode);
@@ -119,15 +119,15 @@ class ContactSitewideTest extends WebTestBase {
// Test update contact form category.
$this->updateCategory($id, $label = $this->randomName(16), $recipients_str = implode(',', array($recipients[0], $recipients[1])), $reply = $this->randomName(30), FALSE);
- $config = config('contact.category.' . $id)->get();
+ $config = \Drupal::config('contact.category.' . $id)->get();
$this->assertEqual($config['label'], $label);
$this->assertEqual($config['recipients'], array($recipients[0], $recipients[1]));
$this->assertEqual($config['reply'], $reply);
- $this->assertNotEqual($id, config('contact.settings')->get('default_category'));
+ $this->assertNotEqual($id, \Drupal::config('contact.settings')->get('default_category'));
$this->assertRaw(t('Category %label has been updated.', array('%label' => $label)));
// Reset the category back to be the default category.
- config('contact.settings')->set('default_category', $id)->save();
+ \Drupal::config('contact.settings')->set('default_category', $id)->save();
// Ensure that the contact form is shown without a category selection input.
user_role_grant_permissions(DRUPAL_ANONYMOUS_RID, array('access site-wide contact form'));
@@ -182,7 +182,7 @@ class ContactSitewideTest extends WebTestBase {
$this->assertText(t('Message field is required.'));
// Test contact form with no default category selected.
- config('contact.settings')
+ \Drupal::config('contact.settings')
->set('default_category', '')
->save();
$this->drupalGet('contact');
@@ -202,7 +202,7 @@ class ContactSitewideTest extends WebTestBase {
// Submit contact form one over limit.
$this->drupalGet('contact');
$this->assertResponse(403);
- $this->assertRaw(t('You cannot send more than %number messages in @interval. Try again later.', array('%number' => config('contact.settings')->get('flood.limit'), '@interval' => format_interval(600))));
+ $this->assertRaw(t('You cannot send more than %number messages in @interval. Try again later.', array('%number' => \Drupal::config('contact.settings')->get('flood.limit'), '@interval' => format_interval(600))));
// Test listing controller.
$this->drupalLogin($admin_user);
@@ -376,7 +376,7 @@ class ContactSitewideTest extends WebTestBase {
$edit['mail'] = $mail;
$edit['subject'] = $subject;
$edit['message'] = $message;
- if ($id == config('contact.settings')->get('default_category')) {
+ if ($id == \Drupal::config('contact.settings')->get('default_category')) {
$this->drupalPost('contact', $edit, t('Send message'));
}
else {
diff --git a/core/modules/contact/lib/Drupal/contact/Tests/ContactUpgradePathTest.php b/core/modules/contact/lib/Drupal/contact/Tests/ContactUpgradePathTest.php
index 4c61653..b5785aa 100644
--- a/core/modules/contact/lib/Drupal/contact/Tests/ContactUpgradePathTest.php
+++ b/core/modules/contact/lib/Drupal/contact/Tests/ContactUpgradePathTest.php
@@ -60,7 +60,7 @@ class ContactUpgradePathTest extends UpgradePathTestBase {
$this->assertEqual($contact_category->recipients, array('test1@example.com', 'test2@example.com'));
// Ensure that the default category has been maintained.
- $this->assertEqual(config('contact.settings')->get('default_category'), $default_contact_category, 'Default category upgraded.');
+ $this->assertEqual(\Drupal::config('contact.settings')->get('default_category'), $default_contact_category, 'Default category upgraded.');
// Check that no default config imported on upgrade.
$this->assertFalse(entity_load('contact_category', 'feedback'));
diff --git a/core/modules/content_translation/content_translation.module b/core/modules/content_translation/content_translation.module
index 56d9508..34e918c 100644
--- a/core/modules/content_translation/content_translation.module
+++ b/core/modules/content_translation/content_translation.module
@@ -413,7 +413,7 @@ function content_translation_get_config_key($entity_type, $bundle, $setting) {
*/
function content_translation_get_config($entity_type, $bundle, $setting) {
$key = content_translation_get_config_key($entity_type, $bundle, $setting);
- return config('content_translation.settings')->get($key);
+ return Drupal::config('content_translation.settings')->get($key);
}
/**
@@ -430,7 +430,7 @@ function content_translation_get_config($entity_type, $bundle, $setting) {
*/
function content_translation_set_config($entity_type, $bundle, $setting, $value) {
$key = content_translation_get_config_key($entity_type, $bundle, $setting);
- return config('content_translation.settings')->set($key, $value)->save();
+ return Drupal::config('content_translation.settings')->set($key, $value)->save();
}
/**
diff --git a/core/modules/datetime/lib/Drupal/datetime/DateHelper.php b/core/modules/datetime/lib/Drupal/datetime/DateHelper.php
index 39c770e..3f8b0f8 100644
--- a/core/modules/datetime/lib/Drupal/datetime/DateHelper.php
+++ b/core/modules/datetime/lib/Drupal/datetime/DateHelper.php
@@ -259,7 +259,7 @@ class DateHelper {
* An array of weekdays reordered to match the first day of the week.
*/
public static function weekDaysOrdered($weekdays) {
- $first_day = config('system.date')->get('first_day');
+ $first_day = \Drupal::config('system.date')->get('first_day');
if ($first_day > 0) {
for ($i = 1; $i <= $first_day; $i++) {
$last = array_shift($weekdays);
diff --git a/core/modules/dblog/dblog.module b/core/modules/dblog/dblog.module
index 202cfcf..9bd8f7f 100644
--- a/core/modules/dblog/dblog.module
+++ b/core/modules/dblog/dblog.module
@@ -99,7 +99,7 @@ function dblog_page_build(&$page) {
*/
function dblog_cron() {
// Cleanup the watchdog table.
- $row_limit = config('dblog.settings')->get('row_limit');
+ $row_limit = Drupal::config('dblog.settings')->get('row_limit');
// For row limit n, get the wid of the nth row in descending wid order.
// Counting the most recent n rows avoids issues with wid number sequences,
@@ -169,7 +169,7 @@ function dblog_form_system_logging_settings_alter(&$form, $form_state) {
$form['dblog_row_limit'] = array(
'#type' => 'select',
'#title' => t('Database log messages to keep'),
- '#default_value' => config('dblog.settings')->get('row_limit'),
+ '#default_value' => Drupal::config('dblog.settings')->get('row_limit'),
'#options' => array(0 => t('All')) + drupal_map_assoc(array(100, 1000, 10000, 100000, 1000000)),
'#description' => t('The maximum number of messages to keep in the database log. Requires a <a href="@cron">cron maintenance task</a>.', array('@cron' => url('admin/reports/status')))
);
@@ -183,5 +183,5 @@ function dblog_form_system_logging_settings_alter(&$form, $form_state) {
* @see dblog_form_system_logging_settings_alter()
*/
function dblog_logging_settings_submit($form, &$form_state) {
- config('dblog.settings')->set('row_limit', $form_state['values']['dblog_row_limit'])->save();
+ Drupal::config('dblog.settings')->set('row_limit', $form_state['values']['dblog_row_limit'])->save();
}
diff --git a/core/modules/dblog/lib/Drupal/dblog/Tests/DbLogTest.php b/core/modules/dblog/lib/Drupal/dblog/Tests/DbLogTest.php
index 59a40c3..4406383 100644
--- a/core/modules/dblog/lib/Drupal/dblog/Tests/DbLogTest.php
+++ b/core/modules/dblog/lib/Drupal/dblog/Tests/DbLogTest.php
@@ -90,7 +90,7 @@ class DbLogTest extends WebTestBase {
$this->assertResponse(200);
// Check row limit variable.
- $current_limit = config('dblog.settings')->get('row_limit');
+ $current_limit = \Drupal::config('dblog.settings')->get('row_limit');
$this->assertTrue($current_limit == $row_limit, format_string('[Cache] Row limit variable of @count equals row limit of @limit', array('@count' => $current_limit, '@limit' => $row_limit)));
}
diff --git a/core/modules/entity/entity.install b/core/modules/entity/entity.install
index af2aba1..9cbd71e 100644
--- a/core/modules/entity/entity.install
+++ b/core/modules/entity/entity.install
@@ -25,7 +25,7 @@ use Drupal\Component\Uuid\Uuid;
*/
function _update_8000_entity_get_display($entity_type, $bundle, $view_mode) {
$id = $entity_type . '.' . $bundle . '.' . $view_mode;
- $config = config("entity.display.$id");
+ $config = Drupal::config("entity.display.$id");
if ($config->get()) {
return $config;
}
@@ -64,7 +64,7 @@ function _update_8000_entity_get_display($entity_type, $bundle, $view_mode) {
*/
function _update_8000_entity_get_form_display($entity_type, $bundle, $form_mode) {
$id = $entity_type . '.' . $bundle . '.' . $form_mode;
- $config = config("entity.form_display.$id");
+ $config = Drupal::config("entity.form_display.$id");
if ($config->get()) {
return $config;
}
diff --git a/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceSelectionAccessTest.php b/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceSelectionAccessTest.php
index 1482d4e..c3107ec 100644
--- a/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceSelectionAccessTest.php
+++ b/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceSelectionAccessTest.php
@@ -248,7 +248,7 @@ class EntityReferenceSelectionAccessTest extends WebTestBase {
),
);
- $user_values['anonymous']->name = config('user.settings')->get('anonymous');
+ $user_values['anonymous']->name = \Drupal::config('user.settings')->get('anonymous');
$users = array();
$user_labels = array();
diff --git a/core/modules/field/field.module b/core/modules/field/field.module
index 2457e4a..c2eda35 100644
--- a/core/modules/field/field.module
+++ b/core/modules/field/field.module
@@ -191,7 +191,7 @@ function field_cron() {
field_sync_field_status();
// Do a pass of purging on deleted Field API data, if any exists.
- $limit = config('field.settings')->get('purge_batch_size');
+ $limit = Drupal::config('field.settings')->get('purge_batch_size');
field_purge_batch($limit);
}
diff --git a/core/modules/field/field.multilingual.inc b/core/modules/field/field.multilingual.inc
index ca33a31..0442bbd 100644
--- a/core/modules/field/field.multilingual.inc
+++ b/core/modules/field/field.multilingual.inc
@@ -155,7 +155,7 @@ function field_content_languages() {
* Checks whether field language fallback is enabled.
*/
function field_language_fallback_enabled() {
- return language_multilingual() && config('field.settings')->get('language_fallback');
+ return language_multilingual() && Drupal::config('field.settings')->get('language_fallback');
}
/**
diff --git a/core/modules/field/lib/Drupal/field/Tests/CrudTest.php b/core/modules/field/lib/Drupal/field/Tests/CrudTest.php
index 70c2236..8e16c3e 100644
--- a/core/modules/field/lib/Drupal/field/Tests/CrudTest.php
+++ b/core/modules/field/lib/Drupal/field/Tests/CrudTest.php
@@ -64,7 +64,7 @@ class CrudTest extends FieldUnitTestBase {
$this->assertEqual($field_config['settings'], $field_type['settings'], 'Default field settings have been written.');
// Ensure that default storage was set.
- $this->assertEqual($field_config['storage']['type'], config('field.settings')->get('default_storage'), 'The field type is properly saved.');
+ $this->assertEqual($field_config['storage']['type'], \Drupal::config('field.settings')->get('default_storage'), 'The field type is properly saved.');
// Guarantee that the name is unique.
try {
diff --git a/core/modules/field/lib/Drupal/field/Tests/FormTest.php b/core/modules/field/lib/Drupal/field/Tests/FormTest.php
index b7c600e..b263859 100644
--- a/core/modules/field/lib/Drupal/field/Tests/FormTest.php
+++ b/core/modules/field/lib/Drupal/field/Tests/FormTest.php
@@ -92,7 +92,7 @@ class FormTest extends FieldTestBase {
$this->drupalGet('entity_test/add');
// Create token value expected for description.
- $token_description = check_plain(config('system.site')->get('name')) . '_description';
+ $token_description = check_plain(\Drupal::config('system.site')->get('name')) . '_description';
$this->assertText($token_description, 'Token replacement for description is displayed');
$this->assertFieldByName("{$field_name}[$langcode][0][value]", '', 'Widget is displayed');
$this->assertNoField("{$field_name}[$langcode][1][value]", 'No extraneous widget is displayed');
diff --git a/core/modules/field_sql_storage/field_sql_storage.install b/core/modules/field_sql_storage/field_sql_storage.install
index 8d14ca8..5c9eef2 100644
--- a/core/modules/field_sql_storage/field_sql_storage.install
+++ b/core/modules/field_sql_storage/field_sql_storage.install
@@ -96,7 +96,7 @@ function field_sql_storage_update_8000(&$sandbox) {
// Retrieve the next field definition. When the index exceeds the number of
// 'configuration' fields, use it to iterate on deleted fields.
if (isset($config_names[$sandbox['index']])) {
- $field_config = config($config_names[$sandbox['index']])->get();
+ $field_config = Drupal::config($config_names[$sandbox['index']])->get();
}
else {
$field_config = $deleted_fields[$sandbox['index'] - count($config_names)];
diff --git a/core/modules/field_ui/lib/Drupal/field_ui/FieldOverview.php b/core/modules/field_ui/lib/Drupal/field_ui/FieldOverview.php
index 621c08d..d2208a1 100644
--- a/core/modules/field_ui/lib/Drupal/field_ui/FieldOverview.php
+++ b/core/modules/field_ui/lib/Drupal/field_ui/FieldOverview.php
@@ -92,7 +92,7 @@ class FieldOverview extends OverviewBase {
$field_types = $this->fieldTypeManager->getDefinitions();
// Field prefix.
- $field_prefix = config('field_ui.settings')->get('field_prefix');
+ $field_prefix = \Drupal::config('field_ui.settings')->get('field_prefix');
$form += array(
'#entity_type' => $this->entity_type,
@@ -327,7 +327,7 @@ class FieldOverview extends OverviewBase {
$field_name = $field['field_name'];
// Add the field prefix.
- $field_name = config('field_ui.settings')->get('field_prefix') . $field_name;
+ $field_name = \Drupal::config('field_ui.settings')->get('field_prefix') . $field_name;
form_set_value($form['fields']['_add_new_field']['field_name'], $field_name, $form_state);
}
diff --git a/core/modules/file/file.field.inc b/core/modules/file/file.field.inc
index 6445527..3e3806e 100644
--- a/core/modules/file/file.field.inc
+++ b/core/modules/file/file.field.inc
@@ -414,7 +414,7 @@ function file_field_widget_process($element, &$form_state, $form) {
// Add the description field if enabled.
if ($element['#description_field'] && $item['fids']) {
- $config = config('file.settings');
+ $config = Drupal::config('file.settings');
$element['description'] = array(
'#type' => $config->get('description.type'),
'#title' => t('Description'),
diff --git a/core/modules/file/file.install b/core/modules/file/file.install
index 614b07c..37b89ae 100644
--- a/core/modules/file/file.install
+++ b/core/modules/file/file.install
@@ -303,7 +303,7 @@ function file_update_8002() {
*/
function file_update_8003() {
foreach (config_get_storage_names_with_prefix('field.field.') as $config_name) {
- $field_config = config($config_name);
+ $field_config = Drupal::config($config_name);
// Only update file fields that use the default SQL storage.
if (in_array($field_config->get('type'), array('file', 'image')) && $field_config->get('storage.type') == 'field_sql_storage') {
$field = new Field($field_config->get());
diff --git a/core/modules/file/file.module b/core/modules/file/file.module
index e9352de..018eef6 100644
--- a/core/modules/file/file.module
+++ b/core/modules/file/file.module
@@ -875,7 +875,7 @@ function file_save_upload($form_field_name, $validators = array(), $destination
// rename filename.php.foo and filename.php to filename.php.foo.txt and
// filename.php.txt, respectively). Don't rename if 'allow_insecure_uploads'
// evaluates to TRUE.
- if (!config('system.file')->get('allow_insecure_uploads') && preg_match('/\.(php|pl|py|cgi|asp|js)(\.|$)/i', $file->getFilename()) && (substr($file->getFilename(), -4) != '.txt')) {
+ if (!Drupal::config('system.file')->get('allow_insecure_uploads') && preg_match('/\.(php|pl|py|cgi|asp|js)(\.|$)/i', $file->getFilename()) && (substr($file->getFilename(), -4) != '.txt')) {
$file->setMimeType('text/plain');
$file->setFileUri($file->getFileUri() . '.txt');
$file->setFilename($file->getFilename() . '.txt');
@@ -1663,7 +1663,7 @@ function file_icon_url(File $file, $icon_directory = NULL) {
function file_icon_path(File $file, $icon_directory = NULL) {
// Use the default set of icons if none specified.
if (!isset($icon_directory)) {
- $icon_directory = config('file.settings')->get('icon.directory');
+ $icon_directory = Drupal::config('file.settings')->get('icon.directory');
}
// If there's an icon matching the exact mimetype, go for it.
diff --git a/core/modules/file/lib/Drupal/file/Tests/RemoteFileSaveUploadTest.php b/core/modules/file/lib/Drupal/file/Tests/RemoteFileSaveUploadTest.php
index fb5e68b..b9932b7 100644
--- a/core/modules/file/lib/Drupal/file/Tests/RemoteFileSaveUploadTest.php
+++ b/core/modules/file/lib/Drupal/file/Tests/RemoteFileSaveUploadTest.php
@@ -27,6 +27,6 @@ class RemoteFileSaveUploadTest extends SaveUploadTest {
function setUp() {
parent::setUp();
- config('system.file')->set('default_scheme', 'dummy-remote')->save();
+ \Drupal::config('system.file')->set('default_scheme', 'dummy-remote')->save();
}
}
diff --git a/core/modules/file/lib/Drupal/file/Tests/SaveUploadTest.php b/core/modules/file/lib/Drupal/file/Tests/SaveUploadTest.php
index 84261cb..6246e5d 100644
--- a/core/modules/file/lib/Drupal/file/Tests/SaveUploadTest.php
+++ b/core/modules/file/lib/Drupal/file/Tests/SaveUploadTest.php
@@ -180,7 +180,7 @@ class SaveUploadTest extends FileManagedTestBase {
* Test dangerous file handling.
*/
function testHandleDangerousFile() {
- $config = config('system.file');
+ $config = \Drupal::config('system.file');
// Allow the .php extension and make sure it gets renamed to .txt for
// safety. Also check to make sure its MIME type was changed.
$edit = array(
@@ -224,7 +224,7 @@ class SaveUploadTest extends FileManagedTestBase {
*/
function testHandleFileMunge() {
// Ensure insecure uploads are disabled for this test.
- config('system.file')->set('allow_insecure_uploads', 0)->save();
+ \Drupal::config('system.file')->set('allow_insecure_uploads', 0)->save();
$this->image = file_move($this->image, $this->image->getFileUri() . '.foo.' . $this->image_extension);
// Reset the hook counters to get rid of the 'move' we just called.
diff --git a/core/modules/filter/filter.install b/core/modules/filter/filter.install
index b450c36..8508e9d 100644
--- a/core/modules/filter/filter.install
+++ b/core/modules/filter/filter.install
@@ -49,7 +49,7 @@ function filter_update_8001() {
$format['filters'] = $filters;
// Save the config object.
- $config = config('filter.format.' . $id);
+ $config = Drupal::config('filter.format.' . $id);
$config->setData($format);
$config->save();
}
diff --git a/core/modules/filter/filter.module b/core/modules/filter/filter.module
index 1a0d9d1..58d3a07 100644
--- a/core/modules/filter/filter.module
+++ b/core/modules/filter/filter.module
@@ -584,7 +584,7 @@ function filter_fallback_format() {
// existing (and potentially unsafe) text format on the site automatically
// available to all users. Returning NULL at least guarantees that this
// cannot happen.
- return config('filter.settings')->get('fallback_format');
+ return Drupal::config('filter.settings')->get('fallback_format');
}
/**
@@ -839,7 +839,7 @@ function filter_process_format($element) {
// If multiple text formats are available, remove the fallback. The
// "always_show_fallback_choice" is a hidden variable that has no UI. It
// defaults to false.
- if (!config('filter.settings')->get('always_show_fallback_choice')) {
+ if (!Drupal::config('filter.settings')->get('always_show_fallback_choice')) {
$fallback_format = filter_fallback_format();
if ($element['#format'] !== $fallback_format && count($formats) > 1) {
unset($formats[$fallback_format]);
@@ -1209,7 +1209,7 @@ function _filter_url($text, $filter) {
// we cannot cleanly differ between protocols here without hard-coding MAILTO,
// so '//' is optional for all protocols.
// @see filter_xss_bad_protocol()
- $protocols = config('system.filter')->get('protocols');
+ $protocols = Drupal::config('system.filter')->get('protocols');
$protocols = implode(':(?://)?|', $protocols) . ':(?://)?';
$valid_url_path_characters = "[\p{L}\p{M}\p{N}!\*\';:=\+,\.\$\/%#\[\]\-_~@&]";
diff --git a/core/modules/filter/lib/Drupal/filter/Plugin/Filter/FilterHtml.php b/core/modules/filter/lib/Drupal/filter/Plugin/Filter/FilterHtml.php
index 177ccdb..04c312a 100644
--- a/core/modules/filter/lib/Drupal/filter/Plugin/Filter/FilterHtml.php
+++ b/core/modules/filter/lib/Drupal/filter/Plugin/Filter/FilterHtml.php
@@ -102,7 +102,7 @@ class FilterHtml extends FilterBase {
$output .= '<p>' . t('This site allows HTML content. While learning all of HTML may feel intimidating, learning how to use a very small number of the most basic HTML "tags" is very easy. This table provides examples for each tag that is enabled on this site.') . '</p>';
$output .= '<p>' . t('For more information see W3C\'s <a href="@html-specifications">HTML Specifications</a> or use your favorite search engine to find other sites that explain HTML.', array('@html-specifications' => 'http://www.w3.org/TR/html/')) . '</p>';
$tips = array(
- 'a' => array(t('Anchors are used to make links to other pages.'), '<a href="' . $base_url . '">' . check_plain(config('system.site')->get('name')) . '</a>'),
+ 'a' => array(t('Anchors are used to make links to other pages.'), '<a href="' . $base_url . '">' . check_plain(\Drupal::config('system.site')->get('name')) . '</a>'),
'br' => array(t('By default line break tags are automatically added, so use this tag to add additional ones. Use of this tag is different because it is not used with an open/close pair like all the others. Use the extra " /" inside the tag to maintain XHTML 1.0 compatibility'), t('Text with <br />line break')),
'p' => array(t('By default paragraph tags are automatically added, so use this tag to add additional ones.'), '<p>' . t('Paragraph one.') . '</p> <p>' . t('Paragraph two.') . '</p>'),
'strong' => array(t('Strong', array(), array('context' => 'Font weight')), '<strong>' . t('Strong', array(), array('context' => 'Font weight')) . '</strong>'),
diff --git a/core/modules/filter/lib/Drupal/filter/Tests/FilterAdminTest.php b/core/modules/filter/lib/Drupal/filter/Tests/FilterAdminTest.php
index 5039305..5f3f6fd 100644
--- a/core/modules/filter/lib/Drupal/filter/Tests/FilterAdminTest.php
+++ b/core/modules/filter/lib/Drupal/filter/Tests/FilterAdminTest.php
@@ -248,7 +248,7 @@ class FilterAdminTest extends WebTestBase {
// Use plain text and see if it escapes all tags, whether allowed or not.
// In order to test plain text, we have to enable the hidden variable for
// "show_fallback_format", which displays plain text in the format list.
- config('filter.settings')
+ \Drupal::config('filter.settings')
->set('always_show_fallback_choice', TRUE)
->save();
$edit = array();
@@ -256,7 +256,7 @@ class FilterAdminTest extends WebTestBase {
$this->drupalPost('node/' . $node->id() . '/edit', $edit, t('Save'));
$this->drupalGet('node/' . $node->id());
$this->assertText(check_plain($text), 'The "Plain text" text format escapes all HTML tags.');
- config('filter.settings')
+ \Drupal::config('filter.settings')
->set('always_show_fallback_choice', FALSE)
->save();
diff --git a/core/modules/filter/lib/Drupal/filter/Tests/FilterUnitTest.php b/core/modules/filter/lib/Drupal/filter/Tests/FilterUnitTest.php
index cd5a762..d3461f3 100644
--- a/core/modules/filter/lib/Drupal/filter/Tests/FilterUnitTest.php
+++ b/core/modules/filter/lib/Drupal/filter/Tests/FilterUnitTest.php
@@ -431,7 +431,7 @@ me@me.tv
),
// Absolute URL protocols.
// The list to test is found in the beginning of _filter_url() at
- // $protocols = config('system.filter')->get('protocols')... (approx line 1555).
+ // $protocols = \Drupal::config('system.filter')->get('protocols')... (approx line 1555).
'
https://example.com,
ftp://ftp.example.com,
diff --git a/core/modules/forum/forum.admin.inc b/core/modules/forum/forum.admin.inc
index 7b19630..c63b21f 100644
--- a/core/modules/forum/forum.admin.inc
+++ b/core/modules/forum/forum.admin.inc
@@ -18,7 +18,7 @@ use Drupal\taxonomy\Plugin\Core\Entity\Term;
*/
function forum_overview($form, &$form_state) {
module_load_include('inc', 'taxonomy', 'taxonomy.admin');
- $config = config('forum.settings');
+ $config = Drupal::config('forum.settings');
$vid = $config->get('vocabulary');
$vocabulary = entity_load('taxonomy_vocabulary', $vid);
diff --git a/core/modules/forum/forum.install b/core/modules/forum/forum.install
index cd7ebdb..60efc30 100644
--- a/core/modules/forum/forum.install
+++ b/core/modules/forum/forum.install
@@ -24,7 +24,7 @@ function forum_enable() {
// Create the forum vocabulary if it does not exist.
// @todo Change Forum module so forum.settings can contain the vocabulary's
// machine name.
- $config = config('forum.settings');
+ $config = Drupal::config('forum.settings');
// If the module was disabled only, the current config may contain a valid
// vocabulary ID already.
$vocabulary = entity_load('taxonomy_vocabulary', $config->get('vocabulary'));
diff --git a/core/modules/forum/forum.module b/core/modules/forum/forum.module
index 4621ddd..46921af 100644
--- a/core/modules/forum/forum.module
+++ b/core/modules/forum/forum.module
@@ -237,7 +237,7 @@ function forum_entity_info(&$info) {
*/
function forum_entity_bundle_info_alter(&$bundles) {
// Take over URI construction for taxonomy terms that are forums.
- if ($vid = config('forum.settings')->get('vocabulary')) {
+ if ($vid = Drupal::config('forum.settings')->get('vocabulary')) {
if (isset($bundles['taxonomy_term'][$vid])) {
$bundles['taxonomy_term'][$vid]['uri_callback'] = 'forum_uri';
}
@@ -280,7 +280,7 @@ function forum_node_validate(EntityInterface $node, $form) {
// vocabulary is selected, not a "container" term.
if (!empty($node->taxonomy_forums[$langcode])) {
// Extract the node's proper topic ID.
- $containers = config('forum.settings')->get('containers');
+ $containers = Drupal::config('forum.settings')->get('containers');
foreach ($node->taxonomy_forums[$langcode] as $delta => $item) {
// If no term was selected (e.g. when no terms exist yet), remove the
// item.
@@ -450,7 +450,7 @@ function forum_permission() {
*/
function forum_taxonomy_term_delete(Term $term) {
// For containers, remove the tid from the forum_containers variable.
- $config = config('forum.settings');
+ $config = Drupal::config('forum.settings');
$containers = $config->get('containers');
$key = array_search($term->id(), $containers);
if ($key !== FALSE) {
@@ -569,7 +569,7 @@ function forum_field_storage_pre_update(EntityInterface $entity, &$skip_fields)
* Implements hook_form_BASE_FORM_ID_alter().
*/
function forum_form_taxonomy_vocabulary_form_alter(&$form, &$form_state, $form_id) {
- $vid = config('forum.settings')->get('vocabulary');
+ $vid = Drupal::config('forum.settings')->get('vocabulary');
$vocabulary = $form_state['controller']->getEntity();
if ($vid == $vocabulary->id()) {
$form['help_forum_vocab'] = array(
@@ -591,7 +591,7 @@ function forum_form_taxonomy_vocabulary_form_alter(&$form, &$form_state, $form_i
* Implements hook_form_FORM_ID_alter() for taxonomy_term_form().
*/
function forum_form_taxonomy_term_form_alter(&$form, &$form_state, $form_id) {
- $vid = config('forum.settings')->get('vocabulary');
+ $vid = Drupal::config('forum.settings')->get('vocabulary');
if (isset($form['vid']['#value']) && $form['vid']['#value'] == $vid) {
// Hide multiple parents select from forum terms.
$form['relations']['parent']['#access'] = FALSE;
@@ -673,7 +673,7 @@ function forum_forum_load($tid = NULL) {
return $cache[$tid];
}
- $config = config('forum.settings');
+ $config = Drupal::config('forum.settings');
$vid = $config->get('vocabulary');
// Load and validate the parent term.
@@ -988,7 +988,7 @@ function template_preprocess_forums(&$variables) {
$variables['forums'] = array();
}
- if ($variables['tid'] && array_search($variables['tid'], config('forum.settings')->get('containers')) === FALSE) {
+ if ($variables['tid'] && array_search($variables['tid'], Drupal::config('forum.settings')->get('containers')) === FALSE) {
$variables['topics'] = array(
'#theme' => 'forum_topic_list',
'#tid' => $variables['tid'],
@@ -1173,7 +1173,7 @@ function template_preprocess_forum_topic_list(&$variables) {
* - first_new: Indicates whether this is the first topic with new posts.
*/
function template_preprocess_forum_icon(&$variables) {
- $variables['hot_threshold'] = config('forum.settings')->get('topics.hot_threshold');
+ $variables['hot_threshold'] = Drupal::config('forum.settings')->get('topics.hot_threshold');
if ($variables['num_posts'] > $variables['hot_threshold']) {
$icon_status_class = $variables['new_posts'] ? 'hot-new' : 'hot';
diff --git a/core/modules/forum/forum.pages.inc b/core/modules/forum/forum.pages.inc
index 6278bf3..3908f31 100644
--- a/core/modules/forum/forum.pages.inc
+++ b/core/modules/forum/forum.pages.inc
@@ -18,7 +18,7 @@
* @see forum_menu()
*/
function forum_page($forum_term = NULL) {
- $config = config('forum.settings');
+ $config = Drupal::config('forum.settings');
$vocabulary = entity_load('taxonomy_vocabulary', $config->get('vocabulary'));
if (!isset($forum_term)) {
diff --git a/core/modules/forum/lib/Drupal/forum/Tests/ForumTest.php b/core/modules/forum/lib/Drupal/forum/Tests/ForumTest.php
index fe50a4d..d09baf5 100644
--- a/core/modules/forum/lib/Drupal/forum/Tests/ForumTest.php
+++ b/core/modules/forum/lib/Drupal/forum/Tests/ForumTest.php
@@ -240,7 +240,7 @@ class ForumTest extends WebTestBase {
*/
function testAddOrphanTopic() {
// Must remove forum topics to test creating orphan topics.
- $vid = config('forum.settings')->get('vocabulary');
+ $vid = \Drupal::config('forum.settings')->get('vocabulary');
$tids = \Drupal::entityQuery('taxonomy_term')
->condition('vid', $vid)
->execute();
@@ -340,7 +340,7 @@ class ForumTest extends WebTestBase {
*/
function editForumVocabulary() {
// Backup forum taxonomy.
- $vid = config('forum.settings')->get('vocabulary');
+ $vid = \Drupal::config('forum.settings')->get('vocabulary');
$original_vocabulary = entity_load('taxonomy_vocabulary', $vid);
// Generate a random name and description.
@@ -406,7 +406,7 @@ class ForumTest extends WebTestBase {
);
// Verify forum.
- $term = db_query("SELECT * FROM {taxonomy_term_data} t WHERE t.vid = :vid AND t.name = :name AND t.description = :desc", array(':vid' => config('forum.settings')->get('vocabulary'), ':name' => $name, ':desc' => $description))->fetchAssoc();
+ $term = db_query("SELECT * FROM {taxonomy_term_data} t WHERE t.vid = :vid AND t.name = :name AND t.description = :desc", array(':vid' => \Drupal::config('forum.settings')->get('vocabulary'), ':name' => $name, ':desc' => $description))->fetchAssoc();
$this->assertTrue(!empty($term), 'The ' . $type . ' exists in the database');
// Verify forum hierarchy.
@@ -437,7 +437,7 @@ class ForumTest extends WebTestBase {
// Assert that the associated term has been removed from the
// forum_containers variable.
- $containers = config('forum.settings')->get('containers');
+ $containers = \Drupal::config('forum.settings')->get('containers');
$this->assertFalse(in_array($tid, $containers), 'The forum_containers variable has been updated.');
}
diff --git a/core/modules/image/image.admin.inc b/core/modules/image/image.admin.inc
index 5f8d46a..a2280ff 100644
--- a/core/modules/image/image.admin.inc
+++ b/core/modules/image/image.admin.inc
@@ -70,7 +70,7 @@ function theme_image_style_effects($variables) {
function theme_image_style_preview($variables) {
$style = $variables['style'];
- $sample_image = config('image.settings')->get('preview_image');
+ $sample_image = Drupal::config('image.settings')->get('preview_image');
$sample_width = 160;
$sample_height = 160;
diff --git a/core/modules/image/image.install b/core/modules/image/image.install
index 58cf110..39ddedf 100644
--- a/core/modules/image/image.install
+++ b/core/modules/image/image.install
@@ -158,7 +158,7 @@ function image_update_8000() {
// Convert each style into a configuration object.
foreach ($styles as $name => $style) {
- $config = config('image.style.' . $name);
+ $config = Drupal::config('image.style.' . $name);
$config->set('name', $name);
$config->set('effects', $style['effects']);
$config->save();
diff --git a/core/modules/image/lib/Drupal/image/Tests/ImageStylesPathAndUrlTest.php b/core/modules/image/lib/Drupal/image/Tests/ImageStylesPathAndUrlTest.php
index 4648701..880ee6f 100644
--- a/core/modules/image/lib/Drupal/image/Tests/ImageStylesPathAndUrlTest.php
+++ b/core/modules/image/lib/Drupal/image/Tests/ImageStylesPathAndUrlTest.php
@@ -109,7 +109,7 @@ class ImageStylesPathAndUrlTest extends WebTestBase {
// Make the default scheme neither "public" nor "private" to verify the
// functions work for other than the default scheme.
- config('system.file')->set('default_scheme', 'temporary')->save();
+ \Drupal::config('system.file')->set('default_scheme', 'temporary')->save();
// Create the directories for the styles.
$directory = $scheme . '://styles/' . $this->style->id();
@@ -200,7 +200,7 @@ class ImageStylesPathAndUrlTest extends WebTestBase {
// Allow insecure image derivatives to be created for the remainder of this
// test.
- config('image.settings')->set('allow_insecure_derivatives', TRUE)->save();
+ \Drupal::config('image.settings')->set('allow_insecure_derivatives', TRUE)->save();
// Create another working copy of the file.
$files = $this->drupalGetTestFiles('image');
@@ -213,7 +213,7 @@ class ImageStylesPathAndUrlTest extends WebTestBase {
// Suppress the security token in the URL, then get the URL of a file that
// has not been created and try to create it. Check that the security token
// is not present in the URL but that the image is still accessible.
- config('image.settings')->set('suppress_itok_output', TRUE)->save();
+ \Drupal::config('image.settings')->set('suppress_itok_output', TRUE)->save();
$generated_uri = $this->style->buildUri($original_uri);
$this->assertFalse(file_exists($generated_uri), 'Generated file does not exist.');
$generate_url = $this->style->buildUrl($original_uri, $clean_url);
diff --git a/core/modules/language/language.admin.inc b/core/modules/language/language.admin.inc
index 041398e..979419e 100644
--- a/core/modules/language/language.admin.inc
+++ b/core/modules/language/language.admin.inc
@@ -284,7 +284,7 @@ function language_negotiation_configure_form() {
'#language_negotiation_info' => language_negotiation_info(),
);
$form['#language_types'] = array();
- $configurable = config('system.language.types')->get('configurable');
+ $configurable = Drupal::config('system.language.types')->get('configurable');
foreach ($form['#language_types_info'] as $type => $info) {
// Show locked language types only if they are configurable.
if (empty($info['locked']) || in_array($type, $configurable)) {
@@ -320,7 +320,7 @@ function language_negotiation_configure_form_table(&$form, $type) {
);
// Only show configurability checkbox for the unlocked language types.
if (empty($info['locked'])) {
- $configurable = config('system.language.types')->get('configurable');
+ $configurable = Drupal::config('system.language.types')->get('configurable');
$table_form['configurable'] = array(
'#type' => 'checkbox',
'#title' => t('Customize %language_name language detection to differ from User interface text language detection settings.', array('%language_name' => $info['name'])),
@@ -483,7 +483,7 @@ function theme_language_negotiation_configure_form($variables) {
function language_negotiation_configure_form_submit($form, &$form_state) {
$configurable_types = $form['#language_types'];
- $stored_values = config('system.language.types')->get('configurable');
+ $stored_values = Drupal::config('system.language.types')->get('configurable');
$customized = array();
$method_weights_type = array();
diff --git a/core/modules/language/language.module b/core/modules/language/language.module
index 66433d3..4d2688c 100644
--- a/core/modules/language/language.module
+++ b/core/modules/language/language.module
@@ -363,7 +363,7 @@ function language_configuration_element_submit(&$form, &$form_state) {
* - language_show: if the language element should be hidden or not.
*/
function language_save_default_configuration($entity_type, $bundle, $values = array()) {
- config('language.settings')->set(language_get_default_configuration_settings_key($entity_type, $bundle), array('langcode' => $values['langcode'], 'language_show' => $values['language_show']))->save();
+ Drupal::config('language.settings')->set(language_get_default_configuration_settings_key($entity_type, $bundle), array('langcode' => $values['langcode'], 'language_show' => $values['language_show']))->save();
}
/**
@@ -380,7 +380,7 @@ function language_save_default_configuration($entity_type, $bundle, $values = ar
* - language_show: if the language element is hidden or not.
*/
function language_get_default_configuration($entity_type, $bundle) {
- $configuration = config('language.settings')->get(language_get_default_configuration_settings_key($entity_type, $bundle));
+ $configuration = Drupal::config('language.settings')->get(language_get_default_configuration_settings_key($entity_type, $bundle));
if (is_null($configuration)) {
$configuration = array();
}
@@ -397,7 +397,7 @@ function language_get_default_configuration($entity_type, $bundle) {
* A string representing the bundle.
*/
function language_clear_default_configuration($entity_type, $bundle) {
- config('language.settings')->clear(language_get_default_configuration_settings_key($entity_type, $bundle))->save();
+ Drupal::config('language.settings')->clear(language_get_default_configuration_settings_key($entity_type, $bundle))->save();
}
/**
@@ -803,7 +803,7 @@ function language_preprocess_block(&$variables) {
* Drupal language codes as values.
*/
function language_get_browser_drupal_langcode_mappings() {
- $config = config('language.mappings');
+ $config = Drupal::config('language.mappings');
if ($config->isNew()) {
return array();
}
@@ -818,7 +818,7 @@ function language_get_browser_drupal_langcode_mappings() {
* Drupal language codes as values.
*/
function language_set_browser_drupal_langcode_mappings($mappings) {
- $config = config('language.mappings');
+ $config = Drupal::config('language.mappings');
$config->setData($mappings);
$config->save();
}
diff --git a/core/modules/language/language.negotiation.inc b/core/modules/language/language.negotiation.inc
index 9e145bb..8834812 100644
--- a/core/modules/language/language.negotiation.inc
+++ b/core/modules/language/language.negotiation.inc
@@ -243,7 +243,7 @@ function language_from_user_admin(array $languages, Request $request = NULL) {
* A valid language code on success, FALSE otherwise.
*/
function language_from_session($languages) {
- $param = config('language.negotiation')->get('session.parameter');
+ $param = Drupal::config('language.negotiation')->get('session.parameter');
// Request parameter: we need to update the session parameter only if we have
// an authenticated user.
@@ -283,7 +283,7 @@ function language_from_url($languages, Request $request = NULL) {
return $language_url;
}
- switch (config('language.negotiation')->get('url.source')) {
+ switch (Drupal::config('language.negotiation')->get('url.source')) {
case LANGUAGE_NEGOTIATION_URL_PREFIX:
$request_path = urldecode(trim($request->getPathInfo(), '/'));
@@ -359,7 +359,7 @@ function language_from_url($languages, Request $request = NULL) {
*/
function language_url_fallback($language = NULL, $request = NULL, $language_type = Language::TYPE_INTERFACE) {
$default = language_default();
- $prefix = (config('language.negotiation')->get('url.source') == LANGUAGE_NEGOTIATION_URL_PREFIX);
+ $prefix = (Drupal::config('language.negotiation')->get('url.source') == LANGUAGE_NEGOTIATION_URL_PREFIX);
// If the default language is not configured to convey language information,
// a missing URL language information indicates that URL language should be
@@ -400,7 +400,7 @@ function language_switcher_url($type, $path) {
* Return the session language switcher block.
*/
function language_switcher_session($type, $path) {
- $param = config('language.negotiation')->get('session.parameter');
+ $param = Drupal::config('language.negotiation')->get('session.parameter');
$language_query = isset($_SESSION[$param]) ? $_SESSION[$param] : language($type)->id;
$languages = language_list();
@@ -431,7 +431,7 @@ function language_switcher_session($type, $path) {
* Reads language prefixes and uses the langcode if no prefix is set.
*/
function language_negotiation_url_prefixes() {
- return config('language.negotiation')->get('url.prefixes');
+ return Drupal::config('language.negotiation')->get('url.prefixes');
}
/**
@@ -456,7 +456,7 @@ function language_negotiation_url_prefixes_update() {
* Saves language prefix settings.
*/
function language_negotiation_url_prefixes_save(array $prefixes) {
- config('language.negotiation')
+ Drupal::config('language.negotiation')
->set('url.prefixes', $prefixes)
->save();
}
@@ -465,14 +465,14 @@ function language_negotiation_url_prefixes_save(array $prefixes) {
* Reads language domains.
*/
function language_negotiation_url_domains() {
- return config('language.negotiation')->get('url.domains');
+ return Drupal::config('language.negotiation')->get('url.domains');
}
/**
* Saves the language domain settings.
*/
function language_negotiation_url_domains_save(array $domains) {
- config('language.negotiation')
+ Drupal::config('language.negotiation')
->set('url.domains', $domains)
->save();
}
@@ -489,7 +489,7 @@ function language_url_rewrite_session(&$path, &$options) {
global $user;
if (!$user->id()) {
$languages = language_list();
- $query_param = check_plain(config('language.negotiation')->get('session.parameter'));
+ $query_param = check_plain(Drupal::config('language.negotiation')->get('session.parameter'));
$query_value = isset($_GET[$query_param]) ? check_plain($_GET[$query_param]) : NULL;
$query_rewrite = isset($languages[$query_value]) && language_negotiation_method_enabled(LANGUAGE_NEGOTIATION_SESSION);
}
diff --git a/core/modules/language/lib/Drupal/language/Tests/LanguageUILanguageNegotiationTest.php b/core/modules/language/lib/Drupal/language/Tests/LanguageUILanguageNegotiationTest.php
index d6dc853..e039341 100644
--- a/core/modules/language/lib/Drupal/language/Tests/LanguageUILanguageNegotiationTest.php
+++ b/core/modules/language/lib/Drupal/language/Tests/LanguageUILanguageNegotiationTest.php
@@ -159,7 +159,7 @@ class LanguageUILanguageNegotiationTest extends WebTestBase {
$this->runTest($test);
// An invalid language is selected.
- config('language.negotiation')->set('selected_langcode', NULL)->save();
+ \Drupal::config('language.negotiation')->set('selected_langcode', NULL)->save();
$test = array(
'language_negotiation' => array(LANGUAGE_NEGOTIATION_SELECTED),
'path' => 'admin/config',
@@ -171,7 +171,7 @@ class LanguageUILanguageNegotiationTest extends WebTestBase {
$this->runTest($test);
// No selected language is available.
- config('language.negotiation')->set('selected_langcode', $langcode_unknown)->save();
+ \Drupal::config('language.negotiation')->set('selected_langcode', $langcode_unknown)->save();
$test = array(
'language_negotiation' => array(LANGUAGE_NEGOTIATION_SELECTED),
'path' => 'admin/config',
@@ -367,7 +367,7 @@ class LanguageUILanguageNegotiationTest extends WebTestBase {
language_negotiation_set(Language::TYPE_INTERFACE, $method_weights);
}
if (!empty($test['language_negotiation_url_part'])) {
- config('language.negotiation')
+ \Drupal::config('language.negotiation')
->set('url.source', $test['language_negotiation_url_part'])
->save();
}
diff --git a/core/modules/language/lib/Drupal/language/Tests/LanguageUrlRewritingTest.php b/core/modules/language/lib/Drupal/language/Tests/LanguageUrlRewritingTest.php
index 8379ca2..5266fd1 100644
--- a/core/modules/language/lib/Drupal/language/Tests/LanguageUrlRewritingTest.php
+++ b/core/modules/language/lib/Drupal/language/Tests/LanguageUrlRewritingTest.php
@@ -114,7 +114,7 @@ class LanguageUrlRewritingTest extends WebTestBase {
$this->rebuildContainer();
// Enable domain configuration.
- config('language.negotiation')
+ \Drupal::config('language.negotiation')
->set('url.source', LANGUAGE_NEGOTIATION_URL_DOMAIN)
->save();
diff --git a/core/modules/language/tests/language_test/language_test.module b/core/modules/language/tests/language_test/language_test.module
index 267cdf3..c3386cf 100644
--- a/core/modules/language/tests/language_test/language_test.module
+++ b/core/modules/language/tests/language_test/language_test.module
@@ -47,10 +47,10 @@ function language_test_language_types_info_alter(array &$language_types) {
unset($language_types[Language::TYPE_CONTENT]['fixed']);
// By default languages are not configurable. Make Language::TYPE_CONTENT
// configurable.
- $configurable = config('system.language.types')->get('configurable');
+ $configurable = Drupal::config('system.language.types')->get('configurable');
if (!in_array(Language::TYPE_CONTENT, $configurable)) {
$configurable[] = Language::TYPE_CONTENT;
- config('system.language.types')->set('configurable', $configurable)->save();
+ Drupal::config('system.language.types')->set('configurable', $configurable)->save();
}
}
}
diff --git a/core/modules/layout/lib/Drupal/layout/Config/DisplayInterface.php b/core/modules/layout/lib/Drupal/layout/Config/DisplayInterface.php
index 916d897..4130f6c 100644
--- a/core/modules/layout/lib/Drupal/layout/Config/DisplayInterface.php
+++ b/core/modules/layout/lib/Drupal/layout/Config/DisplayInterface.php
@@ -41,7 +41,7 @@ interface DisplayInterface extends ConfigEntityInterface {
* displays (e.g., by a "regular" page, by an administrative page, and within
* one or more dashboards). This function returns the block instances that
* have been added to this display. Each key of the returned array is the
- * block instance's configuration object name, and config() may be called on
+ * block instance's configuration object name, and \Drupal::config() may be called on
* it in order to retrieve the full configuration that is shared across all
* displays. For each key, the value is an array of display-specific
* configuration, primarily the 'region' and 'weight', and anything else that
diff --git a/core/modules/locale/lib/Drupal/locale/Form/LocaleSettingsForm.php b/core/modules/locale/lib/Drupal/locale/Form/LocaleSettingsForm.php
index 5669d8f..826ba38 100644
--- a/core/modules/locale/lib/Drupal/locale/Form/LocaleSettingsForm.php
+++ b/core/modules/locale/lib/Drupal/locale/Form/LocaleSettingsForm.php
@@ -44,7 +44,7 @@ class LocaleSettingsForm extends SystemConfigFormBase {
'#default_value' => $config->get('translation.check_disabled_modules'),
);
- if ($directory =config('locale.settings')->get('translation.path')) {
+ if ($directory =\Drupal::config('locale.settings')->get('translation.path')) {
$description = t('Translation files are stored locally in the %path directory. You can change this directory on the <a href="@url">File system</a> configuration page.', array('%path' => $directory, '@url' => url('admin/config/media/file-system')));
}
else {
diff --git a/core/modules/locale/lib/Drupal/locale/LocaleLookup.php b/core/modules/locale/lib/Drupal/locale/LocaleLookup.php
index 075a815..6881092 100644
--- a/core/modules/locale/lib/Drupal/locale/LocaleLookup.php
+++ b/core/modules/locale/lib/Drupal/locale/LocaleLookup.php
@@ -106,7 +106,7 @@ class LocaleLookup extends CacheCollector {
// the exact list of strings used on a page. From a performance
// perspective that is a really bad idea, so we have no user
// interface for this. Be careful when turning this option off!
- if (config('locale.settings')->get('cache_strings')) {
+ if (\Drupal::config('locale.settings')->get('cache_strings')) {
$this->persist($offset);
}
return $value;
diff --git a/core/modules/locale/lib/Drupal/locale/PoDatabaseWriter.php b/core/modules/locale/lib/Drupal/locale/PoDatabaseWriter.php
index b28748a..dd44492 100644
--- a/core/modules/locale/lib/Drupal/locale/PoDatabaseWriter.php
+++ b/core/modules/locale/lib/Drupal/locale/PoDatabaseWriter.php
@@ -155,7 +155,7 @@ class PoDatabaseWriter implements PoWriterInterface {
*/
function setHeader(PoHeader $header) {
$this->_header = $header;
- $config = config('locale.settings');
+ $config = \Drupal::config('locale.settings');
$locale_plurals = \Drupal::state()->get('locale.translation.plurals') ?: array();
// Check for options.
diff --git a/core/modules/locale/lib/Drupal/locale/Tests/LocaleConfigTranslationTest.php b/core/modules/locale/lib/Drupal/locale/Tests/LocaleConfigTranslationTest.php
index 414cde0..aa53fbb 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 @@ class LocaleConfigTranslationTest extends WebTestBase {
$this->assertEqual($property->getValue(), $image_style_label, 'Got the right translation for image style name after translation');
// Quick test to ensure translation file exists.
- $this->assertEqual(config('locale.config.xx.image.style.medium')->get('label'), $image_style_label);
+ $this->assertEqual(\Drupal::config('locale.config.xx.image.style.medium')->get('label'), $image_style_label);
// Disable and uninstall the module.
$this->drupalPost('admin/modules', array('modules[Core][image][enable]' => FALSE), t('Save configuration'));
@@ -144,7 +144,7 @@ class LocaleConfigTranslationTest extends WebTestBase {
$this->drupalPost(NULL, array(), t('Uninstall'));
// Ensure that the translated configuration has been removed.
- $this->assertFalse(config('locale.config.xx.image.style.medium')->get('label'), 'Translated configuration for image module removed.');
+ $this->assertFalse(\Drupal::config('locale.config.xx.image.style.medium')->get('label'), 'Translated configuration for image module removed.');
}
}
diff --git a/core/modules/locale/lib/Drupal/locale/Tests/LocaleImportFunctionalTest.php b/core/modules/locale/lib/Drupal/locale/Tests/LocaleImportFunctionalTest.php
index 198207b..f8fb4c4 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 @@ class LocaleImportFunctionalTest extends WebTestBase {
$this->importPoFile($this->getPoFile(), array(
'langcode' => 'fr',
));
- $config = config('locale.settings');
+ $config = \Drupal::config('locale.settings');
// The import should automatically create the corresponding language.
$this->assertRaw(t('The language %language has been created.', array('%language' => 'French')), 'The language has been automatically created.');
diff --git a/core/modules/locale/lib/Drupal/locale/Tests/LocalePathTest.php b/core/modules/locale/lib/Drupal/locale/Tests/LocalePathTest.php
index f81c916..878444d 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 @@ class LocalePathTest extends WebTestBase {
parent::setUp();
$this->drupalCreateContentType(array('type' => 'page', 'name' => 'Basic page'));
- config('system.site')->set('page.front', 'node')->save();
+ \Drupal::config('system.site')->set('page.front', 'node')->save();
}
/**
diff --git a/core/modules/locale/lib/Drupal/locale/Tests/LocaleTranslationUiTest.php b/core/modules/locale/lib/Drupal/locale/Tests/LocaleTranslationUiTest.php
index 167fc6a..e391022 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 @@ class LocaleTranslationUiTest extends WebTestBase {
function testJavaScriptTranslation() {
$user = $this->drupalCreateUser(array('translate interface', 'administer languages', 'access administration pages'));
$this->drupalLogin($user);
- $config = config('locale.settings');
+ $config = \Drupal::config('locale.settings');
$langcode = 'xx';
// The English name for the language. This will be translated.
diff --git a/core/modules/locale/lib/Drupal/locale/Tests/LocaleUninstallTest.php b/core/modules/locale/lib/Drupal/locale/Tests/LocaleUninstallTest.php
index e2d1109..1cfb538 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 @@ class LocaleUninstallTest extends WebTestBase {
*/
function testUninstallProcess() {
$locale_module = array('locale', 'language');
- $config = config('locale.settings');
+ $config = \Drupal::config('locale.settings');
$language = new Language(array(
'id' => 'fr',
'name' => 'French',
@@ -87,7 +87,7 @@ class LocaleUninstallTest extends WebTestBase {
$edit = array('strings[' . $string->lid . '][translations][0]' => 'french translation');
$this->drupalPost('admin/config/regional/translate', $edit, t('Save translations'));
_locale_rebuild_js('fr');
- $config = config('locale.settings');
+ $config = \Drupal::config('locale.settings');
$locale_javascripts = $this->container->get('state')->get('locale.translation.javascript') ?: array();
$js_file = 'public://' . $config->get('javascript.directory') . '/fr_' . $locale_javascripts['fr'] . '.js';
$this->assertTrue($result = file_exists($js_file), String::format('JavaScript file created: %file', array('%file' => $result ? $js_file : 'none')));
@@ -103,7 +103,7 @@ class LocaleUninstallTest extends WebTestBase {
variable_set('language_negotiation_' . Language::TYPE_URL, language_language_negotiation_info());
// Change language negotiation settings.
- config('language.negotiation')
+ \Drupal::config('language.negotiation')
->set('url.source', LANGUAGE_NEGOTIATION_URL_PREFIX)
->set('session.parameter', TRUE)
->save();
@@ -136,8 +136,8 @@ class LocaleUninstallTest extends WebTestBase {
$this->assertTrue($language_negotiation, String::format('URL language negotiation: %setting', array('%setting' => $language_negotiation ? 'none' : 'set')));
// Check language negotiation method settings.
- $this->assertFalse(config('language.negotiation')->get('url.source'), 'URL language negotiation method indicator settings cleared.');
- $this->assertFalse(config('language.negotiation')->get('session.parameter'), 'Visit language negotiation method settings cleared.');
+ $this->assertFalse(\Drupal::config('language.negotiation')->get('url.source'), 'URL language negotiation method indicator settings cleared.');
+ $this->assertFalse(\Drupal::config('language.negotiation')->get('session.parameter'), 'Visit language negotiation method settings cleared.');
// Check JavaScript parsed.
$javascript_parsed_count = count($this->container->get('state')->get('system.javascript_parsed') ?: array());
diff --git a/core/modules/locale/lib/Drupal/locale/Tests/LocaleUpdateBase.php b/core/modules/locale/lib/Drupal/locale/Tests/LocaleUpdateBase.php
index e8562ba..46d082e 100644
--- a/core/modules/locale/lib/Drupal/locale/Tests/LocaleUpdateBase.php
+++ b/core/modules/locale/lib/Drupal/locale/Tests/LocaleUpdateBase.php
@@ -69,7 +69,7 @@ class LocaleUpdateBase extends WebTestBase {
protected function setTranslationsDirectory($path) {
$this->tranlations_directory = $path;
file_prepare_directory($path, FILE_CREATE_DIRECTORY);
- config('locale.settings')->set('translation.path', $path)->save();
+ \Drupal::config('locale.settings')->set('translation.path', $path)->save();
}
/**
@@ -165,7 +165,7 @@ EOF;
* imported.
*/
protected function setTranslationFiles() {
- $config = config('locale.settings');
+ $config = \Drupal::config('locale.settings');
// A flag is set to let the locale_test module replace the project data with
// a set of test projects which match the below project files.
diff --git a/core/modules/locale/lib/Drupal/locale/Tests/LocaleUpdateCronTest.php b/core/modules/locale/lib/Drupal/locale/Tests/LocaleUpdateCronTest.php
index 219b7f0..90a914f 100644
--- a/core/modules/locale/lib/Drupal/locale/Tests/LocaleUpdateCronTest.php
+++ b/core/modules/locale/lib/Drupal/locale/Tests/LocaleUpdateCronTest.php
@@ -46,7 +46,7 @@ class LocaleUpdateCronTest extends LocaleUpdateBase {
// Setup local and remote translations files.
$this->setTranslationFiles();
- config('locale.settings')->set('translation.default_filename', '%project-%version.%language._po')->save();
+ \Drupal::config('locale.settings')->set('translation.default_filename', '%project-%version.%language._po')->save();
// Update translations using batch to ensure a clean test starting point.
$this->drupalGet('admin/reports/translations/check');
diff --git a/core/modules/locale/lib/Drupal/locale/Tests/LocaleUpdateTest.php b/core/modules/locale/lib/Drupal/locale/Tests/LocaleUpdateTest.php
index cb19716..9f55abc 100644
--- a/core/modules/locale/lib/Drupal/locale/Tests/LocaleUpdateTest.php
+++ b/core/modules/locale/lib/Drupal/locale/Tests/LocaleUpdateTest.php
@@ -65,7 +65,7 @@ class LocaleUpdateTest extends LocaleUpdateBase {
*/
function testUpdateProjectsHidden() {
module_load_include('compare.inc', 'locale');
- $config = config('locale.settings');
+ $config = \Drupal::config('locale.settings');
// Make the test modules look like a normal custom module.
\Drupal::state()->set('locale.test_system_info_alter', TRUE);
@@ -97,7 +97,7 @@ class LocaleUpdateTest extends LocaleUpdateBase {
* for local files only, check for both local and remote files.
*/
function testUpdateCheckStatus() {
- $config = config('locale.settings');
+ $config = \Drupal::config('locale.settings');
// Set a flag to let the locale_test module replace the project data with a
// set of test projects.
\Drupal::state()->set('locale.test_projects_alter', TRUE);
@@ -149,7 +149,7 @@ class LocaleUpdateTest extends LocaleUpdateBase {
* - Import overwrite: all existing translations
*/
function testUpdateImportSourceRemote() {
- $config = config('locale.settings');
+ $config = \Drupal::config('locale.settings');
// Build the test environment.
$this->setTranslationFiles();
@@ -211,7 +211,7 @@ class LocaleUpdateTest extends LocaleUpdateBase {
* - Import overwrite: all existing translations
*/
function testUpdateImportSourceLocal() {
- $config = config('locale.settings');
+ $config = \Drupal::config('locale.settings');
// Build the test environment.
$this->setTranslationFiles();
@@ -265,7 +265,7 @@ class LocaleUpdateTest extends LocaleUpdateBase {
* - Import overwrite: only overwrite non-customized translations
*/
function testUpdateImportModeNonCustomized() {
- $config = config('locale.settings');
+ $config = \Drupal::config('locale.settings');
// Build the test environment.
$this->setTranslationFiles();
@@ -301,7 +301,7 @@ class LocaleUpdateTest extends LocaleUpdateBase {
* - Import overwrite: don't overwrite any existing translation
*/
function testUpdateImportModeNone() {
- $config = config('locale.settings');
+ $config = \Drupal::config('locale.settings');
// Build the test environment.
$this->setTranslationFiles();
diff --git a/core/modules/locale/lib/Drupal/locale/TranslationsStream.php b/core/modules/locale/lib/Drupal/locale/TranslationsStream.php
index 34ef38e..5245bd4 100644
--- a/core/modules/locale/lib/Drupal/locale/TranslationsStream.php
+++ b/core/modules/locale/lib/Drupal/locale/TranslationsStream.php
@@ -20,7 +20,7 @@ class TranslationsStream extends LocalStream {
* Implements Drupal\Core\StreamWrapper\LocalStream::getDirectoryPath()
*/
function getDirectoryPath() {
- return config('locale.settings')->get('translation.path');
+ return \Drupal::config('locale.settings')->get('translation.path');
}
/**
diff --git a/core/modules/locale/locale.bulk.inc b/core/modules/locale/locale.bulk.inc
index 8a15656..02731a4 100644
--- a/core/modules/locale/locale.bulk.inc
+++ b/core/modules/locale/locale.bulk.inc
@@ -243,7 +243,7 @@ function locale_translate_export_form_submit($form, &$form_state) {
if (!empty($item)) {
$uri = tempnam('temporary://', 'po_');
$header = $reader->getHeader();
- $header->setProjectName(config('system.site')->get('name'));
+ $header->setProjectName(Drupal::config('system.site')->get('name'));
$header->setLanguageName($languageName);
$writer = new PoStreamWriter;
@@ -348,7 +348,7 @@ function locale_translate_get_interface_translation_files($projects = array(), $
// containing a project name and language code: {project}.{langcode}.po or
// {project}-{version}.{langcode}.po.
// Only files of known projects and languages will be returned.
- $directory = config('locale.settings')->get('translation.path');
+ $directory = Drupal::config('locale.settings')->get('translation.path');
$result = file_scan_directory($directory, '![a-z_]+(\-[0-9a-z\.\-\+]+|)\.[^\./]+\.po$!', array('recurse' => FALSE));
foreach ($result as $file) {
@@ -799,7 +799,7 @@ function locale_config_batch_build(array $names, array $langcodes, $options = ar
$batch_names[] = $name;
$i++;
// During installation the caching of configuration objects is disabled
- // so it is very expensive to initialize the config() object on each request.
+ // so it is very expensive to initialize the Drupal::config() object on each request.
// We batch a small number of configuration object upgrades together to
// improve the overall performance of the process.
if ($i % 20 == 0) {
diff --git a/core/modules/locale/locale.compare.inc b/core/modules/locale/locale.compare.inc
index d0271bde..ed4664d 100644
--- a/core/modules/locale/locale.compare.inc
+++ b/core/modules/locale/locale.compare.inc
@@ -130,7 +130,7 @@ function locale_translation_project_list() {
$projects = &drupal_static(__FUNCTION__, array());
if (empty($projects)) {
module_load_include('compare.inc', 'update');
- $config = config('locale.settings');
+ $config = Drupal::config('locale.settings');
$projects = array();
$additional_whitelist = array(
@@ -195,9 +195,9 @@ function _locale_translation_prepare_project_list($data, $type) {
* - "server_pattern": URI containing po file pattern.
*/
function locale_translation_default_translation_server() {
- $pattern = config('locale.settings')->get('translation.default_server_pattern');
+ $pattern = Drupal::config('locale.settings')->get('translation.default_server_pattern');
// An additional check is required here. During the upgrade process
- // config()->get() returns NULL. We use the defined value as fallback.
+ // Drupal::config()->get() returns NULL. We use the defined value as fallback.
$pattern = $pattern ? $pattern : LOCALE_TRANSLATION_DEFAULT_SERVER_PATTERN;
return array(
diff --git a/core/modules/locale/locale.install b/core/modules/locale/locale.install
index b781421..b830040 100644
--- a/core/modules/locale/locale.install
+++ b/core/modules/locale/locale.install
@@ -12,9 +12,9 @@ use Drupal\Core\Language\Language;
*/
function locale_install() {
// Create the interface translations directory and ensure it's writable.
- if (!$directory = config('locale.settings')->get('translation.path')) {
+ if (!$directory = Drupal::config('locale.settings')->get('translation.path')) {
$directory = conf_path() . '/files/translations';
- config('locale.settings')->set('translation.path', $directory)->save();
+ Drupal::config('locale.settings')->set('translation.path', $directory)->save();
}
file_prepare_directory($directory, FILE_CREATE_DIRECTORY | FILE_MODIFY_PERMISSIONS);
}
@@ -23,7 +23,7 @@ function locale_install() {
* Implements hook_uninstall().
*/
function locale_uninstall() {
- $config = config('locale.settings');
+ $config = Drupal::config('locale.settings');
// Delete all JavaScript translation files.
$locale_js_directory = 'public://' . $config->get('javascript.directory');
@@ -468,7 +468,7 @@ function locale_update_8002() {
*/
function locale_update_8003() {
$message = '';
- $config = config('language.negotiation');
+ $config = Drupal::config('language.negotiation');
$domains = $config->get('url.domains') ?: array();
// $used_domains keeps track of the domain names in use.
@@ -953,7 +953,7 @@ function locale_update_8016() {
foreach ($result as $format) {
$language = $format->language;
// Create config objects for the language if not yet done.
- config("locale.config.$language.system.date_format." . $format->type)
+ Drupal::config("locale.config.$language.system.date_format." . $format->type)
->set('pattern.php', $format->format)
->save();
}
diff --git a/core/modules/locale/locale.module b/core/modules/locale/locale.module
index c83ff19..01c9a4f 100644
--- a/core/modules/locale/locale.module
+++ b/core/modules/locale/locale.module
@@ -427,7 +427,7 @@ function locale_cron() {
// and a translatable language was set.
// Update tasks are added to the queue here but processed by Drupal's cron
// using the cron worker defined in locale_queue_info().
- if ($frequency = config('locale.settings')->get('translation.update_interval_days') && locale_translatable_language_list()) {
+ if ($frequency = Drupal::config('locale.settings')->get('translation.update_interval_days') && locale_translatable_language_list()) {
module_load_include('translation.inc', 'locale');
locale_cron_fill_queue();
}
@@ -519,7 +519,7 @@ function locale_system_update(array $components) {
// Skip running the translation imports if in the installer,
// because it would break out of the installer flow. We have
// built-in support for translation imports in the installer.
- if (!drupal_installation_attempted() && locale_translatable_language_list() && config('locale.settings')->get('translation.import_enabled')) {
+ if (!drupal_installation_attempted() && locale_translatable_language_list() && Drupal::config('locale.settings')->get('translation.import_enabled')) {
module_load_include('compare.inc', 'locale');
// Update the list of translatable projects and start the import batch.
@@ -595,7 +595,7 @@ function locale_js_alter(&$javascript) {
$language_interface = language(Language::TYPE_INTERFACE);
- $dir = 'public://' . config('local.settings')->get('javascript.directory');
+ $dir = 'public://' . Drupal::config('local.settings')->get('javascript.directory');
$parsed = Drupal::state()->get('system.javascript_parsed') ?: array();
$files = $new_files = FALSE;
@@ -696,7 +696,7 @@ function locale_library_info_alter(&$libraries, $module) {
'ui' => array(
'datepicker' => array(
'isRTL' => $language_interface->direction == Language::DIRECTION_RTL,
- 'firstDay' => config('system.date')->get('first_day'),
+ 'firstDay' => Drupal::config('system.date')->get('first_day'),
),
),
),
@@ -773,7 +773,7 @@ function locale_form_language_admin_add_form_alter(&$form, &$form_state) {
* Set a batch for a newly-added language.
*/
function locale_form_language_admin_add_form_alter_submit($form, $form_state) {
- if (config('locale.settings')->get('translation.import_enabled')) {
+ if (Drupal::config('locale.settings')->get('translation.import_enabled')) {
if (empty($form_state['values']['predefined_langcode']) || $form_state['values']['predefined_langcode'] == 'custom') {
$langcode = $form_state['values']['langcode'];
}
@@ -835,7 +835,7 @@ function locale_form_system_file_system_settings_alter(&$form, $form_state) {
$form['translation_path'] = array(
'#type' => 'textfield',
'#title' => t('Interface translations directory'),
- '#default_value' => config('locale.settings')->get('translation.path'),
+ '#default_value' => Drupal::config('locale.settings')->get('translation.path'),
'#maxlength' => 255,
'#description' => t('A local file system path where interface translation files will be stored.'),
'#required' => TRUE,
@@ -860,7 +860,7 @@ function locale_system_file_system_settings_submit(&$form, $form_state) {
locale_translation_clear_status();
}
- config('locale.settings')
+ Drupal::config('locale.settings')
->set('translation.path', $form_state['values']['translation_path'])
->save();
}
@@ -1095,7 +1095,7 @@ function locale_translation_clear_status() {
* when checking or importing translation files, FALSE otherwise.
*/
function locale_translation_use_remote_source() {
- return config('locale.settings')->get('translation.use_source') == LOCALE_TRANSLATION_USE_SOURCE_REMOTE_AND_LOCAL;
+ return Drupal::config('locale.settings')->get('translation.use_source') == LOCALE_TRANSLATION_USE_SOURCE_REMOTE_AND_LOCAL;
}
/**
@@ -1308,7 +1308,7 @@ function _locale_invalidate_js($langcode = NULL) {
* The language, the translation file should be (re)created for.
*/
function _locale_rebuild_js($langcode = NULL) {
- $config = config('locale.settings');
+ $config = Drupal::config('locale.settings');
if (!isset($langcode)) {
$language = language(Language::TYPE_INTERFACE);
}
diff --git a/core/modules/locale/locale.translation.inc b/core/modules/locale/locale.translation.inc
index 3c77ff0..30c7b0f 100644
--- a/core/modules/locale/locale.translation.inc
+++ b/core/modules/locale/locale.translation.inc
@@ -236,7 +236,7 @@ function locale_translation_source_build($project, $langcode, $filename = NULL)
$source->timestamp = 0;
$source->last_checked = 0;
- $filename = $filename ? $filename : config('locale.settings')->get('translation.default_filename');
+ $filename = $filename ? $filename : Drupal::config('locale.settings')->get('translation.default_filename');
// If the server_pattern contains a remote file path we will check for a
// remote file. The local version of this file will only be checked if a
@@ -322,7 +322,7 @@ function locale_translation_build_server_pattern($project, $template) {
*/
function locale_cron_fill_queue() {
$updates = array();
- $config = config('locale.settings');
+ $config = Drupal::config('locale.settings');
// Determine which project+language should be updated.
$last = REQUEST_TIME - $config->get('translation.update_interval_days') * 3600 * 24;
@@ -425,7 +425,7 @@ function _locale_translation_source_compare($source1, $source2) {
* Array of translation import options.
*/
function _locale_translation_default_update_options() {
- $config = config('locale.settings');
+ $config = Drupal::config('locale.settings');
return array(
'customized' => LOCALE_NOT_CUSTOMIZED,
'overwrite_options' => array(
diff --git a/core/modules/menu/lib/Drupal/menu/Tests/MenuTest.php b/core/modules/menu/lib/Drupal/menu/Tests/MenuTest.php
index 0ae93d4..df81981 100644
--- a/core/modules/menu/lib/Drupal/menu/Tests/MenuTest.php
+++ b/core/modules/menu/lib/Drupal/menu/Tests/MenuTest.php
@@ -161,7 +161,7 @@ class MenuTest extends MenuWebTestBase {
// Enable the custom menu block.
$menu_name = 'menu-' . $menu_name; // Drupal prepends the name with 'menu-'.
// Confirm that the custom menu block is available.
- $this->drupalGet('admin/structure/block/list/' . config('system.theme')->get('default') . '/add');
+ $this->drupalGet('admin/structure/block/list/' . \Drupal::config('system.theme')->get('default') . '/add');
$this->assertText($label);
// Enable the block.
diff --git a/core/modules/menu/menu.install b/core/modules/menu/menu.install
index ae94f90..f1fc64d 100644
--- a/core/modules/menu/menu.install
+++ b/core/modules/menu/menu.install
@@ -80,7 +80,7 @@ function menu_update_8004() {
$result = db_query('SELECT * FROM {menu_custom}');
foreach ($result as $menu) {
// Save the config object.
- config('menu.menu.' . $menu->menu_name)
+ Drupal::config('menu.menu.' . $menu->menu_name)
->set('id', $menu->menu_name)
->set('uuid', $uuid->generate())
->set('label', $menu->title)
diff --git a/core/modules/menu/menu.module b/core/modules/menu/menu.module
index 36cedbe..5d83382 100644
--- a/core/modules/menu/menu.module
+++ b/core/modules/menu/menu.module
@@ -143,7 +143,7 @@ function menu_entity_bundle_info() {
$bundles = array();
$config_names = config_get_storage_names_with_prefix('menu.menu.');
foreach ($config_names as $config_name) {
- $config = config($config_name);
+ $config = Drupal::config($config_name);
$bundles['menu_link'][$config->get('id')] = array(
'label' => $config->get('label'),
);
@@ -236,7 +236,7 @@ function menu_menu_insert(Menu $menu) {
// Make sure the menu is present in the active menus variable so that its
// items may appear in the menu active trail.
// See menu_set_active_menu_names().
- $config = config('system.menu');
+ $config = Drupal::config('system.menu');
$active_menus = $config->get('active_menus_default') ?: array_keys(menu_get_menus());
if (!in_array($menu->id(), $active_menus)) {
@@ -312,7 +312,7 @@ function menu_parent_options(array $menus, MenuLink $menu_link = NULL, $type = N
// allow contrib modules to provide more scalable pattern choosers.
// hook_form_alter is too late in itself because all the possible parents are
// retrieved here, unless override_parent_selector is set to TRUE.
- if (config('menu.settings')->get('override_parent_selector')) {
+ if (Drupal::config('menu.settings')->get('override_parent_selector')) {
return array();
}
diff --git a/core/modules/node/lib/Drupal/node/NodeFormController.php b/core/modules/node/lib/Drupal/node/NodeFormController.php
index c9649ef..ccc1dcc 100644
--- a/core/modules/node/lib/Drupal/node/NodeFormController.php
+++ b/core/modules/node/lib/Drupal/node/NodeFormController.php
@@ -69,7 +69,7 @@ class NodeFormController extends EntityFormController {
drupal_set_title(t('<em>Edit @type</em> @title', array('@type' => node_get_type_label($node), '@title' => $node->label())), PASS_THROUGH);
}
- $user_config = config('user.settings');
+ $user_config = \Drupal::config('user.settings');
// Some special stuff when previewing a node.
if (isset($form_state['node_preview'])) {
$form['#prefix'] = $form_state['node_preview'];
diff --git a/core/modules/node/lib/Drupal/node/Plugin/views/row/Rss.php b/core/modules/node/lib/Drupal/node/Plugin/views/row/Rss.php
index 4d824bd..89c7940 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 @@ class Rss extends RowPluginBase {
$display_mode = $this->options['item_length'];
if ($display_mode == 'default') {
- $display_mode = config('system.rss')->get('items.view_mode');
+ $display_mode = \Drupal::config('system.rss')->get('items.view_mode');
}
// Load the specified node:
diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeAccessPagerTest.php b/core/modules/node/lib/Drupal/node/Tests/NodeAccessPagerTest.php
index 7b2cfe3..287ec65 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 @@ class NodeAccessPagerTest extends WebTestBase {
*/
public function testForumPager() {
// Look up the forums vocabulary ID.
- $vid = config('forum.settings')->get('vocabulary');
+ $vid = \Drupal::config('forum.settings')->get('vocabulary');
$this->assertTrue($vid, 'Forum navigation vocabulary ID is set.');
// Look up the general discussion term.
diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeCreationTest.php b/core/modules/node/lib/Drupal/node/Tests/NodeCreationTest.php
index 90592b0..cd5d89f 100644
--- a/core/modules/node/lib/Drupal/node/Tests/NodeCreationTest.php
+++ b/core/modules/node/lib/Drupal/node/Tests/NodeCreationTest.php
@@ -104,10 +104,10 @@ class NodeCreationTest extends NodeTestBase {
*/
function testUnpublishedNodeCreation() {
// Set the front page to the test page.
- config('system.site')->set('page.front', 'test-page')->save();
+ \Drupal::config('system.site')->set('page.front', 'test-page')->save();
// Set "Basic page" content type to be unpublished by default.
- config('node.type.page')->set('settings.node.options', array())->save();
+ \Drupal::config('node.type.page')->set('settings.node.options', array())->save();
// Create a node.
$edit = array();
diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeFormButtonsTest.php b/core/modules/node/lib/Drupal/node/Tests/NodeFormButtonsTest.php
index b52d825..2a8f025 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 @@ class NodeFormButtonsTest extends NodeTestBase {
// the initial order of buttons and/or status of the node when creating
// a node.
variable_set('node_options_article', array('promote'));
- config('node.type.article')->set('settings.node.options.status', 0)->save();
+ \Drupal::config('node.type.article')->set('settings.node.options.status', 0)->save();
// Verify the buttons on a node add form for an administrator.
$this->drupalLogin($this->admin_user);
diff --git a/core/modules/node/node.install b/core/modules/node/node.install
index 84117d5..7b42475 100644
--- a/core/modules/node/node.install
+++ b/core/modules/node/node.install
@@ -418,8 +418,8 @@ function node_uninstall() {
// Delete node type variables.
$types = config_get_storage_names_with_prefix('node.type.');
foreach ($types as $config_name) {
- $type = config($config_name)->get('type');
- config('language.settings')->clear('node. ' . $type . '.language.default_configuration')->save();
+ $type = Drupal::config($config_name)->get('type');
+ Drupal::config('language.settings')->clear('node. ' . $type . '.language.default_configuration')->save();
}
// Delete node search ranking variables.
@@ -640,7 +640,7 @@ function node_update_8007() {
$language_show = update_variable_get('node_type_language_show_' . $type, NULL);
if (isset($language_default) || isset($language_show)) {
$values = array('langcode' => $language_default, 'language_show' => $language_show);
- config('language.settings')->set('node.' . $type . '.language.default_configuration', $values)->save();
+ Drupal::config('language.settings')->set('node.' . $type . '.language.default_configuration', $values)->save();
}
}
}
@@ -1076,7 +1076,7 @@ function node_update_8020() {
$result = db_query('SELECT * FROM {node_type}')
->fetchAllAssoc('type', PDO::FETCH_ASSOC);
foreach ($result as $id => $node_type) {
- $config = config('node.type.' . $id);
+ $config = Drupal::config('node.type.' . $id);
// Node type.
$config->setData($node_type);
$config->set('uuid', $uuid->generate());
diff --git a/core/modules/node/node.module b/core/modules/node/node.module
index dab8696..200c6f6 100644
--- a/core/modules/node/node.module
+++ b/core/modules/node/node.module
@@ -329,7 +329,7 @@ function node_type_get_names() {
$config_names = config_get_storage_names_with_prefix('node.type.');
$names = array();
foreach ($config_names as $config_name) {
- $config = config($config_name);
+ $config = Drupal::config($config_name);
$names[$config->get('type')] = $config->get('name');
}
cache()->set($cid, $names, CacheBackendInterface::CACHE_PERMANENT, array(
@@ -1489,7 +1489,7 @@ function node_modules_uninstalled($modules) {
// Remove module-specific settings from all node types.
$config_names = config_get_storage_names_with_prefix('node.type.');
foreach ($config_names as $config_name) {
- $config = config($config_name);
+ $config = Drupal::config($config_name);
$changed = FALSE;
foreach ($modules as $module) {
if ($config->get('settings.' . $module)) {
@@ -1572,7 +1572,7 @@ function node_block_access($block) {
function node_feed($nids = FALSE, $channel = array()) {
global $base_url;
$language_content = language(Language::TYPE_CONTENT);
- $rss_config = config('system.rss');
+ $rss_config = Drupal::config('system.rss');
if ($nids === FALSE) {
$nids = db_select('node_field_data', 'n')
@@ -1624,7 +1624,7 @@ function node_feed($nids = FALSE, $channel = array()) {
$channel_defaults = array(
'version' => '2.0',
- 'title' => config('system.site')->get('name'),
+ 'title' => Drupal::config('system.site')->get('name'),
'link' => $base_url,
'description' => $rss_config->get('channel.description'),
'language' => $language_content->id
@@ -1711,7 +1711,7 @@ function node_page_view(EntityInterface $node) {
* Implements hook_update_index().
*/
function node_update_index() {
- $limit = (int) config('search.settings')->get('index.cron_limit');
+ $limit = (int) Drupal::config('search.settings')->get('index.cron_limit');
$result = db_query_range("SELECT n.nid FROM {node} n LEFT JOIN {search_dataset} d ON d.type = 'node' AND d.sid = n.nid WHERE d.sid IS NULL OR d.reindex <> 0 ORDER BY d.reindex ASC, n.nid ASC", 0, $limit, array(), array('target' => 'slave'));
$nids = $result->fetchCol();
@@ -1914,9 +1914,9 @@ function node_form_system_site_information_settings_form_alter(&$form, &$form_st
$form['front_page']['default_nodes_main'] = array(
'#type' => 'select',
'#title' => t('Number of posts on front page'),
- '#default_value' => config('node.settings')->get('items_per_page'),
+ '#default_value' => Drupal::config('node.settings')->get('items_per_page'),
'#options' => drupal_map_assoc(array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 20, 25, 30)),
- '#access' => (config('system.site')->get('page.front') == 'node'),
+ '#access' => (Drupal::config('system.site')->get('page.front') == 'node'),
'#description' => t('The maximum number of posts displayed on overview pages such as the front page.'),
);
$form['#submit'][] = 'node_form_system_site_information_settings_form_submit';
@@ -1928,7 +1928,7 @@ function node_form_system_site_information_settings_form_alter(&$form, &$form_st
* @see node_form_system_site_information_settings_form_alter()
*/
function node_form_system_site_information_settings_form_submit($form, &$form_state) {
- config('node.settings')
+ Drupal::config('node.settings')
->set('items_per_page', $form_state['values']['default_nodes_main'])
->save();
}
@@ -2606,6 +2606,6 @@ function node_library_info() {
*/
function node_system_info_alter(&$info, $file, $type) {
if ($type == 'module' && $file->name == 'translation') {
- $info['hidden'] = !module_exists('translation') && config('system.module.disabled')->get('translation') === NULL;
+ $info['hidden'] = !module_exists('translation') && Drupal::config('system.module.disabled')->get('translation') === NULL;
}
}
diff --git a/core/modules/overlay/overlay.module b/core/modules/overlay/overlay.module
index 2edb256..52edcf8 100644
--- a/core/modules/overlay/overlay.module
+++ b/core/modules/overlay/overlay.module
@@ -501,13 +501,13 @@ function overlay_overlay_parent_initialize() {
// Let the client side know which paths are administrative.
$paths = path_get_admin_paths();
foreach ($paths as &$type) {
- $type = str_replace('<front>', config('system.site')->get('page.front'), $type);
+ $type = str_replace('<front>', Drupal::config('system.site')->get('page.front'), $type);
}
drupal_add_js(array('overlay' => array('paths' => $paths)), 'setting');
$path_prefixes = array();
if (module_exists('language')) {
language_negotiation_include();
- if (config('language.negotiation')->get('url.source') == LANGUAGE_NEGOTIATION_URL_PREFIX) {
+ if (Drupal::config('language.negotiation')->get('url.source') == LANGUAGE_NEGOTIATION_URL_PREFIX) {
// Skip the empty string indicating the default language. We always accept
// paths without a prefix.
$path_prefixes = language_negotiation_url_prefixes();
diff --git a/core/modules/php/php.module b/core/modules/php/php.module
index 02fd1dd..9baffe7 100644
--- a/core/modules/php/php.module
+++ b/core/modules/php/php.module
@@ -70,7 +70,7 @@ function php_eval($code) {
// so code evaluated will not see the caller module as the current theme.
// If theme info is not initialized get the path from default theme.
if (!isset($theme_info)) {
- $theme_path = drupal_get_path('theme', config('system.theme')->get('default'));
+ $theme_path = drupal_get_path('theme', Drupal::config('system.theme')->get('default'));
}
else {
$theme_path = dirname($theme_info->filename);
diff --git a/core/modules/rdf/rdf.install b/core/modules/rdf/rdf.install
index 5bb8f67..117c910 100644
--- a/core/modules/rdf/rdf.install
+++ b/core/modules/rdf/rdf.install
@@ -23,7 +23,7 @@ function rdf_update_8000() {
$bundle = $row['bundle'];
// Create a config object for the mapping.
- $config = config("rdf.mapping.$entity_type.$bundle")
+ $config = Drupal::config("rdf.mapping.$entity_type.$bundle")
->set('id', "$entity_type.$bundle")
->set('uuid', $uuid->generate())
->set('targetEntityType', $entity_type)
diff --git a/core/modules/rest/lib/Drupal/rest/Tests/RESTTestBase.php b/core/modules/rest/lib/Drupal/rest/Tests/RESTTestBase.php
index 94d3e61..db8feb2 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 @@ abstract class RESTTestBase extends WebTestBase {
*/
protected function enableService($resource_type, $method = 'GET', $format = NULL, $auth = array()) {
// Enable REST API for this entity type.
- $config = config('rest.settings');
+ $config = \Drupal::config('rest.settings');
$settings = array();
if ($resource_type) {
if ($format) {
diff --git a/core/modules/rest/rest.module b/core/modules/rest/rest.module
index d0e0551..a37bfe7 100644
--- a/core/modules/rest/rest.module
+++ b/core/modules/rest/rest.module
@@ -11,7 +11,7 @@
function rest_permission() {
$permissions = array();
$manager = Drupal::service('plugin.manager.rest');
- $resources = config('rest.settings')->get('resources');
+ $resources = Drupal::config('rest.settings')->get('resources');
if ($resources && $enabled = array_intersect_key($manager->getDefinitions(), $resources)) {
foreach ($enabled as $key => $resource) {
$plugin = $manager->getInstance(array('id' => $key));
diff --git a/core/modules/search/lib/Drupal/search/Plugin/views/filter/Search.php b/core/modules/search/lib/Drupal/search/Plugin/views/filter/Search.php
index 7461bdd..89b21e4 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 @@ class Search extends FilterPluginBase {
if (!empty($form_state['values'][$key])) {
$this->query_parse_search_expression($form_state['values'][$key]);
if (count($this->search_query->words()) == 0) {
- form_set_error($key, format_plural(config('search.settings')->get('index.minimum_word_size'), 'You must include at least one positive keyword with 1 character or more.', 'You must include at least one positive keyword with @count characters or more.'));
+ form_set_error($key, format_plural(\Drupal::config('search.settings')->get('index.minimum_word_size'), 'You must include at least one positive keyword with 1 character or more.', 'You must include at least one positive keyword with @count characters or more.'));
}
}
}
diff --git a/core/modules/search/lib/Drupal/search/SearchQuery.php b/core/modules/search/lib/Drupal/search/SearchQuery.php
index 86887b7..8776bce 100644
--- a/core/modules/search/lib/Drupal/search/SearchQuery.php
+++ b/core/modules/search/lib/Drupal/search/SearchQuery.php
@@ -200,7 +200,7 @@ class SearchQuery extends SelectExtender {
// Classify tokens.
$or = FALSE;
$warning = '';
- $limit_combinations = config('search.settings')->get('and_or_limit');
+ $limit_combinations = \Drupal::config('search.settings')->get('and_or_limit');
// The first search expression does not count as AND.
$and_count = -1;
$or_count = 0;
@@ -323,7 +323,7 @@ class SearchQuery extends SelectExtender {
$split = explode(' ', $word);
foreach ($split as $s) {
$num = is_numeric($s);
- if ($num || drupal_strlen($s) >= config('search.settings')->get('index.minimum_word_size')) {
+ if ($num || drupal_strlen($s) >= \Drupal::config('search.settings')->get('index.minimum_word_size')) {
if (!isset($this->words[$s])) {
$this->words[$s] = $s;
$num_new_scores++;
@@ -349,11 +349,11 @@ class SearchQuery extends SelectExtender {
$this->parseSearchExpression();
if (count($this->words) == 0) {
- form_set_error('keys', format_plural(config('search.settings')->get('index.minimum_word_size'), 'You must include at least one positive keyword with 1 character or more.', 'You must include at least one positive keyword with @count characters or more.'));
+ form_set_error('keys', format_plural(\Drupal::config('search.settings')->get('index.minimum_word_size'), 'You must include at least one positive keyword with 1 character or more.', 'You must include at least one positive keyword with @count characters or more.'));
return FALSE;
}
if ($this->expressionsIgnored) {
- drupal_set_message(t('Your search used too many AND/OR expressions. Only the first @count terms were included in this search.', array('@count' => config('search.settings')->get('and_or_limit'))), 'warning');
+ drupal_set_message(t('Your search used too many AND/OR expressions. Only the first @count terms were included in this search.', array('@count' => \Drupal::config('search.settings')->get('and_or_limit'))), 'warning');
}
$this->executedFirstPass = TRUE;
diff --git a/core/modules/search/lib/Drupal/search/Tests/SearchEmbedFormTest.php b/core/modules/search/lib/Drupal/search/Tests/SearchEmbedFormTest.php
index ff822c6..4659260 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 @@ class SearchEmbedFormTest extends SearchTestBase {
search_update_totals();
// Set up a dummy initial count of times the form has been submitted.
- $this->submit_count = config('search_embedded_form.settings')->get('submitted');
+ $this->submit_count = \Drupal::config('search_embedded_form.settings')->get('submitted');
$this->refreshVariables();
}
@@ -63,7 +63,7 @@ class SearchEmbedFormTest extends SearchTestBase {
array('name' => 'John'),
t('Send away'));
$this->assertText(t('Test form was submitted'), 'Form message appears');
- $count = config('search_embedded_form.settings')->get('submitted');
+ $count = \Drupal::config('search_embedded_form.settings')->get('submitted');
$this->assertEqual($this->submit_count + 1, $count, 'Form submission count is correct');
$this->submit_count = $count;
@@ -74,7 +74,7 @@ class SearchEmbedFormTest extends SearchTestBase {
array('name' => 'John'),
t('Send away'));
$this->assertText(t('Test form was submitted'), 'Form message appears');
- $count = config('search_embedded_form.settings')->get('submitted');
+ $count = \Drupal::config('search_embedded_form.settings')->get('submitted');
$this->assertEqual($this->submit_count + 1, $count, 'Form submission count is correct');
$this->submit_count = $count;
@@ -84,7 +84,7 @@ class SearchEmbedFormTest extends SearchTestBase {
array('keys' => 'foo'),
t('Search'));
$this->assertNoText(t('Test form was submitted'), 'Form message does not appear');
- $count = config('search_embedded_form.settings')->get('submitted');
+ $count = \Drupal::config('search_embedded_form.settings')->get('submitted');
$this->assertEqual($this->submit_count, $count, 'Form submission count is correct');
$this->submit_count = $count;
}
diff --git a/core/modules/search/lib/Drupal/search/Tests/SearchKeywordsConditionsTest.php b/core/modules/search/lib/Drupal/search/Tests/SearchKeywordsConditionsTest.php
index 87414fa..ab7a0c9 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 @@ class SearchKeywordsConditionsTest extends SearchTestBase {
// Login with sufficient privileges.
$this->drupalLogin($this->searching_user);
// Test with all search modules enabled.
- config('search.settings')->set('active_modules', array('node' => 'node', 'user' => 'user', 'search_extra_type' => 'search_extra_type'))->save();
+ \Drupal::config('search.settings')->set('active_modules', array('node' => 'node', 'user' => 'user', 'search_extra_type' => 'search_extra_type'))->save();
menu_router_rebuild();
}
diff --git a/core/modules/search/lib/Drupal/search/Tests/SearchMatchTest.php b/core/modules/search/lib/Drupal/search/Tests/SearchMatchTest.php
index 0f3d574..76958c6 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 @@ class SearchMatchTest extends SearchTestBase {
* Set up a small index of items to test against.
*/
function _setup() {
- config('search.settings')->set('index.minimum_word_size', 3)->save();
+ \Drupal::config('search.settings')->set('index.minimum_word_size', 3)->save();
for ($i = 1; $i <= 7; ++$i) {
search_index($i, SEARCH_TYPE, $this->getText($i), Language::LANGCODE_NOT_SPECIFIED);
diff --git a/core/modules/search/lib/Drupal/search/Tests/SearchMultilingualEntityTest.php b/core/modules/search/lib/Drupal/search/Tests/SearchMultilingualEntityTest.php
index d9ab415..e1021b4 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 @@ class SearchMultilingualEntityTest extends SearchTestBase {
*/
function testIndexingThrottle() {
// Index only 4 items per cron run.
- config('search.settings')->set('index.cron_limit', 4)->save();
+ \Drupal::config('search.settings')->set('index.cron_limit', 4)->save();
// Update the index. This does the initial processing.
node_update_index();
// Run the shutdown function. Testing is a unique case where indexing
diff --git a/core/modules/search/lib/Drupal/search/Tests/SearchPageOverrideTest.php b/core/modules/search/lib/Drupal/search/Tests/SearchPageOverrideTest.php
index df72d2b..45bcadf 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 @@ class SearchPageOverrideTest extends SearchTestBase {
$this->drupalLogin($this->search_user);
// Enable the extra type module for searching.
- config('search.settings')->set('active_modules', array('node' => 'node', 'user' => 'user', 'search_extra_type' => 'search_extra_type'))->save();
+ \Drupal::config('search.settings')->set('active_modules', array('node' => 'node', 'user' => 'user', 'search_extra_type' => 'search_extra_type'))->save();
menu_router_rebuild();
}
diff --git a/core/modules/search/lib/Drupal/search/Tests/SearchPageTextTest.php b/core/modules/search/lib/Drupal/search/Tests/SearchPageTextTest.php
index b9dede6..247096c 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 @@ class SearchPageTextTest extends SearchTestBase {
// Test a search input exceeding the limit of AND/OR combinations to test
// the Denial-of-Service protection.
- $limit = config('search.settings')->get('and_or_limit');
+ $limit = \Drupal::config('search.settings')->get('and_or_limit');
$keys = array();
for ($i = 0; $i < $limit + 1; $i++) {
$keys[] = $this->randomName(3);
diff --git a/core/modules/search/lib/Drupal/search/Tests/SearchRankingTest.php b/core/modules/search/lib/Drupal/search/Tests/SearchRankingTest.php
index 887e997..6e223f6 100644
--- a/core/modules/search/lib/Drupal/search/Tests/SearchRankingTest.php
+++ b/core/modules/search/lib/Drupal/search/Tests/SearchRankingTest.php
@@ -78,7 +78,7 @@ class SearchRankingTest extends SearchTestBase {
$this->drupalPost(NULL, $edit, t('Save'));
// Enable counting of statistics.
- config('statistics.settings')->set('count_content_views', 1)->save();
+ \Drupal::config('statistics.settings')->set('count_content_views', 1)->save();
// Then View one of the nodes a bunch of times.
// Manually calling statistics.php, simulating ajax behavior.
diff --git a/core/modules/search/lib/Drupal/search/Tests/SearchTokenizerTest.php b/core/modules/search/lib/Drupal/search/Tests/SearchTokenizerTest.php
index 8e705d1..361cebf 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 @@ class SearchTokenizerTest extends SearchTestBase {
function testTokenizer() {
// Set the minimum word size to 1 (to split all CJK characters) and make
// sure CJK tokenizing is turned on.
- config('search.settings')
+ \Drupal::config('search.settings')
->set('index.minimum_word_size', 1)
->set('index.overlap_cjk', TRUE)
->save();
@@ -118,7 +118,7 @@ class SearchTokenizerTest extends SearchTestBase {
function testNoTokenizer() {
// Set the minimum word size to 1 (to split all CJK characters) and make
// sure CJK tokenizing is turned on.
- config('search.settings')
+ \Drupal::config('search.settings')
->set('minimum_word_size', 1)
->set('overlap_cjk', TRUE)
->save();
diff --git a/core/modules/search/search.api.php b/core/modules/search/search.api.php
index 1a343d2..649a933 100644
--- a/core/modules/search/search.api.php
+++ b/core/modules/search/search.api.php
@@ -115,7 +115,7 @@ function hook_search_admin() {
// Note: reversed to reflect that higher number = higher ranking.
$options = drupal_map_assoc(range(0, 10));
- $ranks = config('node.settings')->get('search_rank');
+ $ranks = Drupal::config('node.settings')->get('search_rank');
foreach (Drupal::moduleHandler()->invokeAll('ranking') as $var => $values) {
$form['content_ranking']['factors'][$var] = array(
'#title' => $values['title'],
@@ -329,7 +329,7 @@ function hook_search_preprocess($text, $langcode = NULL) {
* When implementing this hook, your module should index content items that
* were modified or added since the last run. PHP has a time limit
* for cron, though, so it is advisable to limit how many items you index
- * per run using config('search.settings')->get('index.cron_limit') (see
+ * per run using Drupal::config('search.settings')->get('index.cron_limit') (see
* example below). Also, since the cron run could time out and abort in the
* middle of your run, you should update your module's internal bookkeeping on
* when items have last been indexed as you go rather than waiting to the end
@@ -338,7 +338,7 @@ function hook_search_preprocess($text, $langcode = NULL) {
* @ingroup search
*/
function hook_update_index() {
- $limit = (int) config('search.settings')->get('index.cron_limit');
+ $limit = (int) Drupal::config('search.settings')->get('index.cron_limit');
$result = db_query_range("SELECT n.nid FROM {node} n LEFT JOIN {search_dataset} d ON d.type = 'node' AND d.sid = n.nid WHERE d.sid IS NULL OR d.reindex <> 0 ORDER BY d.reindex ASC, n.nid ASC", 0, $limit);
@@ -402,7 +402,7 @@ function callback_search_conditions($keys) {
if (!empty($_REQUEST['sample_search_keys'])) {
$conditions['sample_search_keys'] = $_REQUEST['sample_search_keys'];
}
- if ($force_keys = config('sample_search.settings')->get('force_keywords')) {
+ if ($force_keys = Drupal::config('sample_search.settings')->get('force_keywords')) {
$conditions['sample_search_force_keywords'] = $force_keys;
}
return $conditions;
diff --git a/core/modules/search/search.module b/core/modules/search/search.module
index ac06f3e..fece768 100644
--- a/core/modules/search/search.module
+++ b/core/modules/search/search.module
@@ -252,7 +252,7 @@ function search_get_info($all = FALSE) {
}
// Return only modules that are set to active in search settings.
- return array_intersect_key($search_hooks, array_flip(config('search.settings')->get('active_modules')));
+ return array_intersect_key($search_hooks, array_flip(Drupal::config('search.settings')->get('active_modules')));
}
/**
@@ -263,7 +263,7 @@ function search_get_info($all = FALSE) {
*/
function search_get_default_module_info() {
$info = search_get_info();
- $default = config('search.settings')->get('default_module');
+ $default = Drupal::config('search.settings')->get('default_module');
if (isset($info[$default])) {
return $info[$default];
}
@@ -362,7 +362,7 @@ function search_cron() {
// to date.
drupal_register_shutdown_function('search_update_totals');
- foreach (config('search.settings')->get('active_modules') as $module) {
+ foreach (Drupal::config('search.settings')->get('active_modules') as $module) {
// Update word index
module_invoke($module, 'update_index');
}
@@ -423,7 +423,7 @@ function search_simplify($text, $langcode = NULL) {
search_invoke_preprocess($text, $langcode);
// Simple CJK handling
- if (config('search.settings')->get('index.overlap_cjk')) {
+ if (Drupal::config('search.settings')->get('index.overlap_cjk')) {
$text = preg_replace_callback('/[' . PREG_CLASS_CJK . ']+/u', 'search_expand_cjk', $text);
}
@@ -477,7 +477,7 @@ function search_simplify($text, $langcode = NULL) {
* Tokenized text, starting and ending with a space character.
*/
function search_expand_cjk($matches) {
- $min = config('search.settings')->get('index.minimum_word_size');
+ $min = Drupal::config('search.settings')->get('index.minimum_word_size');
$str = $matches[0];
$length = drupal_strlen($str);
// If the text is shorter than the minimum word size, don't tokenize it.
@@ -558,7 +558,7 @@ function search_invoke_preprocess(&$text, $langcode = NULL) {
* @ingroup search
*/
function search_index($sid, $module, $text, $langcode) {
- $minimum_word_size = config('search.settings')->get('index.minimum_word_size');
+ $minimum_word_size = Drupal::config('search.settings')->get('index.minimum_word_size');
// Link matching
global $base_url;
@@ -567,7 +567,7 @@ function search_index($sid, $module, $text, $langcode) {
// Multipliers for scores of words inside certain HTML tags. The weights are stored
// in a variable so that modules can overwrite the default weights.
// Note: 'a' must be included for link ranking to work.
- $tags = config('search.settings')->get('index.tag_weights');
+ $tags = Drupal::config('search.settings')->get('index.tag_weights');
// Strip off all ignored tags to speed up processing, but insert space before/after
// them to keep word boundaries.
diff --git a/core/modules/search/tests/modules/search_embedded_form/search_embedded_form.module b/core/modules/search/tests/modules/search_embedded_form/search_embedded_form.module
index 919d228..d59f184 100644
--- a/core/modules/search/tests/modules/search_embedded_form/search_embedded_form.module
+++ b/core/modules/search/tests/modules/search_embedded_form/search_embedded_form.module
@@ -30,7 +30,7 @@ function search_embedded_form_menu() {
* @see search_embedded_form_form_submit().
*/
function search_embedded_form_form($form, &$form_state) {
- $count = config('search_embedded_form.settings')->get('submitted');
+ $count = Drupal::config('search_embedded_form.settings')->get('submitted');
$form['name'] = array(
'#type' => 'textfield',
@@ -56,7 +56,7 @@ function search_embedded_form_form($form, &$form_state) {
* Submit handler for search_embedded_form_form().
*/
function search_embedded_form_form_submit($form, &$form_state) {
- $config = config('search_embedded_form.settings');
+ $config = Drupal::config('search_embedded_form.settings');
$submit_count = (int) $config->get('submitted');
$config->set('submitted', $submit_count + 1)->save();
drupal_set_message(t('Test form was submitted'));
diff --git a/core/modules/search/tests/modules/search_extra_type/search_extra_type.module b/core/modules/search/tests/modules/search_extra_type/search_extra_type.module
index 4435b44..b405e9a 100644
--- a/core/modules/search/tests/modules/search_extra_type/search_extra_type.module
+++ b/core/modules/search/tests/modules/search_extra_type/search_extra_type.module
@@ -91,7 +91,7 @@ function search_extra_type_search_admin() {
'bi' => t('Bistromathic'),
'ii' => t('Infinite Improbability'),
),
- '#default_value' => config('search_extra_type.settings')->get('boost'),
+ '#default_value' => Drupal::config('search_extra_type.settings')->get('boost'),
);
$form['#submit'][] = 'search_extra_type_admin_submit';
@@ -103,7 +103,7 @@ function search_extra_type_search_admin() {
* Form API callback: Save admin settings
*/
function search_extra_type_admin_submit($form, &$form_state) {
- config('search_extra_type.settings')
+ Drupal::config('search_extra_type.settings')
->set('boost', $form_state['values']['extra_type_settings']['boost'])
->save();
}
diff --git a/core/modules/shortcut/lib/Drupal/shortcut/Tests/ShortcutLinksTest.php b/core/modules/shortcut/lib/Drupal/shortcut/Tests/ShortcutLinksTest.php
index 4cfd030..0d68469 100644
--- a/core/modules/shortcut/lib/Drupal/shortcut/Tests/ShortcutLinksTest.php
+++ b/core/modules/shortcut/lib/Drupal/shortcut/Tests/ShortcutLinksTest.php
@@ -64,7 +64,7 @@ class ShortcutLinksTest extends ShortcutTestBase {
*/
function testShortcutQuickLink() {
theme_enable(array('seven'));
- config('system.theme')->set('admin', 'seven')->save();
+ \Drupal::config('system.theme')->set('admin', 'seven')->save();
variable_set('node_admin_theme', TRUE);
$link = reset($this->set->links);
@@ -136,7 +136,7 @@ class ShortcutLinksTest extends ShortcutTestBase {
*/
function testNoShortcutLink() {
// Change to a theme that displays shortcuts.
- config('system.theme')
+ \Drupal::config('system.theme')
->set('default', 'seven')
->save();
diff --git a/core/modules/shortcut/shortcut.api.php b/core/modules/shortcut/shortcut.api.php
index 8468c08..27eecf3 100644
--- a/core/modules/shortcut/shortcut.api.php
+++ b/core/modules/shortcut/shortcut.api.php
@@ -32,7 +32,7 @@
*/
function hook_shortcut_default_set($account) {
// Use a special set of default shortcuts for administrators only.
- if (in_array(config('user.settings')->get('admin_role'), $account->getRoles())) {
+ if (in_array(Drupal::config('user.settings')->get('admin_role'), $account->getRoles())) {
return 'admin-shortcuts';
}
}
diff --git a/core/modules/shortcut/shortcut.install b/core/modules/shortcut/shortcut.install
index d78fa3b..76e7097 100644
--- a/core/modules/shortcut/shortcut.install
+++ b/core/modules/shortcut/shortcut.install
@@ -84,7 +84,7 @@ function shortcut_update_8000() {
->condition('menu_name', 'shortcut-set-1')
->execute();
}
- config('shortcut.set.' . $set->set_name)
+ Drupal::config('shortcut.set.' . $set->set_name)
->set('id', $set->set_name)
->set('label', $set->title)
->set('uuid', $uuid->generate())
diff --git a/core/modules/simpletest/lib/Drupal/simpletest/DrupalUnitTestBase.php b/core/modules/simpletest/lib/Drupal/simpletest/DrupalUnitTestBase.php
index 54305c0..b55feee 100644
--- a/core/modules/simpletest/lib/Drupal/simpletest/DrupalUnitTestBase.php
+++ b/core/modules/simpletest/lib/Drupal/simpletest/DrupalUnitTestBase.php
@@ -121,7 +121,7 @@ abstract class DrupalUnitTestBase extends UnitTestBase {
$modules = call_user_func_array('array_merge_recursive', $modules);
$this->enableModules($modules, FALSE);
// In order to use theme functions default theme config needs to exist.
- config('system.theme')->set('default', 'stark');
+ \Drupal::config('system.theme')->set('default', 'stark');
}
protected function tearDown() {
diff --git a/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php b/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php
index 4040625..04e98f1 100644
--- a/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php
+++ b/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php
@@ -702,7 +702,7 @@ abstract class TestBase {
*/
public function run(array $methods = array()) {
TestServiceProvider::$currentTest = $this;
- $simpletest_config = config('simpletest.settings');
+ $simpletest_config = \Drupal::config('simpletest.settings');
$class = get_class($this);
if ($simpletest_config->get('verbose')) {
diff --git a/core/modules/simpletest/lib/Drupal/simpletest/Tests/DrupalUnitTestBaseTest.php b/core/modules/simpletest/lib/Drupal/simpletest/Tests/DrupalUnitTestBaseTest.php
index 1171d1e..a2788b1 100644
--- a/core/modules/simpletest/lib/Drupal/simpletest/Tests/DrupalUnitTestBaseTest.php
+++ b/core/modules/simpletest/lib/Drupal/simpletest/Tests/DrupalUnitTestBaseTest.php
@@ -191,7 +191,7 @@ class DrupalUnitTestBaseTest extends DrupalUnitTestBase {
$this->enableModules(array('user'));
$this->installConfig(array('user'));
$this->assertTrue($this->container->get('config.storage')->exists('user.settings'));
- $this->assertTrue(config('user.settings')->get('register'));
+ $this->assertTrue(\Drupal::config('user.settings')->get('register'));
}
/**
diff --git a/core/modules/simpletest/lib/Drupal/simpletest/Tests/SimpleTestTest.php b/core/modules/simpletest/lib/Drupal/simpletest/Tests/SimpleTestTest.php
index 03b4380..7aaf42f 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 @@ class SimpleTestTest extends WebTestBase {
$this->drupalGet('test-page');
$this->assertTrue($this->drupalGetHeader('Date'), 'An HTTP header was received.');
$this->assertTitle(t('Test page | @site-name', array(
- '@site-name' => config('system.site')->get('name'),
+ '@site-name' => \Drupal::config('system.site')->get('name'),
)));
$this->assertNoTitle('Foo');
diff --git a/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php b/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php
index ab24fc8..f1f5336 100644
--- a/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php
+++ b/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php
@@ -366,7 +366,7 @@ abstract class WebTestBase extends TestBase {
'plugin' => $plugin_id,
'region' => 'sidebar_first',
'machine_name' => strtolower($this->randomName(8)),
- 'theme' => config('system.theme')->get('default'),
+ 'theme' => \Drupal::config('system.theme')->get('default'),
'label' => $this->randomName(8),
'visibility' => array(),
'weight' => 0,
@@ -790,7 +790,7 @@ abstract class WebTestBase extends TestBase {
// Set 'parent_profile' of simpletest to add the parent profile's
// search path to the child site's search paths.
// @see drupal_system_listing()
- config('simpletest.settings')->set('parent_profile', $this->originalProfile)->save();
+ \Drupal::config('simpletest.settings')->set('parent_profile', $this->originalProfile)->save();
// Collect modules to install.
$class = get_class($this);
@@ -814,7 +814,7 @@ abstract class WebTestBase extends TestBase {
// Now make sure that the file path configurations are saved. This is done
// after we install the modules to override default values.
foreach ($variable_groups as $config_base => $variables) {
- $config = config($config_base);
+ $config = \Drupal::config($config_base);
foreach ($variables as $name => $value) {
$config->set($name, $value);
}
@@ -823,7 +823,7 @@ abstract class WebTestBase extends TestBase {
variable_set('file_public_path', $this->public_files_directory);
// Use the test mail class instead of the default mail handler class.
- config('system.mail')->set('interface.default', 'Drupal\Core\Mail\VariableLog')->save();
+ \Drupal::config('system.mail')->set('interface.default', 'Drupal\Core\Mail\VariableLog')->save();
drupal_set_time_limit($this->timeLimit);
// Temporary fix so that when running from run-tests.sh we don't get an
diff --git a/core/modules/simpletest/simpletest.module b/core/modules/simpletest/simpletest.module
index 4df4683..4004dd3 100644
--- a/core/modules/simpletest/simpletest.module
+++ b/core/modules/simpletest/simpletest.module
@@ -579,7 +579,7 @@ function simpletest_generate_file($filename, $width, $lines, $type = 'binary-tex
function simpletest_clean_environment() {
simpletest_clean_database();
simpletest_clean_temporary_directories();
- if (config('simpletest.settings')->get('clear_results')) {
+ if (Drupal::config('simpletest.settings')->get('clear_results')) {
$count = simpletest_clean_results_table();
drupal_set_message(format_plural($count, 'Removed 1 test result.', 'Removed @count test results.'));
}
@@ -648,7 +648,7 @@ function simpletest_clean_temporary_directories() {
* The number of results removed.
*/
function simpletest_clean_results_table($test_id = NULL) {
- if (config('simpletest.settings')->get('clear_results')) {
+ if (Drupal::config('simpletest.settings')->get('clear_results')) {
if ($test_id) {
$count = db_query('SELECT COUNT(test_id) FROM {simpletest_test_id} WHERE test_id = :test_id', array(':test_id' => $test_id))->fetchField();
diff --git a/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsAdminTest.php b/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsAdminTest.php
index b78e19f..6c70985 100644
--- a/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsAdminTest.php
+++ b/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsAdminTest.php
@@ -70,13 +70,13 @@ class StatisticsAdminTest extends WebTestBase {
* Verifies that the statistics settings page works.
*/
function testStatisticsSettings() {
- $config = config('statistics.settings');
+ $config = \Drupal::config('statistics.settings');
$this->assertFalse($config->get('count_content_views'), 'Count content view log is disabled by default.');
// Enable counter on content view.
$edit['statistics_count_content_views'] = 1;
$this->drupalPost('admin/config/system/statistics', $edit, t('Save configuration'));
- $config = config('statistics.settings');
+ $config = \Drupal::config('statistics.settings');
$this->assertTrue($config->get('count_content_views'), 'Count content view log is enabled.');
// Hit the node.
@@ -103,7 +103,7 @@ class StatisticsAdminTest extends WebTestBase {
* Tests that when a node is deleted, the node counter is deleted too.
*/
function testDeleteNode() {
- config('statistics.settings')->set('count_content_views', 1)->save();
+ \Drupal::config('statistics.settings')->set('count_content_views', 1)->save();
$this->drupalGet('node/' . $this->test_node->id());
// Manually calling statistics.php, simulating ajax behavior.
@@ -134,7 +134,7 @@ class StatisticsAdminTest extends WebTestBase {
* Tests that cron clears day counts and expired access logs.
*/
function testExpiredLogs() {
- config('statistics.settings')
+ \Drupal::config('statistics.settings')
->set('count_content_views', 1)
->save();
\Drupal::state()->set('statistics.day_timestamp', 8640000);
diff --git a/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsLoggingTest.php b/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsLoggingTest.php
index 115a8bc..5c8fbbb 100644
--- a/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsLoggingTest.php
+++ b/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsLoggingTest.php
@@ -54,13 +54,13 @@ class StatisticsLoggingTest extends WebTestBase {
$this->node = $this->drupalCreateNode(array('title' => $this->randomName(255), 'uid' => $this->auth_user->id()));
// Enable page caching.
- $config = config('system.performance');
+ $config = \Drupal::config('system.performance');
$config->set('cache.page.use_internal', 1);
$config->set('cache.page.max_age', 300);
$config->save();
// Enable access logging.
- config('statistics.settings')
+ \Drupal::config('statistics.settings')
->set('count_content_views', 1)
->save();
diff --git a/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsTestBase.php b/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsTestBase.php
index f4d75f4..8ad4df2 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 @@ abstract class StatisticsTestBase extends WebTestBase {
$this->drupalLogin($this->blocking_user);
// Enable logging.
- config('statistics.settings')
+ \Drupal::config('statistics.settings')
->set('count_content_views', 1)
->save();
}
diff --git a/core/modules/statistics/statistics.module b/core/modules/statistics/statistics.module
index c40fc6a..1faf13e 100644
--- a/core/modules/statistics/statistics.module
+++ b/core/modules/statistics/statistics.module
@@ -211,7 +211,7 @@ function statistics_node_predelete(EntityInterface $node) {
* Implements hook_ranking().
*/
function statistics_ranking() {
- if (config('statistics.settings')->get('count_content_views')) {
+ if (Drupal::config('statistics.settings')->get('count_content_views')) {
return array(
'views' => array(
'title' => t('Number of views'),
@@ -274,7 +274,7 @@ function statistics_library_info() {
* to count content views.
*/
function statistics_block_alter(&$definitions) {
- $statistics_count_content_views = config('statistics.settings')->get('count_content_views');
+ $statistics_count_content_views = Drupal::config('statistics.settings')->get('count_content_views');
if (empty($statistics_count_content_views)) {
unset($definitions['statistics_popular_block']);
}
diff --git a/core/modules/statistics/statistics.php b/core/modules/statistics/statistics.php
index 22d2fb4..20a2ec9 100644
--- a/core/modules/statistics/statistics.php
+++ b/core/modules/statistics/statistics.php
@@ -12,7 +12,7 @@ chdir('../../..');
include_once dirname(dirname(__DIR__)) . '/includes/bootstrap.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_VARIABLES);
-if (config('statistics.settings')->get('count_content_views')) {
+if (\Drupal::config('statistics.settings')->get('count_content_views')) {
$nid = filter_input(INPUT_POST, 'nid', FILTER_VALIDATE_INT);
if ($nid) {
db_merge('node_counter')
diff --git a/core/modules/syslog/syslog.install b/core/modules/syslog/syslog.install
index 5b2c41a..c9eb769 100644
--- a/core/modules/syslog/syslog.install
+++ b/core/modules/syslog/syslog.install
@@ -11,7 +11,7 @@
function syslog_install() {
// The default facility setting depends on the operating system, so it needs
// to be set dynamically during installation.
- config('syslog.settings')->set('facility', defined('LOG_LOCAL0') ? LOG_LOCAL0 : LOG_USER)->save();
+ Drupal::config('syslog.settings')->set('facility', defined('LOG_LOCAL0') ? LOG_LOCAL0 : LOG_USER)->save();
}
/**
diff --git a/core/modules/syslog/syslog.module b/core/modules/syslog/syslog.module
index fe781c3..c46f58a 100644
--- a/core/modules/syslog/syslog.module
+++ b/core/modules/syslog/syslog.module
@@ -45,7 +45,7 @@ function syslog_help($path, $arg) {
* Implements hook_form_FORM_ID_alter().
*/
function syslog_form_system_logging_settings_alter(&$form, &$form_state) {
- $config = config('syslog.settings');
+ $config = Drupal::config('syslog.settings');
$help = module_exists('help') ? ' ' . l(t('More information'), 'admin/help/syslog') . '.' : NULL;
$form['syslog_identity'] = array(
'#type' => 'textfield',
@@ -78,7 +78,7 @@ function syslog_form_system_logging_settings_alter(&$form, &$form_state) {
* @see syslog_form_system_logging_settings_alter()
*/
function syslog_logging_settings_submit($form, &$form_state) {
- config('syslog.settings')
+ Drupal::config('syslog.settings')
->set('identity', $form_state['values']['syslog_identity'])
->set('facility', $form_state['values']['syslog_facility'])
->set('format', $form_state['values']['syslog_format'])
@@ -111,7 +111,7 @@ function syslog_watchdog(array $log_entry) {
global $base_url;
$log_init = &drupal_static(__FUNCTION__, FALSE);
- $config = config('syslog.settings');
+ $config = Drupal::config('syslog.settings');
if (!$log_init) {
$log_init = TRUE;
diff --git a/core/modules/system/lib/Drupal/system/Access/CronAccessCheck.php b/core/modules/system/lib/Drupal/system/Access/CronAccessCheck.php
index a0cc981..9c12bd0 100644
--- a/core/modules/system/lib/Drupal/system/Access/CronAccessCheck.php
+++ b/core/modules/system/lib/Drupal/system/Access/CronAccessCheck.php
@@ -32,7 +32,7 @@ class CronAccessCheck implements StaticAccessCheckInterface {
watchdog('cron', 'Cron could not run because an invalid key was used.', array(), WATCHDOG_NOTICE);
return FALSE;
}
- elseif (config('system.maintenance')->get('enabled')) {
+ elseif (\Drupal::config('system.maintenance')->get('enabled')) {
watchdog('cron', 'Cron could not run because the site is in maintenance mode.', array(), WATCHDOG_NOTICE);
return FALSE;
}
diff --git a/core/modules/system/lib/Drupal/system/Plugin/Core/Entity/DateFormat.php b/core/modules/system/lib/Drupal/system/Plugin/Core/Entity/DateFormat.php
index badf567..e853b9b 100644
--- a/core/modules/system/lib/Drupal/system/Plugin/Core/Entity/DateFormat.php
+++ b/core/modules/system/lib/Drupal/system/Plugin/Core/Entity/DateFormat.php
@@ -192,7 +192,7 @@ class DateFormat extends ConfigEntityBase implements DateFormatInterface {
foreach ($entities as $entity) {
$format_id = $entity->id();
foreach ($languages as $langcode => $data) {
- config("locale.config.$langcode.system.date_format.$format_id")->delete();
+ \Drupal::config("locale.config.$langcode.system.date_format.$format_id")->delete();
}
}
}
diff --git a/core/modules/system/lib/Drupal/system/Plugin/ImageToolkit/GDToolkit.php b/core/modules/system/lib/Drupal/system/Plugin/ImageToolkit/GDToolkit.php
index 86612c7..2421004 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 @@ class GDToolkit extends PluginBase implements ImageToolkitInterface {
'#description' => t('Define the image quality for JPEG manipulations. Ranges from 0 to 100. Higher values mean better image quality but bigger files.'),
'#min' => 0,
'#max' => 100,
- '#default_value' => config('system.image.gd')->get('jpeg_quality'),
+ '#default_value' => \Drupal::config('system.image.gd')->get('jpeg_quality'),
'#field_suffix' => t('%'),
);
return $form;
@@ -43,7 +43,7 @@ class GDToolkit extends PluginBase implements ImageToolkitInterface {
* {@inheritdoc}
*/
public function settingsFormSubmit($form, &$form_state) {
- config('system.image.gd')
+ \Drupal::config('system.image.gd')
->set('jpeg_quality', $form_state['values']['gd']['image_jpeg_quality'])
->save();
}
@@ -196,7 +196,7 @@ class GDToolkit extends PluginBase implements ImageToolkitInterface {
return FALSE;
}
if ($extension == 'jpeg') {
- $success = $function($image->getResource(), $destination, config('system.image.gd')->get('jpeg_quality'));
+ $success = $function($image->getResource(), $destination, \Drupal::config('system.image.gd')->get('jpeg_quality'));
}
else {
// Always save PNG images with full transparency.
diff --git a/core/modules/system/lib/Drupal/system/Plugin/ImageToolkitManager.php b/core/modules/system/lib/Drupal/system/Plugin/ImageToolkitManager.php
index f8e334d..5f00afb 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 @@ class ImageToolkitManager extends DefaultPluginManager {
* Object of the default toolkit, or FALSE on error.
*/
public function getDefaultToolkit() {
- $toolkit_id = config('system.image')->get('toolkit');
+ $toolkit_id = \Drupal::config('system.image')->get('toolkit');
$toolkits = $this->getAvailableToolkits();
if (!isset($toolkits[$toolkit_id]) || !class_exists($toolkits[$toolkit_id]['class'])) {
diff --git a/core/modules/system/lib/Drupal/system/Tests/Ajax/FrameworkTest.php b/core/modules/system/lib/Drupal/system/Tests/Ajax/FrameworkTest.php
index 44d1ab8..7b86c56 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Ajax/FrameworkTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Ajax/FrameworkTest.php
@@ -189,7 +189,7 @@ class FrameworkTest extends AjaxTestBase {
// The test theme overrides system.module.css without an implementation,
// thereby removing it.
theme_enable(array('test_theme'));
- config('system.theme')
+ \Drupal::config('system.theme')
->set('default', 'test_theme')
->save();
diff --git a/core/modules/system/lib/Drupal/system/Tests/Batch/PageTest.php b/core/modules/system/lib/Drupal/system/Tests/Batch/PageTest.php
index be6bcef..f268e02 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 @@ class PageTest extends WebTestBase {
function testBatchProgressPageTheme() {
// Make sure that the page which starts the batch (an administrative page)
// is using a different theme than would normally be used by the batch API.
- config('system.theme')
+ \Drupal::config('system.theme')
->set('default', 'bartik')
->save();
theme_enable(array('seven'));
- config('system.theme')->set('admin', 'seven')->save();
+ \Drupal::config('system.theme')->set('admin', 'seven')->save();
// Log in as an administrator who can see the administrative theme.
$admin_user = $this->drupalCreateUser(array('view the administration theme'));
$this->drupalLogin($admin_user);
diff --git a/core/modules/system/lib/Drupal/system/Tests/Bootstrap/PageCacheTest.php b/core/modules/system/lib/Drupal/system/Tests/Bootstrap/PageCacheTest.php
index 59d71b6..67a70b8 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 @@ class PageCacheTest extends WebTestBase {
function setUp() {
parent::setUp();
- config('system.site')
+ \Drupal::config('system.site')
->set('name', 'Drupal')
->set('page.front', 'test-page')
->save();
@@ -72,7 +72,7 @@ class PageCacheTest extends WebTestBase {
* Tests support of requests with If-Modified-Since and If-None-Match headers.
*/
function testConditionalRequests() {
- $config = config('system.performance');
+ $config = \Drupal::config('system.performance');
$config->set('cache.page.use_internal', 1);
$config->set('cache.page.max_age', 300);
$config->save();
@@ -117,7 +117,7 @@ class PageCacheTest extends WebTestBase {
* Tests cache headers.
*/
function testPageCache() {
- $config = config('system.performance');
+ $config = \Drupal::config('system.performance');
$config->set('cache.page.use_internal', 1);
$config->set('cache.page.max_age', 300);
$config->set('response.gzip', 1);
@@ -177,7 +177,7 @@ class PageCacheTest extends WebTestBase {
* mod_deflate Apache module.
*/
function testPageCompression() {
- $config = config('system.performance');
+ $config = \Drupal::config('system.performance');
$config->set('cache.page.use_internal', 1);
$config->set('cache.page.max_age', 300);
$config->set('response.gzip', 1);
@@ -200,7 +200,7 @@ class PageCacheTest extends WebTestBase {
$this->drupalGet('');
$this->assertEqual($this->drupalGetHeader('X-Drupal-Cache'), 'HIT', 'Page was cached.');
$this->assertFalse($this->drupalGetHeader('Content-Encoding'), 'A Content-Encoding header was not sent.');
- $this->assertTitle(t('Test page | @site-name', array('@site-name' => config('system.site')->get('name'))), 'Site title matches.');
+ $this->assertTitle(t('Test page | @site-name', array('@site-name' => \Drupal::config('system.site')->get('name'))), 'Site title matches.');
$this->assertRaw('</html>', 'Page was not compressed.');
// Disable compression mode.
diff --git a/core/modules/system/lib/Drupal/system/Tests/Common/FormatDateTest.php b/core/modules/system/lib/Drupal/system/Tests/Common/FormatDateTest.php
index 843f716..2bd36c2 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Common/FormatDateTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Common/FormatDateTest.php
@@ -38,7 +38,7 @@ class FormatDateTest extends WebTestBase {
function setUp() {
parent::setUp('language');
- config('system.date')
+ \Drupal::config('system.date')
->set('timezone.user.configurable', 1)
->save();
$formats = $this->container->get('plugin.manager.entity')
diff --git a/core/modules/system/lib/Drupal/system/Tests/Common/JavaScriptTest.php b/core/modules/system/lib/Drupal/system/Tests/Common/JavaScriptTest.php
index 128dc30..96168fe 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Common/JavaScriptTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Common/JavaScriptTest.php
@@ -39,7 +39,7 @@ class JavaScriptTest extends DrupalUnitTestBase {
parent::setUp();
// Disable preprocessing
- $config = config('system.performance');
+ $config = \Drupal::config('system.performance');
$this->preprocess_js = $config->get('js.preprocess');
$config->set('js.preprocess', 0);
$config->save();
@@ -51,7 +51,7 @@ class JavaScriptTest extends DrupalUnitTestBase {
function tearDown() {
// Restore configured value for JavaScript preprocessing.
- $config = config('system.performance');
+ $config = \Drupal::config('system.performance');
$config->set('js.preprocess', $this->preprocess_js);
$config->save();
parent::tearDown();
@@ -120,7 +120,7 @@ class JavaScriptTest extends DrupalUnitTestBase {
*/
function testAggregatedAttributes() {
// Enable aggregation.
- config('system.performance')->set('js.preprocess', 1)->save();
+ \Drupal::config('system.performance')->set('js.preprocess', 1)->save();
$default_query_string = variable_get('css_js_query_string', '0');
@@ -327,7 +327,7 @@ class JavaScriptTest extends DrupalUnitTestBase {
// Now ensure that with aggregation on, one file is made for the
// 'every_page' files, and one file is made for the others.
drupal_static_reset('drupal_add_js');
- $config = config('system.performance');
+ $config = \Drupal::config('system.performance');
$config->set('js.preprocess', 1);
$config->save();
drupal_add_library('system', 'drupal');
@@ -349,7 +349,7 @@ class JavaScriptTest extends DrupalUnitTestBase {
*/
function testAggregationOrder() {
// Enable JavaScript aggregation.
- config('system.performance')->set('js.preprocess', 1)->save();
+ \Drupal::config('system.performance')->set('js.preprocess', 1)->save();
drupal_static_reset('drupal_add_js');
// Add two JavaScript files to the current request and build the cache.
diff --git a/core/modules/system/lib/Drupal/system/Tests/Common/RenderTest.php b/core/modules/system/lib/Drupal/system/Tests/Common/RenderTest.php
index c964577..1799343 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Common/RenderTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Common/RenderTest.php
@@ -508,7 +508,7 @@ class RenderTest extends WebTestBase {
);
$message = t('%type: !message in %function (line ', $error);
- config('system.logging')->set('error_level', ERROR_REPORTING_DISPLAY_ALL)->save();
+ \Drupal::config('system.logging')->set('error_level', ERROR_REPORTING_DISPLAY_ALL)->save();
$this->drupalGet('common-test/drupal-render-invalid-keys');
$this->assertResponse(200, 'Received expected HTTP status code.');
$this->assertRaw($message, format_string('Found error message: !message.', array('!message' => $message)));
diff --git a/core/modules/system/lib/Drupal/system/Tests/Datetime/DrupalDateTimeTest.php b/core/modules/system/lib/Drupal/system/Tests/Datetime/DrupalDateTimeTest.php
index dc24e38..027d866 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Datetime/DrupalDateTimeTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Datetime/DrupalDateTimeTest.php
@@ -48,7 +48,7 @@ class DrupalDateTimeTest extends WebTestBase {
$date_string = '2007-01-31 21:00:00';
// Make sure no site timezone has been set.
- config('system.date')
+ \Drupal::config('system.date')
->set('timezone.user.configurable', 0)
->set('timezone.default', NULL)
->save();
@@ -68,7 +68,7 @@ class DrupalDateTimeTest extends WebTestBase {
$this->assertTrue($timezone == 'America/Yellowknife', 'DrupalDateTime uses the specified timezone if provided.');
// Set a site timezone.
- config('system.date')->set('timezone.default', 'Europe/Warsaw')->save();
+ \Drupal::config('system.date')->set('timezone.default', 'Europe/Warsaw')->save();
// Create a date object with an unspecified timezone, which should
// end up using the site timezone.
@@ -77,7 +77,7 @@ class DrupalDateTimeTest extends WebTestBase {
$this->assertTrue($timezone == 'Europe/Warsaw', 'DrupalDateTime uses the site timezone if provided.');
// Create user.
- config('system.date')->set('timezone.user.configurable', 1)->save();
+ \Drupal::config('system.date')->set('timezone.user.configurable', 1)->save();
$test_user = $this->drupalCreateUser(array());
$this->drupalLogin($test_user);
diff --git a/core/modules/system/lib/Drupal/system/Tests/File/DirectoryTest.php b/core/modules/system/lib/Drupal/system/Tests/File/DirectoryTest.php
index f72430f..7fd19c5 100644
--- a/core/modules/system/lib/Drupal/system/Tests/File/DirectoryTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/File/DirectoryTest.php
@@ -89,7 +89,7 @@ class DirectoryTest extends FileTestBase {
}
// Test that the directory has the correct permissions.
- $this->assertDirectoryPermissions($directory, octdec(config('system.file')->get('chmod.directory')));
+ $this->assertDirectoryPermissions($directory, octdec(\Drupal::config('system.file')->get('chmod.directory')));
// Remove .htaccess file to then test that it gets re-created.
@drupal_unlink(file_default_scheme() . '://.htaccess');
@@ -160,7 +160,7 @@ class DirectoryTest extends FileTestBase {
*/
function testFileDirectoryTemp() {
// Start with an empty variable to ensure we have a clean slate.
- $config = config('system.file');
+ $config = \Drupal::config('system.file');
$config->set('path.temporary', '')->save();
$tmp_directory = file_directory_temp();
$this->assertEqual(empty($tmp_directory), FALSE, 'file_directory_temp() returned a non-empty value.');
diff --git a/core/modules/system/lib/Drupal/system/Tests/File/NameMungingTest.php b/core/modules/system/lib/Drupal/system/Tests/File/NameMungingTest.php
index fe89a33..9c0d3d9 100644
--- a/core/modules/system/lib/Drupal/system/Tests/File/NameMungingTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/File/NameMungingTest.php
@@ -30,7 +30,7 @@ class NameMungingTest extends FileTestBase {
*/
function testMunging() {
// Disable insecure uploads.
- config('system.file')->set('allow_insecure_uploads', 0)->save();
+ \Drupal::config('system.file')->set('allow_insecure_uploads', 0)->save();
$munged_name = file_munge_filename($this->name, '', TRUE);
$messages = drupal_get_messages();
$this->assertTrue(in_array(t('For security reasons, your upload has been renamed to %filename.', array('%filename' => $munged_name)), $messages['status']), 'Alert properly set when a file is renamed.');
@@ -51,7 +51,7 @@ class NameMungingTest extends FileTestBase {
* come out untouched, no matter how evil the filename.
*/
function testMungeIgnoreInsecure() {
- config('system.file')->set('allow_insecure_uploads', 1)->save();
+ \Drupal::config('system.file')->set('allow_insecure_uploads', 1)->save();
$munged_name = file_munge_filename($this->name, '');
$this->assertIdentical($munged_name, $this->name, format_string('The original filename (%original) matches the munged filename (%munged) when insecure uploads are enabled.', array('%munged' => $munged_name, '%original' => $this->name)));
}
diff --git a/core/modules/system/lib/Drupal/system/Tests/File/RemoteFileDirectoryTest.php b/core/modules/system/lib/Drupal/system/Tests/File/RemoteFileDirectoryTest.php
index 557c03f..4c7abd2 100644
--- a/core/modules/system/lib/Drupal/system/Tests/File/RemoteFileDirectoryTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/File/RemoteFileDirectoryTest.php
@@ -27,6 +27,6 @@ class RemoteFileDirectoryTest extends DirectoryTest {
function setUp() {
parent::setUp('file_test');
- config('system.file')->set('default_scheme', 'dummy-remote')->save();
+ \Drupal::config('system.file')->set('default_scheme', 'dummy-remote')->save();
}
}
diff --git a/core/modules/system/lib/Drupal/system/Tests/File/RemoteFileScanDirectoryTest.php b/core/modules/system/lib/Drupal/system/Tests/File/RemoteFileScanDirectoryTest.php
index 0dccd29..fe554cd 100644
--- a/core/modules/system/lib/Drupal/system/Tests/File/RemoteFileScanDirectoryTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/File/RemoteFileScanDirectoryTest.php
@@ -27,6 +27,6 @@ class RemoteFileScanDirectoryTest extends ScanDirectoryTest {
function setUp() {
parent::setUp('file_test');
- config('system.file')->set('default_scheme', 'dummy-remote')->save();
+ \Drupal::config('system.file')->set('default_scheme', 'dummy-remote')->save();
}
}
diff --git a/core/modules/system/lib/Drupal/system/Tests/File/RemoteFileUnmanagedCopyTest.php b/core/modules/system/lib/Drupal/system/Tests/File/RemoteFileUnmanagedCopyTest.php
index 365c8bb..21973ba 100644
--- a/core/modules/system/lib/Drupal/system/Tests/File/RemoteFileUnmanagedCopyTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/File/RemoteFileUnmanagedCopyTest.php
@@ -27,6 +27,6 @@ class RemoteFileUnmanagedCopyTest extends UnmanagedCopyTest {
function setUp() {
parent::setUp('file_test');
- config('system.file')->set('default_scheme', 'dummy-remote')->save();
+ \Drupal::config('system.file')->set('default_scheme', 'dummy-remote')->save();
}
}
diff --git a/core/modules/system/lib/Drupal/system/Tests/File/RemoteFileUnmanagedDeleteRecursiveTest.php b/core/modules/system/lib/Drupal/system/Tests/File/RemoteFileUnmanagedDeleteRecursiveTest.php
index 6e51f6b..9fbafac 100644
--- a/core/modules/system/lib/Drupal/system/Tests/File/RemoteFileUnmanagedDeleteRecursiveTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/File/RemoteFileUnmanagedDeleteRecursiveTest.php
@@ -27,6 +27,6 @@ class RemoteFileUnmanagedDeleteRecursiveTest extends UnmanagedDeleteRecursiveTes
function setUp() {
parent::setUp('file_test');
- config('system.file')->set('default_scheme', 'dummy-remote')->save();
+ \Drupal::config('system.file')->set('default_scheme', 'dummy-remote')->save();
}
}
diff --git a/core/modules/system/lib/Drupal/system/Tests/File/RemoteFileUnmanagedDeleteTest.php b/core/modules/system/lib/Drupal/system/Tests/File/RemoteFileUnmanagedDeleteTest.php
index 46160f5..b5dfcf7 100644
--- a/core/modules/system/lib/Drupal/system/Tests/File/RemoteFileUnmanagedDeleteTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/File/RemoteFileUnmanagedDeleteTest.php
@@ -27,6 +27,6 @@ class RemoteFileUnmanagedDeleteTest extends UnmanagedDeleteTest {
function setUp() {
parent::setUp('file_test');
- config('system.file')->set('default_scheme', 'dummy-remote')->save();
+ \Drupal::config('system.file')->set('default_scheme', 'dummy-remote')->save();
}
}
diff --git a/core/modules/system/lib/Drupal/system/Tests/File/RemoteFileUnmanagedSaveDataTest.php b/core/modules/system/lib/Drupal/system/Tests/File/RemoteFileUnmanagedSaveDataTest.php
index e21b9ce..1e5712a 100644
--- a/core/modules/system/lib/Drupal/system/Tests/File/RemoteFileUnmanagedSaveDataTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/File/RemoteFileUnmanagedSaveDataTest.php
@@ -27,6 +27,6 @@ class RemoteFileUnmanagedSaveDataTest extends UnmanagedSaveDataTest {
function setUp() {
parent::setUp('file_test');
- config('system.file')->set('default_scheme', 'dummy-remote')->save();
+ \Drupal::config('system.file')->set('default_scheme', 'dummy-remote')->save();
}
}
diff --git a/core/modules/system/lib/Drupal/system/Tests/File/StreamWrapperTest.php b/core/modules/system/lib/Drupal/system/Tests/File/StreamWrapperTest.php
index c17dcb7..1b5c429 100644
--- a/core/modules/system/lib/Drupal/system/Tests/File/StreamWrapperTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/File/StreamWrapperTest.php
@@ -67,7 +67,7 @@ class StreamWrapperTest extends WebTestBase {
* Test the URI and target functions.
*/
function testUriFunctions() {
- $config = config('system.file');
+ $config = \Drupal::config('system.file');
$instance = file_stream_wrapper_get_instance_by_uri($this->scheme . '://foo');
$this->assertEqual($this->classname, get_class($instance), 'Got correct class type for dummy URI.');
diff --git a/core/modules/system/lib/Drupal/system/Tests/File/UnmanagedCopyTest.php b/core/modules/system/lib/Drupal/system/Tests/File/UnmanagedCopyTest.php
index 7f5248c..70f1903 100644
--- a/core/modules/system/lib/Drupal/system/Tests/File/UnmanagedCopyTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/File/UnmanagedCopyTest.php
@@ -23,7 +23,7 @@ class UnmanagedCopyTest extends FileTestBase {
* Copy a normal file.
*/
function testNormal() {
- $config = config('system.file');
+ $config = \Drupal::config('system.file');
// Create a file for testing
$uri = $this->createUri();
@@ -65,7 +65,7 @@ class UnmanagedCopyTest extends FileTestBase {
* Copy a file onto itself.
*/
function testOverwriteSelf() {
- $config = config('system.file');
+ $config = \Drupal::config('system.file');
// Create a file for testing
$uri = $this->createUri();
diff --git a/core/modules/system/lib/Drupal/system/Tests/File/UnmanagedMoveTest.php b/core/modules/system/lib/Drupal/system/Tests/File/UnmanagedMoveTest.php
index 23ac632..1503bd1 100644
--- a/core/modules/system/lib/Drupal/system/Tests/File/UnmanagedMoveTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/File/UnmanagedMoveTest.php
@@ -23,7 +23,7 @@ class UnmanagedMoveTest extends FileTestBase {
* Move a normal file.
*/
function testNormal() {
- $config = config('system.file');
+ $config = \Drupal::config('system.file');
// Create a file for testing
$uri = $this->createUri();
diff --git a/core/modules/system/lib/Drupal/system/Tests/File/UnmanagedSaveDataTest.php b/core/modules/system/lib/Drupal/system/Tests/File/UnmanagedSaveDataTest.php
index 1077c4c..043ed6c 100644
--- a/core/modules/system/lib/Drupal/system/Tests/File/UnmanagedSaveDataTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/File/UnmanagedSaveDataTest.php
@@ -36,6 +36,6 @@ class UnmanagedSaveDataTest extends FileTestBase {
$this->assertTrue($filepath, 'Unnamed file saved correctly.');
$this->assertEqual('asdf.txt', drupal_basename($filepath), 'File was named correctly.');
$this->assertEqual($contents, file_get_contents($filepath), 'Contents of the file are correct.');
- $this->assertFilePermissions($filepath, octdec(config('system.file')->get('chmod.file')));
+ $this->assertFilePermissions($filepath, octdec(\Drupal::config('system.file')->get('chmod.file')));
}
}
diff --git a/core/modules/system/lib/Drupal/system/Tests/Installer/InstallerTranslationTest.php b/core/modules/system/lib/Drupal/system/Tests/Installer/InstallerTranslationTest.php
index 2c6e10f..29abf30 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Installer/InstallerTranslationTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Installer/InstallerTranslationTest.php
@@ -113,7 +113,7 @@ class InstallerTranslationTest extends InstallerTest {
$this->rebuildContainer();
foreach ($variable_groups as $config_base => $variables) {
- $config = config($config_base);
+ $config = \Drupal::config($config_base);
foreach ($variables as $name => $value) {
$config->set($name, $value);
}
@@ -121,7 +121,7 @@ class InstallerTranslationTest extends InstallerTest {
}
// Use the test mail class instead of the default mail handler class.
- config('system.mail')->set('interface.default', 'Drupal\Core\Mail\VariableLog')->save();
+ \Drupal::config('system.mail')->set('interface.default', 'Drupal\Core\Mail\VariableLog')->save();
drupal_set_time_limit($this->timeLimit);
// When running from run-tests.sh we don't get an empty current path which
diff --git a/core/modules/system/lib/Drupal/system/Tests/InstallerTest.php b/core/modules/system/lib/Drupal/system/Tests/InstallerTest.php
index 43824bf..2c4ead8 100644
--- a/core/modules/system/lib/Drupal/system/Tests/InstallerTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/InstallerTest.php
@@ -89,7 +89,7 @@ class InstallerTest extends WebTestBase {
$this->rebuildContainer();
foreach ($variable_groups as $config_base => $variables) {
- $config = config($config_base);
+ $config = \Drupal::config($config_base);
foreach ($variables as $name => $value) {
$config->set($name, $value);
}
@@ -97,7 +97,7 @@ class InstallerTest extends WebTestBase {
}
// Use the test mail class instead of the default mail handler class.
- config('system.mail')->set('interface.default', 'Drupal\Core\Mail\VariableLog')->save();
+ \Drupal::config('system.mail')->set('interface.default', 'Drupal\Core\Mail\VariableLog')->save();
drupal_set_time_limit($this->timeLimit);
// When running from run-tests.sh we don't get an empty current path which
diff --git a/core/modules/system/lib/Drupal/system/Tests/Mail/MailTest.php b/core/modules/system/lib/Drupal/system/Tests/Mail/MailTest.php
index d832f06..b6a5d98 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Mail/MailTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Mail/MailTest.php
@@ -43,7 +43,7 @@ class MailTest extends WebTestBase implements MailInterface {
parent::setUp();
// Set MailTestCase (i.e. this class) as the SMTP library
- config('system.mail')->set('interface.default', 'Drupal\system\Tests\Mail\MailTest')->save();
+ \Drupal::config('system.mail')->set('interface.default', 'Drupal\system\Tests\Mail\MailTest')->save();
}
/**
diff --git a/core/modules/system/lib/Drupal/system/Tests/Menu/BreadcrumbTest.php b/core/modules/system/lib/Drupal/system/Tests/Menu/BreadcrumbTest.php
index dd4cee8..d51c9ea 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Menu/BreadcrumbTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Menu/BreadcrumbTest.php
@@ -49,7 +49,7 @@ class BreadcrumbTest extends MenuTestBase {
'region' => 'content',
);
$this->drupalPlaceBlock('system_menu_block:menu-tools', $settings);
- $settings['theme'] = config('system.theme')->get('admin');
+ $settings['theme'] = \Drupal::config('system.theme')->get('admin');
$this->drupalPlaceBlock('system_menu_block:menu-tools', $settings);
}
diff --git a/core/modules/system/lib/Drupal/system/Tests/Menu/LocalTasksTest.php b/core/modules/system/lib/Drupal/system/Tests/Menu/LocalTasksTest.php
index 34034d6..1a32725 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Menu/LocalTasksTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Menu/LocalTasksTest.php
@@ -51,7 +51,7 @@ class LocalTasksTest extends WebTestBase {
));
// Enable addition of tasks in menu_test_menu_local_tasks().
- config('menu_test.settings')->set('tasks.add', TRUE)->save();
+ \Drupal::config('menu_test.settings')->set('tasks.add', TRUE)->save();
// Verify that the added tasks appear even if there are no tasks normally.
$this->drupalGet('menu-test/tasks/empty');
@@ -80,7 +80,7 @@ class LocalTasksTest extends WebTestBase {
));
// Enable manipulation of tasks in menu_test_menu_local_tasks_alter().
- config('menu_test.settings')->set('tasks.alter', TRUE)->save();
+ \Drupal::config('menu_test.settings')->set('tasks.alter', TRUE)->save();
// Verify that the added tasks appear even if there are no tasks normally.
$this->drupalGet('menu-test/tasks/empty');
diff --git a/core/modules/system/lib/Drupal/system/Tests/Menu/MenuRouterTest.php b/core/modules/system/lib/Drupal/system/Tests/Menu/MenuRouterTest.php
index ac5e151..0a94658 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Menu/MenuRouterTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Menu/MenuRouterTest.php
@@ -60,7 +60,7 @@ class MenuRouterTest extends WebTestBase {
$this->admin_theme = 'seven';
$this->alternate_theme = 'stark';
theme_enable(array($this->default_theme));
- config('system.theme')
+ \Drupal::config('system.theme')
->set('default', $this->default_theme)
->set('admin', $this->admin_theme)
->save();
@@ -160,7 +160,7 @@ class MenuRouterTest extends WebTestBase {
* Test the theme callback when the site is in maintenance mode.
*/
function testThemeCallbackMaintenanceMode() {
- config('system.maintenance')->set('enabled', 1)->save();
+ \Drupal::config('system.maintenance')->set('enabled', 1)->save();
theme_enable(array($this->admin_theme));
// For a regular user, the fact that the site is in maintenance mode means
@@ -175,7 +175,7 @@ class MenuRouterTest extends WebTestBase {
$this->assertText('Custom theme: seven. Actual theme: seven.', 'The theme callback system is correctly triggered for an administrator when the site is in maintenance mode.');
$this->assertRaw('seven/style.css', "The administrative theme's CSS appears on the page.");
- config('system.maintenance')->set('enabled', 0)->save();
+ \Drupal::config('system.maintenance')->set('enabled', 0)->save();
}
/**
@@ -184,15 +184,15 @@ class MenuRouterTest extends WebTestBase {
* @see \Drupal\menu_test\EventSubscriber\MaintenanceModeSubscriber::onKernelRequestMaintenance().
*/
function testMaintenanceModeLoginPaths() {
- config('system.maintenance')->set('enabled', 1)->save();
+ \Drupal::config('system.maintenance')->set('enabled', 1)->save();
- $offline_message = t('@site is currently under maintenance. We should be back shortly. Thank you for your patience.', array('@site' => config('system.site')->get('name')));
+ $offline_message = t('@site is currently under maintenance. We should be back shortly. Thank you for your patience.', array('@site' => \Drupal::config('system.site')->get('name')));
$this->drupalGet('test-page');
$this->assertText($offline_message);
$this->drupalGet('menu_login_callback');
$this->assertText('This is TestControllers::testLogin.', 'Maintenance mode can be bypassed using an event subscriber.');
- config('system.maintenance')->set('enabled', 0)->save();
+ \Drupal::config('system.maintenance')->set('enabled', 0)->save();
}
/**
diff --git a/core/modules/system/lib/Drupal/system/Tests/Menu/TrailTest.php b/core/modules/system/lib/Drupal/system/Tests/Menu/TrailTest.php
index eb59f94..fbd3e34 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Menu/TrailTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Menu/TrailTest.php
@@ -107,7 +107,7 @@ class TrailTest extends MenuTestBase {
*/
function testCustom403And404Pages() {
// Set the custom 403 and 404 pages we will use.
- config('system.site')
+ \Drupal::config('system.site')
->set('page.403', 'menu-test/custom-403-page')
->set('page.404', 'menu-test/custom-404-page')
->save();
diff --git a/core/modules/system/lib/Drupal/system/Tests/Module/ModuleEnableTest.php b/core/modules/system/lib/Drupal/system/Tests/Module/ModuleEnableTest.php
index 7ff9f68..d4967f8 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Module/ModuleEnableTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Module/ModuleEnableTest.php
@@ -32,7 +32,7 @@ class ModuleEnableTest extends WebTestBase {
*/
function testEnableUserTwice() {
$this->container->get('module_handler')->enable(array('user'), FALSE);
- $this->assertIdentical(config('system.module')->get('enabled.user'), '0');
+ $this->assertIdentical(\Drupal::config('system.module')->get('enabled.user'), '0');
}
/**
diff --git a/core/modules/system/lib/Drupal/system/Tests/Module/ModuleTestBase.php b/core/modules/system/lib/Drupal/system/Tests/Module/ModuleTestBase.php
index aed76b3..95844f6 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Module/ModuleTestBase.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Module/ModuleTestBase.php
@@ -118,7 +118,7 @@ abstract class ModuleTestBase extends WebTestBase {
// list all default config once more, but filtered by $module.
$names = $module_file_storage->listAll($module . '.');
foreach ($names as $key => $name) {
- if (config($name)->get()) {
+ if (\Drupal::config($name)->get()) {
unset($names[$key]);
}
}
diff --git a/core/modules/system/lib/Drupal/system/Tests/Path/MatchPathTest.php b/core/modules/system/lib/Drupal/system/Tests/Path/MatchPathTest.php
index 15af3b6..4adb5cf 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Path/MatchPathTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Path/MatchPathTest.php
@@ -31,7 +31,7 @@ class MatchPathTest extends WebTestBase {
// Set up a random site front page to test the '<front>' placeholder.
$this->front = $this->randomName();
- config('system.site')->set('page.front', $this->front)->save();
+ \Drupal::config('system.site')->set('page.front', $this->front)->save();
// Refresh our static variables from the database.
$this->refreshVariables();
}
diff --git a/core/modules/system/lib/Drupal/system/Tests/Path/UrlAlterFunctionalTest.php b/core/modules/system/lib/Drupal/system/Tests/Path/UrlAlterFunctionalTest.php
index 6a782ed..3454c1e 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Path/UrlAlterFunctionalTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Path/UrlAlterFunctionalTest.php
@@ -68,7 +68,7 @@ class UrlAlterFunctionalTest extends WebTestBase {
$this->drupalGet('community');
$this->assertText('General discussion', 'The community path gets resolved correctly');
$this->assertUrlOutboundAlter('forum', 'community');
- $forum_vid = config('forum.settings')->get('vocabulary');
+ $forum_vid = \Drupal::config('forum.settings')->get('vocabulary');
$term_name = $this->randomName();
$term = entity_create('taxonomy_term', array(
'name' => $term_name,
diff --git a/core/modules/system/lib/Drupal/system/Tests/Session/SessionTest.php b/core/modules/system/lib/Drupal/system/Tests/Session/SessionTest.php
index 7310de5..427ad70 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Session/SessionTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Session/SessionTest.php
@@ -149,7 +149,7 @@ class SessionTest extends WebTestBase {
$this->assertSessionEmpty(TRUE);
// The same behavior is expected when caching is enabled.
- $config = config('system.performance');
+ $config = \Drupal::config('system.performance');
$config->set('cache.page.use_internal', 1);
$config->set('cache.page.max_age', 300);
$config->save();
diff --git a/core/modules/system/lib/Drupal/system/Tests/System/AccessDeniedTest.php b/core/modules/system/lib/Drupal/system/Tests/System/AccessDeniedTest.php
index 35af9a3..0e047ec 100644
--- a/core/modules/system/lib/Drupal/system/Tests/System/AccessDeniedTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/System/AccessDeniedTest.php
@@ -78,7 +78,7 @@ class AccessDeniedTest extends WebTestBase {
// Log back in, set the custom 403 page to /user and remove the block
$this->drupalLogin($this->admin_user);
- config('system.site')->set('page.403', 'user')->save();
+ \Drupal::config('system.site')->set('page.403', 'user')->save();
$edit = array(
'region' => -1,
);
diff --git a/core/modules/system/lib/Drupal/system/Tests/System/CronRunTest.php b/core/modules/system/lib/Drupal/system/Tests/System/CronRunTest.php
index 67a5993..5e35a15 100644
--- a/core/modules/system/lib/Drupal/system/Tests/System/CronRunTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/System/CronRunTest.php
@@ -59,7 +59,7 @@ class CronRunTest extends WebTestBase {
$cron_last = time();
$cron_safe_threshold = 100;
\Drupal::state()->set('system.cron_last', $cron_last);
- config('system.cron')
+ \Drupal::config('system.cron')
->set('threshold.autorun', $cron_safe_threshold)
->save();
$this->drupalGet('');
diff --git a/core/modules/system/lib/Drupal/system/Tests/System/DateTimeTest.php b/core/modules/system/lib/Drupal/system/Tests/System/DateTimeTest.php
index 938c7e6..c644f3a 100644
--- a/core/modules/system/lib/Drupal/system/Tests/System/DateTimeTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/System/DateTimeTest.php
@@ -43,7 +43,7 @@ class DateTimeTest extends WebTestBase {
*/
function testTimeZoneHandling() {
// Setup date/time settings for Honolulu time.
- $config = config('system.date')
+ $config = \Drupal::config('system.date')
->set('timezone.default', 'Pacific/Honolulu')
->set('timezone.user.configurable', 0)
->save();
@@ -135,7 +135,7 @@ class DateTimeTest extends WebTestBase {
$format = $date_format->getPattern();
$this->assertEqual('dmYHis', $format, 'Localized date format resides in general config too.');
- $format = config('locale.config.en.system.date_format.test_short')->get('pattern.php');
+ $format = \Drupal::config('locale.config.en.system.date_format.test_short')->get('pattern.php');
$this->assertEqual('dmYHis', $format, 'Localized date format resides in localized config.');
}
diff --git a/core/modules/system/lib/Drupal/system/Tests/System/ErrorHandlerTest.php b/core/modules/system/lib/Drupal/system/Tests/System/ErrorHandlerTest.php
index 11d1356..3ecb0e5 100644
--- a/core/modules/system/lib/Drupal/system/Tests/System/ErrorHandlerTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/System/ErrorHandlerTest.php
@@ -33,7 +33,7 @@ class ErrorHandlerTest extends WebTestBase {
* Test the error handler.
*/
function testErrorHandler() {
- $config = config('system.logging');
+ $config = \Drupal::config('system.logging');
$error_notice = array(
'%type' => 'Notice',
'!message' => 'Undefined variable: bananas',
@@ -54,7 +54,7 @@ class ErrorHandlerTest extends WebTestBase {
);
// Set error reporting to display verbose notices.
- config('system.logging')->set('error_level', ERROR_REPORTING_DISPLAY_VERBOSE)->save();
+ \Drupal::config('system.logging')->set('error_level', ERROR_REPORTING_DISPLAY_VERBOSE)->save();
$this->drupalGet('error-test/generate-warnings');
$this->assertResponse(200, 'Received expected HTTP status code.');
$this->assertErrorMessage($error_notice);
diff --git a/core/modules/system/lib/Drupal/system/Tests/System/FrontPageTest.php b/core/modules/system/lib/Drupal/system/Tests/System/FrontPageTest.php
index f39c6f6..d26a3a4 100644
--- a/core/modules/system/lib/Drupal/system/Tests/System/FrontPageTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/System/FrontPageTest.php
@@ -38,7 +38,7 @@ class FrontPageTest extends WebTestBase {
$this->node_path = "node/" . $this->drupalCreateNode(array('promote' => 1))->id();
// Configure 'node' as front page.
- config('system.site')->set('page.front', 'node')->save();
+ \Drupal::config('system.site')->set('page.front', 'node')->save();
// Enable front page logging in system_test.module.
\Drupal::state()->set('system_test.front_page_output', 1);
}
diff --git a/core/modules/system/lib/Drupal/system/Tests/System/SiteMaintenanceTest.php b/core/modules/system/lib/Drupal/system/Tests/System/SiteMaintenanceTest.php
index 5a295a2..52a4ab0 100644
--- a/core/modules/system/lib/Drupal/system/Tests/System/SiteMaintenanceTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/System/SiteMaintenanceTest.php
@@ -35,7 +35,7 @@ class SiteMaintenanceTest extends WebTestBase {
parent::setUp();
// Configure 'node' as front page.
- config('system.site')->set('page.front', 'node')->save();
+ \Drupal::config('system.site')->set('page.front', 'node')->save();
// Create a user allowed to access site in maintenance mode.
$this->user = $this->drupalCreateUser(array('access site in maintenance mode'));
@@ -56,7 +56,7 @@ class SiteMaintenanceTest extends WebTestBase {
$admin_message = t('Operating in maintenance mode. <a href="@url">Go online.</a>', array('@url' => url('admin/config/development/maintenance')));
$user_message = t('Operating in maintenance mode.');
- $offline_message = t('@site is currently under maintenance. We should be back shortly. Thank you for your patience.', array('@site' => config('system.site')->get('name')));
+ $offline_message = t('@site is currently under maintenance. We should be back shortly. Thank you for your patience.', array('@site' => \Drupal::config('system.site')->get('name')));
$this->drupalGet('');
$this->assertRaw($admin_message, 'Found the site maintenance mode message.');
diff --git a/core/modules/system/lib/Drupal/system/Tests/System/SystemConfigFormTestBase.php b/core/modules/system/lib/Drupal/system/Tests/System/SystemConfigFormTestBase.php
index 5686e3f..5019d86 100644
--- a/core/modules/system/lib/Drupal/system/Tests/System/SystemConfigFormTestBase.php
+++ b/core/modules/system/lib/Drupal/system/Tests/System/SystemConfigFormTestBase.php
@@ -63,7 +63,7 @@ abstract class SystemConfigFormTestBase extends WebTestBase {
$this->assertTrue($valid_form, format_string('Input values: %values<br/>Validation handler errors: %errors', $args));
foreach ($this->values as $data) {
- $this->assertEqual($data['#value'], config($data['#config_name'])->get($data['#config_key']));
+ $this->assertEqual($data['#value'], \Drupal::config($data['#config_name'])->get($data['#config_key']));
}
}
}
diff --git a/core/modules/system/lib/Drupal/system/Tests/System/ThemeTest.php b/core/modules/system/lib/Drupal/system/Tests/System/ThemeTest.php
index dd8920c..4358f10a 100644
--- a/core/modules/system/lib/Drupal/system/Tests/System/ThemeTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/System/ThemeTest.php
@@ -211,7 +211,7 @@ class ThemeTest extends WebTestBase {
$this->assertRaw('core/themes/stark', 'Site default theme used on the add content page.');
// Reset to the default theme settings.
- config('system.theme')
+ \Drupal::config('system.theme')
->set('default', 'bartik')
->save();
$edit = array(
@@ -235,7 +235,7 @@ class ThemeTest extends WebTestBase {
theme_enable(array('bartik'));
$this->drupalGet('admin/appearance');
$this->clickLink(t('Set default'));
- $this->assertEqual(config('system.theme')->get('default'), 'bartik');
+ $this->assertEqual(\Drupal::config('system.theme')->get('default'), 'bartik');
drupal_flush_all_caches();
diff --git a/core/modules/system/lib/Drupal/system/Tests/System/TokenReplaceTest.php b/core/modules/system/lib/Drupal/system/Tests/System/TokenReplaceTest.php
index 742ec0f..84bf929 100644
--- a/core/modules/system/lib/Drupal/system/Tests/System/TokenReplaceTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/System/TokenReplaceTest.php
@@ -116,15 +116,15 @@ class TokenReplaceTest extends WebTestBase {
);
// Set a few site variables.
- config('system.site')
+ \Drupal::config('system.site')
->set('name', '<strong>Drupal<strong>')
->set('slogan', '<blink>Slogan</blink>')
->save();
// Generate and test sanitized tokens.
$tests = array();
- $tests['[site:name]'] = check_plain(config('system.site')->get('name'));
- $tests['[site:slogan]'] = filter_xss_admin(config('system.site')->get('slogan'));
+ $tests['[site:name]'] = check_plain(\Drupal::config('system.site')->get('name'));
+ $tests['[site:slogan]'] = filter_xss_admin(\Drupal::config('system.site')->get('slogan'));
$tests['[site:mail]'] = 'simpletest@example.com';
$tests['[site:url]'] = url('<front>', $url_options);
$tests['[site:url-brief]'] = preg_replace(array('!^https?://!', '!/$!'), '', url('<front>', $url_options));
@@ -139,8 +139,8 @@ class TokenReplaceTest extends WebTestBase {
}
// Generate and test unsanitized tokens.
- $tests['[site:name]'] = config('system.site')->get('name');
- $tests['[site:slogan]'] = config('system.site')->get('slogan');
+ $tests['[site:name]'] = \Drupal::config('system.site')->get('name');
+ $tests['[site:slogan]'] = \Drupal::config('system.site')->get('slogan');
foreach ($tests as $input => $expected) {
$output = $token_service->replace($input, array(), array('langcode' => $language_interface->id, 'sanitize' => FALSE));
diff --git a/core/modules/system/lib/Drupal/system/Tests/Theme/EntityFilteringThemeTest.php b/core/modules/system/lib/Drupal/system/Tests/Theme/EntityFilteringThemeTest.php
index 7a06c78..f7d53e2 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Theme/EntityFilteringThemeTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Theme/EntityFilteringThemeTest.php
@@ -130,7 +130,7 @@ class EntityFilteringThemeTest extends WebTestBase {
// Check each path in all available themes.
foreach ($this->themes as $theme) {
- config('system.theme')
+ \Drupal::config('system.theme')
->set('default', $theme)
->save();
foreach ($paths as $path) {
diff --git a/core/modules/system/lib/Drupal/system/Tests/Theme/FunctionsTest.php b/core/modules/system/lib/Drupal/system/Tests/Theme/FunctionsTest.php
index d8505bc..9330299 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Theme/FunctionsTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Theme/FunctionsTest.php
@@ -142,7 +142,7 @@ class FunctionsTest extends WebTestBase {
// Required to verify the "active" class in expected links below, and
// because the current path is different when running tests manually via
// simpletest.module ('batch') and via the testing framework ('').
- _current_path(config('system.site')->get('page.front'));
+ _current_path(\Drupal::config('system.site')->get('page.front'));
// Verify that a list of links is properly rendered.
$variables = array();
diff --git a/core/modules/system/lib/Drupal/system/Tests/Theme/ThemeInfoStylesTest.php b/core/modules/system/lib/Drupal/system/Tests/Theme/ThemeInfoStylesTest.php
index d8e58cc..47acb01 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Theme/ThemeInfoStylesTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Theme/ThemeInfoStylesTest.php
@@ -34,7 +34,7 @@ class ThemeInfoStylesTest extends WebTestBase {
*/
function testStylesheets() {
theme_enable(array('test_basetheme', 'test_subtheme'));
- config('system.theme')
+ \Drupal::config('system.theme')
->set('default', 'test_subtheme')
->save();
diff --git a/core/modules/system/lib/Drupal/system/Tests/Theme/ThemeTest.php b/core/modules/system/lib/Drupal/system/Tests/Theme/ThemeTest.php
index 8bbb3d0..90a60f5 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Theme/ThemeTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Theme/ThemeTest.php
@@ -63,7 +63,7 @@ class ThemeTest extends WebTestBase {
function testThemeSuggestions() {
// Set the front page as something random otherwise the CLI
// test runner fails.
- config('system.site')->set('page.front', 'nobody-home')->save();
+ \Drupal::config('system.site')->set('page.front', 'nobody-home')->save();
$args = array('node', '1', 'edit');
$suggestions = theme_get_suggestions($args, 'page');
$this->assertEqual($suggestions, array('page__node', 'page__node__%', 'page__node__1', 'page__node__edit'), 'Found expected node edit page suggestions');
@@ -107,7 +107,7 @@ class ThemeTest extends WebTestBase {
$original_path = _current_path();
// Set the current path to node because theme_get_suggestions() will query
// it to see if we are on the front page.
- config('system.site')->set('page.front', 'node')->save();
+ \Drupal::config('system.site')->set('page.front', 'node')->save();
_current_path('node');
$suggestions = theme_get_suggestions(array('node'), 'page');
// Set it back to not annoy the batch runner.
@@ -133,7 +133,7 @@ class ThemeTest extends WebTestBase {
// what is output to the HTML HEAD based on what is in a theme's .info.yml
// file, so it doesn't matter what page we get, as long as it is themed with
// the test theme. First we test with CSS aggregation disabled.
- $config = config('system.performance');
+ $config = \Drupal::config('system.performance');
$config->set('css.preprocess', 0);
$config->save();
$this->drupalGet('theme-test/suggestion');
@@ -154,7 +154,7 @@ class ThemeTest extends WebTestBase {
* Ensures a themes template is overrideable based on the 'template' filename.
*/
function testTemplateOverride() {
- config('system.theme')
+ \Drupal::config('system.theme')
->set('default', 'test_theme')
->save();
$this->drupalGet('theme-test/template-test');
diff --git a/core/modules/system/lib/Drupal/system/Tests/Theme/ThemeTestPhpTemplate.php b/core/modules/system/lib/Drupal/system/Tests/Theme/ThemeTestPhpTemplate.php
index 54f1b0f..35680fa 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Theme/ThemeTestPhpTemplate.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Theme/ThemeTestPhpTemplate.php
@@ -38,7 +38,7 @@ class ThemeTestPhpTemplate extends WebTestBase {
* Ensures a theme's template is overrideable based on the 'template' filename.
*/
function testTemplateOverride() {
- config('system.theme')
+ \Drupal::config('system.theme')
->set('default', 'test_theme_phptemplate')
->save();
$this->drupalGet('theme-test/template-test');
diff --git a/core/modules/system/lib/Drupal/system/Tests/Theme/ThemeTestTwig.php b/core/modules/system/lib/Drupal/system/Tests/Theme/ThemeTestTwig.php
index 7860511..2dce51f 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Theme/ThemeTestTwig.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Theme/ThemeTestTwig.php
@@ -38,7 +38,7 @@ class ThemeTestTwig extends WebTestBase {
* Tests that the Twig engine handles PHP data correctly.
*/
function testTwigVariableDataTypes() {
- config('system.theme')
+ \Drupal::config('system.theme')
->set('default', 'test_theme')
->save();
$this->drupalGet('twig-theme-test/php-variables');
diff --git a/core/modules/system/lib/Drupal/system/Tests/Theme/TwigDebugMarkupTest.php b/core/modules/system/lib/Drupal/system/Tests/Theme/TwigDebugMarkupTest.php
index 34675f7..53d6a0b 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Theme/TwigDebugMarkupTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Theme/TwigDebugMarkupTest.php
@@ -35,7 +35,7 @@ class TwigDebugMarkupTest extends WebTestBase {
function testTwigDebugMarkup() {
$extension = twig_extension();
theme_enable(array('test_theme'));
- config('system.theme')->set('default', 'test_theme')->save();
+ \Drupal::config('system.theme')->set('default', 'test_theme')->save();
// Enable debug, rebuild the service container, and clear all caches.
$this->settingsSet('twig_debug', TRUE);
$this->rebuildContainer();
diff --git a/core/modules/system/lib/Drupal/system/Tests/Theme/TwigExtensionTest.php b/core/modules/system/lib/Drupal/system/Tests/Theme/TwigExtensionTest.php
index 8526cb2..8fdc293 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Theme/TwigExtensionTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Theme/TwigExtensionTest.php
@@ -47,7 +47,7 @@ class TwigExtensionTest extends WebTestBase {
* Tests that the Twig extension's filter produces expected output.
*/
function testTwigExtensionFilter() {
- config('system.theme')
+ \Drupal::config('system.theme')
->set('default', 'test_theme')
->save();
@@ -59,7 +59,7 @@ class TwigExtensionTest extends WebTestBase {
* Tests that the Twig extension's function produces expected output.
*/
function testTwigExtensionFunction() {
- config('system.theme')
+ \Drupal::config('system.theme')
->set('default', 'test_theme')
->save();
diff --git a/core/modules/system/lib/Drupal/system/Tests/Theme/TwigSettingsTest.php b/core/modules/system/lib/Drupal/system/Tests/Theme/TwigSettingsTest.php
index a764dc9..e7bc98c 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Theme/TwigSettingsTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Theme/TwigSettingsTest.php
@@ -78,7 +78,7 @@ class TwigSettingsTest extends WebTestBase {
function testTwigCacheOverride() {
$extension = twig_extension();
theme_enable(array('test_theme'));
- config('system.theme')
+ \Drupal::config('system.theme')
->set('default', 'test_theme')
->save();
diff --git a/core/modules/system/lib/Drupal/system/Tests/Update/UpdateScriptTest.php b/core/modules/system/lib/Drupal/system/Tests/Update/UpdateScriptTest.php
index e7fa8e0..65981f1 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Update/UpdateScriptTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Update/UpdateScriptTest.php
@@ -74,7 +74,7 @@ class UpdateScriptTest extends WebTestBase {
* Tests that requirements warnings and errors are correctly displayed.
*/
function testRequirements() {
- $update_script_test_config = config('update_script_test.settings');
+ $update_script_test_config = \Drupal::config('update_script_test.settings');
$this->drupalLogin($this->update_user);
// If there are no requirements warnings or errors, we expect to be able to
@@ -130,10 +130,10 @@ class UpdateScriptTest extends WebTestBase {
// Since visiting update.php triggers a rebuild of the theme system from an
// unusual maintenance mode environment, we check that this rebuild did not
// put any incorrect information about the themes into the database.
- $original_theme_data = config('system.theme')->get('enabled');
+ $original_theme_data = \Drupal::config('system.theme')->get('enabled');
$this->drupalLogin($this->update_user);
$this->drupalGet($this->update_url, array('external' => TRUE));
- $final_theme_data = config('system.theme')->get('enabled');
+ $final_theme_data = \Drupal::config('system.theme')->get('enabled');
$this->assertEqual($original_theme_data, $final_theme_data, 'Visiting update.php does not alter the information about themes stored in the database.');
}
diff --git a/core/modules/system/lib/Drupal/system/Tests/Upgrade/BareMinimalUpgradePathTest.php b/core/modules/system/lib/Drupal/system/Tests/Upgrade/BareMinimalUpgradePathTest.php
index 2abff85..914b72d 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Upgrade/BareMinimalUpgradePathTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Upgrade/BareMinimalUpgradePathTest.php
@@ -84,10 +84,10 @@ class BareMinimalUpgradePathTest extends UpgradePathTestBase {
$this->assertEqual(array_diff_key($required, $enabled), array());
// Verify that image.module was correctly installed.
- $this->assertEqual('thumbnail', config('image.style.thumbnail')->get('name'));
+ $this->assertEqual('thumbnail', \Drupal::config('image.style.thumbnail')->get('name'));
// Make sure that the default mail configuration has been converted.
- $this->assertEqual(array('default' => 'Drupal\Core\Mail\PhpMail'), config('system.mail')->get('interface'), 'Default mail configuration set.');
+ $this->assertEqual(array('default' => 'Drupal\Core\Mail\PhpMail'), \Drupal::config('system.mail')->get('interface'), 'Default mail configuration set.');
}
/**
diff --git a/core/modules/system/lib/Drupal/system/Tests/Upgrade/BlockUpgradePathTest.php b/core/modules/system/lib/Drupal/system/Tests/Upgrade/BlockUpgradePathTest.php
index 45f2efb..bde6f60 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Upgrade/BlockUpgradePathTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Upgrade/BlockUpgradePathTest.php
@@ -46,7 +46,7 @@ class BlockUpgradePathTest extends UpgradePathTestBase {
'machine_name' => strtolower($this->randomName(8)),
'region' => 'sidebar_first',
);
- $this->drupalPost('admin/structure/block/add/system_powered_by_block/' . config('system.theme')->get('default'), $settings, t('Save block'));
+ $this->drupalPost('admin/structure/block/add/system_powered_by_block/' . \Drupal::config('system.theme')->get('default'), $settings, t('Save block'));
$this->assertText($settings['settings[label]'], 'Block with title longer than 64 characters successfully created.');
// Try to add a block with a title over 255 characters.
@@ -55,7 +55,7 @@ class BlockUpgradePathTest extends UpgradePathTestBase {
'machine_name' => strtolower($this->randomName(8)),
'region' => 'sidebar_first',
);
- $this->drupalPost('admin/structure/block/add/system_powered_by_block/' . config('system.theme')->get('default'), $settings, t('Save block'));
+ $this->drupalPost('admin/structure/block/add/system_powered_by_block/' . \Drupal::config('system.theme')->get('default'), $settings, t('Save block'));
// Confirm that the custom block cannot be created with title longer than
// the maximum number of characters.
diff --git a/core/modules/system/lib/Drupal/system/Tests/Upgrade/DateUpgradePathTest.php b/core/modules/system/lib/Drupal/system/Tests/Upgrade/DateUpgradePathTest.php
index 990cbd5..5e1dd58 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Upgrade/DateUpgradePathTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Upgrade/DateUpgradePathTest.php
@@ -92,7 +92,7 @@ class DateUpgradePathTest extends UpgradePathTestBase {
);
foreach ($expected_de_formats as $locale_format) {
- $format = config('locale.config.de.system.date_format.' . $locale_format['type'])->get('pattern.php');
+ $format = \Drupal::config('locale.config.de.system.date_format.' . $locale_format['type'])->get('pattern.php');
$this->assertEqual($locale_format['format'], $format);
}
}
diff --git a/core/modules/system/lib/Drupal/system/Tests/Upgrade/FieldUpgradePathTest.php b/core/modules/system/lib/Drupal/system/Tests/Upgrade/FieldUpgradePathTest.php
index dd13cf9..66a95c0 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Upgrade/FieldUpgradePathTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Upgrade/FieldUpgradePathTest.php
@@ -37,8 +37,8 @@ class FieldUpgradePathTest extends UpgradePathTestBase {
// Check that the configuration entries were created.
$displays = array(
- 'default' => config('entity.display.node.article.default')->get(),
- 'teaser' => config('entity.display.node.article.teaser')->get(),
+ 'default' => \Drupal::config('entity.display.node.article.default')->get(),
+ 'teaser' => \Drupal::config('entity.display.node.article.teaser')->get(),
);
$this->assertTrue(!empty($displays['default']));
$this->assertTrue(!empty($displays['teaser']));
@@ -88,7 +88,7 @@ class FieldUpgradePathTest extends UpgradePathTestBase {
$this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.');
// Check that the configuration entries were created.
- $form_display = config('entity.form_display.node.article.default')->get();
+ $form_display = \Drupal::config('entity.form_display.node.article.default')->get();
$this->assertTrue(!empty($form_display));
// Check that the 'body' field is configured as expected.
@@ -152,7 +152,7 @@ class FieldUpgradePathTest extends UpgradePathTestBase {
// Check that the configuration for the instance on article and page nodes
// is correct.
foreach (array('article', 'page') as $node_type) {
- $config = config("field.instance.node.$node_type.body")->get();
+ $config = \Drupal::config("field.instance.node.$node_type.body")->get();
// We cannot predict the value of the UUID, we just check it's present.
$this->assertFalse(empty($config['uuid']));
unset($config['uuid']);
diff --git a/core/modules/system/lib/Drupal/system/Tests/Upgrade/ImageUpgradePathTest.php b/core/modules/system/lib/Drupal/system/Tests/Upgrade/ImageUpgradePathTest.php
index cc5979a..dbc072e 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Upgrade/ImageUpgradePathTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Upgrade/ImageUpgradePathTest.php
@@ -68,7 +68,7 @@ class ImageUpgradePathTest extends UpgradePathTestBase {
),
);
foreach ($expected_styles as $name => $style) {
- $config = config('image.style.' . $name);
+ $config = \Drupal::config('image.style.' . $name);
// Replace placeholder with image effect name keys with UUID's generated
// during by the image style upgrade functions.
foreach ($config->get('effects') as $uuid => $effect) {
diff --git a/core/modules/system/lib/Drupal/system/Tests/Upgrade/MailUpgradePathTest.php b/core/modules/system/lib/Drupal/system/Tests/Upgrade/MailUpgradePathTest.php
index a77c6b7..417f41e 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Upgrade/MailUpgradePathTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Upgrade/MailUpgradePathTest.php
@@ -35,7 +35,7 @@ class MailUpgradePathTest extends UpgradePathTestBase {
$this->performUpgrade(TRUE);
// Get the new mailer definitions.
- $mail_system = config('system.mail')->get('interface');
+ $mail_system = \Drupal::config('system.mail')->get('interface');
// Check that the default mailer has been changed to a PSR-0 definition.
$this->assertEqual($mail_system['default'], 'Drupal\Core\Mail\PhpMail', 'Default mailer upgraded to Drupal 8 syntax.');
diff --git a/core/modules/system/lib/Drupal/system/Tests/Upgrade/SystemUpgradePathTest.php b/core/modules/system/lib/Drupal/system/Tests/Upgrade/SystemUpgradePathTest.php
index 67ec268..a53b70f 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Upgrade/SystemUpgradePathTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Upgrade/SystemUpgradePathTest.php
@@ -170,7 +170,7 @@ class SystemUpgradePathTest extends UpgradePathTestBase {
);
foreach ($expected_config as $file => $values) {
- $config = config($file);
+ $config = \Drupal::config($file);
$this->verbose(print_r($config->get(), TRUE));
foreach ($values as $name => $value) {
$stored = $config->get($name);
diff --git a/core/modules/system/system.admin.inc b/core/modules/system/system.admin.inc
index 05c67a7..050cdd7 100644
--- a/core/modules/system/system.admin.inc
+++ b/core/modules/system/system.admin.inc
@@ -94,9 +94,9 @@ function system_themes_page() {
$themes = system_rebuild_theme_data();
uasort($themes, 'system_sort_modules_by_info_name');
- $theme_default = config('system.theme')->get('default');
+ $theme_default = Drupal::config('system.theme')->get('default');
$theme_groups = array();
- $admin_theme = config('system.theme')->get('admin');
+ $admin_theme = Drupal::config('system.theme')->get('admin');
foreach ($themes as &$theme) {
if (!empty($theme->info['hidden'])) {
@@ -233,7 +233,7 @@ function system_themes_admin_form($form, &$form_state, $theme_options) {
'#options' => array(0 => t('Default theme')) + $theme_options,
'#title' => t('Administration theme'),
'#description' => t('Choose "Default theme" to always use the same theme as the rest of the site.'),
- '#default_value' => config('system.theme')->get('admin'),
+ '#default_value' => Drupal::config('system.theme')->get('admin'),
);
$form['admin_theme']['actions'] = array('#type' => 'actions');
$form['admin_theme']['actions']['submit'] = array(
@@ -248,7 +248,7 @@ function system_themes_admin_form($form, &$form_state, $theme_options) {
*/
function system_themes_admin_form_submit($form, &$form_state) {
drupal_set_message(t('The configuration options have been saved.'));
- config('system.theme')->set('admin', $form_state['values']['admin_theme'])->save();
+ Drupal::config('system.theme')->set('admin', $form_state['values']['admin_theme'])->save();
}
/**
@@ -269,7 +269,7 @@ function system_theme_default() {
theme_enable(array($theme));
}
// Set the default theme.
- config('system.theme')
+ Drupal::config('system.theme')
->set('default', $theme)
->save();
@@ -283,7 +283,7 @@ function system_theme_default() {
// The status message depends on whether an admin theme is currently in use:
// a value of 0 means the admin theme is set to be the default theme.
- $admin_theme = config('system.theme')->get('admin');
+ $admin_theme = Drupal::config('system.theme')->get('admin');
if ($admin_theme != 0 && $admin_theme != $theme) {
drupal_set_message(t('Please note that the administration theme is still set to the %admin_theme theme; consequently, the theme on this page remains unchanged. All non-administrative sections of the site, however, will show the selected %selected_theme theme by default.', array(
'%admin_theme' => $themes[$admin_theme]->info['name'],
@@ -981,7 +981,7 @@ function theme_system_date_format_localize_form($variables) {
*/
function system_date_format_localize_form_save($langcode, $date_format_id, DateFormatInterface $format) {
$format->addLocale($langcode)->save();
- config('locale.config.' . $langcode . '.system.date_format.' . $date_format_id)
+ Drupal::config('locale.config.' . $langcode . '.system.date_format.' . $date_format_id)
->set('pattern', $format->get('pattern'))
->save();
}
diff --git a/core/modules/system/system.api.php b/core/modules/system/system.api.php
index ca80944..bbc3c72 100644
--- a/core/modules/system/system.api.php
+++ b/core/modules/system/system.api.php
@@ -1357,7 +1357,7 @@ function hook_mail_alter(&$message) {
$message['send'] = FALSE;
return;
}
- $message['body'][] = "--\nMail sent out from " . config('system.site')->get('name');
+ $message['body'][] = "--\nMail sent out from " . Drupal::config('system.site')->get('name');
}
}
@@ -1775,7 +1775,7 @@ function hook_watchdog(array $log_entry) {
$to = 'someone@example.com';
$params = array();
$params['subject'] = t('[@site_name] @severity_desc: Alert from your web site', array(
- '@site_name' => config('system.site')->get('name'),
+ '@site_name' => Drupal::config('system.site')->get('name'),
'@severity_desc' => $severity_list[$log_entry['severity']],
));
@@ -1841,7 +1841,7 @@ function hook_mail($key, &$message, $params) {
$account = $params['account'];
$context = $params['context'];
$variables = array(
- '%site_name' => config('system.site')->get('name'),
+ '%site_name' => Drupal::config('system.site')->get('name'),
'%username' => user_format_name($account),
);
if ($context['hook'] == 'taxonomy') {
@@ -3153,7 +3153,7 @@ function hook_tokens($type, $tokens, array $data = array(), array $options = arr
// Default values for the chained tokens handled below.
case 'author':
- $name = ($node->uid == 0) ? config('user.settings')->get('anonymous') : $node->name;
+ $name = ($node->uid == 0) ? Drupal::config('user.settings')->get('anonymous') : $node->name;
$replacements[$original] = $sanitize ? filter_xss($name) : $name;
break;
diff --git a/core/modules/system/system.install b/core/modules/system/system.install
index ef16eaa..3f0fac0 100644
--- a/core/modules/system/system.install
+++ b/core/modules/system/system.install
@@ -259,7 +259,7 @@ function system_requirements($phase) {
// Report cron status.
if ($phase == 'runtime') {
- $cron_config = config('system.cron');
+ $cron_config = Drupal::config('system.cron');
// Cron warning threshold defaults to two days.
$threshold_warning = $cron_config->get('threshold.requirements_warning');
// Cron error threshold defaults to two weeks.
@@ -300,7 +300,7 @@ function system_requirements($phase) {
);
}
if ($phase != 'install') {
- $filesystem_config = config('system.file');
+ $filesystem_config = Drupal::config('system.file');
$directories = array(
variable_get('file_public_path', conf_path() . '/files'),
// By default no private files directory is configured. For private files
@@ -522,7 +522,7 @@ function system_install() {
// Enable and set the default theme. Can't use theme_enable() this early in
// installation.
config_install_default_config('theme', 'stark');
- config('system.theme')
+ Drupal::config('system.theme')
->set('default', 'stark')
->save();
@@ -1426,7 +1426,7 @@ function system_update_8013() {
function system_update_8014() {
// Not using update_variables_to_config(), since the only value is
// 'error_level', which needs to be mapped to a new value.
- $config = config('system.logging');
+ $config = Drupal::config('system.logging');
$error_level = db_query("SELECT value FROM {variable} WHERE name = 'error_level'")->fetchField();
if ($error_level !== FALSE) {
$error_level = unserialize($error_level);
@@ -1881,7 +1881,7 @@ function system_update_8045() {
if (!empty($date_formats)) {
foreach ($date_formats as $type => $format) {
// Set name and locked properties.
- $config = config("system.date_format.$type")
+ $config = Drupal::config("system.date_format.$type")
->set('id', $type)
->set('label', $format['title'])
->set('locked', $format['locked'])
@@ -1926,7 +1926,7 @@ function system_update_8046() {
update_install_default_config('module', 'views.view.user_admin_people', 'user');
update_install_default_config('module', 'views.view.content', 'node');
- $front_page = config('system.site')->get('page.front') ?: 'node';
+ $front_page = Drupal::config('system.site')->get('page.front') ?: 'node';
if ($front_page == 'node') {
// This imports the node frontpage view.
update_install_default_config('module', 'views.view.frontpage', 'node');
@@ -2173,7 +2173,7 @@ function system_update_8056() {
foreach ($entity_view_modes as $entity_type => $view_modes) {
foreach ($view_modes as $key => $name) {
$status = in_array($key, array('teaser', 'compact'));
- config("entity.view_mode.$entity_type.$key")
+ Drupal::config("entity.view_mode.$entity_type.$key")
->set('id', "$entity_type.$key")
->set('label', $name)
->set('targetEntityType', $entity_type)
@@ -2197,7 +2197,7 @@ function system_update_8057() {
$action['aid'] = $action['callback'] . '_' . $action['aid'];
}
$configuration = unserialize($action['parameters']) ?: array();
- config('action.action.' . $action['aid'])
+ Drupal::config('action.action.' . $action['aid'])
->set('id', $action['aid'])
->set('label', $action['label'])
->set('status', '1')
diff --git a/core/modules/system/system.module b/core/modules/system/system.module
index 536e6d2..5297fe0 100644
--- a/core/modules/system/system.module
+++ b/core/modules/system/system.module
@@ -224,7 +224,7 @@ function system_permission() {
),
'view the administration theme' => array(
'title' => t('View the administration theme'),
- 'description' => config('system.theme')->get('admin') ?: t('This is only used when the site is configured to use a separate administration theme on the <a href="@appearance-url">Appearance</a> page.', array('@appearance-url' => url('admin/appearance'))),
+ 'description' => Drupal::config('system.theme')->get('admin') ?: t('This is only used when the site is configured to use a separate administration theme on the <a href="@appearance-url">Appearance</a> page.', array('@appearance-url' => url('admin/appearance'))),
),
'access site reports' => array(
'title' => t('View site reports'),
@@ -2011,7 +2011,7 @@ function system_stream_wrappers() {
);
// Only register the private file stream wrapper if a file path has been set.
- if (config('system.file')->get('path.private')) {
+ if (Drupal::config('system.file')->get('path.private')) {
$wrappers['private'] = array(
'name' => t('Private files'),
'class' => 'Drupal\Core\StreamWrapper\PrivateStream',
@@ -2246,7 +2246,7 @@ function system_custom_theme() {
$request = drupal_container()->get('request');
$path = $request->attributes->get('_system_path');
if (user_access('view the administration theme') && path_is_admin($path)) {
- return config('system.theme')->get('admin');
+ return Drupal::config('system.theme')->get('admin');
}
}
}
@@ -2255,7 +2255,7 @@ function system_custom_theme() {
* Implements hook_form_FORM_ID_alter().
*/
function system_form_user_form_alter(&$form, &$form_state) {
- if (config('system.date')->get('timezone.user.configurable')) {
+ if (Drupal::config('system.date')->get('timezone.user.configurable')) {
system_user_timezone($form, $form_state);
}
}
@@ -2264,7 +2264,7 @@ function system_form_user_form_alter(&$form, &$form_state) {
* Implements hook_form_FORM_ID_alter().
*/
function system_form_user_register_form_alter(&$form, &$form_state) {
- $config = config('system.date');
+ $config = Drupal::config('system.date');
if ($config->get('timezone.user.configurable') && $config->get('timezone.user.default') == DRUPAL_USER_TIMEZONE_SELECT) {
system_user_timezone($form, $form_state);
}
@@ -2274,7 +2274,7 @@ function system_form_user_register_form_alter(&$form, &$form_state) {
* Implements hook_user_presave().
*/
function system_user_presave(UserInterface $account) {
- $config = config('system.date');
+ $config = Drupal::config('system.date');
if ($config->get('timezone.user.configurable') && !$account->getTimeZone() && !$config->get('timezone.user.default')) {
$account->timezone = $config->get('timezone.default');
}
@@ -2284,7 +2284,7 @@ function system_user_presave(UserInterface $account) {
* Implements hook_user_login().
*/
function system_user_login($account) {
- $config = config('system.date');
+ $config = Drupal::config('system.date');
// If the user has a NULL time zone, notify them to set a time zone.
if (!$account->getTimezone() && $config->get('timezone.user.configurable') && $config->get('timezone.user.warn')) {
drupal_set_message(t('Configure your <a href="@user-edit">account time zone setting</a>.', array('@user-edit' => url("user/$account->id()/edit", array('query' => drupal_get_destination(), 'fragment' => 'edit-timezone')))));
@@ -2306,7 +2306,7 @@ function system_user_timezone(&$form, &$form_state) {
$form['timezone']['timezone'] = array(
'#type' => 'select',
'#title' => t('Time zone'),
- '#default_value' => $account->getTimezone() ? $account->getTimezone() : config('system.date')->get('timezone.default'),
+ '#default_value' => $account->getTimezone() ? $account->getTimezone() : Drupal::config('system.date')->get('timezone.default'),
'#options' => system_time_zones($account->id() != $user->id()),
'#description' => t('Select the desired local time and time zone. Dates and times throughout this site will be displayed using this time zone.'),
);
@@ -2596,8 +2596,8 @@ function system_rebuild_module_data() {
$files = array();
ksort($modules);
// Add name, status, weight, and schema version.
- $enabled_modules = (array) config('system.module')->get('enabled');
- $disabled_modules = (array) config('system.module.disabled')->get();
+ $enabled_modules = (array) Drupal::config('system.module')->get('enabled');
+ $disabled_modules = (array) Drupal::config('system.module.disabled')->get();
$all_modules = $enabled_modules + $disabled_modules;
foreach ($modules as $module => $record) {
$record->name = $module;
@@ -2750,7 +2750,7 @@ function system_rebuild_theme_data() {
// based on the current config. Remove this code when themes have a proper
// installation status.
// @see http://drupal.org/node/1067408
- $enabled_themes = (array) config('system.theme')->get('enabled');
+ $enabled_themes = (array) Drupal::config('system.theme')->get('enabled');
$files = array();
foreach ($themes as $name => $theme) {
$theme->status = (int) isset($enabled_themes[$name]);
@@ -2977,7 +2977,7 @@ function confirm_form($form, $question, $path, $description = NULL, $yes = NULL,
function system_admin_compact_mode() {
// PHP converts dots into underscores in cookie names to avoid problems with
// its parser, so we use a converted cookie name.
- return isset($_COOKIE['Drupal_visitor_admin_compact_mode']) ? $_COOKIE['Drupal_visitor_admin_compact_mode'] : config('system.site')->get('admin_compact_mode');
+ return isset($_COOKIE['Drupal_visitor_admin_compact_mode']) ? $_COOKIE['Drupal_visitor_admin_compact_mode'] : Drupal::config('system.site')->get('admin_compact_mode');
}
/**
@@ -3250,7 +3250,7 @@ function system_run_automated_cron() {
// If the site is not fully installed, suppress the automated cron run.
// Otherwise it could be triggered prematurely by Ajax requests during
// installation.
- if (($threshold = config('system.cron')->get('threshold.autorun')) > 0 && variable_get('install_task') == 'done') {
+ if (($threshold = Drupal::config('system.cron')->get('threshold.autorun')) > 0 && variable_get('install_task') == 'done') {
$cron_last = Drupal::state()->get('system.cron_last') ?: NULL;
if (!isset($cron_last) || (REQUEST_TIME - $cron_last > $threshold)) {
drupal_cron_run();
diff --git a/core/modules/system/system.tokens.inc b/core/modules/system/system.tokens.inc
index 9a8a459..2dca362 100644
--- a/core/modules/system/system.tokens.inc
+++ b/core/modules/system/system.tokens.inc
@@ -103,17 +103,17 @@ function system_tokens($type, $tokens, array $data = array(), array $options = a
foreach ($tokens as $name => $original) {
switch ($name) {
case 'name':
- $site_name = config('system.site')->get('name');
+ $site_name = Drupal::config('system.site')->get('name');
$replacements[$original] = $sanitize ? check_plain($site_name) : $site_name;
break;
case 'slogan':
- $slogan = config('system.site')->get('slogan');
+ $slogan = Drupal::config('system.site')->get('slogan');
$replacements[$original] = $sanitize ? filter_xss_admin($slogan) : $slogan;
break;
case 'mail':
- $replacements[$original] = config('system.site')->get('mail');
+ $replacements[$original] = Drupal::config('system.site')->get('mail');
break;
case 'url':
diff --git a/core/modules/system/tests/modules/design_test/design_test.module b/core/modules/system/tests/modules/design_test/design_test.module
index f69f961..334ea31 100644
--- a/core/modules/system/tests/modules/design_test/design_test.module
+++ b/core/modules/system/tests/modules/design_test/design_test.module
@@ -96,7 +96,7 @@ function design_test_menu_local_tasks_alter(&$data, $router_item, $root_path) {
$actions = &$data['actions']['output'];
// Determine the currently selected theme, if any.
$selected_theme = drupal_container()->get('request')->query->get('theme');
- $default_theme = config('system.theme')->get('default');
+ $default_theme = Drupal::config('system.theme')->get('default');
// Expand all enabled themes into action links.
$themes = list_themes();
diff --git a/core/modules/system/tests/modules/form_test/lib/Drupal/form_test/FormTestArgumentsObject.php b/core/modules/system/tests/modules/form_test/lib/Drupal/form_test/FormTestArgumentsObject.php
index ee13968..111b164 100644
--- a/core/modules/system/tests/modules/form_test/lib/Drupal/form_test/FormTestArgumentsObject.php
+++ b/core/modules/system/tests/modules/form_test/lib/Drupal/form_test/FormTestArgumentsObject.php
@@ -53,7 +53,7 @@ class FormTestArgumentsObject implements FormInterface {
*/
public function submitForm(array &$form, array &$form_state) {
drupal_set_message(t('The FormTestArgumentsObject::submitForm() method was used for this form.'));
- config('form_test.object')
+ \Drupal::config('form_test.object')
->set('bananas', $form_state['values']['bananas'])
->save();
}
diff --git a/core/modules/system/tests/modules/form_test/lib/Drupal/form_test/FormTestControllerObject.php b/core/modules/system/tests/modules/form_test/lib/Drupal/form_test/FormTestControllerObject.php
index b342128..cfb5dfd 100644
--- a/core/modules/system/tests/modules/form_test/lib/Drupal/form_test/FormTestControllerObject.php
+++ b/core/modules/system/tests/modules/form_test/lib/Drupal/form_test/FormTestControllerObject.php
@@ -66,7 +66,7 @@ class FormTestControllerObject implements FormInterface, ControllerInterface {
*/
public function submitForm(array &$form, array &$form_state) {
drupal_set_message(t('The FormTestControllerObject::submitForm() method was used for this form.'));
- config('form_test.object')
+ \Drupal::config('form_test.object')
->set('bananas', $form_state['values']['bananas'])
->save();
}
diff --git a/core/modules/system/tests/modules/form_test/lib/Drupal/form_test/FormTestObject.php b/core/modules/system/tests/modules/form_test/lib/Drupal/form_test/FormTestObject.php
index 22b6d7a..8106fa1 100644
--- a/core/modules/system/tests/modules/form_test/lib/Drupal/form_test/FormTestObject.php
+++ b/core/modules/system/tests/modules/form_test/lib/Drupal/form_test/FormTestObject.php
@@ -52,7 +52,7 @@ class FormTestObject implements FormInterface {
*/
public function submitForm(array &$form, array &$form_state) {
drupal_set_message(t('The FormTestObject::submitForm() method was used for this form.'));
- config('form_test.object')
+ \Drupal::config('form_test.object')
->set('bananas', $form_state['values']['bananas'])
->save();
}
diff --git a/core/modules/system/tests/modules/form_test/lib/Drupal/form_test/FormTestServiceObject.php b/core/modules/system/tests/modules/form_test/lib/Drupal/form_test/FormTestServiceObject.php
index c7663ef..264f747 100644
--- a/core/modules/system/tests/modules/form_test/lib/Drupal/form_test/FormTestServiceObject.php
+++ b/core/modules/system/tests/modules/form_test/lib/Drupal/form_test/FormTestServiceObject.php
@@ -53,7 +53,7 @@ class FormTestServiceObject implements FormInterface {
*/
public function submitForm(array &$form, array &$form_state) {
drupal_set_message(t('The FormTestServiceObject::submitForm() method was used for this form.'));
- config('form_test.object')
+ \Drupal::config('form_test.object')
->set('bananas', $form_state['values']['bananas'])
->save();
}
diff --git a/core/modules/system/tests/modules/menu_test/menu_test.module b/core/modules/system/tests/modules/menu_test/menu_test.module
index 8f71bd3..fd9a900 100644
--- a/core/modules/system/tests/modules/menu_test/menu_test.module
+++ b/core/modules/system/tests/modules/menu_test/menu_test.module
@@ -461,7 +461,7 @@ function menu_test_local_action_dynamic_title($arg) {
* several local tasks to menu-test/tasks.
*/
function menu_test_menu_local_tasks(&$data, $router_item, $root_path) {
- if (!config('menu_test.settings')->get('tasks.add')) {
+ if (!Drupal::config('menu_test.settings')->get('tasks.add')) {
return;
}
if (strpos($router_item['tab_root'], 'menu-test/tasks/') === 0) {
@@ -491,7 +491,7 @@ function menu_test_menu_local_tasks(&$data, $router_item, $root_path) {
* several local tasks to menu-test/tasks.
*/
function menu_test_menu_local_tasks_alter(&$data, $router_item, $root_path) {
- if (!config('menu_test.settings')->get('tasks.alter')) {
+ if (!Drupal::config('menu_test.settings')->get('tasks.alter')) {
return;
}
if (strpos($router_item['tab_root'], 'menu-test/tasks/') === 0) {
@@ -634,7 +634,7 @@ function menu_test_theme_page_callback($inherited = FALSE) {
function menu_test_theme_callback($argument) {
// Test using the variable administrative theme.
if ($argument == 'use-admin-theme') {
- return config('system.theme')->get('admin');
+ return Drupal::config('system.theme')->get('admin');
}
// Test using a theme that exists, but may or may not be enabled.
elseif ($argument == 'use-stark-theme') {
diff --git a/core/modules/system/tests/modules/plugin_test/lib/Drupal/plugin_test/Plugin/plugin_test/mock_block/MockLayoutBlockDeriver.php b/core/modules/system/tests/modules/plugin_test/lib/Drupal/plugin_test/Plugin/plugin_test/mock_block/MockLayoutBlockDeriver.php
index 1bfe806..2348b75 100644
--- a/core/modules/system/tests/modules/plugin_test/lib/Drupal/plugin_test/Plugin/plugin_test/mock_block/MockLayoutBlockDeriver.php
+++ b/core/modules/system/tests/modules/plugin_test/lib/Drupal/plugin_test/Plugin/plugin_test/mock_block/MockLayoutBlockDeriver.php
@@ -44,7 +44,7 @@ class MockLayoutBlockDeriver implements DerivativeInterface {
// We also allow them to add a customized one. Here, we just mock the
// customized one, but in a real implementation, this would be fetched
- // from some config() object.
+ // from some \Drupal::config() object.
'foo' => array(
'label' => t('Layout Foo'),
) + $base_plugin_definition,
diff --git a/core/modules/system/tests/modules/system_mail_failure_test/lib/Drupal/system_mail_failure_test/TestPhpMailFailure.php b/core/modules/system/tests/modules/system_mail_failure_test/lib/Drupal/system_mail_failure_test/TestPhpMailFailure.php
index a719d7a..f20472a 100644
--- a/core/modules/system/tests/modules/system_mail_failure_test/lib/Drupal/system_mail_failure_test/TestPhpMailFailure.php
+++ b/core/modules/system/tests/modules/system_mail_failure_test/lib/Drupal/system_mail_failure_test/TestPhpMailFailure.php
@@ -16,7 +16,7 @@ use Drupal\Core\Mail\MailInterface;
* This class is for running tests or for development. To use set the
* configuration:
* @code
- * config('system.mail')->set('interface.default', 'Drupal\system_mail_failure_test\TestPhpMailFailure')->save();
+ * \Drupal::config('system.mail')->set('interface.default', 'Drupal\system_mail_failure_test\TestPhpMailFailure')->save();
* @endcode
*/
class TestPhpMailFailure extends PhpMail implements MailInterface {
diff --git a/core/modules/system/tests/modules/update_script_test/update_script_test.install b/core/modules/system/tests/modules/update_script_test/update_script_test.install
index 5666827..c5c9e59 100644
--- a/core/modules/system/tests/modules/update_script_test/update_script_test.install
+++ b/core/modules/system/tests/modules/update_script_test/update_script_test.install
@@ -13,7 +13,7 @@ function update_script_test_requirements($phase) {
if ($phase == 'update') {
// Set a requirements warning or error when the test requests it.
- $requirement_type = config('update_script_test.settings')->get('requirement_type');
+ $requirement_type = Drupal::config('update_script_test.settings')->get('requirement_type');
switch ($requirement_type) {
case REQUIREMENT_WARNING:
$requirements['update_script_test'] = array(
diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/TermFormController.php b/core/modules/taxonomy/lib/Drupal/taxonomy/TermFormController.php
index 5e8c870..0c92528 100644
--- a/core/modules/taxonomy/lib/Drupal/taxonomy/TermFormController.php
+++ b/core/modules/taxonomy/lib/Drupal/taxonomy/TermFormController.php
@@ -62,7 +62,7 @@ class TermFormController extends EntityFormControllerNG {
// numbers of items so we check for taxonomy.settings:override_selector
// before loading the full vocabulary. Contrib modules can then intercept
// before hook_form_alter to provide scalable alternatives.
- if (!config('taxonomy.settings')->get('override_selector')) {
+ if (!\Drupal::config('taxonomy.settings')->get('override_selector')) {
$parent = array_keys(taxonomy_term_load_parents($term->id()));
$children = taxonomy_get_tree($vocabulary->id(), $term->id());
diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/ThemeTest.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/ThemeTest.php
index 6e3acb9..452e33f 100644
--- a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/ThemeTest.php
+++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/ThemeTest.php
@@ -25,11 +25,11 @@ class ThemeTest extends TaxonomyTestBase {
// Make sure we are using distinct default and administrative themes for
// the duration of these tests.
- config('system.theme')
+ \Drupal::config('system.theme')
->set('default', 'bartik')
->save();
theme_enable(array('seven'));
- config('system.theme')->set('admin', 'seven')->save();
+ \Drupal::config('system.theme')->set('admin', 'seven')->save();
// Create and log in as a user who has permission to add and edit taxonomy
// terms and view the administrative theme.
diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/VocabularyTest.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/VocabularyTest.php
index 5381156..b5e0b77 100644
--- a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/VocabularyTest.php
+++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/VocabularyTest.php
@@ -71,7 +71,7 @@ class VocabularyTest extends TaxonomyTestBase {
$edit['vid'] = 'don_t_panic';
$this->drupalPost('admin/structure/taxonomy/add', $edit, t('Save'));
- $site_name = config('system.site')->get('name');
+ $site_name = \Drupal::config('system.site')->get('name');
$this->assertTitle(t('Don\'t Panic | @site-name', array('@site-name' => $site_name)));
$this->assertNoTitle(t('Don&#039;t Panic | @site-name', array('@site-name' => $site_name)));
}
diff --git a/core/modules/taxonomy/taxonomy.admin.inc b/core/modules/taxonomy/taxonomy.admin.inc
index c4f950b..b61424e 100644
--- a/core/modules/taxonomy/taxonomy.admin.inc
+++ b/core/modules/taxonomy/taxonomy.admin.inc
@@ -39,7 +39,7 @@ function taxonomy_overview_terms($form, &$form_state, Vocabulary $vocabulary) {
$parent_fields = FALSE;
$page = isset($_GET['page']) ? $_GET['page'] : 0;
- $page_increment = config('taxonomy.settings')->get('terms_per_page_admin');
+ $page_increment = Drupal::config('taxonomy.settings')->get('terms_per_page_admin');
$page_entries = 0;
$before_entries = 0;
$after_entries = 0;
diff --git a/core/modules/taxonomy/taxonomy.install b/core/modules/taxonomy/taxonomy.install
index 860cde3..f89db3a 100644
--- a/core/modules/taxonomy/taxonomy.install
+++ b/core/modules/taxonomy/taxonomy.install
@@ -312,7 +312,7 @@ function taxonomy_update_8005() {
$result = db_query('SELECT * FROM {taxonomy_vocabulary}');
foreach ($result as $vocabulary) {
- $config = config('taxonomy.vocabulary.' . $vocabulary->machine_name)
+ $config = Drupal::config('taxonomy.vocabulary.' . $vocabulary->machine_name)
->set('vid', $vocabulary->machine_name)
->set('name', $vocabulary->name)
->set('uuid', !empty($vocabulary->uuid) ? $vocabulary->uuid : $uuid->generate())
@@ -354,7 +354,7 @@ function taxonomy_update_8006() {
*/
function taxonomy_update_8007() {
foreach (config_get_storage_names_with_prefix('field.field.') as $config_name) {
- $field_config = config($config_name);
+ $field_config = Drupal::config($config_name);
// Only update taxonomy reference fields that use the default SQL storage.
if ($field_config->get('type') == 'taxonomy_term_reference' && $field_config->get('storage.type') == 'field_sql_storage') {
$field = new Field($field_config->get());
diff --git a/core/modules/taxonomy/taxonomy.module b/core/modules/taxonomy/taxonomy.module
index 2167270..090baaf 100644
--- a/core/modules/taxonomy/taxonomy.module
+++ b/core/modules/taxonomy/taxonomy.module
@@ -113,7 +113,7 @@ function taxonomy_permission() {
function taxonomy_entity_bundle_info() {
$bundles = array();
foreach (taxonomy_vocabulary_get_names() as $id) {
- $config = config('taxonomy.vocabulary.' . $id);
+ $config = Drupal::config('taxonomy.vocabulary.' . $id);
$bundles['taxonomy_term'][$id]['label'] = $config->get('name');
}
return $bundles;
@@ -181,7 +181,7 @@ function taxonomy_field_extra_fields() {
* An array of nids matching the query.
*/
function taxonomy_select_nodes($tid, $pager = TRUE, $limit = FALSE, $order = array('t.sticky' => 'DESC', 't.created' => 'DESC')) {
- if (!config('taxonomy.settings')->get('maintain_index_table')) {
+ if (!Drupal::config('taxonomy.settings')->get('maintain_index_table')) {
return array();
}
$query = db_select('taxonomy_index', 't');
@@ -1129,7 +1129,7 @@ function taxonomy_build_node_index($node) {
// We maintain a denormalized table of term/node relationships, containing
// only data for current, published nodes.
$status = NULL;
- if (config('taxonomy.settings')->get('maintain_index_table')) {
+ if (Drupal::config('taxonomy.settings')->get('maintain_index_table')) {
// If a node property is not set in the node object when $node->save() is
// called, the old value from $node->original is used.
if (!empty($node->original)) {
@@ -1209,7 +1209,7 @@ function taxonomy_node_predelete(EntityInterface $node) {
* The node entity.
*/
function taxonomy_delete_node_index(EntityInterface $node) {
- if (config('taxonomy.settings')->get('maintain_index_table')) {
+ if (Drupal::config('taxonomy.settings')->get('maintain_index_table')) {
db_delete('taxonomy_index')->condition('nid', $node->id())->execute();
}
}
@@ -1218,7 +1218,7 @@ function taxonomy_delete_node_index(EntityInterface $node) {
* Implements hook_taxonomy_term_delete().
*/
function taxonomy_taxonomy_term_delete(Term $term) {
- if (config('taxonomy.settings')->get('maintain_index_table')) {
+ if (Drupal::config('taxonomy.settings')->get('maintain_index_table')) {
// Clean up the {taxonomy_index} table when terms are deleted.
db_delete('taxonomy_index')->condition('tid', $term->id())->execute();
}
diff --git a/core/modules/taxonomy/taxonomy.pages.inc b/core/modules/taxonomy/taxonomy.pages.inc
index d70b8fd..4baf150 100644
--- a/core/modules/taxonomy/taxonomy.pages.inc
+++ b/core/modules/taxonomy/taxonomy.pages.inc
@@ -44,7 +44,7 @@ function taxonomy_term_page(Term $term) {
}
$build['taxonomy_terms'] = taxonomy_term_view_multiple(array($term->id() => $term));
- if ($nids = taxonomy_select_nodes($term->id(), TRUE, config('node.settings')->get('items_per_page'))) {
+ if ($nids = taxonomy_select_nodes($term->id(), TRUE, Drupal::config('node.settings')->get('items_per_page'))) {
$nodes = node_load_multiple($nids);
$build['nodes'] = node_view_multiple($nodes);
$build['pager'] = array(
@@ -70,11 +70,11 @@ function taxonomy_term_page(Term $term) {
*/
function taxonomy_term_feed(Term $term) {
$channel['link'] = url('taxonomy/term/' . $term->id(), array('absolute' => TRUE));
- $channel['title'] = config('system.site')->get('name') . ' - ' . $term->label();
+ $channel['title'] = Drupal::config('system.site')->get('name') . ' - ' . $term->label();
// Only display the description if we have a single term, to avoid clutter and confusion.
// HTML will be removed from feed description.
$channel['description'] = check_markup($term->description->value, $term->format->value, '', TRUE);
- $nids = taxonomy_select_nodes($term->id(), FALSE, config('system.rss')->get('items.limit'));
+ $nids = taxonomy_select_nodes($term->id(), FALSE, Drupal::config('system.rss')->get('items.limit'));
return node_feed($nids, $channel);
}
diff --git a/core/modules/text/text.module b/core/modules/text/text.module
index 3c239c0..0bb7427 100644
--- a/core/modules/text/text.module
+++ b/core/modules/text/text.module
@@ -102,7 +102,7 @@ function text_sanitize($text_processing, $langcode, $item, $column) {
function text_summary($text, $format = NULL, $size = NULL) {
if (!isset($size)) {
- $size = config('text.settings')->get('default_summary_length');
+ $size = Drupal::config('text.settings')->get('default_summary_length');
}
// Find where the delimiter is in the body
diff --git a/core/modules/tracker/tracker.module b/core/modules/tracker/tracker.module
index 26af484..1052b5f 100644
--- a/core/modules/tracker/tracker.module
+++ b/core/modules/tracker/tracker.module
@@ -82,7 +82,7 @@ function tracker_cron() {
$state = Drupal::state();
$max_nid = $state->get('tracker.index_nid') ?: 0;
if ($max_nid > 0) {
- $batch_size = config('tracker.settings')->get('cron_index_limit');
+ $batch_size = Drupal::config('tracker.settings')->get('cron_index_limit');
$last_nid = FALSE;
// @todo This should be actually filtering on the desired language and just
// fall back to the default language.
diff --git a/core/modules/translation/translation.module b/core/modules/translation/translation.module
index 17d148e..5846ca2 100644
--- a/core/modules/translation/translation.module
+++ b/core/modules/translation/translation.module
@@ -266,7 +266,7 @@ function translation_node_view(EntityInterface $node, EntityDisplay $display, $v
// only for configurable language types and interface language is the only
// configurable language type in core, we use it as default. Contributed
// modules can change this behavior by setting the system variable below.
- $type = config('translation.settings')->get('language_type');
+ $type = Drupal::config('translation.settings')->get('language_type');
$custom_links = language_negotiation_get_switch_links($type, 'node/' . $node->id());
$links = array();
@@ -545,7 +545,7 @@ function translation_path_get_translations($path) {
* Replaces links with pointers to translated versions of the content.
*/
function translation_language_switch_links_alter(array &$links, $type, $path) {
- $language_type = config('translation.settings')->get('language_type');
+ $language_type = Drupal::config('translation.settings')->get('language_type');
if ($type == $language_type && preg_match("!^node/(\d+)(/.+|)!", $path, $matches)) {
$node = node_load((int) $matches[1]);
diff --git a/core/modules/translation/translation.pages.inc b/core/modules/translation/translation.pages.inc
index 66da1e4..62d2ada 100644
--- a/core/modules/translation/translation.pages.inc
+++ b/core/modules/translation/translation.pages.inc
@@ -33,7 +33,7 @@ function translation_node_overview(EntityInterface $node) {
$translations = array($node->langcode => $node);
}
- $type = config('translation.settings')->get('language_type');
+ $type = Drupal::config('translation.settings')->get('language_type');
$header = array(t('Language'), t('Title'), t('Status'), t('Operations'));
foreach (language_list() as $langcode => $language) {
diff --git a/core/modules/update/lib/Drupal/update/Tests/UpdateContribTest.php b/core/modules/update/lib/Drupal/update/Tests/UpdateContribTest.php
index 757894f..a184092 100644
--- a/core/modules/update/lib/Drupal/update/Tests/UpdateContribTest.php
+++ b/core/modules/update/lib/Drupal/update/Tests/UpdateContribTest.php
@@ -49,7 +49,7 @@ class UpdateContribTest extends UpdateTestBase {
'hidden' => FALSE,
),
);
- config('update_test.settings')->set('system_info', $system_info)->save();
+ \Drupal::config('update_test.settings')->set('system_info', $system_info)->save();
$this->refreshUpdateStatus(array('drupal' => '0', 'aaa_update_test' => 'no-releases'));
$this->drupalGet('admin/reports/updates');
// Cannot use $this->standardTests() because we need to check for the
@@ -77,7 +77,7 @@ class UpdateContribTest extends UpdateTestBase {
'hidden' => FALSE,
),
);
- config('update_test.settings')->set('system_info', $system_info)->save();
+ \Drupal::config('update_test.settings')->set('system_info', $system_info)->save();
$this->refreshUpdateStatus(
array(
'drupal' => '0',
@@ -136,7 +136,7 @@ class UpdateContribTest extends UpdateTestBase {
'hidden' => FALSE,
),
);
- config('update_test.settings')->set('system_info', $system_info)->save();
+ \Drupal::config('update_test.settings')->set('system_info', $system_info)->save();
$this->refreshUpdateStatus(array('drupal' => '0', '#all' => '1_0'));
$this->standardTests();
// We're expecting the report to say all projects are up to date.
@@ -189,7 +189,7 @@ class UpdateContribTest extends UpdateTestBase {
'hidden' => FALSE,
),
);
- config('update_test.settings')->set('system_info', $system_info)->save();
+ \Drupal::config('update_test.settings')->set('system_info', $system_info)->save();
$xml_mapping = array(
'drupal' => '0',
'update_test_subtheme' => '1_0',
@@ -204,9 +204,9 @@ class UpdateContribTest extends UpdateTestBase {
* Tests that disabled themes are only shown when desired.
*/
function testUpdateShowDisabledThemes() {
- $update_settings = config('update.settings');
+ $update_settings = \Drupal::config('update.settings');
// Make sure all the update_test_* themes are disabled.
- $theme_config = config('system.theme');
+ $theme_config = \Drupal::config('system.theme');
foreach ($theme_config->get('enabled') as $theme => $weight) {
if (preg_match('/^update_test_/', $theme)) {
$theme_config->clear("enabled.$theme");
@@ -238,7 +238,7 @@ class UpdateContribTest extends UpdateTestBase {
// of update_max_fetch_attempts. Therefore this variable is set very high
// to avoid test failures in those cases.
$update_settings->set('fetch.max_attempts', 99999)->save();
- config('update_test.settings')->set('system_info', $system_info)->save();
+ \Drupal::config('update_test.settings')->set('system_info', $system_info)->save();
$xml_mapping = array(
'drupal' => '0',
'update_test_subtheme' => '1_0',
@@ -286,7 +286,7 @@ class UpdateContribTest extends UpdateTestBase {
'hidden' => FALSE,
),
);
- config('update_test.settings')->set('system_info', $system_info)->save();
+ \Drupal::config('update_test.settings')->set('system_info', $system_info)->save();
$projects = update_get_projects();
$theme_data = system_rebuild_theme_data();
$project_info = new ProjectInfo();
@@ -319,7 +319,7 @@ class UpdateContribTest extends UpdateTestBase {
'hidden' => FALSE,
),
);
- config('update_test.settings')->set('system_info', $system_info)->save();
+ \Drupal::config('update_test.settings')->set('system_info', $system_info)->save();
$xml_mapping = array(
'drupal' => '0',
@@ -360,7 +360,7 @@ class UpdateContribTest extends UpdateTestBase {
* update, then assert if we see the appropriate warnings on the right pages.
*/
function testHookUpdateStatusAlter() {
- $update_test_config = config('update_test.settings');
+ $update_test_config = \Drupal::config('update_test.settings');
$update_admin_user = $this->drupalCreateUser(array('administer site configuration', 'administer software updates'));
$this->drupalLogin($update_admin_user);
diff --git a/core/modules/update/lib/Drupal/update/Tests/UpdateCoreTest.php b/core/modules/update/lib/Drupal/update/Tests/UpdateCoreTest.php
index bfbd4a0..f0c55be 100644
--- a/core/modules/update/lib/Drupal/update/Tests/UpdateCoreTest.php
+++ b/core/modules/update/lib/Drupal/update/Tests/UpdateCoreTest.php
@@ -91,7 +91,7 @@ class UpdateCoreTest extends UpdateTestBase {
'datestamp' => '1000000000',
),
);
- config('update_test.settings')->set('system_info', $system_info)->save();
+ \Drupal::config('update_test.settings')->set('system_info', $system_info)->save();
$this->refreshUpdateStatus(array('drupal' => 'dev'));
$this->assertNoText(t('2001-Sep-'));
$this->assertText(t('Up to date'));
@@ -104,8 +104,8 @@ class UpdateCoreTest extends UpdateTestBase {
*/
function testModulePageRunCron() {
$this->setSystemInfo7_0();
- config('update.settings')->set('fetch.url', url('update-test', array('absolute' => TRUE)))->save();
- config('update_test.settings')->set('xml_map', array('drupal' => '0'))->save();
+ \Drupal::config('update.settings')->set('fetch.url', url('update-test', array('absolute' => TRUE)))->save();
+ \Drupal::config('update_test.settings')->set('xml_map', array('drupal' => '0'))->save();
$this->cronRun();
$this->drupalGet('admin/modules');
@@ -118,8 +118,8 @@ class UpdateCoreTest extends UpdateTestBase {
function testModulePageUpToDate() {
$this->setSystemInfo7_0();
// Instead of using refreshUpdateStatus(), set these manually.
- config('update.settings')->set('fetch.url', url('update-test', array('absolute' => TRUE)))->save();
- config('update_test.settings')->set('xml_map', array('drupal' => '0'))->save();
+ \Drupal::config('update.settings')->set('fetch.url', url('update-test', array('absolute' => TRUE)))->save();
+ \Drupal::config('update_test.settings')->set('xml_map', array('drupal' => '0'))->save();
$this->drupalGet('admin/reports/updates');
$this->clickLink(t('Check manually'));
@@ -135,8 +135,8 @@ class UpdateCoreTest extends UpdateTestBase {
function testModulePageRegularUpdate() {
$this->setSystemInfo7_0();
// Instead of using refreshUpdateStatus(), set these manually.
- config('update.settings')->set('fetch.url', url('update-test', array('absolute' => TRUE)))->save();
- config('update_test.settings')->set('xml_map', array('drupal' => '1'))->save();
+ \Drupal::config('update.settings')->set('fetch.url', url('update-test', array('absolute' => TRUE)))->save();
+ \Drupal::config('update_test.settings')->set('xml_map', array('drupal' => '1'))->save();
$this->drupalGet('admin/reports/updates');
$this->clickLink(t('Check manually'));
@@ -152,8 +152,8 @@ class UpdateCoreTest extends UpdateTestBase {
function testModulePageSecurityUpdate() {
$this->setSystemInfo7_0();
// Instead of using refreshUpdateStatus(), set these manually.
- config('update.settings')->set('fetch.url', url('update-test', array('absolute' => TRUE)))->save();
- config('update_test.settings')->set('xml_map', array('drupal' => '2-sec'))->save();
+ \Drupal::config('update.settings')->set('fetch.url', url('update-test', array('absolute' => TRUE)))->save();
+ \Drupal::config('update_test.settings')->set('xml_map', array('drupal' => '2-sec'))->save();
$this->drupalGet('admin/reports/updates');
$this->clickLink(t('Check manually'));
@@ -224,8 +224,8 @@ class UpdateCoreTest extends UpdateTestBase {
function testLanguageModuleUpdate() {
$this->setSystemInfo7_0();
// Instead of using refreshUpdateStatus(), set these manually.
- config('update.settings')->set('fetch.url', url('update-test', array('absolute' => TRUE)))->save();
- config('update_test.settings')->set('xml_map', array('drupal' => '1'))->save();
+ \Drupal::config('update.settings')->set('fetch.url', url('update-test', array('absolute' => TRUE)))->save();
+ \Drupal::config('update_test.settings')->set('xml_map', array('drupal' => '1'))->save();
$this->drupalGet('admin/reports/updates');
$this->assertText(t('Language'));
@@ -240,6 +240,6 @@ class UpdateCoreTest extends UpdateTestBase {
'version' => '7.0',
),
);
- config('update_test.settings')->set('system_info', $setting)->save();
+ \Drupal::config('update_test.settings')->set('system_info', $setting)->save();
}
}
diff --git a/core/modules/update/lib/Drupal/update/Tests/UpdateTestBase.php b/core/modules/update/lib/Drupal/update/Tests/UpdateTestBase.php
index 99d01d1..47a6649 100644
--- a/core/modules/update/lib/Drupal/update/Tests/UpdateTestBase.php
+++ b/core/modules/update/lib/Drupal/update/Tests/UpdateTestBase.php
@@ -43,9 +43,9 @@ abstract class UpdateTestBase extends WebTestBase {
protected function refreshUpdateStatus($xml_map, $url = 'update-test') {
// Tell the Update Manager module to fetch from the URL provided by
// update_test module.
- config('update.settings')->set('fetch.url', url($url, array('absolute' => TRUE)))->save();
+ \Drupal::config('update.settings')->set('fetch.url', url($url, array('absolute' => TRUE)))->save();
// Save the map for update_test_mock_page() to use.
- config('update_test.settings')->set('xml_map', $xml_map)->save();
+ \Drupal::config('update_test.settings')->set('xml_map', $xml_map)->save();
// Manually check the update status.
$this->drupalGet('admin/reports/updates/check');
}
diff --git a/core/modules/update/lib/Drupal/update/Tests/UpdateUploadTest.php b/core/modules/update/lib/Drupal/update/Tests/UpdateUploadTest.php
index d3bcdb8..73a7b9c 100644
--- a/core/modules/update/lib/Drupal/update/Tests/UpdateUploadTest.php
+++ b/core/modules/update/lib/Drupal/update/Tests/UpdateUploadTest.php
@@ -81,11 +81,11 @@ class UpdateUploadTest extends UpdateTestBase {
'version' => '7.0',
),
);
- config('update_test.settings')
+ \Drupal::config('update_test.settings')
->set('system_info', $setting)
->set('xml_map', array('drupal' => '2-sec'))
->save();
- config('update.settings')->set('fetch.url', url('update-test', array('absolute' => TRUE)))->save();
+ \Drupal::config('update.settings')->set('fetch.url', url('update-test', array('absolute' => TRUE)))->save();
// Initialize the update status.
$this->drupalGet('admin/reports/updates');
diff --git a/core/modules/update/tests/modules/update_test/update_test.module b/core/modules/update/tests/modules/update_test/update_test.module
index 31ee72d..a8c9e22 100644
--- a/core/modules/update/tests/modules/update_test/update_test.module
+++ b/core/modules/update/tests/modules/update_test/update_test.module
@@ -51,7 +51,7 @@ function update_test_menu() {
* just for that module or theme.
*/
function update_test_system_info_alter(&$info, $file) {
- $setting = config('update_test.settings')->get('system_info');
+ $setting = Drupal::config('update_test.settings')->get('system_info');
foreach (array('#all', $file->name) as $id) {
if (!empty($setting[$id])) {
foreach ($setting[$id] as $key => $value) {
@@ -73,7 +73,7 @@ function update_test_system_info_alter(&$info, $file) {
* module or theme.
*/
function update_test_update_status_alter(&$projects) {
- $setting = config('update_test.settings')->get('update_status');
+ $setting = Drupal::config('update_test.settings')->get('update_status');
if (!empty($setting)) {
foreach ($projects as $project_name => &$project) {
foreach (array('#all', $project_name) as $id) {
@@ -109,7 +109,7 @@ function update_test_update_status_alter(&$projects) {
* @see update_test_menu()
*/
function update_test_mock_page($project_name) {
- $xml_map = config('update_test.settings')->get('xml_map');
+ $xml_map = Drupal::config('update_test.settings')->get('xml_map');
if (isset($xml_map[$project_name])) {
$availability_scenario = $xml_map[$project_name];
}
diff --git a/core/modules/update/update.api.php b/core/modules/update/update.api.php
index 9e5f937..ce8234c 100644
--- a/core/modules/update/update.api.php
+++ b/core/modules/update/update.api.php
@@ -83,7 +83,7 @@ function hook_update_projects_alter(&$projects) {
* @see update_calculate_project_data()
*/
function hook_update_status_alter(&$projects) {
- $settings = config('update_advanced.settings')->get('projects');
+ $settings = Drupal::config('update_advanced.settings')->get('projects');
foreach ($projects as $project => $project_info) {
if (isset($settings[$project]) && isset($settings[$project]['check']) &&
($settings[$project]['check'] == 'never' ||
diff --git a/core/modules/update/update.authorize.inc b/core/modules/update/update.authorize.inc
index 57acc34..ee1e6fb 100644
--- a/core/modules/update/update.authorize.inc
+++ b/core/modules/update/update.authorize.inc
@@ -191,7 +191,7 @@ function update_authorize_update_batch_finished($success, $results) {
$success = FALSE;
}
}
- $offline = config('system.maintenance')->get('enabled');
+ $offline = Drupal::config('system.maintenance')->get('enabled');
if ($success) {
// Now that the update completed, we need to clear the available update data
// and recompute our status, so prevent show bogus results.
@@ -199,7 +199,7 @@ function update_authorize_update_batch_finished($success, $results) {
// Take the site out of maintenance mode if it was previously that way.
if ($offline && isset($_SESSION['maintenance_mode']) && $_SESSION['maintenance_mode'] == FALSE) {
- config('system.maintenance')->set('enabled', FALSE)->save();
+ Drupal::config('system.maintenance')->set('enabled', FALSE)->save();
$page_message = array(
'message' => t('Update was completed successfully. Your site has been taken out of maintenance mode.'),
'type' => 'status',
@@ -258,11 +258,11 @@ function update_authorize_install_batch_finished($success, $results) {
$success = FALSE;
}
}
- $offline = config('system.maintenance')->get('enabled');
+ $offline = Drupal::config('system.maintenance')->get('enabled');
if ($success) {
// Take the site out of maintenance mode if it was previously that way.
if ($offline && isset($_SESSION['maintenance_mode']) && $_SESSION['maintenance_mode'] == FALSE) {
- config('system.maintenance')->set('enabled', FALSE)->save();
+ Drupal::config('system.maintenance')->set('enabled', FALSE)->save();
$page_message = array(
'message' => t('Installation was completed successfully. Your site has been taken out of maintenance mode.'),
'type' => 'status',
diff --git a/core/modules/update/update.compare.inc b/core/modules/update/update.compare.inc
index 6741b41..3c0422d 100644
--- a/core/modules/update/update.compare.inc
+++ b/core/modules/update/update.compare.inc
@@ -66,7 +66,7 @@ function update_get_projects() {
$project_info = new ProjectInfo();
$project_info->processInfoList($projects, $module_data, 'module', TRUE);
$project_info->processInfoList($projects, $theme_data, 'theme', TRUE);
- if (config('update.settings')->get('check.disabled_extensions')) {
+ if (Drupal::config('update.settings')->get('check.disabled_extensions')) {
$project_info->processInfoList($projects, $module_data, 'module', FALSE);
$project_info->processInfoList($projects, $theme_data, 'theme', FALSE);
}
diff --git a/core/modules/update/update.fetch.inc b/core/modules/update/update.fetch.inc
index 3fce023..8ac927f 100644
--- a/core/modules/update/update.fetch.inc
+++ b/core/modules/update/update.fetch.inc
@@ -110,7 +110,7 @@ function update_fetch_data_finished($success, $results) {
*/
function _update_fetch_data() {
$queue = Drupal::queue('update_fetch_tasks');
- $end = time() + config('update.settings')->get('fetch.timeout');
+ $end = time() + Drupal::config('update.settings')->get('fetch.timeout');
while (time() < $end && ($item = $queue->claimItem())) {
_update_process_fetch_task($item->data);
$queue->deleteItem($item);
@@ -131,7 +131,7 @@ function _update_fetch_data() {
*/
function _update_process_fetch_task($project) {
global $base_url;
- $update_config = config('update.settings');
+ $update_config = Drupal::config('update.settings');
$fail = &drupal_static(__FUNCTION__, array());
// This can be in the middle of a long-running batch, so REQUEST_TIME won't
// necessarily be valid.
@@ -319,7 +319,7 @@ function _update_get_fetch_url_base($project) {
$url = $project['info']['project status url'];
}
else {
- $url = config('update.settings')->get('fetch.url');
+ $url = Drupal::config('update.settings')->get('fetch.url');
if (empty($url)) {
$url = UPDATE_DEFAULT_URL;
}
@@ -337,7 +337,7 @@ function _update_get_fetch_url_base($project) {
* @see update_requirements()
*/
function _update_cron_notify() {
- $update_config = config('update.settings');
+ $update_config = Drupal::config('update.settings');
module_load_install('update');
$status = update_requirements('runtime');
$params = array();
diff --git a/core/modules/update/update.manager.inc b/core/modules/update/update.manager.inc
index ed73e37..9e9d73a 100644
--- a/core/modules/update/update.manager.inc
+++ b/core/modules/update/update.manager.inc
@@ -430,9 +430,9 @@ function update_manager_update_ready_form($form, &$form_state) {
*/
function update_manager_update_ready_form_submit($form, &$form_state) {
// Store maintenance_mode setting so we can restore it when done.
- $_SESSION['maintenance_mode'] = config('system.maintenance')->get('enabled');
+ $_SESSION['maintenance_mode'] = Drupal::config('system.maintenance')->get('enabled');
if ($form_state['values']['maintenance_mode'] == TRUE) {
- config('system.maintenance')->set('enabled', TRUE)->save();
+ Drupal::config('system.maintenance')->set('enabled', TRUE)->save();
}
if (!empty($_SESSION['update_manager_update_projects'])) {
diff --git a/core/modules/update/update.module b/core/modules/update/update.module
index 111aa14..ac63694 100644
--- a/core/modules/update/update.module
+++ b/core/modules/update/update.module
@@ -281,7 +281,7 @@ function update_theme() {
* Implements hook_cron().
*/
function update_cron() {
- $update_config = config('update.settings');
+ $update_config = Drupal::config('update.settings');
$frequency = $update_config->get('check.interval_days');
$interval = 60 * 60 * 24 * $frequency;
$last_check = Drupal::state()->get('update.last_check') ?: 0;
@@ -489,7 +489,7 @@ function update_fetch_data() {
function update_mail($key, &$message, $params) {
$langcode = $message['langcode'];
$language = language_load($langcode);
- $message['subject'] .= t('New release(s) available for !site_name', array('!site_name' => config('system.site')->get('name')), array('langcode' => $langcode));
+ $message['subject'] .= t('New release(s) available for !site_name', array('!site_name' => Drupal::config('system.site')->get('name')), array('langcode' => $langcode));
foreach ($params as $msg_type => $msg_reason) {
$message['body'][] = _update_message_text($msg_type, $msg_reason, FALSE, $langcode);
}
@@ -498,7 +498,7 @@ function update_mail($key, &$message, $params) {
$message['body'][] = t('You can automatically install your missing updates using the Update manager:', array(), array('langcode' => $langcode)) . "\n" . url('admin/reports/updates/update', array('absolute' => TRUE, 'language' => $language));
}
$settings_url = url('admin/reports/updates/settings', array('absolute' => TRUE));
- if (config('update.settings')->get('notification.threshold') == 'all') {
+ if (Drupal::config('update.settings')->get('notification.threshold') == 'all') {
$message['body'][] = t('Your site is currently configured to send these emails when any updates are available. To get notified only for security updates, !url.', array('!url' => $settings_url));
}
else {
diff --git a/core/modules/update/update.report.inc b/core/modules/update/update.report.inc
index 50a9da6..1ce4f7c 100644
--- a/core/modules/update/update.report.inc
+++ b/core/modules/update/update.report.inc
@@ -32,7 +32,7 @@ function theme_update_report($variables) {
$header = array();
$rows = array();
- $notification_level = config('update.settings')->get('notification.threshold');
+ $notification_level = Drupal::config('update.settings')->get('notification.threshold');
// Create an array of status values keyed by module or theme name, since
// we'll need this while generating the report if we have to cross reference
diff --git a/core/modules/user/lib/Drupal/user/Access/RegisterAccessCheck.php b/core/modules/user/lib/Drupal/user/Access/RegisterAccessCheck.php
index a7e3933..1fb0688 100644
--- a/core/modules/user/lib/Drupal/user/Access/RegisterAccessCheck.php
+++ b/core/modules/user/lib/Drupal/user/Access/RegisterAccessCheck.php
@@ -27,6 +27,6 @@ class RegisterAccessCheck implements StaticAccessCheckInterface {
* Implements AccessCheckInterface::access().
*/
public function access(Route $route, Request $request) {
- return user_is_anonymous() && (config('user.settings')->get('register') != USER_REGISTER_ADMINISTRATORS_ONLY);
+ return user_is_anonymous() && (\Drupal::config('user.settings')->get('register') != USER_REGISTER_ADMINISTRATORS_ONLY);
}
}
diff --git a/core/modules/user/lib/Drupal/user/AccountFormController.php b/core/modules/user/lib/Drupal/user/AccountFormController.php
index 709951a..e0df82b 100644
--- a/core/modules/user/lib/Drupal/user/AccountFormController.php
+++ b/core/modules/user/lib/Drupal/user/AccountFormController.php
@@ -21,7 +21,7 @@ abstract class AccountFormController extends EntityFormControllerNG {
public function form(array $form, array &$form_state) {
$account = $this->entity;
global $user;
- $config = config('user.settings');
+ $config = \Drupal::config('user.settings');
$language_interface = language(Language::TYPE_INTERFACE);
$register = $account->isAnonymous();
diff --git a/core/modules/user/lib/Drupal/user/Plugin/Block/UserLoginBlock.php b/core/modules/user/lib/Drupal/user/Plugin/Block/UserLoginBlock.php
index ab4401c..00a9061 100644
--- a/core/modules/user/lib/Drupal/user/Plugin/Block/UserLoginBlock.php
+++ b/core/modules/user/lib/Drupal/user/Plugin/Block/UserLoginBlock.php
@@ -95,7 +95,7 @@ class UserLoginBlock extends BlockBase implements ContainerFactoryPluginInterfac
$form['#action'] = url(current_path(), array('query' => drupal_get_destination(), 'external' => FALSE));
// Build action links.
$items = array();
- if (config('user.settings')->get('register') != USER_REGISTER_ADMINISTRATORS_ONLY) {
+ if (\Drupal::config('user.settings')->get('register') != USER_REGISTER_ADMINISTRATORS_ONLY) {
$items['create_account'] = l(t('Create new account'), 'user/register', array(
'attributes' => array(
'title' => t('Create a new user account.'),
diff --git a/core/modules/user/lib/Drupal/user/Plugin/views/argument/Uid.php b/core/modules/user/lib/Drupal/user/Plugin/views/argument/Uid.php
index 5bd0bff..03c492a 100644
--- a/core/modules/user/lib/Drupal/user/Plugin/views/argument/Uid.php
+++ b/core/modules/user/lib/Drupal/user/Plugin/views/argument/Uid.php
@@ -27,7 +27,7 @@ class Uid extends Numeric {
*/
public function titleQuery() {
if (!$this->argument) {
- return array(config('user.settings')->get('anonymous'));
+ return array(\Drupal::config('user.settings')->get('anonymous'));
}
$titles = array();
diff --git a/core/modules/user/lib/Drupal/user/Plugin/views/argument_validator/User.php b/core/modules/user/lib/Drupal/user/Plugin/views/argument_validator/User.php
index d014602..abbb25c 100644
--- a/core/modules/user/lib/Drupal/user/Plugin/views/argument_validator/User.php
+++ b/core/modules/user/lib/Drupal/user/Plugin/views/argument_validator/User.php
@@ -124,7 +124,7 @@ class User extends ArgumentValidatorPluginBase {
}
else {
if ($type == 'name' || $type == 'either') {
- $name = $GLOBALS['user']->getUserName() ?: config('user.settings')->get('anonymous');
+ $name = $GLOBALS['user']->getUserName() ?: \Drupal::config('user.settings')->get('anonymous');
if ($argument == $name) {
$account = clone $GLOBALS['user'];
}
diff --git a/core/modules/user/lib/Drupal/user/RegisterFormController.php b/core/modules/user/lib/Drupal/user/RegisterFormController.php
index d5f5024..4d6b7fc 100644
--- a/core/modules/user/lib/Drupal/user/RegisterFormController.php
+++ b/core/modules/user/lib/Drupal/user/RegisterFormController.php
@@ -69,7 +69,7 @@ class RegisterFormController extends AccountFormController {
public function submit(array $form, array &$form_state) {
$admin = $form_state['values']['administer_users'];
- if (!config('user.settings')->get('verify_mail') || $admin) {
+ if (!\Drupal::config('user.settings')->get('verify_mail') || $admin) {
$pass = $form_state['values']['pass'];
}
else {
@@ -112,7 +112,7 @@ class RegisterFormController extends AccountFormController {
drupal_set_message(t('Created a new user account for <a href="@url">%name</a>. No e-mail has been sent.', array('@url' => url($uri['path'], $uri['options']), '%name' => $account->getUsername())));
}
// No e-mail verification required; log in user immediately.
- elseif (!$admin && !config('user.settings')->get('verify_mail') && $account->isActive()) {
+ elseif (!$admin && !\Drupal::config('user.settings')->get('verify_mail') && $account->isActive()) {
_user_mail_notify('register_no_approval_required', $account);
user_login_finalize($account);
drupal_set_message(t('Registration successful. You are now logged in.'));
diff --git a/core/modules/user/lib/Drupal/user/Tests/UserAdminTest.php b/core/modules/user/lib/Drupal/user/Tests/UserAdminTest.php
index 1dd89b2..0b61e23 100644
--- a/core/modules/user/lib/Drupal/user/Tests/UserAdminTest.php
+++ b/core/modules/user/lib/Drupal/user/Tests/UserAdminTest.php
@@ -127,14 +127,14 @@ class UserAdminTest extends WebTestBase {
$this->drupalLogout();
// Test custom user registration approval email address(es).
- $config = config('user.settings');
+ $config = \Drupal::config('user.settings');
// Allow users to register with admin approval.
$config
->set('verify_mail', TRUE)
->set('register', USER_REGISTER_VISITORS_ADMINISTRATIVE_APPROVAL)
->save();
// Set the site and notification email addresses.
- $system = config('system.site');
+ $system = \Drupal::config('system.site');
$server_address = $this->randomName() . '@example.com';
$notify_address = $this->randomName() . '@example.com';
$system
diff --git a/core/modules/user/lib/Drupal/user/Tests/UserAutocompleteTest.php b/core/modules/user/lib/Drupal/user/Tests/UserAutocompleteTest.php
index 46518f4..e6fad9a 100644
--- a/core/modules/user/lib/Drupal/user/Tests/UserAutocompleteTest.php
+++ b/core/modules/user/lib/Drupal/user/Tests/UserAutocompleteTest.php
@@ -49,7 +49,7 @@ class UserAutocompleteTest extends WebTestBase {
$this->assertRaw($this->unprivileged_user->getUsername(), 'User name found in autocompletion results.');
$anonymous_name = $this->randomString() . '<script>alert();</script>';
- config('user.settings')->set('anonymous', $anonymous_name)->save();
+ \Drupal::config('user.settings')->set('anonymous', $anonymous_name)->save();
// Test that anonymous username is in the result when requested and escaped
// with check_plain().
$users = $this->drupalGetJSON('user/autocomplete/anonymous', array('query' => array('q' => drupal_substr($anonymous_name, 0, 4))));
diff --git a/core/modules/user/lib/Drupal/user/Tests/UserCancelTest.php b/core/modules/user/lib/Drupal/user/Tests/UserCancelTest.php
index 42c2f7f..051499e 100644
--- a/core/modules/user/lib/Drupal/user/Tests/UserCancelTest.php
+++ b/core/modules/user/lib/Drupal/user/Tests/UserCancelTest.php
@@ -33,7 +33,7 @@ class UserCancelTest extends WebTestBase {
* Attempt to cancel account without permission.
*/
function testUserCancelWithoutPermission() {
- config('user.settings')->set('cancel_method', 'user_cancel_reassign')->save();
+ \Drupal::config('user.settings')->set('cancel_method', 'user_cancel_reassign')->save();
// Create a user.
$account = $this->drupalCreateUser(array());
@@ -103,7 +103,7 @@ class UserCancelTest extends WebTestBase {
* Attempt invalid account cancellations.
*/
function testUserCancelInvalid() {
- config('user.settings')->set('cancel_method', 'user_cancel_reassign')->save();
+ \Drupal::config('user.settings')->set('cancel_method', 'user_cancel_reassign')->save();
// Create a user.
$account = $this->drupalCreateUser(array('cancel account'));
@@ -145,7 +145,7 @@ class UserCancelTest extends WebTestBase {
* Disable account and keep all content.
*/
function testUserBlock() {
- config('user.settings')->set('cancel_method', 'user_cancel_block')->save();
+ \Drupal::config('user.settings')->set('cancel_method', 'user_cancel_block')->save();
// Create a user.
$web_user = $this->drupalCreateUser(array('cancel account'));
@@ -180,7 +180,7 @@ class UserCancelTest extends WebTestBase {
* Disable account and unpublish all content.
*/
function testUserBlockUnpublish() {
- config('user.settings')->set('cancel_method', 'user_cancel_block_unpublish')->save();
+ \Drupal::config('user.settings')->set('cancel_method', 'user_cancel_block_unpublish')->save();
// Create a user.
$account = $this->drupalCreateUser(array('cancel account'));
@@ -224,7 +224,7 @@ class UserCancelTest extends WebTestBase {
* Delete account and anonymize all content.
*/
function testUserAnonymize() {
- config('user.settings')->set('cancel_method', 'user_cancel_reassign')->save();
+ \Drupal::config('user.settings')->set('cancel_method', 'user_cancel_reassign')->save();
// Create a user.
$account = $this->drupalCreateUser(array('cancel account'));
@@ -248,7 +248,7 @@ class UserCancelTest extends WebTestBase {
$this->drupalGet('user/' . $account->id() . '/edit');
$this->drupalPost(NULL, NULL, t('Cancel account'));
$this->assertText(t('Are you sure you want to cancel your account?'), 'Confirmation form to cancel account displayed.');
- $this->assertRaw(t('Your account will be removed and all account information deleted. All of your content will be assigned to the %anonymous-name user.', array('%anonymous-name' => config('user.settings')->get('anonymous'))), 'Informs that all content will be attributed to anonymous account.');
+ $this->assertRaw(t('Your account will be removed and all account information deleted. All of your content will be assigned to the %anonymous-name user.', array('%anonymous-name' => \Drupal::config('user.settings')->get('anonymous'))), 'Informs that all content will be attributed to anonymous account.');
// Confirm account cancellation.
$timestamp = time();
@@ -275,7 +275,7 @@ class UserCancelTest extends WebTestBase {
* Delete account and remove all content.
*/
function testUserDelete() {
- config('user.settings')->set('cancel_method', 'user_cancel_delete')->save();
+ \Drupal::config('user.settings')->set('cancel_method', 'user_cancel_delete')->save();
module_enable(array('comment'));
$this->resetAll();
@@ -339,7 +339,7 @@ class UserCancelTest extends WebTestBase {
* Create an administrative user and delete another user.
*/
function testUserCancelByAdmin() {
- config('user.settings')->set('cancel_method', 'user_cancel_reassign')->save();
+ \Drupal::config('user.settings')->set('cancel_method', 'user_cancel_reassign')->save();
// Create a regular user.
$account = $this->drupalCreateUser(array());
@@ -364,7 +364,7 @@ class UserCancelTest extends WebTestBase {
* Tests deletion of a user account without an e-mail address.
*/
function testUserWithoutEmailCancelByAdmin() {
- config('user.settings')->set('cancel_method', 'user_cancel_reassign')->save();
+ \Drupal::config('user.settings')->set('cancel_method', 'user_cancel_reassign')->save();
// Create a regular user.
$account = $this->drupalCreateUser(array());
@@ -393,9 +393,9 @@ class UserCancelTest extends WebTestBase {
*/
function testMassUserCancelByAdmin() {
module_enable(array('views'));
- config('user.settings')->set('cancel_method', 'user_cancel_reassign')->save();
+ \Drupal::config('user.settings')->set('cancel_method', 'user_cancel_reassign')->save();
// Enable account cancellation notification.
- config('user.settings')->set('notify.status_canceled', TRUE)->save();
+ \Drupal::config('user.settings')->set('notify.status_canceled', TRUE)->save();
// Create administrative user.
$admin_user = $this->drupalCreateUser(array('administer users'));
diff --git a/core/modules/user/lib/Drupal/user/Tests/UserCreateFailMailTest.php b/core/modules/user/lib/Drupal/user/Tests/UserCreateFailMailTest.php
index eb37e52..be4fb7b 100644
--- a/core/modules/user/lib/Drupal/user/Tests/UserCreateFailMailTest.php
+++ b/core/modules/user/lib/Drupal/user/Tests/UserCreateFailMailTest.php
@@ -37,7 +37,7 @@ class UserCreateFailMailTest extends WebTestBase {
$this->drupalLogin($user);
// Replace the mail functionality with a fake, malfunctioning service.
- config('system.mail')->set('interface.default', 'Drupal\system_mail_failure_test\TestPhpMailFailure')->save();
+ \Drupal::config('system.mail')->set('interface.default', 'Drupal\system_mail_failure_test\TestPhpMailFailure')->save();
// Create a user, but fail to send an email.
$name = $this->randomName();
$edit = array(
diff --git a/core/modules/user/lib/Drupal/user/Tests/UserCreateTest.php b/core/modules/user/lib/Drupal/user/Tests/UserCreateTest.php
index 1e1c891..eaaf350 100644
--- a/core/modules/user/lib/Drupal/user/Tests/UserCreateTest.php
+++ b/core/modules/user/lib/Drupal/user/Tests/UserCreateTest.php
@@ -80,7 +80,7 @@ class UserCreateTest extends WebTestBase {
$this->assertFieldByXPath('//input[@type="radio" and @id="edit-status-1" and @checked="checked"]', NULL, 'Default setting for user status is active.');
// Test that the password strength indicator displays.
- $config = config('user.settings');
+ $config = \Drupal::config('user.settings');
$config->set('password_strength', TRUE)->save();
$this->drupalGet('admin/people/create');
diff --git a/core/modules/user/lib/Drupal/user/Tests/UserEditTest.php b/core/modules/user/lib/Drupal/user/Tests/UserEditTest.php
index 0713df0..548c0c7 100644
--- a/core/modules/user/lib/Drupal/user/Tests/UserEditTest.php
+++ b/core/modules/user/lib/Drupal/user/Tests/UserEditTest.php
@@ -78,7 +78,7 @@ class UserEditTest extends WebTestBase {
$this->drupalLogout();
// Test that the password strength indicator displays.
- $config = config('user.settings');
+ $config = \Drupal::config('user.settings');
$this->drupalLogin($user1);
$config->set('password_strength', TRUE)->save();
diff --git a/core/modules/user/lib/Drupal/user/Tests/UserEditedOwnAccountTest.php b/core/modules/user/lib/Drupal/user/Tests/UserEditedOwnAccountTest.php
index 6bdb9d0..3647e69 100644
--- a/core/modules/user/lib/Drupal/user/Tests/UserEditedOwnAccountTest.php
+++ b/core/modules/user/lib/Drupal/user/Tests/UserEditedOwnAccountTest.php
@@ -25,7 +25,7 @@ class UserEditedOwnAccountTest extends WebTestBase {
function testUserEditedOwnAccount() {
// Change account setting 'Who can register accounts?' to Administrators
// only.
- config('user.settings')->set('register', USER_REGISTER_ADMINISTRATORS_ONLY)->save();
+ \Drupal::config('user.settings')->set('register', USER_REGISTER_ADMINISTRATORS_ONLY)->save();
// Create a new user account and log in.
$account = $this->drupalCreateUser(array('change own username'));
diff --git a/core/modules/user/lib/Drupal/user/Tests/UserEntityCallbacksTest.php b/core/modules/user/lib/Drupal/user/Tests/UserEntityCallbacksTest.php
index b367e2d..76bf0e9 100644
--- a/core/modules/user/lib/Drupal/user/Tests/UserEntityCallbacksTest.php
+++ b/core/modules/user/lib/Drupal/user/Tests/UserEntityCallbacksTest.php
@@ -44,7 +44,7 @@ class UserEntityCallbacksTest extends WebTestBase {
// Setup a random anonymous name to be sure the name is used.
$name = $this->randomName();
- config('user.settings')->set('anonymous', $name)->save();
+ \Drupal::config('user.settings')->set('anonymous', $name)->save();
$this->assertEqual($this->anonymous->label(), $name, 'The variable anonymous should be used for name of uid 0');
}
diff --git a/core/modules/user/lib/Drupal/user/Tests/UserLoginTest.php b/core/modules/user/lib/Drupal/user/Tests/UserLoginTest.php
index 38b7abf..053e13d 100644
--- a/core/modules/user/lib/Drupal/user/Tests/UserLoginTest.php
+++ b/core/modules/user/lib/Drupal/user/Tests/UserLoginTest.php
@@ -26,7 +26,7 @@ class UserLoginTest extends WebTestBase {
* Test the global login flood control.
*/
function testGlobalLoginFloodControl() {
- config('user.flood')
+ \Drupal::config('user.flood')
->set('ip_limit', 10)
// Set a high per-user limit out so that it is not relevant in the test.
->set('user_limit', 4000)
@@ -63,7 +63,7 @@ class UserLoginTest extends WebTestBase {
* Test the per-user login flood control.
*/
function testPerUserLoginFloodControl() {
- config('user.flood')
+ \Drupal::config('user.flood')
// Set a high global limit out so that it is not relevant in the test.
->set('ip_limit', 4000)
->set('user_limit', 3)
@@ -149,7 +149,7 @@ class UserLoginTest extends WebTestBase {
$this->assertNoFieldByXPath("//input[@name='pass' and @value!='']", NULL, 'Password value attribute is blank.');
if (isset($flood_trigger)) {
if ($flood_trigger == 'user') {
- $this->assertRaw(format_plural(config('user.flood')->get('user_limit'), 'Sorry, there has been more than one failed login attempt for this account. It is temporarily blocked. Try again later or <a href="@url">request a new password</a>.', 'Sorry, there have been more than @count failed login attempts for this account. It is temporarily blocked. Try again later or <a href="@url">request a new password</a>.', array('@url' => url('user/password'))));
+ $this->assertRaw(format_plural(\Drupal::config('user.flood')->get('user_limit'), 'Sorry, there has been more than one failed login attempt for this account. It is temporarily blocked. Try again later or <a href="@url">request a new password</a>.', 'Sorry, there have been more than @count failed login attempts for this account. It is temporarily blocked. Try again later or <a href="@url">request a new password</a>.', array('@url' => url('user/password'))));
}
else {
// No uid, so the limit is IP-based.
diff --git a/core/modules/user/lib/Drupal/user/Tests/UserPasswordResetTest.php b/core/modules/user/lib/Drupal/user/Tests/UserPasswordResetTest.php
index 97390c7..3a11909 100644
--- a/core/modules/user/lib/Drupal/user/Tests/UserPasswordResetTest.php
+++ b/core/modules/user/lib/Drupal/user/Tests/UserPasswordResetTest.php
@@ -68,7 +68,7 @@ class UserPasswordResetTest extends WebTestBase {
// Verify that the user was sent an e-mail.
$this->assertMail('to', $this->account->getEmail(), 'Password e-mail sent to user.');
- $subject = t('Replacement login information for @username at @site', array('@username' => $this->account->getUsername(), '@site' => config('system.site')->get('name')));
+ $subject = t('Replacement login information for @username at @site', array('@username' => $this->account->getUsername(), '@site' => \Drupal::config('system.site')->get('name')));
$this->assertMail('subject', $subject, 'Password reset e-mail subject is correct.');
$resetURL = $this->getResetURL();
@@ -81,7 +81,7 @@ class UserPasswordResetTest extends WebTestBase {
// Check successful login.
$this->drupalPost(NULL, NULL, t('Log in'));
$this->assertLink(t('Log out'));
- $this->assertTitle(t('@name | @site', array('@name' => $this->account->getUsername(), '@site' => config('system.site')->get('name'))), 'Logged in using password reset link.');
+ $this->assertTitle(t('@name | @site', array('@name' => $this->account->getUsername(), '@site' => \Drupal::config('system.site')->get('name'))), 'Logged in using password reset link.');
// Log out, and try to log in again using the same one-time link.
$this->drupalLogout();
@@ -97,7 +97,7 @@ class UserPasswordResetTest extends WebTestBase {
$this->assertTrue( count($this->drupalGetMails(array('id' => 'user_password_reset'))) === $before + 1, 'E-mail sent when requesting password reset using e-mail address.');
// Create a password reset link as if the request time was 60 seconds older than the allowed limit.
- $timeout = config('user.settings')->get('password_reset_timeout');
+ $timeout = \Drupal::config('user.settings')->get('password_reset_timeout');
$bogus_timestamp = REQUEST_TIME - $timeout - 60;
$_uid = $this->account->id();
$this->drupalGet("user/reset/$_uid/$bogus_timestamp/" . user_pass_rehash($this->account->getPassword(), $bogus_timestamp, $this->account->getLastLoginTime()));
diff --git a/core/modules/user/lib/Drupal/user/Tests/UserRegistrationTest.php b/core/modules/user/lib/Drupal/user/Tests/UserRegistrationTest.php
index deb1175..ec86be2 100644
--- a/core/modules/user/lib/Drupal/user/Tests/UserRegistrationTest.php
+++ b/core/modules/user/lib/Drupal/user/Tests/UserRegistrationTest.php
@@ -28,7 +28,7 @@ class UserRegistrationTest extends WebTestBase {
}
function testRegistrationWithEmailVerification() {
- $config = config('user.settings');
+ $config = \Drupal::config('user.settings');
// Require e-mail verification.
$config->set('verify_mail', TRUE)->save();
@@ -61,7 +61,7 @@ class UserRegistrationTest extends WebTestBase {
}
function testRegistrationWithoutEmailVerification() {
- $config = config('user.settings');
+ $config = \Drupal::config('user.settings');
// Don't require e-mail verification and allow registration by site visitors
// without administrator approval.
$config
@@ -126,7 +126,7 @@ class UserRegistrationTest extends WebTestBase {
function testRegistrationEmailDuplicates() {
// Don't require e-mail verification and allow registration by site visitors
// without administrator approval.
- config('user.settings')
+ \Drupal::config('user.settings')
->set('verify_mail', FALSE)
->set('register', USER_REGISTER_VISITORS)
->save();
@@ -152,13 +152,13 @@ class UserRegistrationTest extends WebTestBase {
function testRegistrationDefaultValues() {
// Don't require e-mail verification and allow registration by site visitors
// without administrator approval.
- $config_user_settings = config('user.settings')
+ $config_user_settings = \Drupal::config('user.settings')
->set('verify_mail', FALSE)
->set('register', USER_REGISTER_VISITORS)
->save();
// Set the default timezone to Brussels.
- $config_system_date = config('system.date')
+ $config_system_date = \Drupal::config('system.date')
->set('timezone.user.configurable', 1)
->set('timezone.default', 'Europe/Brussels')
->save();
diff --git a/core/modules/user/lib/Drupal/user/Tests/UserSignatureTest.php b/core/modules/user/lib/Drupal/user/Tests/UserSignatureTest.php
index c859226..fe74aa1 100644
--- a/core/modules/user/lib/Drupal/user/Tests/UserSignatureTest.php
+++ b/core/modules/user/lib/Drupal/user/Tests/UserSignatureTest.php
@@ -34,7 +34,7 @@ class UserSignatureTest extends WebTestBase {
parent::setUp();
// Enable user signatures.
- config('user.settings')->set('signatures', 1)->save();
+ \Drupal::config('user.settings')->set('signatures', 1)->save();
// Create Basic page node type.
$this->drupalCreateContentType(array('type' => 'page', 'name' => 'Basic page'));
diff --git a/core/modules/user/lib/Drupal/user/Tests/UserTimeZoneTest.php b/core/modules/user/lib/Drupal/user/Tests/UserTimeZoneTest.php
index 4c95efd..8189fcb 100644
--- a/core/modules/user/lib/Drupal/user/Tests/UserTimeZoneTest.php
+++ b/core/modules/user/lib/Drupal/user/Tests/UserTimeZoneTest.php
@@ -26,7 +26,7 @@ class UserTimeZoneTest extends WebTestBase {
*/
function testUserTimeZone() {
// Setup date/time settings for Los Angeles time.
- config('system.date')
+ \Drupal::config('system.date')
->set('timezone.user.configurable', 1)
->set('timezone.default', 'America/Los_Angeles')
->save();
diff --git a/core/modules/user/lib/Drupal/user/Tests/Views/BulkFormTest.php b/core/modules/user/lib/Drupal/user/Tests/Views/BulkFormTest.php
index d2d42fc..68e8b47 100644
--- a/core/modules/user/lib/Drupal/user/Tests/Views/BulkFormTest.php
+++ b/core/modules/user/lib/Drupal/user/Tests/Views/BulkFormTest.php
@@ -89,7 +89,7 @@ class BulkFormTest extends UserTestBase {
// Ensure the anonymous user is found.
$this->drupalGet('test-user-bulk-form');
- $this->assertText(config('user.settings')->get('anonymous'));
+ $this->assertText(\Drupal::config('user.settings')->get('anonymous'));
// Attempt to block the anonymous user.
$edit = array(
diff --git a/core/modules/user/lib/Drupal/user/Tests/Views/HandlerFieldUserNameTest.php b/core/modules/user/lib/Drupal/user/Tests/Views/HandlerFieldUserNameTest.php
index 4a41b43..99659a7 100644
--- a/core/modules/user/lib/Drupal/user/Tests/Views/HandlerFieldUserNameTest.php
+++ b/core/modules/user/lib/Drupal/user/Tests/Views/HandlerFieldUserNameTest.php
@@ -49,7 +49,7 @@ class HandlerFieldUserNameTest extends UserTestBase {
$this->assertIdentical($render, $username, 'If the user is not linked the username should be printed out for a normal user.');
$view->result[0]->uid = 0;
- $anon_name = config('user.settings')->get('anonymous');
+ $anon_name = \Drupal::config('user.settings')->get('anonymous');
$view->result[0]->users_name = '';
$render = $view->field['name']->advancedRender($view->result[0]);
$this->assertIdentical($render, $anon_name , 'For user0 it should use the default anonymous name by default.');
diff --git a/core/modules/user/user.api.php b/core/modules/user/user.api.php
index d83832c..07ba0eb 100644
--- a/core/modules/user/user.api.php
+++ b/core/modules/user/user.api.php
@@ -284,7 +284,7 @@ function hook_user_update($account) {
* The user object on which the operation was just performed.
*/
function hook_user_login($account) {
- $config = config('system.date');
+ $config = Drupal::config('system.date');
// If the user has a NULL time zone, notify them to set a time zone.
if (!$account->getTimezone() && $config->get('timezone.user.configurable') && $config->get('timezone.user.warn')) {
drupal_set_message(t('Configure your <a href="@user-edit">account time zone setting</a>.', array('@user-edit' => url("user/" . $account->id() . "/edit", array('query' => drupal_get_destination(), 'fragment' => 'edit-timezone')))));
diff --git a/core/modules/user/user.install b/core/modules/user/user.install
index 62eb4a9..4a48efb 100644
--- a/core/modules/user/user.install
+++ b/core/modules/user/user.install
@@ -494,7 +494,7 @@ function user_update_8004() {
'2' => 'visitors_admin_approval',
);
- $config = config('user.settings');
+ $config = Drupal::config('user.settings');
$user_register = $config->get('register');
$user_cancel_method = $config->get('cancel_method');
@@ -1026,7 +1026,7 @@ function user_update_8017() {
->fetchAll();
foreach ($roles as $role) {
- config('user.role.' . $role->rid)
+ Drupal::config('user.role.' . $role->rid)
->set('id', $role->rid)
->set('uuid', $uuid->generate())
->set('label', $role->name)
@@ -1109,7 +1109,7 @@ function user_update_8019() {
}
}
foreach ($new_permissions as $rid => $permissions) {
- config("user.role.$rid")
+ Drupal::config("user.role.$rid")
->set('permissions', $permissions)
->save();
}
@@ -1121,7 +1121,7 @@ function user_update_8019() {
function user_update_8020() {
$uuid = new Uuid();
- config("entity.form_mode.user.register")
+ Drupal::config("entity.form_mode.user.register")
->set('id', "user.register")
->set('uuid', $uuid->generate())
->set('label', 'Register')
diff --git a/core/modules/user/user.module b/core/modules/user/user.module
index 0a8d4ab..2c0e2d3 100644
--- a/core/modules/user/user.module
+++ b/core/modules/user/user.module
@@ -204,7 +204,7 @@ function user_field_extra_fields() {
'description' => t('User module account form elements.'),
'weight' => -10,
);
- if (config('user.settings')->get('signatures')) {
+ if (Drupal::config('user.settings')->get('signatures')) {
$fields['user']['user']['form']['signature_settings'] = array(
'label' => t('Signature settings'),
'description' => t('User module form element.'),
@@ -216,7 +216,7 @@ function user_field_extra_fields() {
'description' => t('User module form element.'),
'weight' => 0,
);
- if (config('system.date')->get('timezone.user.configurable')) {
+ if (Drupal::config('system.date')->get('timezone.user.configurable')) {
$fields['user']['user']['form']['timezone'] = array(
'label' => t('Timezone'),
'description' => t('System module form element.'),
@@ -491,7 +491,7 @@ function user_permission() {
),
'cancel account' => array(
'title' => t('Cancel own user account'),
- 'description' => t('Note: content may be kept, unpublished, deleted or transferred to the %anonymous-name user depending on the configured <a href="@user-settings-url">user settings</a>.', array('%anonymous-name' => config('user.settings')->get('anonymous'), '@user-settings-url' => url('admin/config/people/accounts'))),
+ 'description' => t('Note: content may be kept, unpublished, deleted or transferred to the %anonymous-name user depending on the configured <a href="@user-settings-url">user settings</a>.', array('%anonymous-name' => Drupal::config('user.settings')->get('anonymous'), '@user-settings-url' => url('admin/config/people/accounts'))),
),
'select account cancellation method' => array(
'title' => t('Select method for cancelling own account'),
@@ -780,7 +780,7 @@ function user_is_logged_in() {
* TRUE if the user is not already logged in and can register for an account.
*/
function user_register_access() {
- return user_is_anonymous() && (config('user.settings')->get('register') != USER_REGISTER_ADMINISTRATORS_ONLY);
+ return user_is_anonymous() && (Drupal::config('user.settings')->get('register') != USER_REGISTER_ADMINISTRATORS_ONLY);
}
/**
@@ -1463,7 +1463,7 @@ function user_mail($key, &$message, $params) {
// the locale module is enabled.
$user_config_context = config_context_enter('Drupal\user\UserConfigContext');
$user_config_context->setAccount($params['account']);
- $mail_config = config('user.mail');
+ $mail_config = Drupal::config('user.mail');
// We do not sanitize the token replacement, since the output of this
// replacement is intended for an e-mail message, not a web browser.
@@ -1777,7 +1777,7 @@ function user_multiple_cancel_confirm($form, &$form_state) {
'#type' => 'checkbox',
'#title' => t('Notify user when account is canceled.'),
'#default_value' => FALSE,
- '#access' => config('user.settings')->get('notify.status_canceled'),
+ '#access' => Drupal::config('user.settings')->get('notify.status_canceled'),
'#description' => t('When enabled, the user will receive an e-mail notification after the account has been cancelled.'),
);
@@ -1877,17 +1877,17 @@ function theme_user_signature($variables) {
*/
function _user_mail_notify($op, $account, $langcode = NULL) {
// By default, we always notify except for canceled and blocked.
- $notify = config('user.settings')->get('notify.' . $op);
+ $notify = Drupal::config('user.settings')->get('notify.' . $op);
if ($notify || ($op != 'status_canceled' && $op != 'status_blocked')) {
$params['account'] = $account;
$langcode = $langcode ? $langcode : $account->getPreferredLangcode();
// Get the custom site notification email to use as the from email address
// if it has been set.
- $site_mail = config('system.site')->get('mail_notification');
+ $site_mail = Drupal::config('system.site')->get('mail_notification');
// If the custom site notification email has not been set, we use the site
// default for this.
if (empty($site_mail)) {
- $site_mail = config('system.site')->get('mail');
+ $site_mail = Drupal::config('system.site')->get('mail');
}
if (empty($site_mail)) {
$site_mail = ini_get('sendmail_from');
@@ -1919,7 +1919,7 @@ function user_form_process_password_confirm($element) {
'showStrengthIndicator' => FALSE,
);
- if (config('user.settings')->get('password_strength')) {
+ if (Drupal::config('user.settings')->get('password_strength')) {
global $user;
$password_settings['showStrengthIndicator'] = TRUE;
@@ -1983,7 +1983,7 @@ function user_node_load($nodes, $types) {
*/
function user_modules_installed($modules) {
// Assign all available permissions to the administrator role.
- $rid = config('user.settings')->get('admin_role');
+ $rid = Drupal::config('user.settings')->get('admin_role');
if ($rid) {
$permissions = array();
foreach ($modules as $module) {
diff --git a/core/modules/user/user.pages.inc b/core/modules/user/user.pages.inc
index 33e2593..2aa9b88 100644
--- a/core/modules/user/user.pages.inc
+++ b/core/modules/user/user.pages.inc
@@ -39,7 +39,7 @@ function user_pass_reset($form, &$form_state, $uid, $timestamp, $hashed_pass, $a
}
else {
// Time out, in seconds, until login URL expires.
- $timeout = config('user.settings')->get('password_reset_timeout');
+ $timeout = Drupal::config('user.settings')->get('password_reset_timeout');
$current = REQUEST_TIME;
$account = user_load($uid);
// Verify that the user exists and is active.
@@ -166,7 +166,7 @@ function user_cancel_confirm_form($form, &$form_state, $account) {
'#description' => t('When enabled, the user must confirm the account cancellation via e-mail.'),
);
// Also allow to send account canceled notification mail, if enabled.
- $default_notify = config('user.settings')->get('notify.status_canceled');
+ $default_notify = Drupal::config('user.settings')->get('notify.status_canceled');
$form['user_cancel_notify'] = array(
'#type' => 'checkbox',
'#title' => t('Notify user when account is canceled.'),
@@ -182,7 +182,7 @@ function user_cancel_confirm_form($form, &$form_state, $account) {
else {
$question = t('Are you sure you want to cancel the account %name?', array('%name' => $account->getUsername()));
}
- $default_method = config('user.settings')->get('cancel_method');
+ $default_method = Drupal::config('user.settings')->get('cancel_method');
$description = NULL;
if ($can_select_method) {
$description = t('Select the method to cancel the account above.');
@@ -248,7 +248,7 @@ function user_cancel_confirm_form_submit($form, &$form_state) {
* @see user_multiple_cancel_confirm()
*/
function user_cancel_methods() {
- $anonymous_name = config('user.settings')->get('anonymous');
+ $anonymous_name = Drupal::config('user.settings')->get('anonymous');
$methods = array(
'user_cancel_block' => array(
'title' => t('Disable the account and keep its content.'),
@@ -272,7 +272,7 @@ function user_cancel_methods() {
drupal_alter('user_cancel_methods', $methods);
// Turn all methods into real form elements.
- $default_method = config('user.settings')->get('cancel_method');
+ $default_method = Drupal::config('user.settings')->get('cancel_method');
$form = array(
'#options' => array(),
'#default_value' => $default_method,
@@ -309,7 +309,7 @@ function user_cancel_confirm($account, $timestamp = 0, $hashed_pass = '') {
// Validate expiration and hashed password/login.
if ($timestamp <= $current && $current - $timestamp < $timeout && $account->id() && $timestamp >= $account->getLastLoginTime() && $hashed_pass == user_pass_rehash($account->getPassword(), $timestamp, $account->getLastLoginTime())) {
$edit = array(
- 'user_cancel_notify' => isset($account_data['cancel_notify']) ? $account_data['cancel_notify'] : config('user.settings')->get('notify.status_canceled'),
+ 'user_cancel_notify' => isset($account_data['cancel_notify']) ? $account_data['cancel_notify'] : Drupal::config('user.settings')->get('notify.status_canceled'),
);
user_cancel($edit, $account->id(), $account_data['cancel_method']);
// Since user_cancel() is not invoked via Form API, batch processing needs
diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php
index 4d04243..c5836f9 100644
--- a/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php
+++ b/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php
@@ -1745,7 +1745,7 @@ abstract class DisplayPluginBase extends PluginBase {
$this->theme = $theme;
}
elseif (empty($this->theme)) {
- $this->theme = config('system.theme')->get('default');
+ $this->theme = \Drupal::config('system.theme')->get('default');
}
if (isset($GLOBALS['theme']) && $GLOBALS['theme'] == $this->theme) {
diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/display/Embed.php b/core/modules/views/lib/Drupal/views/Plugin/views/display/Embed.php
index b004963..ccb0191 100644
--- a/core/modules/views/lib/Drupal/views/Plugin/views/display/Embed.php
+++ b/core/modules/views/lib/Drupal/views/Plugin/views/display/Embed.php
@@ -16,7 +16,7 @@ use Drupal\Core\Annotation\Translation;
* @ingroup views_display_plugins
*
* @todo: Wait until annotations/plugins support access mehtods.
- * no_ui => !config('views.settings')->get('ui.show.display_embed'),
+ * no_ui => !\Drupal::config('views.settings')->get('ui.show.display_embed'),
*
* @Plugin(
* id = "embed",
diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/field/FieldPluginBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/field/FieldPluginBase.php
index 6fda24b..f37284f 100644
--- a/core/modules/views/lib/Drupal/views/Plugin/views/field/FieldPluginBase.php
+++ b/core/modules/views/lib/Drupal/views/Plugin/views/field/FieldPluginBase.php
@@ -279,7 +279,7 @@ abstract class FieldPluginBase extends HandlerBase {
'' => t(' - Use default -'),
'0' => t('- None -')
);
- $elements += config('views.settings')->get('field_rewrite_elements');
+ $elements += \Drupal::config('views.settings')->get('field_rewrite_elements');
}
return $elements;
diff --git a/core/modules/views/lib/Drupal/views/Tests/Handler/HandlerTest.php b/core/modules/views/lib/Drupal/views/Tests/Handler/HandlerTest.php
index 293125d..03a2b7f 100644
--- a/core/modules/views/lib/Drupal/views/Tests/Handler/HandlerTest.php
+++ b/core/modules/views/lib/Drupal/views/Tests/Handler/HandlerTest.php
@@ -355,8 +355,8 @@ class HandlerTest extends ViewTestBase {
$views_data = $views_data['views_test_data'];
// Enable access to callback only field and deny for callback + arguments.
- config('views_test_data.tests')->set('handler_access_callback', TRUE)->save();
- config('views_test_data.tests')->set('handler_access_callback_argument', FALSE)->save();
+ \Drupal::config('views_test_data.tests')->set('handler_access_callback', TRUE)->save();
+ \Drupal::config('views_test_data.tests')->set('handler_access_callback_argument', FALSE)->save();
$view->initDisplay();
$view->initHandlers();
@@ -368,8 +368,8 @@ class HandlerTest extends ViewTestBase {
}
// Enable access to the callback + argument handlers and deny for callback.
- config('views_test_data.tests')->set('handler_access_callback', FALSE)->save();
- config('views_test_data.tests')->set('handler_access_callback_argument', TRUE)->save();
+ \Drupal::config('views_test_data.tests')->set('handler_access_callback', FALSE)->save();
+ \Drupal::config('views_test_data.tests')->set('handler_access_callback_argument', TRUE)->save();
$view->destroy();
$view->initDisplay();
$view->initHandlers();
diff --git a/core/modules/views/lib/Drupal/views/Tests/Plugin/DisplayExtenderTest.php b/core/modules/views/lib/Drupal/views/Tests/Plugin/DisplayExtenderTest.php
index 5d9e69c..eeb5914 100644
--- a/core/modules/views/lib/Drupal/views/Tests/Plugin/DisplayExtenderTest.php
+++ b/core/modules/views/lib/Drupal/views/Tests/Plugin/DisplayExtenderTest.php
@@ -41,7 +41,7 @@ class DisplayExtenderTest extends PluginTestBase {
* Test display extenders.
*/
public function testDisplayExtenders() {
- config('views.settings')->set('display_extenders', array('display_extender_test'))->save();
+ \Drupal::config('views.settings')->set('display_extenders', array('display_extender_test'))->save();
$this->assertEqual(count(views_get_enabled_display_extenders()), 1, 'Make sure that there is only one enabled display extender.');
$view = views_get_view('test_view');
diff --git a/core/modules/views/lib/Drupal/views/Tests/Plugin/DisplayTest.php b/core/modules/views/lib/Drupal/views/Tests/Plugin/DisplayTest.php
index 272868c..a106d38 100644
--- a/core/modules/views/lib/Drupal/views/Tests/Plugin/DisplayTest.php
+++ b/core/modules/views/lib/Drupal/views/Tests/Plugin/DisplayTest.php
@@ -234,7 +234,7 @@ class DisplayTest extends PluginTestBase {
// Change the page plugin id to an invalid one. Bypass the entity system
// so no menu rebuild was executed (so the path is still available).
- $config = config('views.view.test_display_invalid');
+ $config = \Drupal::config('views.view.test_display_invalid');
$config->set('display.page_1.display_plugin', 'invalid');
$config->save();
@@ -249,7 +249,7 @@ class DisplayTest extends PluginTestBase {
$this->assertResponse(404);
// Change the display plugin ID back to the correct ID.
- $config = config('views.view.test_display_invalid');
+ $config = \Drupal::config('views.view.test_display_invalid');
$config->set('display.page_1.display_plugin', 'page');
$config->save();
@@ -261,7 +261,7 @@ class DisplayTest extends PluginTestBase {
$this->assertBlockAppears($block);
// Change the block plugin ID to an invalid one.
- $config = config('views.view.test_display_invalid');
+ $config = \Drupal::config('views.view.test_display_invalid');
$config->set('display.block_1.display_plugin', 'invalid');
$config->save();
diff --git a/core/modules/views/lib/Drupal/views/Tests/ViewStorageTest.php b/core/modules/views/lib/Drupal/views/Tests/ViewStorageTest.php
index 2ef4b0d..4a696c3 100644
--- a/core/modules/views/lib/Drupal/views/Tests/ViewStorageTest.php
+++ b/core/modules/views/lib/Drupal/views/Tests/ViewStorageTest.php
@@ -95,7 +95,7 @@ class ViewStorageTest extends ViewUnitTestBase {
*/
protected function loadTests() {
$view = entity_load('view', 'test_view_storage');
- $data = config('views.view.test_view_storage')->get();
+ $data = \Drupal::config('views.view.test_view_storage')->get();
// Confirm that an actual view object is loaded and that it returns all of
// expected properties.
@@ -140,7 +140,7 @@ class ViewStorageTest extends ViewUnitTestBase {
}
// Create a new View instance with config values.
- $values = config('views.view.test_view_storage')->get();
+ $values = \Drupal::config('views.view.test_view_storage')->get();
$created = $this->controller->create($values);
$this->assertTrue($created instanceof View, 'Created object is a View.');
@@ -183,7 +183,7 @@ class ViewStorageTest extends ViewUnitTestBase {
$view = $view->createDuplicate();
$view->set('id', 'test_view_storage_new_new2');
$view->save();
- $values = config('views.view.test_view_storage_new_new2')->get();
+ $values = \Drupal::config('views.view.test_view_storage_new_new2')->get();
$this->assertTrue(isset($values['display']['test']) && is_array($values['display']['test']), 'New display was saved.');
}
diff --git a/core/modules/views/lib/Drupal/views/Tests/Wizard/BasicTest.php b/core/modules/views/lib/Drupal/views/Tests/Wizard/BasicTest.php
index 8f3f4eb..cefd1dd 100644
--- a/core/modules/views/lib/Drupal/views/Tests/Wizard/BasicTest.php
+++ b/core/modules/views/lib/Drupal/views/Tests/Wizard/BasicTest.php
@@ -122,7 +122,7 @@ class BasicTest extends WizardTestBase {
$this->assertLinkByHref(url($view3['page[path]']));
// Confirm that the block is available in the block administration UI.
- $this->drupalGet('admin/structure/block/list/' . config('system.theme')->get('default') . '/add');
+ $this->drupalGet('admin/structure/block/list/' . \Drupal::config('system.theme')->get('default') . '/add');
$this->assertText('View: ' . $view3['label']);
// Place the block.
diff --git a/core/modules/views/lib/Drupal/views/Tests/Wizard/ItemsPerPageTest.php b/core/modules/views/lib/Drupal/views/Tests/Wizard/ItemsPerPageTest.php
index 485f048..d613698 100644
--- a/core/modules/views/lib/Drupal/views/Tests/Wizard/ItemsPerPageTest.php
+++ b/core/modules/views/lib/Drupal/views/Tests/Wizard/ItemsPerPageTest.php
@@ -75,7 +75,7 @@ class ItemsPerPageTest extends WizardTestBase {
$this->assertTrue($pos5 < $pos4 && $pos4 < $pos3 && $pos3 < $pos2, 'The nodes appear in the expected order in the page display.');
// Confirm that the block is listed in the block administration UI.
- $this->drupalGet('admin/structure/block/list/' . config('system.theme')->get('default') . '/add');
+ $this->drupalGet('admin/structure/block/list/' . \Drupal::config('system.theme')->get('default') . '/add');
$this->assertText('View: ' . $view['label']);
// Place the block, visit a page that displays the block, and check that the
diff --git a/core/modules/views/lib/Drupal/views/ViewExecutable.php b/core/modules/views/lib/Drupal/views/ViewExecutable.php
index b1519a9..21c95fb 100644
--- a/core/modules/views/lib/Drupal/views/ViewExecutable.php
+++ b/core/modules/views/lib/Drupal/views/ViewExecutable.php
@@ -1127,7 +1127,7 @@ class ViewExecutable {
$exposed_form->query();
}
- if (config('views.settings')->get('sql_signature')) {
+ if (\Drupal::config('views.settings')->get('sql_signature')) {
$this->query->addSignature($this);
}
@@ -1278,7 +1278,7 @@ class ViewExecutable {
}
drupal_theme_initialize();
- $config = config('views.settings');
+ $config = \Drupal::config('views.settings');
$exposed_form = $this->display_handler->getPlugin('exposed_form');
$exposed_form->preRender($this->result);
@@ -1714,7 +1714,7 @@ class ViewExecutable {
foreach ($this->build_info['breadcrumb'] as $path => $title) {
// Check to see if the frontpage is in the breadcrumb trail; if it
// is, we'll remove that from the actual breadcrumb later.
- if ($path == config('system.site')->get('page.front')) {
+ if ($path == \Drupal::config('system.site')->get('page.front')) {
$base = FALSE;
$title = t('Home');
}
diff --git a/core/modules/views/tests/modules/views_test_data/views_test_data.install b/core/modules/views/tests/modules/views_test_data/views_test_data.install
index 6b1a868..f01f410 100644
--- a/core/modules/views/tests/modules/views_test_data/views_test_data.install
+++ b/core/modules/views/tests/modules/views_test_data/views_test_data.install
@@ -31,5 +31,5 @@ function views_test_data_install() {
'em' => 'EM',
'marquee' => 'MARQUEE'
);
- config('views.settings')->set('field_rewrite_elements', $values)->save();
+ Drupal::config('views.settings')->set('field_rewrite_elements', $values)->save();
}
diff --git a/core/modules/views/tests/modules/views_test_data/views_test_data.module b/core/modules/views/tests/modules/views_test_data/views_test_data.module
index b00f8e8..e5dc45e 100644
--- a/core/modules/views/tests/modules/views_test_data/views_test_data.module
+++ b/core/modules/views/tests/modules/views_test_data/views_test_data.module
@@ -29,7 +29,7 @@ function views_test_data_permission() {
* @see Drupal\views\Tests\Handler\HandlerTest
*/
function views_test_data_handler_test_access_callback() {
- return config('views_test_data.tests')->get('handler_access_callback');
+ return Drupal::config('views_test_data.tests')->get('handler_access_callback');
}
/**
@@ -48,7 +48,7 @@ function views_test_data_handler_test_access_callback_argument($argument = FALSE
// Check the argument to be sure that access arguments are passed into the
// callback.
if ($argument) {
- return config('views_test_data.tests')->get('handler_access_callback_argument');
+ return Drupal::config('views_test_data.tests')->get('handler_access_callback_argument');
}
else {
return FALSE;
diff --git a/core/modules/views/views.module b/core/modules/views/views.module
index c7c2b31..cbb04b2 100644
--- a/core/modules/views/views.module
+++ b/core/modules/views/views.module
@@ -890,7 +890,7 @@ function views_get_plugin_definitions() {
* Get enabled display extenders.
*/
function views_get_enabled_display_extenders() {
- $enabled = array_filter((array) config('views.settings')->get('display_extenders'));
+ $enabled = array_filter((array) Drupal::config('views.settings')->get('display_extenders'));
return drupal_map_assoc($enabled);
}
@@ -1663,7 +1663,7 @@ function views_element_validate_tags($element, &$form_state) {
* If TRUE, the data will be cached specific to the currently active language.
*/
function views_cache_set($cid, $data, $use_language = FALSE) {
- if (config('views.settings')->get('skip_cache')) {
+ if (Drupal::config('views.settings')->get('skip_cache')) {
return;
}
if ($use_language) {
@@ -1687,7 +1687,7 @@ function views_cache_set($cid, $data, $use_language = FALSE) {
* The cache or FALSE on failure.
*/
function views_cache_get($cid, $use_language = FALSE) {
- if (config('views.settings')->get('skip_cache')) {
+ if (Drupal::config('views.settings')->get('skip_cache')) {
return FALSE;
}
if ($use_language) {
diff --git a/core/modules/views/views.theme.inc b/core/modules/views/views.theme.inc
index a005b39..69e8b36 100644
--- a/core/modules/views/views.theme.inc
+++ b/core/modules/views/views.theme.inc
@@ -965,7 +965,7 @@ function template_preprocess_views_view_rss(&$variables) {
$style = $view->style_plugin;
- $config = config('system.site');
+ $config = Drupal::config('system.site');
// The RSS 2.0 "spec" doesn't indicate HTML can be used in the description.
// We strip all HTML tags, but need to prevent double encoding from properly
diff --git a/core/modules/views_ui/lib/Drupal/views_ui/Tests/DefaultViewsTest.php b/core/modules/views_ui/lib/Drupal/views_ui/Tests/DefaultViewsTest.php
index ed147ab..92ee4b4 100644
--- a/core/modules/views_ui/lib/Drupal/views_ui/Tests/DefaultViewsTest.php
+++ b/core/modules/views_ui/lib/Drupal/views_ui/Tests/DefaultViewsTest.php
@@ -86,7 +86,7 @@ class DefaultViewsTest extends UITestBase {
$edit = array(
'id' => 'clone_of_glossary',
);
- $this->assertTitle(t('Clone of @label | @site-name', array('@label' => 'Glossary', '@site-name' => config('system.site')->get('name'))));
+ $this->assertTitle(t('Clone of @label | @site-name', array('@label' => 'Glossary', '@site-name' => \Drupal::config('system.site')->get('name'))));
$this->drupalPost(NULL, $edit, t('Clone'));
$this->assertUrl('admin/structure/views/view/clone_of_glossary', array(), 'The normal cloning name schema is applied.');
diff --git a/core/modules/views_ui/lib/Drupal/views_ui/Tests/DisplayExtenderUITest.php b/core/modules/views_ui/lib/Drupal/views_ui/Tests/DisplayExtenderUITest.php
index 85e23b9..c04f8a5 100644
--- a/core/modules/views_ui/lib/Drupal/views_ui/Tests/DisplayExtenderUITest.php
+++ b/core/modules/views_ui/lib/Drupal/views_ui/Tests/DisplayExtenderUITest.php
@@ -31,7 +31,7 @@ class DisplayExtenderUITest extends UITestBase {
* Tests the display extender UI.
*/
public function testDisplayExtenderUI() {
- config('views.settings')->set('display_extenders', array('display_extender_test'))->save();
+ \Drupal::config('views.settings')->set('display_extenders', array('display_extender_test'))->save();
$view = views_get_view('test_view');
$view_edit_url = "admin/structure/views/view/{$view->storage->id()}/edit";
diff --git a/core/modules/views_ui/lib/Drupal/views_ui/Tests/DisplayTest.php b/core/modules/views_ui/lib/Drupal/views_ui/Tests/DisplayTest.php
index 11bc5e3..7d827f9 100644
--- a/core/modules/views_ui/lib/Drupal/views_ui/Tests/DisplayTest.php
+++ b/core/modules/views_ui/lib/Drupal/views_ui/Tests/DisplayTest.php
@@ -96,7 +96,7 @@ class DisplayTest extends UITestBase {
*/
public function testAddDisplay() {
// Show the master display.
- config('views.settings')->set('ui.show.master_display', TRUE)->save();
+ \Drupal::config('views.settings')->set('ui.show.master_display', TRUE)->save();
$settings['page[create]'] = FALSE;
$view = $this->randomView($settings);
@@ -234,7 +234,7 @@ class DisplayTest extends UITestBase {
*/
public function testDisplayAreas() {
// Show the advanced column.
- config('views.settings')->set('ui.show.advanced_column', TRUE)->save();
+ \Drupal::config('views.settings')->set('ui.show.advanced_column', TRUE)->save();
// Add a new data display to the view.
$view = views_get_view('test_display');
diff --git a/core/modules/views_ui/lib/Drupal/views_ui/Tests/OverrideDisplaysTest.php b/core/modules/views_ui/lib/Drupal/views_ui/Tests/OverrideDisplaysTest.php
index 1dab1f6..87e52e1 100644
--- a/core/modules/views_ui/lib/Drupal/views_ui/Tests/OverrideDisplaysTest.php
+++ b/core/modules/views_ui/lib/Drupal/views_ui/Tests/OverrideDisplaysTest.php
@@ -54,7 +54,7 @@ class OverrideDisplaysTest extends UITestBase {
$this->assertText($original_title);
// Confirm that the view block is available in the block administration UI.
- $this->drupalGet('admin/structure/block/list/' . config('system.theme')->get('default') . '/add');
+ $this->drupalGet('admin/structure/block/list/' . \Drupal::config('system.theme')->get('default') . '/add');
$this->assertText('View: ' . $view['label']);
// Place the block.
@@ -112,7 +112,7 @@ class OverrideDisplaysTest extends UITestBase {
$this->assertNoText($view['block[title]']);
// Confirm that the block is available in the block administration UI.
- $this->drupalGet('admin/structure/block/list/' . config('system.theme')->get('default') . '/add');
+ $this->drupalGet('admin/structure/block/list/' . \Drupal::config('system.theme')->get('default') . '/add');
$this->assertText('View: ' . $view['label']);
// Put the block into the first sidebar region, and make sure it will not
diff --git a/core/modules/views_ui/lib/Drupal/views_ui/ViewEditFormController.php b/core/modules/views_ui/lib/Drupal/views_ui/ViewEditFormController.php
index 7fa64d6..6048d35 100644
--- a/core/modules/views_ui/lib/Drupal/views_ui/ViewEditFormController.php
+++ b/core/modules/views_ui/lib/Drupal/views_ui/ViewEditFormController.php
@@ -95,7 +95,7 @@ class ViewEditFormController extends ViewFormControllerBase implements EntityCon
$form['#attached']['library'][] = array('system', 'drupal.states');
$form['#attached']['library'][] = array('system', 'drupal.tabledrag');
- if (!config('views.settings')->get('no_javascript')) {
+ if (!\Drupal::config('views.settings')->get('no_javascript')) {
$form['#attached']['library'][] = array('views_ui', 'views_ui.admin');
}
@@ -509,7 +509,7 @@ class ViewEditFormController extends ViewFormControllerBase implements EntityCon
);
// Collapse the details by default.
- if (config('views.settings')->get('ui.show.advanced_column')) {
+ if (\Drupal::config('views.settings')->get('ui.show.advanced_column')) {
$build['columns']['third']['#collapsed'] = FALSE;
}
diff --git a/core/modules/views_ui/lib/Drupal/views_ui/ViewFormControllerBase.php b/core/modules/views_ui/lib/Drupal/views_ui/ViewFormControllerBase.php
index 0543082..5150273 100644
--- a/core/modules/views_ui/lib/Drupal/views_ui/ViewFormControllerBase.php
+++ b/core/modules/views_ui/lib/Drupal/views_ui/ViewFormControllerBase.php
@@ -157,7 +157,7 @@ abstract class ViewFormControllerBase extends EntityFormController {
*/
public function isDefaultDisplayShown(ViewUI $view) {
// Always show the default display for advanced users who prefer that mode.
- $advanced_mode = config('views.settings')->get('ui.show.master_display');
+ $advanced_mode = \Drupal::config('views.settings')->get('ui.show.master_display');
// For other users, show the default display only if there are no others, and
// hide it if there's at least one "real" display.
$additional_displays = (count($view->getExecutable()->displayHandlers) == 1);
diff --git a/core/modules/views_ui/lib/Drupal/views_ui/ViewPreviewFormController.php b/core/modules/views_ui/lib/Drupal/views_ui/ViewPreviewFormController.php
index fb292fa..de4bd60 100644
--- a/core/modules/views_ui/lib/Drupal/views_ui/ViewPreviewFormController.php
+++ b/core/modules/views_ui/lib/Drupal/views_ui/ViewPreviewFormController.php
@@ -73,7 +73,7 @@ class ViewPreviewFormController extends ViewFormControllerBase implements Entity
'#type' => 'checkbox',
'#id' => 'edit-displays-live-preview',
'#title' => t('Auto preview'),
- '#default_value' => config('views.settings')->get('ui.always_live_preview'),
+ '#default_value' => \Drupal::config('views.settings')->get('ui.always_live_preview'),
);
// Add the arguments textfield
diff --git a/core/modules/views_ui/lib/Drupal/views_ui/ViewUI.php b/core/modules/views_ui/lib/Drupal/views_ui/ViewUI.php
index 7bae956..7af391a 100644
--- a/core/modules/views_ui/lib/Drupal/views_ui/ViewUI.php
+++ b/core/modules/views_ui/lib/Drupal/views_ui/ViewUI.php
@@ -519,7 +519,7 @@ class ViewUI implements ViewStorageInterface {
$old_q = current_path();
// Determine where the query and performance statistics should be output.
- $config = config('views.settings');
+ $config = \Drupal::config('views.settings');
$show_query = $config->get('ui.show.sql_query.enabled');
$show_info = $config->get('ui.show.preview_information');
$show_location = $config->get('ui.show.sql_query.where');
diff --git a/core/modules/views_ui/views_ui.theme.inc b/core/modules/views_ui/views_ui.theme.inc
index 30286bd..a3e2d1b 100644
--- a/core/modules/views_ui/views_ui.theme.inc
+++ b/core/modules/views_ui/views_ui.theme.inc
@@ -180,7 +180,7 @@ function theme_views_ui_build_group_filter_form($variables) {
drupal_render($form['default_group']['All']),
'',
array(
- 'data' => config('views.settings')->get('ui.exposed_filter_any_label') == 'old_any' ? t('&lt;Any&gt;') : t('- Any -'),
+ 'data' => Drupal::config('views.settings')->get('ui.exposed_filter_any_label') == 'old_any' ? t('&lt;Any&gt;') : t('- Any -'),
'colspan' => 4,
'class' => array('class' => 'any-default-radios-row'),
),
diff --git a/core/profiles/minimal/minimal.install b/core/profiles/minimal/minimal.install
index 9666b25..cdc4a18 100644
--- a/core/profiles/minimal/minimal.install
+++ b/core/profiles/minimal/minimal.install
@@ -16,7 +16,7 @@ function minimal_install() {
Drupal::config('system.theme.global')->set('features.node_user_picture', FALSE)->save();
// Allow visitor account creation, but with administrative approval.
- config('user.settings')->set('register', USER_REGISTER_VISITORS_ADMINISTRATIVE_APPROVAL)->save();
+ Drupal::config('user.settings')->set('register', USER_REGISTER_VISITORS_ADMINISTRATIVE_APPROVAL)->save();
// Enable default permissions for system roles.
user_role_grant_permissions(DRUPAL_ANONYMOUS_RID, array('access content'));
diff --git a/core/profiles/standard/standard.install b/core/profiles/standard/standard.install
index f74841e..a80beaa 100644
--- a/core/profiles/standard/standard.install
+++ b/core/profiles/standard/standard.install
@@ -15,20 +15,20 @@ function standard_install() {
// Enable Bartik theme and set it as default theme instead of Stark.
// @see system_install()
$default_theme = 'bartik';
- config('system.theme')
+ Drupal::config('system.theme')
->set('default', $default_theme)
->save();
theme_enable(array($default_theme));
theme_disable(array('stark'));
// Set front page to "node".
- config('system.site')->set('page.front', 'node')->save();
+ Drupal::config('system.site')->set('page.front', 'node')->save();
// Default "Basic page" to have comments disabled.
variable_set('comment_page', COMMENT_NODE_HIDDEN);
// Allow visitor account creation with administrative approval.
- $user_settings = config('user.settings');
+ $user_settings = Drupal::config('user.settings');
$user_settings->set('register', USER_REGISTER_VISITORS_ADMINISTRATIVE_APPROVAL)->save();
// Create user picture field.
@@ -84,6 +84,6 @@ function standard_install() {
// Enable the admin theme.
theme_enable(array('seven'));
- config('system.theme')->set('admin', 'seven')->save();
+ Drupal::config('system.theme')->set('admin', 'seven')->save();
variable_set('node_admin_theme', '1');
}
diff --git a/core/themes/bartik/bartik.theme b/core/themes/bartik/bartik.theme
index 8f44e34..ed59e8d 100644
--- a/core/themes/bartik/bartik.theme
+++ b/core/themes/bartik/bartik.theme
@@ -43,7 +43,7 @@ function bartik_preprocess_page(&$variables) {
$variables['secondary_menu']['#attributes']['class'] = array('links', 'inline', 'clearfix');
}
- $site_config = config('system.site');
+ $site_config = Drupal::config('system.site');
// Always print the site name and slogan, but if they are toggled off, we'll
// just hide them visually.
$variables['hide_site_name'] = theme_get_setting('features.name') ? FALSE : TRUE;
@@ -87,7 +87,7 @@ function bartik_preprocess_maintenance_page(&$variables) {
drupal_add_css(drupal_get_path('theme', 'bartik') . '/css/maintenance-page.css');
$variables['styles'] = drupal_get_css();
- $site_config = config('system.site');
+ $site_config = Drupal::config('system.site');
// Always print the site name and slogan, but if they are toggled off, we'll
// just hide them visually.
$variables['hide_site_name'] = theme_get_setting('features.name') ? FALSE : TRUE;