BackupCommand.php 527 B

1234567891011121314151617181920212223
  1. <?php
  2. namespace Intervention\Image\Gd\Commands;
  3. class BackupCommand extends \Intervention\Image\Commands\AbstractCommand
  4. {
  5. /**
  6. * Saves a backups of current state of image core
  7. *
  8. * @param \Intervention\Image\Image $image
  9. * @return boolean
  10. */
  11. public function execute($image)
  12. {
  13. $backupName = $this->argument(0)->value();
  14. // clone current image resource
  15. $clone = clone $image;
  16. $image->setBackup($clone->getCore(), $backupName);
  17. return true;
  18. }
  19. }