Favicon.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Theme\Model\Design\Backend;
  7. use Magento\Framework\Filesystem;
  8. class Favicon extends Image
  9. {
  10. /**
  11. * The tail part of directory path for uploading
  12. *
  13. */
  14. const UPLOAD_DIR = 'favicon';
  15. /**
  16. * Return path to directory for upload file
  17. *
  18. * @return string
  19. * @throw \Magento\Framework\Exception\LocalizedException
  20. */
  21. protected function _getUploadDir()
  22. {
  23. return $this->_mediaDirectory->getRelativePath($this->_appendScopeInfo(self::UPLOAD_DIR));
  24. }
  25. /**
  26. * Makes a decision about whether to add info about the scope.
  27. *
  28. * @return boolean
  29. */
  30. protected function _addWhetherScopeInfo()
  31. {
  32. return true;
  33. }
  34. /**
  35. * Getter for allowed extensions of uploaded files.
  36. *
  37. * @return string[]
  38. */
  39. public function getAllowedExtensions()
  40. {
  41. return ['ico', 'png', 'gif', 'jpg', 'jpeg', 'apng'];
  42. }
  43. }