<?php
// Redis connection file

$redis = false;

try {
    $redis = new Redis();
    $redis->connect('127.0.0.1', 6379, 2.5);

    // Use PHP serializer (safe for arrays)
    $redis->setOption(Redis::OPT_SERIALIZER, Redis::SERIALIZER_PHP);

} catch (Exception $e) {
    // Redis not available, fallback to DB
    $redis = false;
}
