File size: 619 Bytes
d2897cd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php

declare(strict_types=1);

namespace Mautic\CoreBundle\Predis\Replication;

final class StrategyConfig
{
    public function __construct(
        private bool $primaryOnly
    ) {
    }

    /**
     * @param mixed[] $options
     */
    public static function fromArray(array $options): self
    {
        return new StrategyConfig($options['primaryOnly'] ?? false);
    }

    /**
     * Use primary Redis server for reads and writes only.
     * The secondary Redis replicas will not be used at all when TRUE.
     */
    public function usePrimaryOnly(): bool
    {
        return $this->primaryOnly;
    }
}