コード例 #1
0
ファイル: Executor.php プロジェクト: kachkaev/php-backup
 /**
  * @param Profile $profile
  * @param string  $filename
  *
  * @return Backup[]
  */
 private function sendToDestinations(Profile $profile, $filename)
 {
     $backups = array();
     foreach ($profile->getDestinations() as $destination) {
         $backup = $destination->push($filename, $this->logger);
         $size = $backup->getSize();
         if (class_exists('\\ByteUnits\\System')) {
             $size = \ByteUnits\parse($size)->format('B');
         }
         $this->logger->info(sprintf('Backup created for destination "%s" at: "%s" ', $destination->getName(), $backup->getKey()), array('size' => $size, 'created_at' => $backup->getCreatedAt()->format('Y-m-d H:i:s')));
         $backups[] = $backup;
     }
     return $backups;
 }
コード例 #2
0
ファイル: ListCommand.php プロジェクト: kachkaev/php-backup
 /**
  * {@inheritdoc}
  */
 protected function doExecute(Profile $profile, InputInterface $input, OutputInterface $output)
 {
     foreach ($profile->getDestinations() as $destination) {
         $this->listBackups($destination, $output);
     }
 }