コード例 #1
0
ファイル: Outdated.php プロジェクト: todiadiyatmo/phpbu
 /**
  * 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;
 }
コード例 #2
0
ファイル: TestCase.php プロジェクト: todiadiyatmo/phpbu
 /**
  * Get a fake last modified date.
  *
  * @param  string $offset
  * @return integer
  */
 protected function getMTime($offset)
 {
     return $this->getTime() - Str::toTime($offset);
 }