PHP compatibility(8.1) errors

Created on 26 July 2023, over 1 year ago
Updated 31 March 2024, 9 months ago

Problem/Motivation

FILE: /Users/rahulkumarkhandelwal/Sites/nativesites-acquia/docroot/modules/contrib/drd_agent/src/Crypt/Method/MCrypt.php
-------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 9 ERRORS AFFECTING 4 LINES
-------------------------------------------------------------------------------------------------------------------------------------------------------
78 | ERROR | Function mcrypt_get_iv_size() is deprecated since PHP 7.1 and removed since PHP 7.2; Use OpenSSL instead
78 | ERROR | Extension 'mcrypt' is deprecated since PHP 7.1 and removed since PHP 7.2; Use openssl (preferred) or pecl/mcrypt once available instead
80 | ERROR | Function mcrypt_create_iv() is deprecated since PHP 7.1 and removed since PHP 7.2; Use random_bytes() or OpenSSL instead
80 | ERROR | Extension 'mcrypt' is deprecated since PHP 7.1 and removed since PHP 7.2; Use openssl (preferred) or pecl/mcrypt once available instead
80 | ERROR | The constant "MCRYPT_DEV_URANDOM" is deprecated since PHP 7.1 and removed since PHP 7.2
89 | ERROR | Function mcrypt_encrypt() is deprecated since PHP 7.1 and removed since PHP 7.2; Use OpenSSL instead
89 | ERROR | Extension 'mcrypt' is deprecated since PHP 7.1 and removed since PHP 7.2; Use openssl (preferred) or pecl/mcrypt once available instead
104 | ERROR | Function mcrypt_decrypt() is deprecated since PHP 7.1 and removed since PHP 7.2; Use OpenSSL instead
104 | ERROR | Extension 'mcrypt' is deprecated since PHP 7.1 and removed since PHP 7.2; Use openssl (preferred) or pecl/mcrypt once available instead
-------------------------------------------------------------------------------------------------------------------------------------------------------

Steps to reproduce

When you run phpcs compatibility check after update your php version to 8.1 for Drupal 9 compatibility
vendor/bin/phpcs -p docroot --standard=PHPCompatibility --runtime-set testVersion 8.1 --extensions=php,module,install,inc

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Fixed

Version

4.0

Component

Code

Created by

🇮🇳India rahulkhandelwal1990 Gurgugram

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @rahulkhandelwal1990
  • Status changed to Fixed 9 months ago
  • 🇩🇪Germany jurgenhaas Gottmadingen

    MCrypt needs to remain in the code since the agent is also used on Drupal 7 sites that may still run on older PHP versions. The 4.1 release, which is for Drupal 10 and later only, requires PHP 8.1 or later and there the mcrypt code is already removed.

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024