diff --git a/core/lib/Drupal/Component/Utility/Crypt.php b/core/lib/Drupal/Component/Utility/Crypt.php index 9fec8b50dc483..7144e3b549909 100644 --- a/core/lib/Drupal/Component/Utility/Crypt.php +++ b/core/lib/Drupal/Component/Utility/Crypt.php @@ -30,12 +30,9 @@ class Crypt { static $random_state, $bytes; // Initialize on the first call. The contents of $_SERVER includes a mix of // user-specific and system information that varies a little with each page. + // Further initialize with the somewhat random PHP process ID. if (!isset($random_state)) { - $random_state = print_r($_SERVER, TRUE); - if (function_exists('getmypid')) { - // Further initialize with the somewhat random PHP process ID. - $random_state .= getmypid(); - } + $random_state = print_r($_SERVER, TRUE) . getmypid(); $bytes = ''; } if (strlen($bytes) < $count) { diff --git a/core/modules/color/color.module b/core/modules/color/color.module index a903a7806f10b..e9710c283fc4b 100644 --- a/core/modules/color/color.module +++ b/core/modules/color/color.module @@ -295,26 +295,24 @@ function color_scheme_form_submit($form, &$form_state) { $palette += $info['schemes']['default']['colors']; } - // Make sure enough memory is available, if PHP's memory limit is compiled in. - if (function_exists('memory_get_usage')) { - // Fetch source image dimensions. - $source = drupal_get_path('theme', $theme) . '/' . $info['base_image']; - list($width, $height) = getimagesize($source); + // Make sure enough memory is available. + // Fetch source image dimensions. + $source = drupal_get_path('theme', $theme) . '/' . $info['base_image']; + list($width, $height) = getimagesize($source); - // We need at least a copy of the source and a target buffer of the same - // size (both at 32bpp). - $required = $width * $height * 8; - // We intend to prevent color scheme changes if there isn't enough memory - // available. memory_get_usage(TRUE) returns a more accurate number than - // memory_get_usage(), therefore we won't inadvertently reject a color - // scheme change based on a faulty memory calculation. - $usage = memory_get_usage(TRUE); - $memory_limit = ini_get('memory_limit'); - $size = parse_size($memory_limit); - if (!drupal_check_memory_limit($usage + $required, $memory_limit)) { - drupal_set_message(t('There is not enough memory available to PHP to change this theme\'s color scheme. You need at least %size more. Check the PHP documentation for more information.', array('%size' => format_size($usage + $required - $size), '@url' => 'http://www.php.net/manual/ini.core.php#ini.sect.resource-limits')), 'error'); - return; - } + // We need at least a copy of the source and a target buffer of the same + // size (both at 32bpp). + $required = $width * $height * 8; + // We intend to prevent color scheme changes if there isn't enough memory + // available. memory_get_usage(TRUE) returns a more accurate number than + // memory_get_usage(), therefore we won't inadvertently reject a color + // scheme change based on a faulty memory calculation. + $usage = memory_get_usage(TRUE); + $memory_limit = ini_get('memory_limit'); + $size = parse_size($memory_limit); + if (!drupal_check_memory_limit($usage + $required, $memory_limit)) { + drupal_set_message(t('There is not enough memory available to PHP to change this theme\'s color scheme. You need at least %size more. Check the PHP documentation for more information.', array('%size' => format_size($usage + $required - $size), '@url' => 'http://www.php.net/manual/ini.core.php#ini.sect.resource-limits')), 'error'); + return; } // Delete old files. diff --git a/core/modules/simpletest/simpletest.install b/core/modules/simpletest/simpletest.install index 020b3cdac2e0b..4b940eddbfa80 100644 --- a/core/modules/simpletest/simpletest.install +++ b/core/modules/simpletest/simpletest.install @@ -17,7 +17,6 @@ function simpletest_requirements($phase) { $requirements = array(); $has_curl = function_exists('curl_init'); - $has_hash = function_exists('hash_hmac'); $has_domdocument = method_exists('DOMDocument', 'loadHTML'); $open_basedir = ini_get('open_basedir'); @@ -29,14 +28,6 @@ function simpletest_requirements($phase) { $requirements['curl']['severity'] = REQUIREMENT_ERROR; $requirements['curl']['description'] = t('The testing framework could not be installed because the PHP cURL library is not available.', array('@curl_url' => 'http://php.net/manual/curl.setup.php')); } - $requirements['hash'] = array( - 'title' => t('hash'), - 'value' => $has_hash ? t('Enabled') : t('Not found'), - ); - if (!$has_hash) { - $requirements['hash']['severity'] = REQUIREMENT_ERROR; - $requirements['hash']['description'] = t('The testing framework could not be installed because the PHP hash extension is disabled.', array('@hash_url' => 'http://php.net/manual/book.hash.php')); - } $requirements['php_domdocument'] = array( 'title' => t('PHP DOMDocument class'),