BackupCommand.php 548 B

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