diff options
Diffstat (limited to 'core/modules/system/system.install')
-rw-r--r-- | core/modules/system/system.install | 133 |
1 files changed, 67 insertions, 66 deletions
diff --git a/core/modules/system/system.install b/core/modules/system/system.install index 9b8c25c157e..431651d08e2 100644 --- a/core/modules/system/system.install +++ b/core/modules/system/system.install @@ -14,9 +14,9 @@ use Drupal\Component\Utility\Unicode; use Drupal\Core\Database\Database; use Drupal\Core\DrupalKernel; use Drupal\Core\Extension\ExtensionLifecycle; +use Drupal\Core\Extension\Requirement\RequirementSeverity; use Drupal\Core\File\FileSystemInterface; use Drupal\Core\Link; -use Drupal\Core\Utility\PhpRequirements; use Drupal\Core\Render\Markup; use Drupal\Core\Site\Settings; use Drupal\Core\StreamWrapper\PrivateStream; @@ -27,6 +27,7 @@ use Drupal\Core\StringTranslation\TranslatableMarkup; use Drupal\Core\Update\EquivalentUpdate; use Drupal\Core\Url; use Drupal\Core\Utility\Error; +use Drupal\Core\Utility\PhpRequirements; use Psr\Http\Client\ClientExceptionInterface; use Symfony\Component\HttpFoundation\Request; @@ -83,7 +84,7 @@ function system_requirements($phase): array { $requirements['drupal'] = [ 'title' => t('Drupal'), 'value' => \Drupal::VERSION, - 'severity' => REQUIREMENT_INFO, + 'severity' => RequirementSeverity::Info, 'weight' => -10, ]; @@ -99,7 +100,7 @@ function system_requirements($phase): array { '%profile' => $profile, '%version' => !empty($info['version']) ? '-' . $info['version'] : '', ]), - 'severity' => REQUIREMENT_INFO, + 'severity' => RequirementSeverity::Info, 'weight' => -9, ]; } @@ -129,7 +130,7 @@ function system_requirements($phase): array { $requirements['experimental_modules'] = [ 'title' => t('Experimental modules installed'), 'value' => t('Experimental modules found: %module_list. <a href=":url">Experimental modules</a> are provided for testing purposes only. Use at your own risk.', ['%module_list' => implode(', ', $experimental_modules), ':url' => 'https://www.drupal.org/core/experimental']), - 'severity' => REQUIREMENT_WARNING, + 'severity' => RequirementSeverity::Warning, ]; } // Warn if any deprecated modules are installed. @@ -142,7 +143,7 @@ function system_requirements($phase): array { 'value' => t('Deprecated modules found: %module_list.', [ '%module_list' => Markup::create(implode(', ', $deprecated_modules_link_list)), ]), - 'severity' => REQUIREMENT_WARNING, + 'severity' => RequirementSeverity::Warning, ]; } @@ -170,7 +171,7 @@ function system_requirements($phase): array { $requirements['experimental_themes'] = [ 'title' => t('Experimental themes installed'), 'value' => t('Experimental themes found: %theme_list. Experimental themes are provided for testing purposes only. Use at your own risk.', ['%theme_list' => implode(', ', $experimental_themes)]), - 'severity' => REQUIREMENT_WARNING, + 'severity' => RequirementSeverity::Warning, ]; } @@ -185,7 +186,7 @@ function system_requirements($phase): array { 'value' => t('Deprecated themes found: %theme_list.', [ '%theme_list' => Markup::create(implode(', ', $deprecated_themes_link_list)), ]), - 'severity' => REQUIREMENT_WARNING, + 'severity' => RequirementSeverity::Warning, ]; } @@ -200,7 +201,7 @@ function system_requirements($phase): array { '%extensions' => Markup::create(implode(', ', $obsolete_extensions_link_list)), ':uninstall_url' => Url::fromRoute('system.modules_uninstall')->toString(), ]), - 'severity' => REQUIREMENT_WARNING, + 'severity' => RequirementSeverity::Warning, ]; } _system_advisories_requirements($requirements); @@ -264,7 +265,7 @@ function system_requirements($phase): array { $requirements['apache_version'] = [ 'title' => t('Apache version'), 'value' => $apache_version_string, - 'severity' => REQUIREMENT_WARNING, + 'severity' => RequirementSeverity::Warning, 'description' => t('Due to the settings for ServerTokens in httpd.conf, it is impossible to accurately determine the version of Apache running on this server. The reported value is @reported, to run Drupal without mod_rewrite, a minimum version of 2.2.16 is needed.', ['@reported' => $apache_version_string]), ]; } @@ -273,7 +274,7 @@ function system_requirements($phase): array { $requirements['Apache version'] = [ 'title' => t('Apache version'), 'value' => $apache_version_string, - 'severity' => REQUIREMENT_ERROR, + 'severity' => RequirementSeverity::Error, 'description' => t('The minimum version of Apache needed to run Drupal without mod_rewrite enabled is 2.2.16. See the <a href=":link">enabling clean URLs</a> page for more information on mod_rewrite.', [':link' => 'https://www.drupal.org/docs/8/clean-urls-in-drupal-8']), ]; } @@ -282,7 +283,7 @@ function system_requirements($phase): array { $requirements['rewrite_module'] = [ 'title' => t('Clean URLs'), 'value' => t('Disabled'), - 'severity' => REQUIREMENT_WARNING, + 'severity' => RequirementSeverity::Warning, 'description' => t('Your server is capable of using clean URLs, but it is not enabled. Using clean URLs gives an improved user experience and is recommended. <a href=":link">Enable clean URLs</a>', [':link' => 'https://www.drupal.org/docs/8/clean-urls-in-drupal-8']), ]; } @@ -319,19 +320,19 @@ function system_requirements($phase): array { // safe to continue with the requirements check, and should always be an // error. if (version_compare($phpversion, \Drupal::MINIMUM_PHP) < 0) { - $requirements['php']['severity'] = REQUIREMENT_ERROR; + $requirements['php']['severity'] = RequirementSeverity::Error; return $requirements; } // Otherwise, the message should be an error at runtime, and a warning // during installation or update. - $requirements['php']['severity'] = ($phase === 'runtime') ? REQUIREMENT_ERROR : REQUIREMENT_WARNING; + $requirements['php']['severity'] = ($phase === 'runtime') ? RequirementSeverity::Error : RequirementSeverity::Warning; } // For PHP versions that are still supported but no longer recommended, // inform users of what's recommended, allowing them to take action before it // becomes urgent. elseif ($phase === 'runtime' && version_compare($phpversion, \Drupal::RECOMMENDED_PHP) < 0) { $requirements['php']['description'] = t('It is recommended to upgrade to PHP version %recommended or higher for the best ongoing support. See <a href="http://php.net/supported-versions.php">PHP\'s version support documentation</a> and the <a href=":php_requirements">Drupal PHP requirements</a> page for more information.', ['%recommended' => \Drupal::RECOMMENDED_PHP, ':php_requirements' => 'https://www.drupal.org/docs/system-requirements/php-requirements']); - $requirements['php']['severity'] = REQUIREMENT_INFO; + $requirements['php']['severity'] = RequirementSeverity::Info; } // Test for PHP extensions. @@ -381,7 +382,7 @@ function system_requirements($phase): array { ]; $requirements['php_extensions']['value'] = t('Disabled'); - $requirements['php_extensions']['severity'] = REQUIREMENT_ERROR; + $requirements['php_extensions']['severity'] = RequirementSeverity::Error; $requirements['php_extensions']['description'] = $description; } else { @@ -393,7 +394,7 @@ function system_requirements($phase): array { if (!OpCodeCache::isEnabled()) { $requirements['php_opcache'] = [ 'value' => t('Not enabled'), - 'severity' => REQUIREMENT_WARNING, + 'severity' => RequirementSeverity::Warning, 'description' => t('PHP OPcode caching can improve your site\'s performance considerably. It is <strong>highly recommended</strong> to have <a href="http://php.net/manual/opcache.installation.php" target="_blank">OPcache</a> installed on your server.'), ]; } @@ -413,7 +414,7 @@ function system_requirements($phase): array { $apcu_recommended_size = '32 MB'; $requirements['php_apcu_enabled']['value'] = t('Enabled (@size)', ['@size' => $apcu_actual_size]); if (Bytes::toNumber(ini_get('apc.shm_size')) * ini_get('apc.shm_segments') < Bytes::toNumber($apcu_recommended_size)) { - $requirements['php_apcu_enabled']['severity'] = REQUIREMENT_WARNING; + $requirements['php_apcu_enabled']['severity'] = RequirementSeverity::Warning; $requirements['php_apcu_enabled']['description'] = t('Depending on your configuration, Drupal can run with a @apcu_size APCu limit. However, a @apcu_default_size APCu limit (the default) or above is recommended, especially if your site uses additional custom or contributed modules.', [ '@apcu_size' => $apcu_actual_size, '@apcu_default_size' => $apcu_recommended_size, @@ -422,19 +423,19 @@ function system_requirements($phase): array { else { $memory_available = $memory_info['avail_mem'] / ($memory_info['seg_size'] * $memory_info['num_seg']); if ($memory_available < 0.1) { - $requirements['php_apcu_available']['severity'] = REQUIREMENT_ERROR; + $requirements['php_apcu_available']['severity'] = RequirementSeverity::Error; $requirements['php_apcu_available']['description'] = t('APCu is using over 90% of its allotted memory (@apcu_actual_size). To improve APCu performance, consider increasing this limit.', [ '@apcu_actual_size' => $apcu_actual_size, ]); } elseif ($memory_available < 0.25) { - $requirements['php_apcu_available']['severity'] = REQUIREMENT_WARNING; + $requirements['php_apcu_available']['severity'] = RequirementSeverity::Warning; $requirements['php_apcu_available']['description'] = t('APCu is using over 75% of its allotted memory (@apcu_actual_size). To improve APCu performance, consider increasing this limit.', [ '@apcu_actual_size' => $apcu_actual_size, ]); } else { - $requirements['php_apcu_available']['severity'] = REQUIREMENT_OK; + $requirements['php_apcu_available']['severity'] = RequirementSeverity::OK; } $requirements['php_apcu_available']['value'] = t('Memory available: @available.', [ '@available' => ByteSizeMarkup::create($memory_info['avail_mem']), @@ -444,7 +445,7 @@ function system_requirements($phase): array { else { $requirements['php_apcu_enabled'] += [ 'value' => t('Not enabled'), - 'severity' => REQUIREMENT_INFO, + 'severity' => RequirementSeverity::Info, 'description' => t('PHP APCu caching can improve your site\'s performance considerably. It is <strong>highly recommended</strong> to have <a href="https://www.php.net/manual/apcu.installation.php" target="_blank">APCu</a> installed on your server.'), ]; } @@ -484,7 +485,7 @@ function system_requirements($phase): array { $requirements['php_random_bytes']['description'] = t('Drupal is unable to generate highly randomized numbers, which means certain security features like password reset URLs are not as secure as they should be. Instead, only a slow, less-secure fallback generator is available. See the <a href=":drupal-php">system requirements</a> page for more information. %exception_message', $args); } $requirements['php_random_bytes']['value'] = t('Less secure'); - $requirements['php_random_bytes']['severity'] = REQUIREMENT_ERROR; + $requirements['php_random_bytes']['severity'] = RequirementSeverity::Error; } } @@ -493,7 +494,7 @@ function system_requirements($phase): array { $requirements['output_buffering'] = [ 'title' => t('Output Buffering'), 'error_value' => t('Not enabled'), - 'severity' => REQUIREMENT_WARNING, + 'severity' => RequirementSeverity::Warning, 'description' => t('<a href="https://www.php.net/manual/en/function.ob-start.php">Output buffering</a> is not enabled. This may degrade Drupal\'s performance. You can enable output buffering by default <a href="https://www.php.net/manual/en/outcontrol.configuration.php#ini.output-buffering">in your PHP settings</a>.'), ]; } @@ -532,7 +533,7 @@ function system_requirements($phase): array { if (!$database_ok) { $requirements['database_extensions']['value'] = t('Disabled'); - $requirements['database_extensions']['severity'] = REQUIREMENT_ERROR; + $requirements['database_extensions']['severity'] = RequirementSeverity::Error; $requirements['database_extensions']['description'] = $pdo_message; } else { @@ -563,7 +564,7 @@ function system_requirements($phase): array { // Use the comma-list style to display a single error without bullets. '#context' => ['list_style' => $error_count === 1 ? 'comma-list' : ''], ]; - $requirements['database_system_version']['severity'] = REQUIREMENT_ERROR; + $requirements['database_system_version']['severity'] = RequirementSeverity::Error; $requirements['database_system_version']['description'] = $error_message; } } @@ -572,14 +573,14 @@ function system_requirements($phase): array { // Test database JSON support. $requirements['database_support_json'] = [ 'title' => t('Database support for JSON'), - 'severity' => REQUIREMENT_OK, + 'severity' => RequirementSeverity::OK, 'value' => t('Available'), 'description' => t('Drupal requires databases that support JSON storage.'), ]; if (!Database::getConnection()->hasJson()) { $requirements['database_support_json']['value'] = t('Not available'); - $requirements['database_support_json']['severity'] = REQUIREMENT_ERROR; + $requirements['database_support_json']['severity'] = RequirementSeverity::Error; } } @@ -623,7 +624,7 @@ function system_requirements($phase): array { ]; $requirements['php_memory_limit']['description'] = $description; - $requirements['php_memory_limit']['severity'] = REQUIREMENT_WARNING; + $requirements['php_memory_limit']['severity'] = RequirementSeverity::Warning; } } @@ -645,12 +646,12 @@ function system_requirements($phase): array { $error_value = t('Protection disabled'); // If permissions hardening is disabled, then only show a warning for a // writable file, as a reminder, rather than an error. - $file_protection_severity = REQUIREMENT_WARNING; + $file_protection_severity = RequirementSeverity::Warning; } else { $error_value = t('Not protected'); // In normal operation, writable files or directories are an error. - $file_protection_severity = REQUIREMENT_ERROR; + $file_protection_severity = RequirementSeverity::Error; if (!drupal_verify_install_file($site_path, FILE_NOT_WRITABLE, 'dir')) { $conf_errors[] = t("The directory %file is not protected from modifications and poses a security risk. You must change the directory's permissions to be non-writable.", ['%file' => $site_path]); } @@ -709,7 +710,7 @@ function system_requirements($phase): array { // phpcs:ignore Drupal.Semantics.FunctionT.NotLiteralString 'title' => new TranslatableMarkup($protected_dir->getTitle()), 'value' => t('Not fully protected'), - 'severity' => REQUIREMENT_ERROR, + 'severity' => RequirementSeverity::Error, 'description' => t('See <a href=":url">@url</a> for information about the recommended .htaccess file which should be added to the %directory directory to help protect against arbitrary code execution.', [':url' => $url, '@url' => $url, '%directory' => $protected_dir->getPath()]), ]; } @@ -731,13 +732,13 @@ function system_requirements($phase): array { } // Determine severity based on time since cron last ran. - $severity = REQUIREMENT_INFO; + $severity = RequirementSeverity::Info; $request_time = \Drupal::time()->getRequestTime(); if ($request_time - $cron_last > $threshold_error) { - $severity = REQUIREMENT_ERROR; + $severity = RequirementSeverity::Error; } elseif ($request_time - $cron_last > $threshold_warning) { - $severity = REQUIREMENT_WARNING; + $severity = RequirementSeverity::Warning; } // Set summary and description based on values determined above. @@ -748,7 +749,7 @@ function system_requirements($phase): array { 'severity' => $severity, 'value' => $summary, ]; - if ($severity != REQUIREMENT_INFO) { + if ($severity != RequirementSeverity::Info) { $requirements['cron']['description'][] = [ [ '#markup' => t('Cron has not run recently.'), @@ -833,7 +834,7 @@ function system_requirements($phase): array { $requirements['config sync directory'] = [ 'title' => t('Configuration sync directory'), 'description' => $description, - 'severity' => REQUIREMENT_ERROR, + 'severity' => RequirementSeverity::Error, ]; } } @@ -842,7 +843,7 @@ function system_requirements($phase): array { 'title' => t('Configuration sync directory'), 'value' => t('Not present'), 'description' => t("Your %file file must define the %setting setting as a string containing the directory in which configuration files can be found.", ['%file' => $site_path . '/settings.php', '%setting' => "\$settings['config_sync_directory']"]), - 'severity' => REQUIREMENT_ERROR, + 'severity' => RequirementSeverity::Error, ]; } @@ -891,7 +892,7 @@ function system_requirements($phase): array { ], ]; $requirements['file system']['description'] = $description; - $requirements['file system']['severity'] = REQUIREMENT_ERROR; + $requirements['file system']['severity'] = RequirementSeverity::Error; } } else { @@ -937,7 +938,7 @@ function system_requirements($phase): array { } if ($has_pending_updates) { - $requirements['update']['severity'] = REQUIREMENT_ERROR; + $requirements['update']['severity'] = RequirementSeverity::Error; $requirements['update']['value'] = t('Out of date'); $requirements['update']['description'] = t('Some modules have database schema updates to install. You should run the <a href=":update">database update script</a> immediately.', [':update' => Url::fromRoute('system.db_update')->toString()]); } @@ -959,7 +960,7 @@ function system_requirements($phase): array { } $entity_update_issues = \Drupal::service('renderer')->renderInIsolation($build); - $requirements['entity_update']['severity'] = REQUIREMENT_ERROR; + $requirements['entity_update']['severity'] = RequirementSeverity::Error; $requirements['entity_update']['value'] = t('Mismatched entity and/or field definitions'); $requirements['entity_update']['description'] = t('The following changes were detected in the entity type and field definitions. @updates', ['@updates' => $entity_update_issues]); } @@ -971,7 +972,7 @@ function system_requirements($phase): array { $requirements['deployment identifier'] = [ 'title' => t('Deployment identifier'), 'value' => $deployment_identifier, - 'severity' => REQUIREMENT_INFO, + 'severity' => RequirementSeverity::Info, ]; } } @@ -981,7 +982,7 @@ function system_requirements($phase): array { if (Settings::get('update_free_access')) { $requirements['update access'] = [ 'value' => t('Not protected'), - 'severity' => REQUIREMENT_ERROR, + 'severity' => RequirementSeverity::Error, 'description' => t('The update.php script is accessible to everyone without authentication check, which is a security risk. You must change the @settings_name value in your settings.php back to FALSE.', ['@settings_name' => '$settings[\'update_free_access\']']), ]; } @@ -1023,7 +1024,7 @@ function system_requirements($phase): array { '#markup' => $message, ], ], - 'severity' => REQUIREMENT_ERROR, + 'severity' => RequirementSeverity::Error, ]; }; $profile = \Drupal::installProfile(); @@ -1058,7 +1059,7 @@ function system_requirements($phase): array { 'title' => t('Unresolved dependency'), 'description' => t('@name requires this module.', ['@name' => $name]), 'value' => t('@required_name (Missing)', ['@required_name' => $required_module]), - 'severity' => REQUIREMENT_ERROR, + 'severity' => RequirementSeverity::Error, ]; continue; } @@ -1072,7 +1073,7 @@ function system_requirements($phase): array { 'title' => t('Unresolved dependency'), 'description' => t('@name requires this module and version. Currently using @required_name version @version', ['@name' => $name, '@required_name' => $required_name, '@version' => $version]), 'value' => t('@required_name (Version @compatibility required)', ['@required_name' => $required_name, '@compatibility' => $requirement->getConstraintString()]), - 'severity' => REQUIREMENT_ERROR, + 'severity' => RequirementSeverity::Error, ]; continue; } @@ -1272,9 +1273,9 @@ function system_requirements($phase): array { Unicode::STATUS_ERROR => t('Error'), ]; $severities = [ - Unicode::STATUS_SINGLEBYTE => REQUIREMENT_WARNING, + Unicode::STATUS_SINGLEBYTE => RequirementSeverity::Warning, Unicode::STATUS_MULTIBYTE => NULL, - Unicode::STATUS_ERROR => REQUIREMENT_ERROR, + Unicode::STATUS_ERROR => RequirementSeverity::Error, ]; $failed_check = Unicode::check(); $library = Unicode::getStatus(); @@ -1299,7 +1300,7 @@ function system_requirements($phase): array { if (!\Drupal::moduleHandler()->moduleExists('update')) { $requirements['update status'] = [ 'value' => t('Not enabled'), - 'severity' => REQUIREMENT_WARNING, + 'severity' => RequirementSeverity::Warning, 'description' => t('Update notifications are not enabled. It is <strong>highly recommended</strong> that you install the Update Status module from the <a href=":module">module administration page</a> in order to stay up-to-date on new releases. For more information, <a href=":update">Update status handbook page</a>.', [ ':update' => 'https://www.drupal.org/documentation/modules/update', ':module' => Url::fromRoute('system.modules_list')->toString(), @@ -1317,7 +1318,7 @@ function system_requirements($phase): array { $requirements['rebuild access'] = [ 'title' => t('Rebuild access'), 'value' => t('Enabled'), - 'severity' => REQUIREMENT_ERROR, + 'severity' => RequirementSeverity::Error, 'description' => t('The rebuild_access setting is enabled in settings.php. It is recommended to have this setting disabled unless you are performing a rebuild.'), ]; } @@ -1338,7 +1339,7 @@ function system_requirements($phase): array { $requirements['php_session_samesite'] = [ 'title' => t('SameSite cookie attribute'), 'value' => $samesite, - 'severity' => $valid ? REQUIREMENT_OK : REQUIREMENT_WARNING, + 'severity' => $valid ? RequirementSeverity::OK : RequirementSeverity::Warning, 'description' => t('This attribute should be explicitly set to Lax, Strict or None. If set to None then the request must be made via HTTPS. See <a href=":url" target="_blank">PHP documentation</a>', [ ':url' => 'https://www.php.net/manual/en/session.configuration.php#ini.session.cookie-samesite', ]), @@ -1354,7 +1355,7 @@ function system_requirements($phase): array { 'title' => t('Trusted Host Settings'), 'value' => t('Not enabled'), 'description' => t('The trusted_host_patterns setting is not configured in settings.php. This can lead to security vulnerabilities. It is <strong>highly recommended</strong> that you configure this. See <a href=":url">Protecting against HTTP HOST Header attacks</a> for more information.', [':url' => 'https://www.drupal.org/docs/installing-drupal/trusted-host-settings']), - 'severity' => REQUIREMENT_ERROR, + 'severity' => RequirementSeverity::Error, ]; } else { @@ -1383,7 +1384,7 @@ function system_requirements($phase): array { 'title' => t('Database driver provided by module'), 'value' => t('Not installed'), 'description' => t('The current database driver is provided by the module: %module. The module is currently not installed. You should immediately <a href=":install">install</a> the module.', ['%module' => $provider, ':install' => Url::fromRoute('system.modules_list')->toString()]), - 'severity' => REQUIREMENT_ERROR, + 'severity' => RequirementSeverity::Error, ]; } } @@ -1403,7 +1404,7 @@ function system_requirements($phase): array { 'title' => t('Xdebug settings'), 'value' => t('xdebug.max_nesting_level is set to %value.', ['%value' => $current_nesting_level]), 'description' => t('Set <code>xdebug.max_nesting_level=@level</code> in your PHP configuration as some pages in your Drupal site will not work when this setting is too low.', ['@level' => $minimum_nesting_level]), - 'severity' => REQUIREMENT_ERROR, + 'severity' => RequirementSeverity::Error, ]; } } @@ -1420,7 +1421,7 @@ function system_requirements($phase): array { $requirements['max_path_on_windows'] = [ 'title' => t('Windows installation depth'), 'description' => t('The public files directory path is %depth characters. Paths longer than 120 characters will cause problems on Windows.', ['%depth' => $depth]), - 'severity' => REQUIREMENT_ERROR, + 'severity' => RequirementSeverity::Error, ]; } } @@ -1430,7 +1431,7 @@ function system_requirements($phase): array { 'title' => t('Limited date range'), 'value' => t('Your PHP installation has a limited date range.'), 'description' => t('You are running on a system where PHP is compiled or limited to using 32-bit integers. This will limit the range of dates and timestamps to the years 1901-2038. Read about the <a href=":url">limitations of 32-bit PHP</a>.', [':url' => 'https://www.drupal.org/docs/system-requirements/limitations-of-32-bit-php']), - 'severity' => REQUIREMENT_WARNING, + 'severity' => RequirementSeverity::Warning, ]; } @@ -1443,7 +1444,7 @@ function system_requirements($phase): array { 'title' => t('Configuration install'), 'value' => $install_state['parameters']['profile'], 'description' => t('The selected profile has a hook_install() implementation and therefore can not be installed from configuration.'), - 'severity' => REQUIREMENT_ERROR, + 'severity' => RequirementSeverity::Error, ]; } } @@ -1457,7 +1458,7 @@ function system_requirements($phase): array { $requirements['install_profile_in_settings'] = [ 'title' => t('Install profile in settings'), 'value' => t("Drupal 9 no longer uses the \$settings['install_profile'] value in settings.php and it should be removed."), - 'severity' => REQUIREMENT_WARNING, + 'severity' => RequirementSeverity::Warning, ]; } } @@ -1501,7 +1502,7 @@ function system_requirements($phase): array { '@previous_major' => 9, ':url' => 'https://www.drupal.org/docs/upgrading-drupal/drupal-8-and-higher', ]), - 'severity' => REQUIREMENT_ERROR, + 'severity' => RequirementSeverity::Error, ]; } else { @@ -1513,7 +1514,7 @@ function system_requirements($phase): array { '@last_removed_version' => $data['last_removed'], '@installed_version' => $data['installed_version'], ]), - 'severity' => REQUIREMENT_ERROR, + 'severity' => RequirementSeverity::Error, ]; } } @@ -1541,7 +1542,7 @@ function system_requirements($phase): array { $requirements[$module . '_post_update_removed'] = [ 'title' => t('Missing updates for: @module', ['@module' => $module_info->info['name']]), 'description' => $description, - 'severity' => REQUIREMENT_ERROR, + 'severity' => RequirementSeverity::Error, ]; } } @@ -1575,7 +1576,7 @@ function system_requirements($phase): array { '@future_update' => $future_update, '@future_version_string' => $future_version_string, ]), - 'severity' => REQUIREMENT_ERROR, + 'severity' => RequirementSeverity::Error, ]; break; } @@ -1598,7 +1599,7 @@ function system_requirements($phase): array { 'system.development_settings', )->toString(), ]), - 'severity' => REQUIREMENT_WARNING, + 'severity' => RequirementSeverity::Warning, ]; } $render_cache_disabled = $development_settings->get('disable_rendered_output_cache_bins', FALSE); @@ -1611,7 +1612,7 @@ function system_requirements($phase): array { 'system.development_settings', )->toString(), ]), - 'severity' => REQUIREMENT_WARNING, + 'severity' => RequirementSeverity::Warning, ]; } } @@ -1702,7 +1703,7 @@ function _system_advisories_requirements(array &$requirements): void { } catch (ClientExceptionInterface $exception) { $requirements['system_advisories']['title'] = t('Critical security announcements'); - $requirements['system_advisories']['severity'] = REQUIREMENT_WARNING; + $requirements['system_advisories']['severity'] = RequirementSeverity::Warning; $requirements['system_advisories']['description'] = ['#theme' => 'system_security_advisories_fetch_error_message']; Error::logException(\Drupal::logger('system'), $exception, 'Failed to retrieve security advisory data.'); return; @@ -1710,10 +1711,10 @@ function _system_advisories_requirements(array &$requirements): void { if (!empty($advisories)) { $advisory_links = []; - $severity = REQUIREMENT_WARNING; + $severity = RequirementSeverity::Warning; foreach ($advisories as $advisory) { if (!$advisory->isPsa()) { - $severity = REQUIREMENT_ERROR; + $severity = RequirementSeverity::Error; } $advisory_links[] = new Link($advisory->getTitle(), Url::fromUri($advisory->getUrl())); } |