Commit 1bf679ba authored by xjm's avatar xjm

Revert "Issue #2764821 by Dinesh18, Alka Kumari, pk188, xjm, catch: Inline...

Revert "Issue #2764821 by Dinesh18, Alka Kumari, pk188, xjm, catch: Inline unicode_requirements() in system_requirements()"

This reverts commit 4d14b5f2.
parent 4a3afbf2
......@@ -10,16 +10,7 @@
/**
* Returns Unicode library status and errors.
*/
/**
* Moves unicode_requirements() logic to system_requirements().
*
* @deprecated in Drupal 8.4.0 and will be removed before Drupal 9.0.0.
*
* @see https://www.drupal.org/node/2764821
*/
function unicode_requirements() {
@trigger_error('unicode_requirements() is deprecated in Drupal 8.4.0 and will be removed before Drupal 9.0.0. There is no replacement; system_requirements() now includes the logic instead. See https://www.drupal.org/node/2884698', E_USER_DEPRECATED);
$libraries = [
Unicode::STATUS_SINGLEBYTE => t('Standard PHP'),
Unicode::STATUS_MULTIBYTE => t('PHP Mbstring Extension'),
......
......@@ -9,7 +9,6 @@
use Drupal\Component\Utility\Environment;
use Drupal\Component\FileSystem\FileSystem;
use Drupal\Component\Utility\OpCodeCache;
use Drupal\Component\Utility\Unicode;
use Drupal\Core\Path\AliasStorage;
use Drupal\Core\Url;
use Drupal\Core\Database\Database;
......@@ -809,46 +808,9 @@ function system_requirements($phase) {
}
}
// Returns Unicode library status and errors.
$libraries = [
Unicode::STATUS_SINGLEBYTE => t('Standard PHP'),
Unicode::STATUS_MULTIBYTE => t('PHP Mbstring Extension'),
Unicode::STATUS_ERROR => t('Error'),
];
$severities = [
Unicode::STATUS_SINGLEBYTE => REQUIREMENT_WARNING,
Unicode::STATUS_MULTIBYTE => NULL,
Unicode::STATUS_ERROR => REQUIREMENT_ERROR,
];
$failed_check = Unicode::check();
$library = Unicode::getStatus();
$requirements['unicode'] = [
'title' => t('Unicode library'),
'value' => $libraries[$library],
'severity' => $severities[$library],
];
switch ($failed_check) {
case 'mb_strlen':
$requirements['unicode']['description'] = t('Operations on Unicode strings are emulated on a best-effort basis. Install the <a href="http://php.net/mbstring">PHP mbstring extension</a> for improved Unicode support.');
break;
case 'mbstring.func_overload':
$requirements['unicode']['description'] = t('Multibyte string function overloading in PHP is active and must be disabled. Check the php.ini <em>mbstring.func_overload</em> setting. Please refer to the <a href="http://php.net/mbstring">PHP mbstring documentation</a> for more information.');
break;
case 'mbstring.encoding_translation':
$requirements['unicode']['description'] = t('Multibyte string input conversion in PHP is active and must be disabled. Check the php.ini <em>mbstring.encoding_translation</em> setting. Please refer to the <a href="http://php.net/mbstring">PHP mbstring documentation</a> for more information.');
break;
case 'mbstring.http_input':
$requirements['unicode']['description'] = t('Multibyte string input conversion in PHP is active and must be disabled. Check the php.ini <em>mbstring.http_input</em> setting. Please refer to the <a href="http://php.net/mbstring">PHP mbstring documentation</a> for more information.');
break;
case 'mbstring.http_output':
$requirements['unicode']['description'] = t('Multibyte string output conversion in PHP is active and must be disabled. Check the php.ini <em>mbstring.http_output</em> setting. Please refer to the <a href="http://php.net/mbstring">PHP mbstring documentation</a> for more information.');
break;
}
// Test Unicode library
include_once DRUPAL_ROOT . '/core/includes/unicode.inc';
$requirements = array_merge($requirements, unicode_requirements());
if ($phase == 'runtime') {
// Check for update status module.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment