Favicon.php 1.1 KB

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