Footer.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Backend\Block\Page;
  7. /**
  8. * Adminhtml footer block
  9. *
  10. * @api
  11. * @author Magento Core Team <core@magentocommerce.com>
  12. * @since 100.0.2
  13. */
  14. class Footer extends \Magento\Backend\Block\Template
  15. {
  16. /**
  17. * @var string
  18. */
  19. protected $_template = 'Magento_Backend::page/footer.phtml';
  20. /**
  21. * @var \Magento\Framework\App\ProductMetadataInterface
  22. * @since 100.1.0
  23. */
  24. protected $productMetadata;
  25. /**
  26. * @param \Magento\Backend\Block\Template\Context $context
  27. * @param \Magento\Framework\App\ProductMetadataInterface $productMetadata
  28. * @param array $data
  29. */
  30. public function __construct(
  31. \Magento\Backend\Block\Template\Context $context,
  32. \Magento\Framework\App\ProductMetadataInterface $productMetadata,
  33. array $data = []
  34. ) {
  35. $this->productMetadata = $productMetadata;
  36. parent::__construct($context, $data);
  37. }
  38. /**
  39. * @inheritdoc
  40. */
  41. protected function _construct()
  42. {
  43. $this->setShowProfiler(true);
  44. }
  45. /**
  46. * Get product version
  47. *
  48. * @return string
  49. * @since 100.1.0
  50. */
  51. public function getMagentoVersion()
  52. {
  53. return $this->productMetadata->getVersion();
  54. }
  55. /**
  56. * @inheritdoc
  57. * @since 101.0.0
  58. */
  59. protected function getCacheLifetime()
  60. {
  61. return 3600 * 24 * 10;
  62. }
  63. }