How to adapt `colinmollenhour/php-redis-session-abstract` to PHP 7.2?

php7
php72

(Dmitry Fedyuk) #1

Context: How to adapt Magento 2 to PHP 7.2?

Step 1

Replace the line:

with the following one:

"mage2pro/php-redis-session-abstract": ">=1.3.8",

Step 2

If you are using Magento 2.3, then replace the lib/internal/Magento/Framework/Session/SaveHandler/Redis/Config.php file with its version from Magento 2.2.2.

Step 3

Add the following methods (getSentinelConnectRetries, getSentinelMaster, getSentinelServers, getSentinelVerifyMaster) to the Magento\Framework\Session\SaveHandler\Redis\Config class:

/**
 * Connection retries for sentinels
 *
 * @return string
 */
function getSentinelConnectRetries() {return '';}

/**
 * Get sentinel master name
 *
 * @return string
 */
function getSentinelMaster() {return '';}

/**
 * Get list of redis sentinels
 *
 * @return string
 */
function getSentinelServers() {return '';}

/**
 * Verify master status flag
 *
 * @return string
 */
function getSentinelVerifyMaster() {return '';}

How to adapt Magento 2 to PHP 7.2?