/** * Setup the Cleaner. * * @see \phpbu\App\Backup\Cleanup::setup() * @param array $options * @throws \phpbu\App\Backup\Cleaner\Exception */ public function setup(array $options) { if (!isset($options['older'])) { throw new Exception('option \'older\' is missing'); } try { $seconds = Str::toTime($options['older']); } catch (RuntimeException $e) { throw new Exception($e->getMessage()); } $this->offsetRaw = $options['older']; $this->offsetSeconds = $seconds; }
/** * Get a fake last modified date. * * @param string $offset * @return integer */ protected function getMTime($offset) { return $this->getTime() - Str::toTime($offset); }