// Provide the PHP backtrace and exception to logger implementations. Add
// 'severity_level' to the context to maintain BC and allow logging
// implementations to use it.
\Drupal::logger('php')->log($severity,'%type: @message in %function (line %line of %file) @backtrace_string.',$error+['backtrace'=>$backtrace,'exception'=>$exception,'severity_level'=>$severity]);
\Drupal::logger('php')
->log($severity,'%type: @message in %function (line %line of %file) @backtrace_string.',$error+[
'backtrace'=>$backtrace,
'exception'=>$exception,
'severity_level'=>$severity,
]);
}
catch(\Throwable){
// We can't log, for example because the database connection is not
$errors['driver']=t("In your %settings_file file you have configured @drupal to use a %driver server, however your PHP installation currently does not support this database type.",['%settings_file'=>$settings_file,'@drupal'=>drupal_install_profile_distribution_name(),'%driver'=>$database['driver']]);
$errors['driver']=t("In your %settings_file file you have configured @drupal to use a %driver server, however your PHP installation currently does not support this database type.",[
@@ -2031,7 +2035,10 @@ function install_check_translations($langcode, $server_pattern): array {
'title'=>t('Translations directory'),
'value'=>t('The translations directory does not exist.'),
'severity'=>RequirementSeverity::Error,
'description'=>t('The installer requires that you create a translations directory as part of the installation process. Create the directory %translations_directory . More details about installing Drupal are available in <a href=":install_txt">INSTALL.txt</a>.',['%translations_directory'=>$translations_directory,':install_txt'=>base_path().'core/INSTALL.txt']),
'description'=>t('The installer requires that you create a translations directory as part of the installation process. Create the directory %translations_directory . More details about installing Drupal are available in <a href=":install_txt">INSTALL.txt</a>.',[
@@ -2045,7 +2052,10 @@ function install_check_translations($langcode, $server_pattern): array {
'title'=>t('Translations directory'),
'value'=>t('The translations directory is not readable.'),
'severity'=>RequirementSeverity::Error,
'description'=>t('The installer requires read permissions to %translations_directory at all times. The <a href=":handbook_url">webhosting issues</a> documentation section offers help on this and other topics.',['%translations_directory'=>$translations_directory,':handbook_url'=>'https://www.drupal.org/server-permissions']),
'description'=>t('The installer requires read permissions to %translations_directory at all times. The <a href=":handbook_url">webhosting issues</a> documentation section offers help on this and other topics.',[
// If translations directory is not writable, throw an error.
@@ -2054,7 +2064,10 @@ function install_check_translations($langcode, $server_pattern): array {
'title'=>t('Translations directory'),
'value'=>t('The translations directory is not writable.'),
'severity'=>RequirementSeverity::Error,
'description'=>t('The installer requires write permissions to %translations_directory during the installation process. The <a href=":handbook_url">webhosting issues</a> documentation section offers help on this and other topics.',['%translations_directory'=>$translations_directory,':handbook_url'=>'https://www.drupal.org/server-permissions']),
'description'=>t('The installer requires write permissions to %translations_directory during the installation process. The <a href=":handbook_url">webhosting issues</a> documentation section offers help on this and other topics.',[
@@ -2071,7 +2084,10 @@ function install_check_translations($langcode, $server_pattern): array {
'title'=>t('Internet'),
'value'=>t('The translation server is offline.'),
'severity'=>RequirementSeverity::Error,
'description'=>t('The installer requires to contact the translation server to download a translation file. Check your internet connection and verify that your website can reach the translation server at <a href=":server_url">@server_url</a>.',[':server_url'=>$server_url,'@server_url'=>$server_url]),
'description'=>t('The installer requires to contact the translation server to download a translation file. Check your internet connection and verify that your website can reach the translation server at <a href=":server_url">@server_url</a>.',[
':server_url'=>$server_url,
'@server_url'=>$server_url,
]),
];
}
else{
@@ -2086,7 +2102,10 @@ function install_check_translations($langcode, $server_pattern): array {
'title'=>t('Translation'),
'value'=>t('The %language translation is not available.',['%language'=>$language]),
'severity'=>RequirementSeverity::Error,
'description'=>t('The %language translation file is not available at the translation server. <a href=":url">Choose a different language</a> or select English and translate your website later.',['%language'=>$language,':url'=>$_SERVER['SCRIPT_NAME']]),
'description'=>t('The %language translation file is not available at the translation server. <a href=":url">Choose a different language</a> or select English and translate your website later.',[
'%language'=>$language,
':url'=>$_SERVER['SCRIPT_NAME'],
]),
];
}
else{
@@ -2105,7 +2124,10 @@ function install_check_translations($langcode, $server_pattern): array {
'title'=>t('Translation'),
'value'=>t('The %language translation could not be downloaded.',['%language'=>$language]),
'severity'=>RequirementSeverity::Error,
'description'=>t('The %language translation file could not be downloaded. <a href=":url">Choose a different language</a> or select English and translate your website later.',['%language'=>$language,':url'=>$_SERVER['SCRIPT_NAME']]),
'description'=>t('The %language translation file could not be downloaded. <a href=":url">Choose a different language</a> or select English and translate your website later.',[
'%language'=>$language,
':url'=>$_SERVER['SCRIPT_NAME'],
]),
];
}
}
@@ -2338,7 +2360,10 @@ function install_display_requirements($install_state, $requirements) {
$build['report']['#requirements']=$requirements;
if($severity==RequirementSeverity::Warning){
$build['#title']=t('Requirements review');
$build['#suffix']=t('Check the messages and <a href=":retry">retry</a>, or you may choose to <a href=":cont">continue anyway</a>.',[':retry'=>drupal_requirements_url(RequirementSeverity::Error),':cont'=>drupal_requirements_url($severity)]);
$build['#suffix']=t('Check the messages and <a href=":retry">retry</a>, or you may choose to <a href=":cont">continue anyway</a>.',[
$message=t('@requirements_message (Currently using @item version @version)',['@requirements_message'=>$requirement['description'],'@item'=>$requirement['title'],'@version'=>$requirement['value']]);
$message=t('@requirements_message (Currently using @item version @version)',[