123456789101112131415161718192021222324252627282930313233343536 |
- <?php
- /**
- *
- * Copyright © Magento, Inc. All rights reserved.
- * See COPYING.txt for license details.
- */
- namespace Magento\Backend\Controller\Adminhtml\Cache;
- use Magento\Framework\App\Action\HttpGetActionInterface as HttpGetActionInterface;
- use Magento\Framework\Controller\ResultFactory;
- class CleanStaticFiles extends \Magento\Backend\Controller\Adminhtml\Cache implements HttpGetActionInterface
- {
- /**
- * Authorization level of a basic admin session
- *
- * @see _isAllowed()
- */
- const ADMIN_RESOURCE = 'Magento_Backend::flush_static_files';
- /**
- * Clean static files cache
- *
- * @return \Magento\Backend\Model\View\Result\Redirect
- */
- public function execute()
- {
- $this->_objectManager->get(\Magento\Framework\App\State\CleanupFiles::class)->clearMaterializedViewFiles();
- $this->_eventManager->dispatch('clean_static_files_cache_after');
- $this->messageManager->addSuccessMessage(__('The static files cache has been cleaned.'));
- /** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */
- $resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);
- return $resultRedirect->setPath('adminhtml/*');
- }
- }
|