MathiasGrimm\LaravelLogKeeper\Repos\FakeLogsRepo::__construct PHP Метод

__construct() публичный Метод

public __construct ( array $config )
$config array
    public function __construct(array $config)
    {
        $this->config = $config;
        $localRetentionMinus1 = Carbon::today()->subDays($this->config['localRetentionDays'] - 1);
        $localRetention = Carbon::today()->subDays($this->config['localRetentionDays']);
        $localRetentionPlus1 = Carbon::today()->subDays($this->config['localRetentionDays'] + 1);
        $remoteRetentionMinus1 = Carbon::today()->subDays($this->config['remoteRetentionDaysCalculated'] - 1);
        $remoteRetention = Carbon::today()->subDays($this->config['remoteRetentionDaysCalculated']);
        $remoteRetentionPlus1 = Carbon::today()->subDays($this->config['remoteRetentionDaysCalculated'] + 1);
        $this->logs = ['/fake/storage/logs/laravel-old-2010-01-01.log', '/fake/storage/logs/laravel-old-2010-01-02.log', "/fake/storage/logs/laravel-6days-{$localRetentionMinus1->toDateString()}.log", "/fake/storage/logs/laravel-7days-{$localRetention->toDateString()}.log", "/fake/storage/logs/laravel-8days-{$localRetentionPlus1->toDateString()}.log", "/fake/storage/logs/laravel-29days-{$remoteRetentionMinus1->toDateString()}.log", "/fake/storage/logs/laravel-30days-{$remoteRetention->toDateString()}.log", "/fake/storage/logs/laravel-31days-{$remoteRetentionPlus1->toDateString()}.log"];
    }

Usage Example

 public function __construct(array $config)
 {
     parent::__construct($config);
     if ($this->config['enabled_remote'] && !$this->config['remote_disk']) {
         throw new Exception("remote_disk not configured for Laravel Log Keeper");
     }
 }