diff --git a/core/includes/bootstrap.inc b/core/includes/bootstrap.inc index c29dfcc..2d66a5c 100644 --- a/core/includes/bootstrap.inc +++ b/core/includes/bootstrap.inc @@ -29,16 +29,6 @@ */ /** - * The current system version. - */ -const VERSION = '8.0-dev'; - -/** - * Core API compatibility. - */ -const DRUPAL_CORE_COMPATIBILITY = '8.x'; - -/** * Minimum supported version of PHP. */ const DRUPAL_MINIMUM_PHP = '5.3.10'; diff --git a/core/includes/common.inc b/core/includes/common.inc index d6886f2..5f08170 100644 --- a/core/includes/common.inc +++ b/core/includes/common.inc @@ -354,7 +354,7 @@ function _drupal_default_html_head() { ); // Show Drupal and the major version number in the META GENERATOR tag. // Get the major version. - list($version, ) = explode('.', VERSION); + list($version, ) = explode('.', Drupal::VERSION); $elements['system_meta_generator'] = array( '#type' => 'html_tag', '#tag' => 'meta', @@ -4614,7 +4614,7 @@ function drupal_parse_info_file($filename) { $parser = new Parser(); $info[$filename] = $parser->parse(file_get_contents($filename)); if (isset($info[$filename]['version']) && $info[$filename]['version'] === 'VERSION') { - $info[$filename]['version'] = VERSION; + $info[$filename]['version'] = Drupal::VERSION; } } } diff --git a/core/includes/install.core.inc b/core/includes/install.core.inc index 8e4b66e..2235997 100644 --- a/core/includes/install.core.inc +++ b/core/includes/install.core.inc @@ -1689,8 +1689,8 @@ function install_check_localization_server($uri) { * Associative array containing 'core' and 'version' of the release. */ function install_get_localization_release() { - if (strpos(VERSION, 'dev')) { - list($version, ) = explode('-', VERSION); + if (strpos(Drupal::VERSION, 'dev')) { + list($version, ) = explode('-', Drupal::VERSION); list($major, $minor) = explode('.', $version); // Calculate the major and minor release numbers to fall back to. @@ -1704,7 +1704,7 @@ function install_get_localization_release() { $release = "$major.$minor"; } else { - $release = VERSION; + $release = Drupal::VERSION; } return array( diff --git a/core/includes/update.inc b/core/includes/update.inc index 5e8ff4e..18df6b2 100644 --- a/core/includes/update.inc +++ b/core/includes/update.inc @@ -72,7 +72,7 @@ function update_check_incompatibility($name, $type = 'module') { } if (!isset($file) || !isset($file->info['core']) - || $file->info['core'] != DRUPAL_CORE_COMPATIBILITY + || $file->info['core'] != Drupal::CORE_COMPATIBILITY || version_compare(phpversion(), $file->info['php']) < 0) { return TRUE; } diff --git a/core/lib/Drupal.php b/core/lib/Drupal.php index 8315e73..c8617dd 100644 --- a/core/lib/Drupal.php +++ b/core/lib/Drupal.php @@ -77,6 +77,16 @@ class Drupal { /** + * The current system version. + */ + const VERSION = '8.0-dev'; + + /** + * Core API compatibility. + */ + const CORE_COMPATIBILITY = '8.x'; + + /** * The currently active container object. * * @var \Symfony\Component\DependencyInjection\ContainerInterface diff --git a/core/lib/Drupal/Core/Extension/ModuleHandler.php b/core/lib/Drupal/Core/Extension/ModuleHandler.php index b9e5724..3ac1d89 100644 --- a/core/lib/Drupal/Core/Extension/ModuleHandler.php +++ b/core/lib/Drupal/Core/Extension/ModuleHandler.php @@ -464,7 +464,7 @@ protected function parseDependency($dependency) { // supports. Also, op is optional and defaults to equals. $p_op = '(?!=|==|=|<|<=|>|>=|<>)?'; // Core version is always optional: 8.x-2.x and 2.x is treated the same. - $p_core = '(?:' . preg_quote(DRUPAL_CORE_COMPATIBILITY) . '-)?'; + $p_core = '(?:' . preg_quote(\Drupal::CORE_COMPATIBILITY) . '-)?'; $p_major = '(?\d+)'; // By setting the minor version to x, branches can be matched. $p_minor = '(?(?:\d+|x)(?:-[A-Za-z]+\d+)?)'; diff --git a/core/lib/Drupal/Core/SystemListingInfo.php b/core/lib/Drupal/Core/SystemListingInfo.php index 3c34a5e..714365b 100644 --- a/core/lib/Drupal/Core/SystemListingInfo.php +++ b/core/lib/Drupal/Core/SystemListingInfo.php @@ -61,7 +61,7 @@ protected function process(array $files, array $files_to_add) { // If the module or theme is incompatible with Drupal core, remove it // from the array for the current search directory, so it is not // overwritten when merged with the $files array. - if (isset($info['core']) && $info['core'] != DRUPAL_CORE_COMPATIBILITY) { + if (isset($info['core']) && $info['core'] != \Drupal::CORE_COMPATIBILITY) { unset($files_to_add[$file_key]); } } diff --git a/core/modules/block/block.module b/core/modules/block/block.module index a08254a..250be1c 100644 --- a/core/modules/block/block.module +++ b/core/modules/block/block.module @@ -622,7 +622,7 @@ function block_language_delete($language) { function block_library_info() { $libraries['drupal.block'] = array( 'title' => 'Block', - 'version' => VERSION, + 'version' => Drupal::VERSION, 'js' => array( drupal_get_path('module', 'block') . '/block.js' => array(), ), @@ -633,7 +633,7 @@ function block_library_info() { ); $libraries['drupal.block.admin'] = array( 'title' => 'Block admin', - 'version' => VERSION, + 'version' => Drupal::VERSION, 'js' => array( drupal_get_path('module', 'block') . '/js/block.admin.js' => array(), ), diff --git a/core/modules/book/book.module b/core/modules/book/book.module index 22b9ea9..74b1986 100644 --- a/core/modules/book/book.module +++ b/core/modules/book/book.module @@ -1281,7 +1281,7 @@ function book_menu_subtree_data($link) { function book_library_info() { $libraries['drupal.book'] = array( 'title' => 'Book', - 'version' => VERSION, + 'version' => Drupal::VERSION, 'js' => array( drupal_get_path('module', 'book') . '/book.js' => array(), ), diff --git a/core/modules/ckeditor/ckeditor.module b/core/modules/ckeditor/ckeditor.module index 7813581..79c5f3d 100644 --- a/core/modules/ckeditor/ckeditor.module +++ b/core/modules/ckeditor/ckeditor.module @@ -42,7 +42,7 @@ function ckeditor_library_info() { ); $libraries['drupal.ckeditor'] = array( 'title' => 'Drupal behavior to enable CKEditor on textareas.', - 'version' => VERSION, + 'version' => Drupal::VERSION, 'js' => array( $module_path . '/js/ckeditor.js' => array(), array('data' => $settings, 'type' => 'setting'), @@ -58,7 +58,7 @@ function ckeditor_library_info() { ); $libraries['drupal.ckeditor.admin'] = array( 'title' => 'Drupal behavior for drag-and-drop CKEditor toolbar builder UI.', - 'version' => VERSION, + 'version' => Drupal::VERSION, 'js' => array( $module_path . '/js/ckeditor.admin.js' => array(), ), @@ -81,7 +81,7 @@ function ckeditor_library_info() { ); $libraries['drupal.ckeditor.drupalimage.admin'] = array( 'title' => 'Only show the "drupalimage" plugin settings when its button is enabled.', - 'version' => VERSION, + 'version' => Drupal::VERSION, 'js' => array( $module_path . '/js/ckeditor.drupalimage.admin.js' => array(), ), @@ -95,7 +95,7 @@ function ckeditor_library_info() { ); $libraries['drupal.ckeditor.stylescombo.admin'] = array( 'title' => 'Only show the "stylescombo" plugin settings when its button is enabled.', - 'version' => VERSION, + 'version' => Drupal::VERSION, 'js' => array( $module_path . '/js/ckeditor.stylescombo.admin.js' => array(), ), diff --git a/core/modules/color/color.module b/core/modules/color/color.module index 233c5c5..17adfb7 100644 --- a/core/modules/color/color.module +++ b/core/modules/color/color.module @@ -740,7 +740,7 @@ function _color_rgb2hsl($rgb) { function color_library_info() { $libraries['drupal.color'] = array( 'title' => 'Color', - 'version' => VERSION, + 'version' => Drupal::VERSION, 'js' => array( drupal_get_path('module', 'color') . '/color.js' => array(), ), @@ -754,7 +754,7 @@ function color_library_info() { ); $libraries['drupal.color.preview'] = array( 'title' => 'Color preview', - 'version' => VERSION, + 'version' => Drupal::VERSION, 'js' => array( drupal_get_path('module', 'color') . '/preview.js' => array(), ), diff --git a/core/modules/comment/comment.module b/core/modules/comment/comment.module index 32404be..973bccb 100644 --- a/core/modules/comment/comment.module +++ b/core/modules/comment/comment.module @@ -1782,7 +1782,7 @@ function comment_file_download_access($field, EntityInterface $entity, File $fil function comment_library_info() { $libraries['drupal.comment'] = array( 'title' => 'Comment', - 'version' => VERSION, + 'version' => Drupal::VERSION, 'js' => array( drupal_get_path('module', 'comment') . '/comment-node-form.js' => array(), ), diff --git a/core/modules/content_translation/content_translation.module b/core/modules/content_translation/content_translation.module index 3edb6aa..3ced188 100644 --- a/core/modules/content_translation/content_translation.module +++ b/core/modules/content_translation/content_translation.module @@ -356,7 +356,7 @@ function content_translation_library_info() { $path = drupal_get_path('module', 'content_translation'); $libraries['drupal.content_translation.admin'] = array( 'title' => 'Content translation UI', - 'version' => VERSION, + 'version' => Drupal::VERSION, 'js' => array( $path . '/content_translation.admin.js' => array(), ), diff --git a/core/modules/contextual/contextual.module b/core/modules/contextual/contextual.module index 392554e..925ad9d 100644 --- a/core/modules/contextual/contextual.module +++ b/core/modules/contextual/contextual.module @@ -108,7 +108,7 @@ function contextual_library_info() { $libraries['drupal.contextual-links'] = array( 'title' => 'Contextual Links', 'website' => 'http://drupal.org/node/473268', - 'version' => VERSION, + 'version' => Drupal::VERSION, 'js' => array( // Add the JavaScript, with a group and weight such that it will run // before modules/contextual/js/contextual.toolbar.js. @@ -130,7 +130,7 @@ function contextual_library_info() { ); $libraries['drupal.contextual-toolbar'] = array( 'title' => 'Contextual Links Toolbar Tab', - 'version' => VERSION, + 'version' => Drupal::VERSION, 'js' => array( // Add the JavaScript, with a group and weight such that it will run // before modules/overlay/overlay-parent.js. diff --git a/core/modules/edit/edit.module b/core/modules/edit/edit.module index 071073c..4973463 100644 --- a/core/modules/edit/edit.module +++ b/core/modules/edit/edit.module @@ -77,7 +77,7 @@ function edit_library_info() { ); $libraries['edit'] = array( 'title' => 'Edit: in-place editing', - 'version' => VERSION, + 'version' => Drupal::VERSION, 'js' => array( // Core. $path . '/js/edit.js' => $options, @@ -119,7 +119,7 @@ function edit_library_info() { ); $libraries['edit.editorWidget.form'] = array( 'title' => 'Form in-place editor', - 'version' => VERSION, + 'version' => Drupal::VERSION, 'js' => array( $path . '/js/editors/formEditor.js' => $options, ), @@ -129,7 +129,7 @@ function edit_library_info() { ); $libraries['edit.editorWidget.direct'] = array( 'title' => 'Direct in-place editor', - 'version' => VERSION, + 'version' => Drupal::VERSION, 'js' => array( $path . '/js/editors/directEditor.js' => $options, ), diff --git a/core/modules/edit/lib/Drupal/edit/Tests/EditLoadingTest.php b/core/modules/edit/lib/Drupal/edit/Tests/EditLoadingTest.php index 7b01ade..d3e474c 100644 --- a/core/modules/edit/lib/Drupal/edit/Tests/EditLoadingTest.php +++ b/core/modules/edit/lib/Drupal/edit/Tests/EditLoadingTest.php @@ -165,7 +165,7 @@ function testUserWithPermission() { $this->assertIdentical('settings', $ajax_commands[0]['command'], 'The first AJAX command is a settings command.'); // Second command: insert libraries into DOM. $this->assertIdentical('insert', $ajax_commands[1]['command'], 'The second AJAX command is an append command.'); - $command = new AppendCommand('body', '' . "\n"); + $command = new AppendCommand('body', '' . "\n"); $this->assertIdentical($command->render(), $ajax_commands[1], 'The append command contains the expected data.'); // Retrieving the form for this field should result in a 200 response, diff --git a/core/modules/editor/editor.module b/core/modules/editor/editor.module index fd95b0f..229af20 100644 --- a/core/modules/editor/editor.module +++ b/core/modules/editor/editor.module @@ -71,7 +71,7 @@ function editor_library_info() { $libraries['drupal.editor.admin'] = array( 'title' => 'Text Editor', - 'version' => VERSION, + 'version' => Drupal::VERSION, 'js' => array( $path . '/js/editor.admin.js' => array(), ), @@ -82,7 +82,7 @@ function editor_library_info() { ); $libraries['drupal.editor'] = array( 'title' => 'Text Editor', - 'version' => VERSION, + 'version' => Drupal::VERSION, 'js' => array( $path . '/js/editor.js' => array(), ), @@ -99,7 +99,7 @@ function editor_library_info() { $libraries['drupal.editor.dialog'] = array( 'title' => 'Text Editor Dialog', - 'version' => VERSION, + 'version' => Drupal::VERSION, 'js' => array( $path . '/js/editor.dialog.js' => array('weight' => 2), ), @@ -113,7 +113,7 @@ function editor_library_info() { $libraries['edit.formattedTextEditor.editor'] = array( 'title' => 'Formatted text editor', - 'version' => VERSION, + 'version' => Drupal::VERSION, 'js' => array( $path . '/js/editor.formattedTextEditor.js' => array( 'scope' => 'footer', diff --git a/core/modules/field_ui/field_ui.module b/core/modules/field_ui/field_ui.module index 51d755e..18a631e 100644 --- a/core/modules/field_ui/field_ui.module +++ b/core/modules/field_ui/field_ui.module @@ -349,7 +349,7 @@ function field_ui_form_node_type_form_submit($form, &$form_state) { function field_ui_library_info() { $libraries['drupal.field_ui'] = array( 'title' => 'Field UI', - 'version' => VERSION, + 'version' => Drupal::VERSION, 'js' => array( drupal_get_path('module', 'field_ui') . '/field_ui.js' => array(), ), diff --git a/core/modules/file/file.module b/core/modules/file/file.module index 538d121..662fd16 100644 --- a/core/modules/file/file.module +++ b/core/modules/file/file.module @@ -1922,7 +1922,7 @@ function file_get_file_references(File $file, $field = NULL, $age = FIELD_LOAD_R function file_library_info() { $libraries['drupal.file'] = array( 'title' => 'File', - 'version' => VERSION, + 'version' => Drupal::VERSION, 'js' => array( drupal_get_path('module', 'file') . '/file.js' => array(), ), diff --git a/core/modules/filter/filter.module b/core/modules/filter/filter.module index 8b5f3a5..732acf4 100644 --- a/core/modules/filter/filter.module +++ b/core/modules/filter/filter.module @@ -1456,7 +1456,7 @@ function filter_library_info() { $libraries['drupal.filter.admin'] = array( 'title' => 'Filter', - 'version' => VERSION, + 'version' => Drupal::VERSION, 'js' => array( $path . '/filter.admin.js' => array(), ), @@ -1472,7 +1472,7 @@ function filter_library_info() { ); $libraries['drupal.filter.filter_html.admin'] = array( 'title' => 'Automatic "Limit allowed HTML tags" filter setting updating.', - 'version' => VERSION, + 'version' => Drupal::VERSION, 'js' => array( $path . '/filter.filter_html.admin.js' => array(), ), @@ -1484,7 +1484,7 @@ function filter_library_info() { ); $libraries['drupal.filter'] = array( 'title' => 'Filter', - 'version' => VERSION, + 'version' => Drupal::VERSION, 'js' => array( $path . '/filter.js' => array(), ), @@ -1499,7 +1499,7 @@ function filter_library_info() { ); $libraries['caption'] = array( 'title' => 'Captions for images and alignments', - 'version' => VERSION, + 'version' => Drupal::VERSION, 'css' => array( $path . '/css/filter.caption.css', ), diff --git a/core/modules/language/language.module b/core/modules/language/language.module index f092c86..2dd5e57 100644 --- a/core/modules/language/language.module +++ b/core/modules/language/language.module @@ -584,7 +584,7 @@ function language_delete($langcode) { function language_library_info() { $libraries['language.admin'] = array( 'title' => 'Language detection admin', - 'version' => VERSION, + 'version' => Drupal::VERSION, 'js' => array( drupal_get_path('module', 'language') . '/language.admin.js' => array(), ), diff --git a/core/modules/locale/lib/Drupal/locale/LocaleLookup.php b/core/modules/locale/lib/Drupal/locale/LocaleLookup.php index 6881092..8603f67 100644 --- a/core/modules/locale/lib/Drupal/locale/LocaleLookup.php +++ b/core/modules/locale/lib/Drupal/locale/LocaleLookup.php @@ -97,7 +97,7 @@ protected function resolveCacheMiss($offset) { $this->stringStorage->createString(array( 'source' => $offset, 'context' => $this->context, - 'version' => VERSION + 'version' => \Drupal::VERSION ))->addLocation('path', request_uri())->save(); $value = TRUE; } diff --git a/core/modules/locale/lib/Drupal/locale/StringDatabaseStorage.php b/core/modules/locale/lib/Drupal/locale/StringDatabaseStorage.php index 4860819..b1c5571 100644 --- a/core/modules/locale/lib/Drupal/locale/StringDatabaseStorage.php +++ b/core/modules/locale/lib/Drupal/locale/StringDatabaseStorage.php @@ -83,7 +83,7 @@ public function findTranslation(array $conditions) { if (!empty($values)) { $string = new TranslationString($values); - $this->checkVersion($string, VERSION); + $this->checkVersion($string, \Drupal::VERSION); $string->setStorage($this); return $string; } @@ -156,7 +156,7 @@ protected function updateLocation($string) { // This is a new location to add, take care not to duplicate. $this->connection->merge('locales_location', $this->options) ->key(array('sid' => $string->getId(), 'type' => $type, 'name' => $name)) - ->fields(array('version' => VERSION)) + ->fields(array('version' => \Drupal::VERSION)) ->execute(); $created = TRUE; } @@ -165,7 +165,7 @@ protected function updateLocation($string) { } if ($created) { // As we've set a new location, check string version too. - $this->checkVersion($string, VERSION); + $this->checkVersion($string, \Drupal::VERSION); } } } diff --git a/core/modules/locale/lib/Drupal/locale/Tests/LocaleStringTest.php b/core/modules/locale/lib/Drupal/locale/Tests/LocaleStringTest.php index 26b8080..caf19ce 100644 --- a/core/modules/locale/lib/Drupal/locale/Tests/LocaleStringTest.php +++ b/core/modules/locale/lib/Drupal/locale/Tests/LocaleStringTest.php @@ -73,7 +73,7 @@ function testStringCRUDAPI() { // Check version handling and updating. $this->assertEqual($source->version, 'none', 'String originally created without version.'); $string = $this->storage->findTranslation(array('lid' => $source->lid)); - $this->assertEqual($string->version, VERSION, 'Checked and updated string version to Drupal version.'); + $this->assertEqual($string->version, \Drupal::VERSION, 'Checked and updated string version to Drupal version.'); // Create translation and find it by lid and source. $langcode = 'es'; diff --git a/core/modules/locale/locale.compare.inc b/core/modules/locale/locale.compare.inc index ed4664d..db2918f 100644 --- a/core/modules/locale/locale.compare.inc +++ b/core/modules/locale/locale.compare.inc @@ -92,7 +92,7 @@ function locale_translation_build_projects() { // For every project store information. $data += array( 'version' => isset($data['info']['version']) ? $data['info']['version'] : '', - 'core' => isset($data['info']['core']) ? $data['info']['core'] : DRUPAL_CORE_COMPATIBILITY, + 'core' => isset($data['info']['core']) ? $data['info']['core'] : Drupal::CORE_COMPATIBILITY, // A project can provide the path and filename pattern to download the // gettext file. Use the default if not. 'server_pattern' => isset($data['info']['interface translation server pattern']) && $data['info']['interface translation server pattern'] ? $data['info']['interface translation server pattern'] : $default_server['pattern'], diff --git a/core/modules/locale/locale.module b/core/modules/locale/locale.module index 9819f18..8c233d5 100644 --- a/core/modules/locale/locale.module +++ b/core/modules/locale/locale.module @@ -652,7 +652,7 @@ function locale_js_alter(&$javascript) { function locale_library_info() { $libraries['drupal.locale.admin'] = array( 'title' => 'Locale', - 'version' => VERSION, + 'version' => Drupal::VERSION, 'js' => array( drupal_get_path('module', 'locale') . '/locale.admin.js' => array(), ), @@ -664,7 +664,7 @@ function locale_library_info() { ); $libraries['drupal.locale.datepicker'] = array( 'title' => 'Locale Datepicker UI', - 'version' => VERSION, + 'version' => Drupal::VERSION, 'js' => array( drupal_get_path('module', 'locale') . '/locale.datepicker.js' => array(), ), diff --git a/core/modules/menu/menu.module b/core/modules/menu/menu.module index 4906043..f564f33 100644 --- a/core/modules/menu/menu.module +++ b/core/modules/menu/menu.module @@ -711,7 +711,7 @@ function menu_preprocess_block(&$variables) { function menu_library_info() { $libraries['drupal.menu'] = array( 'title' => 'Menu', - 'version' => VERSION, + 'version' => Drupal::VERSION, 'js' => array( drupal_get_path('module', 'menu') . '/menu.js' => array(), ), @@ -723,7 +723,7 @@ function menu_library_info() { ); $libraries['drupal.menu.admin'] = array( 'title' => 'Menu admin', - 'version' => VERSION, + 'version' => Drupal::VERSION, 'js' => array( drupal_get_path('module', 'menu') . '/menu.admin.js' => array(), ), diff --git a/core/modules/node/node.module b/core/modules/node/node.module index 6d3708d..10b6d77 100644 --- a/core/modules/node/node.module +++ b/core/modules/node/node.module @@ -2505,7 +2505,7 @@ function node_language_delete($language) { function node_library_info() { $libraries['drupal.node'] = array( 'title' => 'Node', - 'version' => VERSION, + 'version' => Drupal::VERSION, 'js' => array( drupal_get_path('module', 'node') . '/node.js' => array(), ), @@ -2518,7 +2518,7 @@ function node_library_info() { ); $libraries['drupal.node.preview'] = array( 'title' => 'Node preview', - 'version' => VERSION, + 'version' => Drupal::VERSION, 'js' => array( drupal_get_path('module', 'node') . '/node.preview.js' => array(), ), @@ -2529,7 +2529,7 @@ function node_library_info() { ); $libraries['drupal.content_types'] = array( 'title' => 'Content types', - 'version' => VERSION, + 'version' => Drupal::VERSION, 'js' => array( drupal_get_path('module', 'node') . '/content_types.js' => array(), ), diff --git a/core/modules/path/path.module b/core/modules/path/path.module index e6a1063..a6d7fbd 100644 --- a/core/modules/path/path.module +++ b/core/modules/path/path.module @@ -288,7 +288,7 @@ function path_entity_predelete(EntityInterface $entity) { function path_library_info() { $libraries['drupal.path'] = array( 'title' => 'Path', - 'version' => VERSION, + 'version' => Drupal::VERSION, 'js' => array( drupal_get_path('module', 'path') . '/path.js' => array(), ), diff --git a/core/modules/picture/picture.module b/core/modules/picture/picture.module index 07e616a..d2474d1 100644 --- a/core/modules/picture/picture.module +++ b/core/modules/picture/picture.module @@ -87,7 +87,7 @@ function picture_library_info() { $libraries['picturefill'] = array( 'title' => t('Picturefill'), 'website' => 'http://drupal.org/node/1775530', - 'version' => VERSION, + 'version' => Drupal::VERSION, 'js' => array( drupal_get_path('module', 'picture') . '/picturefill/picturefill.js' => array('type' => 'file', 'weight' => -10, 'group' => JS_DEFAULT), ), diff --git a/core/modules/shortcut/shortcut.module b/core/modules/shortcut/shortcut.module index 87414f0..15249fd 100644 --- a/core/modules/shortcut/shortcut.module +++ b/core/modules/shortcut/shortcut.module @@ -563,7 +563,7 @@ function shortcut_library_info() { $path = drupal_get_path('module', 'shortcut'); $libraries['drupal.shortcut.admin'] = array( 'title' => 'Shortcut configuration', - 'version' => VERSION, + 'version' => Drupal::VERSION, 'js' => array( $path . '/shortcut.admin.js' => array(), ), @@ -574,7 +574,7 @@ function shortcut_library_info() { ); $libraries['drupal.shortcut'] = array( 'title' => 'Shortcut UI', - 'version' => VERSION, + 'version' => Drupal::VERSION, 'css' => array( $path . '/css/shortcut.module.css' => array(), $path . '/css/shortcut.theme.css' => array(), diff --git a/core/modules/simpletest/simpletest.module b/core/modules/simpletest/simpletest.module index 92a9886..8d441f4 100644 --- a/core/modules/simpletest/simpletest.module +++ b/core/modules/simpletest/simpletest.module @@ -686,7 +686,7 @@ function simpletest_mail_alter(&$message) { function simpletest_library_info() { $libraries['drupal.simpletest'] = array( 'title' => 'Simpletest', - 'version' => VERSION, + 'version' => Drupal::VERSION, 'js' => array( drupal_get_path('module', 'simpletest') . '/simpletest.js' => array(), ), diff --git a/core/modules/statistics/statistics.module b/core/modules/statistics/statistics.module index 81e1fd9..853d139 100644 --- a/core/modules/statistics/statistics.module +++ b/core/modules/statistics/statistics.module @@ -251,7 +251,7 @@ function statistics_preprocess_block(&$variables) { function statistics_library_info() { $libraries['drupal.statistics'] = array( 'title' => 'Statistics', - 'version' => VERSION, + 'version' => Drupal::VERSION, 'js' => array( drupal_get_path('module', 'statistics') . '/statistics.js' => array( 'scope' => 'footer' diff --git a/core/modules/system/lib/Drupal/system/Form/ModulesListForm.php b/core/modules/system/lib/Drupal/system/Form/ModulesListForm.php index 32d8db7..ffe1253 100644 --- a/core/modules/system/lib/Drupal/system/Form/ModulesListForm.php +++ b/core/modules/system/lib/Drupal/system/Form/ModulesListForm.php @@ -222,10 +222,10 @@ protected function buildRow(array $modules, $module, $distribution) { $status = ''; // Check the core compatibility. - if ($module->info['core'] != DRUPAL_CORE_COMPATIBILITY) { + if ($module->info['core'] != \Drupal::CORE_COMPATIBILITY) { $compatible = FALSE; $status .= $this->t('This version is not compatible with Drupal !core_version and should be replaced.', array( - '!core_version' => DRUPAL_CORE_COMPATIBILITY, + '!core_version' => \Drupal::CORE_COMPATIBILITY, )); } @@ -259,7 +259,7 @@ protected function buildRow(array $modules, $module, $distribution) { $name = $modules[$dependency]->info['name']; // Disable the module's checkbox if it is incompatible with the // dependency's version. - if ($incompatible_version = drupal_check_incompatibility($version, str_replace(DRUPAL_CORE_COMPATIBILITY . '-', '', $modules[$dependency]->info['version']))) { + if ($incompatible_version = drupal_check_incompatibility($version, str_replace(\Drupal::CORE_COMPATIBILITY . '-', '', $modules[$dependency]->info['version']))) { $row['#requires'][$dependency] = $this->t('@module (incompatible with version @version)', array( '@module' => $name . $incompatible_version, '@version' => $modules[$dependency]->info['version'], @@ -268,7 +268,7 @@ protected function buildRow(array $modules, $module, $distribution) { } // Disable the checkbox if the dependency is incompatible with this // version of Drupal core. - elseif ($modules[$dependency]->info['core'] != DRUPAL_CORE_COMPATIBILITY) { + elseif ($modules[$dependency]->info['core'] != \Drupal::CORE_COMPATIBILITY) { $row['#requires'][$dependency] = $this->t('@module (incompatible with this version of Drupal core)', array( '@module' => $name, )); diff --git a/core/modules/system/lib/Drupal/system/Tests/Common/ParseInfoFileUnitTest.php b/core/modules/system/lib/Drupal/system/Tests/Common/ParseInfoFileUnitTest.php index c02e006..00acbaf 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Common/ParseInfoFileUnitTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Common/ParseInfoFileUnitTest.php @@ -27,7 +27,7 @@ public static function getInfo() { function testParseInfoFile() { $info_values = drupal_parse_info_file(drupal_get_path('module', 'system') . '/tests/common_test_info.txt'); $this->assertEqual($info_values['simple_string'], 'A simple string', 'Simple string value was parsed correctly.', 'System'); - $this->assertEqual($info_values['version'], VERSION, 'Constant value was parsed correctly.', 'System'); + $this->assertEqual($info_values['version'], \Drupal::VERSION, 'Constant value was parsed correctly.', 'System'); $this->assertEqual($info_values['double_colon'], 'dummyClassName::', 'Value containing double-colon was parsed correctly.', 'System'); } } diff --git a/core/modules/system/lib/Drupal/system/Tests/System/AdminMetaTagTest.php b/core/modules/system/lib/Drupal/system/Tests/System/AdminMetaTagTest.php index 1b767e6..508ac2d 100644 --- a/core/modules/system/lib/Drupal/system/Tests/System/AdminMetaTagTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/System/AdminMetaTagTest.php @@ -25,7 +25,7 @@ public static function getInfo() { * Verify that the meta tag HTML is generated correctly. */ public function testMetaTag() { - list($version, ) = explode('.', VERSION); + list($version, ) = explode('.', \Drupal::VERSION); $string = ''; $this->drupalGet('node'); $this->assertRaw($string, 'Fingerprinting meta tag generated correctly.', 'System'); diff --git a/core/modules/system/system.admin.inc b/core/modules/system/system.admin.inc index df7ef6f..4a14958 100644 --- a/core/modules/system/system.admin.inc +++ b/core/modules/system/system.admin.inc @@ -77,7 +77,7 @@ function system_themes_page() { // Ensure this theme is compatible with this version of core. // Require the 'content' region to make sure the main page // content has a common place in all themes. - $theme->incompatible_core = !isset($theme->info['core']) || ($theme->info['core'] != DRUPAL_CORE_COMPATIBILITY) || (!isset($theme->info['regions']['content'])); + $theme->incompatible_core = !isset($theme->info['core']) || ($theme->info['core'] != Drupal::CORE_COMPATIBILITY) || (!isset($theme->info['regions']['content'])); $theme->incompatible_php = version_compare(phpversion(), $theme->info['php']) < 0; // Confirmed that the base theme is available. $theme->incompatible_base = (isset($theme->info['base theme']) && !isset($themes[$theme->info['base theme']])); @@ -736,7 +736,7 @@ function theme_system_themes_page($variables) { // Make sure to provide feedback on compatibility. if (!empty($theme->incompatible_core)) { - $output .= '
' . t('This version is not compatible with Drupal !core_version and should be replaced.', array('!core_version' => DRUPAL_CORE_COMPATIBILITY)) . '
'; + $output .= '
' . t('This version is not compatible with Drupal !core_version and should be replaced.', array('!core_version' => Drupal::CORE_COMPATIBILITY)) . '
'; } elseif (!empty($theme->incompatible_php)) { if (substr_count($theme->info['php'], '.') < 2) { diff --git a/core/modules/system/system.api.php b/core/modules/system/system.api.php index 49e87a0..d366e01 100644 --- a/core/modules/system/system.api.php +++ b/core/modules/system/system.api.php @@ -2277,7 +2277,7 @@ function hook_requirements($phase) { if ($phase == 'runtime') { $requirements['drupal'] = array( 'title' => t('Drupal'), - 'value' => VERSION, + 'value' => Drupal::VERSION, 'severity' => REQUIREMENT_INFO ); } diff --git a/core/modules/system/system.install b/core/modules/system/system.install index 7777e0c..9dc4b5e 100644 --- a/core/modules/system/system.install +++ b/core/modules/system/system.install @@ -22,7 +22,7 @@ function system_requirements($phase) { if ($phase == 'runtime') { $requirements['drupal'] = array( 'title' => t('Drupal'), - 'value' => VERSION, + 'value' => Drupal::VERSION, 'severity' => REQUIREMENT_INFO, 'weight' => -10, ); @@ -476,7 +476,7 @@ function system_requirements($phase) { // Check for an incompatible version. $required_file = $files[$required_module]; $required_name = $required_file->info['name']; - $version = str_replace(DRUPAL_CORE_COMPATIBILITY . '-', '', $required_file->info['version']); + $version = str_replace(Drupal::CORE_COMPATIBILITY . '-', '', $required_file->info['version']); $compatibility = drupal_check_incompatibility($requirement, $version); if ($compatibility) { $compatibility = rtrim(substr($compatibility, 2), ')'); diff --git a/core/modules/system/system.module b/core/modules/system/system.module index b0e87d8..900065c 100644 --- a/core/modules/system/system.module +++ b/core/modules/system/system.module @@ -976,7 +976,7 @@ function system_library_info() { // Drupal-specific JavaScript. $libraries['drupal'] = array( 'title' => 'Drupal', - 'version' => VERSION, + 'version' => Drupal::VERSION, 'js' => array( 'core/misc/drupal.js' => array('group' => JS_LIBRARY, 'weight' => -18), ), @@ -988,7 +988,7 @@ function system_library_info() { // Drupal settings. $libraries['drupalSettings'] = array( 'title' => 'Drupal Settings', - 'version' => VERSION, + 'version' => Drupal::VERSION, 'js' => array( array('type' => 'setting', 'data' => array()), ), @@ -998,7 +998,7 @@ function system_library_info() { $libraries['drupal.ajax'] = array( 'title' => 'Drupal AJAX', 'website' => 'http://api.drupal.org/api/group/ajax/8', - 'version' => VERSION, + 'version' => Drupal::VERSION, 'js' => array( 'core/misc/ajax.js' => array('group' => JS_LIBRARY, 'weight' => 2), ), @@ -1014,7 +1014,7 @@ function system_library_info() { // Drupal's Screen Reader change announcement utility. $libraries['drupal.announce'] = array( 'title' => 'Drupal announce', - 'version' => VERSION, + 'version' => Drupal::VERSION, 'js' => array( 'core/misc/announce.js' => array('group' => JS_LIBRARY), ), @@ -1027,7 +1027,7 @@ function system_library_info() { // Drupal's batch API. $libraries['drupal.batch'] = array( 'title' => 'Drupal batch API', - 'version' => VERSION, + 'version' => Drupal::VERSION, 'js' => array( 'core/misc/batch.js' => array('group' => JS_DEFAULT, 'cache' => FALSE), ), @@ -1044,7 +1044,7 @@ function system_library_info() { // Drupal's progress indicator. $libraries['drupal.progress'] = array( 'title' => 'Drupal progress indicator', - 'version' => VERSION, + 'version' => Drupal::VERSION, 'js' => array( 'core/misc/progress.js' => array('group' => JS_DEFAULT), ), @@ -1058,7 +1058,7 @@ function system_library_info() { // Drupal's form library. $libraries['drupal.form'] = array( 'title' => 'Drupal form library', - 'version' => VERSION, + 'version' => Drupal::VERSION, 'js' => array( 'core/misc/form.js' => array('group' => JS_LIBRARY, 'weight' => 1), ), @@ -1073,7 +1073,7 @@ function system_library_info() { // Drupal's dialog component. $libraries['drupal.dialog'] = array( 'title' => 'Drupal Dialog', - 'version' => VERSION, + 'version' => Drupal::VERSION, 'js' => array( 'core/misc/dialog.js' => array('group' => JS_LIBRARY), ), @@ -1092,7 +1092,7 @@ function system_library_info() { // Drupal's integration between AJAX and dialogs. $libraries['drupal.dialog.ajax'] = array( 'title' => 'Drupal Dialog AJAX', - 'version' => VERSION, + 'version' => Drupal::VERSION, 'js' => array( 'core/misc/dialog.ajax.js' => array('group' => JS_LIBRARY, 'weight' => 3), ), @@ -1108,7 +1108,7 @@ function system_library_info() { // Drupal's states library. $libraries['drupal.states'] = array( 'title' => 'Drupal states', - 'version' => VERSION, + 'version' => Drupal::VERSION, 'js' => array( 'core/misc/states.js' => array('group' => JS_LIBRARY, 'weight' => 1), ), @@ -1123,7 +1123,7 @@ function system_library_info() { // Drupal's tabledrag library. $libraries['drupal.tabledrag'] = array( 'title' => 'Drupal tabledrag', - 'version' => VERSION, + 'version' => Drupal::VERSION, 'js' => array( 'core/misc/tabledrag.js' => array('group' => JS_LIBRARY, 'weight' => -1), ), @@ -1140,7 +1140,7 @@ function system_library_info() { // Drupal's responsive table API. $libraries['drupal.tableresponsive'] = array( 'title' => 'Drupal responsive table API', - 'version' => VERSION, + 'version' => Drupal::VERSION, 'js' => array( 'core/misc/tableresponsive.js' => array('group' => JS_LIBRARY), ), @@ -1154,7 +1154,7 @@ function system_library_info() { // Collapsible details. $libraries['drupal.collapse'] = array( 'title' => 'Collapsible details', - 'version' => VERSION, + 'version' => Drupal::VERSION, 'js' => array( 'core/misc/collapse.js' => array('group' => JS_DEFAULT), ), @@ -1171,7 +1171,7 @@ function system_library_info() { // Drupal's autocomplete widget. $libraries['drupal.autocomplete'] = array( 'title' => 'Drupal autocomplete', - 'version' => VERSION, + 'version' => Drupal::VERSION, 'js' => array( 'core/misc/autocomplete.js' => array('group' => JS_DEFAULT), ), @@ -1187,7 +1187,7 @@ function system_library_info() { // elements like the overlay. $libraries['drupal.displace'] = array( 'title' => 'Drupal displace', - 'version' => VERSION, + 'version' => Drupal::VERSION, 'js' => array( 'core/misc/displace.js' => array('group' => JS_LIBRARY), ), @@ -1201,7 +1201,7 @@ function system_library_info() { // Manages tab orders in the document. $libraries['drupal.tabbingmanager'] = array( 'title' => 'Drupal tabbing manager', - 'version' => VERSION, + 'version' => Drupal::VERSION, 'js' => array( 'core/misc/tabbingmanager.js' => array('group' => JS_LIBRARY), ), @@ -1216,7 +1216,7 @@ function system_library_info() { // A utility function to limit calls to a function with a given time. $libraries['drupal.debounce'] = array( 'title' => 'Drupal debounce', - 'version' => VERSION, + 'version' => Drupal::VERSION, 'js' => array( 'core/misc/debounce.js' => array('group' => JS_LIBRARY), ), @@ -1330,7 +1330,7 @@ function system_library_info() { $libraries['matchmedia'] = array( 'title' => 'window.matchMedia polyfill', 'website' => 'http://drupal.org/node/1815602', - 'version' => VERSION, + 'version' => Drupal::VERSION, 'js' => array( 'core/misc/matchmedia.js' => array(), ), @@ -1401,7 +1401,7 @@ function system_library_info() { // Drupal's base CSS. $libraries['drupal.base'] = array( 'title' => 'Drupal base CSS', - 'version' => VERSION, + 'version' => Drupal::VERSION, 'css' => array( 'core/misc/drupal.base.css' => array( 'every_page' => TRUE, @@ -1901,7 +1901,7 @@ function system_library_info() { ); $libraries['drupal.tableselect'] = array( 'title' => 'Tableselect', - 'version' => VERSION, + 'version' => Drupal::VERSION, 'js' => array( 'core/misc/tableselect.js' => array(), ), @@ -1912,7 +1912,7 @@ function system_library_info() { ); $libraries['drupal.tableheader'] = array( 'title' => 'Table header', - 'version' => VERSION, + 'version' => Drupal::VERSION, 'js' => array( 'core/misc/tableheader.js' => array(), ), @@ -1926,7 +1926,7 @@ function system_library_info() { ); $libraries['drupal.timezone'] = array( 'title' => 'Timezone', - 'version' => VERSION, + 'version' => Drupal::VERSION, 'js' => array( 'core/misc/timezone.js' => array(), ), @@ -1937,7 +1937,7 @@ function system_library_info() { ); $libraries['drupal.machine-name'] = array( 'title' => 'Machine name', - 'version' => VERSION, + 'version' => Drupal::VERSION, 'js' => array( 'core/misc/machine-name.js' => array(), ), @@ -1951,7 +1951,7 @@ function system_library_info() { $libraries['drupal.system'] = array( 'title' => 'System', - 'version' => VERSION, + 'version' => Drupal::VERSION, 'js' => array( drupal_get_path('module', 'system') . '/system.js' => array(), ), @@ -1964,7 +1964,7 @@ function system_library_info() { ); $libraries['drupal.system.modules'] = array( 'title' => 'System modules', - 'version' => VERSION, + 'version' => Drupal::VERSION, 'js' => array( drupal_get_path('module', 'system') . '/system.modules.js' => array(), ), diff --git a/core/modules/taxonomy/taxonomy.module b/core/modules/taxonomy/taxonomy.module index 5769da0..fef6c40 100644 --- a/core/modules/taxonomy/taxonomy.module +++ b/core/modules/taxonomy/taxonomy.module @@ -1197,7 +1197,7 @@ function taxonomy_taxonomy_term_delete(Term $term) { function taxonomy_library_info() { $libraries['drupal.taxonomy'] = array( 'title' => 'Taxonomy', - 'version' => VERSION, + 'version' => Drupal::VERSION, 'js' => array( drupal_get_path('module', 'taxonomy') . '/taxonomy.js' => array(), ), diff --git a/core/modules/text/text.module b/core/modules/text/text.module index c1acc6e..9014113 100644 --- a/core/modules/text/text.module +++ b/core/modules/text/text.module @@ -13,7 +13,7 @@ function text_library_info() { $libraries['drupal.text'] = array( 'title' => 'Text', - 'version' => VERSION, + 'version' => Drupal::VERSION, 'js' => array( drupal_get_path('module', 'text') . '/text.js' => array(), ), diff --git a/core/modules/toolbar/toolbar.module b/core/modules/toolbar/toolbar.module index 4111dd2..43ad735 100644 --- a/core/modules/toolbar/toolbar.module +++ b/core/modules/toolbar/toolbar.module @@ -585,7 +585,7 @@ function toolbar_in_active_trail($path) { function toolbar_library_info() { $libraries['toolbar'] = array( 'title' => 'Toolbar', - 'version' => VERSION, + 'version' => Drupal::VERSION, 'js' => array( drupal_get_path('module', 'toolbar') . '/js/toolbar.js' => array(), ), @@ -609,7 +609,7 @@ function toolbar_library_info() { $libraries['toolbar.menu'] = array( 'title' => 'Toolbar nested accordion menus.', - 'version' => VERSION, + 'version' => Drupal::VERSION, 'js' => array( drupal_get_path('module', 'toolbar') . '/js/toolbar.menu.js' => array(), ), diff --git a/core/modules/tour/tour.module b/core/modules/tour/tour.module index affdc49..9f65e85 100644 --- a/core/modules/tour/tour.module +++ b/core/modules/tour/tour.module @@ -26,7 +26,7 @@ function tour_library_info() { $libraries['tour'] = array( 'title' => 'Tour', - 'version' => VERSION, + 'version' => Drupal::VERSION, 'js' => array( // Add the JavaScript, with a group and weight such that it will run // before modules/overlay/overlay-parent.js. @@ -44,7 +44,7 @@ function tour_library_info() { $libraries['tour-styling'] = array( 'title' => 'Tour', - 'version' => VERSION, + 'version' => Drupal::VERSION, 'css' => array( $path . '/css/tour.module.css' => array('media' => 'screen'), ) diff --git a/core/modules/translation/translation.module b/core/modules/translation/translation.module index 9477c84..f1d7075 100644 --- a/core/modules/translation/translation.module +++ b/core/modules/translation/translation.module @@ -594,7 +594,7 @@ function translation_language_switch_links_alter(array &$links, $type, $path) { function translation_library_info() { $libraries['drupal.translation'] = array( 'title' => 'Translation', - 'version' => VERSION, + 'version' => Drupal::VERSION, 'js' => array( drupal_get_path('module', 'translation') . '/translation.js' => array(), ), diff --git a/core/modules/update/lib/Drupal/update/Tests/UpdateCoreUnitTest.php b/core/modules/update/lib/Drupal/update/Tests/UpdateCoreUnitTest.php index ac26bd7..c682f99 100644 --- a/core/modules/update/lib/Drupal/update/Tests/UpdateCoreUnitTest.php +++ b/core/modules/update/lib/Drupal/update/Tests/UpdateCoreUnitTest.php @@ -45,20 +45,20 @@ function testUpdateBuildFetchUrl() { $project['info']['project status url'] = 'http://www.example.com'; $project['includes'] = array('module1' => 'Module 1', 'module2' => 'Module 2'); $site_key = ''; - $expected = 'http://www.example.com/' . $project['name'] . '/' . DRUPAL_CORE_COMPATIBILITY; + $expected = 'http://www.example.com/' . $project['name'] . '/' . \Drupal::CORE_COMPATIBILITY; $url = _update_build_fetch_url($project, $site_key); $this->assertEqual($url, $expected, "'$url' when no site_key provided should be '$expected'."); //For disabled projects it shouldn't add the site key either. $site_key = 'site_key'; $project['project_type'] = 'disabled'; - $expected = 'http://www.example.com/' . $project['name'] . '/' . DRUPAL_CORE_COMPATIBILITY; + $expected = 'http://www.example.com/' . $project['name'] . '/' . \Drupal::CORE_COMPATIBILITY; $url = _update_build_fetch_url($project, $site_key); $this->assertEqual($url, $expected, "'$url' should be '$expected' for disabled projects."); //for enabled projects, adding the site key $project['project_type'] = ''; - $expected = 'http://www.example.com/' . $project['name'] . '/' . DRUPAL_CORE_COMPATIBILITY; + $expected = 'http://www.example.com/' . $project['name'] . '/' . \Drupal::CORE_COMPATIBILITY; $expected .= '?site_key=site_key'; $expected .= '&list=' . rawurlencode('module1,module2'); $url = _update_build_fetch_url($project, $site_key); @@ -67,7 +67,7 @@ function testUpdateBuildFetchUrl() { // http://drupal.org/node/1481156 test incorrect logic when URL contains // a question mark. $project['info']['project status url'] = 'http://www.example.com/?project='; - $expected = 'http://www.example.com/?project=/' . $project['name'] . '/' . DRUPAL_CORE_COMPATIBILITY; + $expected = 'http://www.example.com/?project=/' . $project['name'] . '/' . \Drupal::CORE_COMPATIBILITY; $expected .= '&site_key=site_key'; $expected .= '&list=' . rawurlencode('module1,module2'); $url = _update_build_fetch_url($project, $site_key); diff --git a/core/modules/update/update.fetch.inc b/core/modules/update/update.fetch.inc index 8ac927f..e84c691 100644 --- a/core/modules/update/update.fetch.inc +++ b/core/modules/update/update.fetch.inc @@ -277,7 +277,7 @@ function _update_create_fetch_task($project) { function _update_build_fetch_url($project, $site_key = '') { $name = $project['name']; $url = _update_get_fetch_url_base($project); - $url .= '/' . $name . '/' . DRUPAL_CORE_COMPATIBILITY; + $url .= '/' . $name . '/' . Drupal::CORE_COMPATIBILITY; // Only append usage infomation if we have a site key and the project is // enabled. We do not want to record usage statistics for disabled projects. diff --git a/core/modules/update/update.module b/core/modules/update/update.module index ac63694..1457893 100644 --- a/core/modules/update/update.module +++ b/core/modules/update/update.module @@ -677,7 +677,7 @@ function update_verify_update_archive($project, $archive_file, $directory) { $info = drupal_parse_info_file($file->uri); // If the module or theme is incompatible with Drupal core, set an error. - if (empty($info['core']) || $info['core'] != DRUPAL_CORE_COMPATIBILITY) { + if (empty($info['core']) || $info['core'] != Drupal::CORE_COMPATIBILITY) { $incompatible[] = !empty($info['name']) ? $info['name'] : t('Unknown'); } else { @@ -694,7 +694,7 @@ function update_verify_update_archive($project, $archive_file, $directory) { count($incompatible), '%archive_file contains a version of %names that is not compatible with Drupal !version.', '%archive_file contains versions of modules or themes that are not compatible with Drupal !version: %names', - array('!version' => DRUPAL_CORE_COMPATIBILITY, '%archive_file' => drupal_basename($archive_file), '%names' => implode(', ', $incompatible)) + array('!version' => Drupal::CORE_COMPATIBILITY, '%archive_file' => drupal_basename($archive_file), '%names' => implode(', ', $incompatible)) ); } diff --git a/core/modules/user/user.module b/core/modules/user/user.module index 4768f93..5b067be 100644 --- a/core/modules/user/user.module +++ b/core/modules/user/user.module @@ -2105,7 +2105,7 @@ function user_library_info() { $path = drupal_get_path('module', 'user'); $libraries['drupal.user'] = array( 'title' => 'User', - 'version' => VERSION, + 'version' => Drupal::VERSION, 'js' => array( $path . '/user.js' => array(), ), @@ -2121,7 +2121,7 @@ function user_library_info() { $libraries['drupal.user.permissions'] = array( 'title' => 'User permissions', - 'version' => VERSION, + 'version' => Drupal::VERSION, 'js' => array( $path . '/user.permissions.js' => array(), ), @@ -2134,7 +2134,7 @@ function user_library_info() { $libraries['drupal.user.icons'] = array( 'title' => 'User icon styling', - 'version' => VERSION, + 'version' => Drupal::VERSION, 'css' => array( $path . '/css/user.icons.css' => array(), ), diff --git a/core/modules/views/lib/Drupal/views/Entity/View.php b/core/modules/views/lib/Drupal/views/Entity/View.php index e98ae01..82f93c4 100644 --- a/core/modules/views/lib/Drupal/views/Entity/View.php +++ b/core/modules/views/lib/Drupal/views/Entity/View.php @@ -79,7 +79,7 @@ class View extends ConfigEntityBase implements ViewStorageInterface { * * @var int */ - protected $core = DRUPAL_CORE_COMPATIBILITY; + protected $core = \Drupal::CORE_COMPATIBILITY; /** * Stores all display handlers of this view. diff --git a/core/modules/views/tests/Drupal/views/Tests/Plugin/Block/ViewsBlockTest.php b/core/modules/views/tests/Drupal/views/Tests/Plugin/Block/ViewsBlockTest.php index 94a2cf7..e94586f 100644 --- a/core/modules/views/tests/Drupal/views/Tests/Plugin/Block/ViewsBlockTest.php +++ b/core/modules/views/tests/Drupal/views/Tests/Plugin/Block/ViewsBlockTest.php @@ -12,9 +12,6 @@ use Drupal\block\Plugin\views\display\Block; // @todo Remove this once the constant got converted. -if (!defined('DRUPAL_CORE_COMPATIBILITY')) { - define('DRUPAL_CORE_COMPATIBILITY', '8.x'); -} if (!defined('BLOCK_LABEL_VISIBLE')) { define('BLOCK_LABEL_VISIBLE', 'visible'); } diff --git a/core/modules/views/views.api.php b/core/modules/views/views.api.php index 226f92f..261c357 100644 --- a/core/modules/views/views.api.php +++ b/core/modules/views/views.api.php @@ -336,7 +336,7 @@ function hook_views_data_alter(array &$data) { function hook_views_query_substitutions(ViewExecutable $view) { // Example from views_views_query_substitutions(). return array( - '***CURRENT_VERSION***' => VERSION, + '***CURRENT_VERSION***' => Drupal::VERSION, '***CURRENT_TIME***' => REQUEST_TIME, '***CURRENT_LANGUAGE***' => language(\Drupal\Core\Language\Language::TYPE_CONTENT)->id, '***DEFAULT_LANGUAGE***' => language_default()->id, diff --git a/core/modules/views/views.module b/core/modules/views/views.module index 26a9dbb..e46f7fe 100644 --- a/core/modules/views/views.module +++ b/core/modules/views/views.module @@ -813,14 +813,14 @@ function views_library_info() { $path = drupal_get_path('module', 'views'); $libraries['views.module'] = array( 'title' => 'Views base', - 'version' => VERSION, + 'version' => Drupal::VERSION, 'css' => array( "$path/css/views.module.css" ), ); $libraries['views.ajax'] = array( 'title' => 'Views AJAX', - 'version' => VERSION, + 'version' => Drupal::VERSION, 'js' => array( "$path/js/base.js" => array('group' => JS_DEFAULT), "$path/js/ajax_view.js" => array('group' => JS_DEFAULT), @@ -836,7 +836,7 @@ function views_library_info() { ); $libraries['views.contextual-links'] = array( 'title' => 'Views Contextual links', - 'version' => VERSION, + 'version' => Drupal::VERSION, 'js' => array( // Set to -10 to move it before the contextual links javascript file. "$path/js/views-contextual.js" => array('group' => JS_LIBRARY, 'weight' => -10), @@ -848,7 +848,7 @@ function views_library_info() { ); $libraries['views.exposed-form'] = array( 'title' => 'Views exposed form', - 'version' => VERSION, + 'version' => Drupal::VERSION, 'css' => array( "$path/css/views.exposed_form.css", ), diff --git a/core/modules/views/views.views_execution.inc b/core/modules/views/views.views_execution.inc index ddde9d9..73ebd09 100644 --- a/core/modules/views/views.views_execution.inc +++ b/core/modules/views/views.views_execution.inc @@ -15,7 +15,7 @@ */ function views_views_query_substitutions(ViewExecutable $view) { return array( - '***CURRENT_VERSION***' => VERSION, + '***CURRENT_VERSION***' => Drupal::VERSION, '***CURRENT_TIME***' => REQUEST_TIME, '***CURRENT_LANGUAGE***' => language(Language::TYPE_CONTENT)->id, '***DEFAULT_LANGUAGE***' => language_default()->id, diff --git a/core/modules/views_ui/tests/Drupal/views_ui/Tests/ViewUIObjectTest.php b/core/modules/views_ui/tests/Drupal/views_ui/Tests/ViewUIObjectTest.php index 9b52116..172d6ef 100644 --- a/core/modules/views_ui/tests/Drupal/views_ui/Tests/ViewUIObjectTest.php +++ b/core/modules/views_ui/tests/Drupal/views_ui/Tests/ViewUIObjectTest.php @@ -13,10 +13,6 @@ use Drupal\views_ui\ViewUI; use Symfony\Component\DependencyInjection\Container; -if (!defined('DRUPAL_CORE_COMPATIBILITY')) { - define('DRUPAL_CORE_COMPATIBILITY', '8.x'); -} - /** * Tests the ViewUI class. * diff --git a/core/modules/views_ui/views_ui.module b/core/modules/views_ui/views_ui.module index 7c41565..9e61cfd 100644 --- a/core/modules/views_ui/views_ui.module +++ b/core/modules/views_ui/views_ui.module @@ -193,7 +193,7 @@ function views_ui_library_info() { $libraries['views_ui.admin'] = array( 'title' => 'Views UI ADMIN', - 'version' => VERSION, + 'version' => Drupal::VERSION, 'js' => array( $path . 'ajax.js' => array('group' => JS_DEFAULT), $path . 'views-admin.js' => array('group' => JS_DEFAULT), diff --git a/core/themes/seven/seven.theme b/core/themes/seven/seven.theme index 0f08715..ceb4ab5 100644 --- a/core/themes/seven/seven.theme +++ b/core/themes/seven/seven.theme @@ -14,7 +14,7 @@ function seven_library_info() { $path = drupal_get_path('theme', 'seven'); $libraries['install-page'] = array( - 'version' => VERSION, + 'version' => Drupal::VERSION, 'js' => array( $path . '/js/mobile.install.js' => array( 'group' => JS_THEME,