diff --git a/core/includes/install.core.inc b/core/includes/install.core.inc index e2991e3..1616f18 100644 --- a/core/includes/install.core.inc +++ b/core/includes/install.core.inc @@ -1940,23 +1940,6 @@ function install_check_translations($langcode, $server_pattern) { } } - // Installations on Windows can run into limitations with MAX_PATH if the - // Drupal root directory is too deep in the filesystem. Generally this shows - // up in cached Twig templates and other public files with long directory or - // file names. There is no definite root directory depth below which Drupal is - // guaranteed to function correctly on Windows, but we start warning when - // there are more than 100 characters in the Drupal root path. - if (substr(PHP_OS, 0, 3) == 'WIN') { - $depth = strlen(realpath(DRUPAL_ROOT)); - if ($depth > 100) { - $requirements['max_path_on_windows'] = [ - 'title' => t('Windows installation'), - 'description' => t('The path length to the Drupal root directory (@depth characters) is greater than 100 characters. This may cause problems when running on a Windows server. It is recommended to install Drupal on Windows in a shorter path.', ['@depth' => $depth]), - 'severity' => REQUIREMENT_WARNING, - ]; - } - } - return $requirements; } diff --git a/core/modules/system/system.install b/core/modules/system/system.install index 6dc2663..2b63c23 100644 --- a/core/modules/system/system.install +++ b/core/modules/system/system.install @@ -904,6 +904,23 @@ function system_requirements($phase) { } } + // Installations on Windows can run into limitations with MAX_PATH if the + // Drupal root directory is too deep in the filesystem. Generally this shows + // up in cached Twig templates and other public files with long directory or + // file names. There is no definite root directory depth below which Drupal is + // guaranteed to function correctly on Windows, but we start warning when + // there are more than 100 characters in the Drupal root path. + if (substr(PHP_OS, 0, 3) == 'WIN') { + $depth = strlen(realpath(DRUPAL_ROOT)); + if ($depth > 100) { + $requirements['max_path_on_windows'] = [ + 'title' => t('Windows installation depth'), + 'description' => t('The path length to the Drupal root directory (@depth characters) is greater than 100 characters. This may cause problems when running on a Windows server. You should install Drupal in a shorter path.', ['@depth' => $depth]), + 'severity' => REQUIREMENT_WARNING, + ]; + } + } + return $requirements; }