Thank you. I tried creating a file common\utility\MyRedisActiveRecord.php (I’m using the advanced theme)
<?php
namespace common\utility;
use Yii;
/**
* MyRedisActiveRecord replaces yii\redis\ActiveRecord to override the MD5 redis keys with the raw key.
*/
class MyRedisActiveRecord extends yii\redis\ActiveRecord // \yii\redis\ActiveRecord
{
/**
* {@inheritdoc}
*/
public static function buildKey($key)
{
return $key;
}
}
and in common\config\bootstrap.php I’ve added:
// Override redis ActiveRecord class with our class
Yii::$classMap['yii\redis\ActiveRecord'] = '@common/utility/MyRedisActiveRecord.php';
echo yii\redis\ActiveRecord::buildKey('test:key:123');
But it kicks an error which I cannot figure out why:
Fatal error: Class 'Yii\redis\ActiveRecord' not found in ...\common\utility\MyRedisActiveRecord.php on line 9