Nomedia.php 786 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Framework\Backup;
  7. /**
  8. * Class to work system backup that excludes media folder
  9. *
  10. * @author Magento Core Team <core@magentocommerce.com>
  11. */
  12. class Nomedia extends \Magento\Framework\Backup\Media
  13. {
  14. /**
  15. * Overlap getType
  16. *
  17. * @return string
  18. * @see BackupInterface::getType()
  19. */
  20. public function getType()
  21. {
  22. return 'nomedia';
  23. }
  24. /**
  25. * Add media folder to ignore list
  26. *
  27. * @return $this
  28. */
  29. protected function _prepareIgnoreList()
  30. {
  31. $rootDir = $this->getRootDir();
  32. $this->addIgnorePaths([$rootDir . '/media', $rootDir . '/pub/media']);
  33. return $this;
  34. }
  35. }