diff --git a/.github/phpstan.neon b/.github/phpstan.neon index c6dd2eaed7d..cc2e2ab76b8 100644 --- a/.github/phpstan.neon +++ b/.github/phpstan.neon @@ -43,7 +43,6 @@ parameters: - %currentWorkingDirectory%/app/code/core/Mage/Newsletter - %currentWorkingDirectory%/app/code/core/Mage/Oauth - %currentWorkingDirectory%/app/code/core/Mage/Page - - %currentWorkingDirectory%/app/code/core/Mage/PageCache - %currentWorkingDirectory%/app/code/core/Mage/Paygate - %currentWorkingDirectory%/app/code/core/Mage/Payment - %currentWorkingDirectory%/app/code/core/Mage/Paypal diff --git a/README.md b/README.md index 772042be952..19506283a78 100644 --- a/README.md +++ b/README.md @@ -93,6 +93,7 @@ Do not use 20.x.x if you need IE support. - possibility to disable global search in backend #1532 - reduce needless saves by avoiding setting `_hasDataChanges` flag #2066 - removed support for `global/sales/old_fields_map` defined in XML #921 +- removed Mage_PageCache module #2258 - removed lib/flex containing unused ActionScript "file uploader" files #2271 For full list of changes, you can [compare tags](https://github.com/OpenMage/magento-lts/compare/1.9.4.x...20.0). diff --git a/app/code/core/Mage/PageCache/Block/Adminhtml/Cache/Additional.php b/app/code/core/Mage/PageCache/Block/Adminhtml/Cache/Additional.php deleted file mode 100644 index d2438e1bd2e..00000000000 --- a/app/code/core/Mage/PageCache/Block/Adminhtml/Cache/Additional.php +++ /dev/null @@ -1,55 +0,0 @@ - - */ -class Mage_PageCache_Block_Adminhtml_Cache_Additional extends Mage_Adminhtml_Block_Template -{ - /** - * Get clean cache url - * - * @return string - */ - public function getCleanExternalCacheUrl() - { - return $this->getUrl('*/pageCache/clean'); - } - - /** - * Check if block can be displayed - * - * @return bool - */ - public function canShowButton() - { - return Mage::helper('pagecache')->isEnabled() && Mage::getSingleton('admin/session')->isAllowed('page_cache'); - } -} diff --git a/app/code/core/Mage/PageCache/Helper/Data.php b/app/code/core/Mage/PageCache/Helper/Data.php deleted file mode 100644 index 384c5c0885e..00000000000 --- a/app/code/core/Mage/PageCache/Helper/Data.php +++ /dev/null @@ -1,122 +0,0 @@ - - */ -class Mage_PageCache_Helper_Data extends Mage_Core_Helper_Abstract -{ - /** - * Pathes to external cache config options - */ - const XML_PATH_EXTERNAL_CACHE_ENABLED = 'system/external_page_cache/enabled'; - const XML_PATH_EXTERNAL_CACHE_LIFETIME = 'system/external_page_cache/cookie_lifetime'; - const XML_PATH_EXTERNAL_CACHE_CONTROL = 'system/external_page_cache/control'; - - /** - * Path to external cache controls - */ - const XML_PATH_EXTERNAL_CACHE_CONTROLS = 'global/external_cache/controls'; - - /** - * Cookie name for disabling external caching - * - * @var string - */ - const NO_CACHE_COOKIE = 'external_no_cache'; - - /** - * Check whether external cache is enabled - * - * @return bool - */ - public function isEnabled() - { - return (bool)Mage::getStoreConfig(self::XML_PATH_EXTERNAL_CACHE_ENABLED); - } - - /** - * Return all available external cache controls - * - * @return array - */ - public function getCacheControls() - { - $controls = Mage::app()->getConfig()->getNode(self::XML_PATH_EXTERNAL_CACHE_CONTROLS); - return $controls->asCanonicalArray(); - } - - /** - * Initialize proper external cache control model - * - * @throws Mage_Core_Exception - * @return Mage_PageCache_Model_Control_Interface - */ - public function getCacheControlInstance() - { - $usedControl = Mage::getStoreConfig(self::XML_PATH_EXTERNAL_CACHE_CONTROL); - if ($usedControl) { - foreach ($this->getCacheControls() as $control => $info) { - if ($control == $usedControl && !empty($info['class'])) { - return Mage::getSingleton($info['class']); - } - } - } - Mage::throwException($this->__('Failed to load external cache control')); - } - - /** - * Disable caching on external storage side by setting special cookie - * - * @return void - */ - public function setNoCacheCookie() - { - $cookie = Mage::getSingleton('core/cookie'); - $lifetime = Mage::getStoreConfig(self::XML_PATH_EXTERNAL_CACHE_LIFETIME); - $noCache = $cookie->get(self::NO_CACHE_COOKIE); - - if ($noCache) { - $cookie->renew(self::NO_CACHE_COOKIE, $lifetime); - } else { - $cookie->set(self::NO_CACHE_COOKIE, 1, $lifetime); - } - } - - /** - * Returns a lifetime of cookie for external cache - * - * @return string Time in seconds - */ - public function getNoCacheCookieLifetime() - { - return Mage::getStoreConfig(self::XML_PATH_EXTERNAL_CACHE_LIFETIME); - } -} diff --git a/app/code/core/Mage/PageCache/Model/Control/Interface.php b/app/code/core/Mage/PageCache/Model/Control/Interface.php deleted file mode 100644 index 7b2a2568cf3..00000000000 --- a/app/code/core/Mage/PageCache/Model/Control/Interface.php +++ /dev/null @@ -1,42 +0,0 @@ - - */ -interface Mage_PageCache_Model_Control_Interface -{ - /** - * Clean external cache - * - * @return void - */ - public function clean(); -} diff --git a/app/code/core/Mage/PageCache/Model/Control/Zend.php b/app/code/core/Mage/PageCache/Model/Control/Zend.php deleted file mode 100644 index 0b02f9f3549..00000000000 --- a/app/code/core/Mage/PageCache/Model/Control/Zend.php +++ /dev/null @@ -1,47 +0,0 @@ - - */ -class Mage_PageCache_Model_Control_Zend implements Mage_PageCache_Model_Control_Interface -{ - /** - * Clean zend server page cache - * - * @return void - */ - public function clean() - { - if (extension_loaded('Zend Page Cache') && function_exists('page_cache_remove_all_cached_contents')) { - page_cache_remove_all_cached_contents(); - } - } -} diff --git a/app/code/core/Mage/PageCache/Model/Observer.php b/app/code/core/Mage/PageCache/Model/Observer.php deleted file mode 100644 index b4bd1b0090e..00000000000 --- a/app/code/core/Mage/PageCache/Model/Observer.php +++ /dev/null @@ -1,97 +0,0 @@ - - */ -class Mage_PageCache_Model_Observer -{ - const XML_NODE_ALLOWED_CACHE = 'frontend/cache/allowed_requests'; - - /** - * Check if full page cache is enabled - * - * @return bool - */ - public function isCacheEnabled() - { - return Mage::helper('pagecache')->isEnabled(); - } - - /** - * Check when cache should be disabled - * - * @param Varien_Event_Observer $observer - * @return $this - */ - public function processPreDispatch(Varien_Event_Observer $observer) - { - if (!$this->isCacheEnabled()) { - return $this; - } - /** @var Mage_Core_Controller_Front_Action $action */ - $action = $observer->getEvent()->getControllerAction(); - $request = $action->getRequest(); - $needCaching = true; - - if ($request->isPost()) { - $needCaching = false; - } - - $configuration = Mage::getConfig()->getNode(self::XML_NODE_ALLOWED_CACHE); - - if (!$configuration) { - $needCaching = false; - } - - $configuration = $configuration->asArray(); - $module = $request->getModuleName(); - $controller = $request->getControllerName(); - $action = $request->getActionName(); - - if (!isset($configuration[$module])) { - $needCaching = false; - } - - if (isset($configuration[$module]['controller']) && $configuration[$module]['controller'] != $controller) { - $needCaching = false; - } - - if (isset($configuration[$module]['action']) && $configuration[$module]['action'] != $action) { - $needCaching = false; - } - - if (!$needCaching) { - Mage::helper('pagecache')->setNoCacheCookie(); - } - - return $this; - } -} diff --git a/app/code/core/Mage/PageCache/Model/System/Config/Source/Controls.php b/app/code/core/Mage/PageCache/Model/System/Config/Source/Controls.php deleted file mode 100644 index c8d75363e6c..00000000000 --- a/app/code/core/Mage/PageCache/Model/System/Config/Source/Controls.php +++ /dev/null @@ -1,52 +0,0 @@ - - */ -class Mage_PageCache_Model_System_Config_Source_Controls -{ - /** - * Return array of external cache controls for using as options - * - * @return array - */ - public function toOptionArray() - { - $options = array(); - foreach (Mage::helper('pagecache')->getCacheControls() as $code => $type) { - $options[] = array( - 'value' => $code, - 'label' => $type['label'] - ); - } - return $options; - } -} diff --git a/app/code/core/Mage/PageCache/controllers/Adminhtml/PageCacheController.php b/app/code/core/Mage/PageCache/controllers/Adminhtml/PageCacheController.php deleted file mode 100644 index 3276f4977a3..00000000000 --- a/app/code/core/Mage/PageCache/controllers/Adminhtml/PageCacheController.php +++ /dev/null @@ -1,80 +0,0 @@ - - */ -class Mage_PageCache_Adminhtml_PageCacheController extends Mage_Adminhtml_Controller_Action -{ - /** - * Retrieve session model - * - * @return Mage_Adminhtml_Model_Session - */ - protected function _getSession() - { - return Mage::getSingleton('adminhtml/session'); - } - - /** - * Clean external cache action - * - * @return void - */ - public function cleanAction() - { - try { - if (Mage::helper('pagecache')->isEnabled()) { - Mage::helper('pagecache')->getCacheControlInstance()->clean(); - $this->_getSession()->addSuccess( - Mage::helper('pagecache')->__('The external full page cache has been cleaned.') - ); - } - } catch (Mage_Core_Exception $e) { - $this->_getSession()->addError($e->getMessage()); - } catch (Exception $e) { - $this->_getSession()->addException( - $e, - Mage::helper('pagecache')->__('An error occurred while clearing the external full page cache.') - ); - } - $this->_redirect('*/cache/index'); - } - - /** - * Check current user permission on resource and privilege - * - * @return bool - */ - protected function _isAllowed() - { - return Mage::getSingleton('admin/session')->isAllowed('page_cache'); - } -} diff --git a/app/code/core/Mage/PageCache/etc/adminhtml.xml b/app/code/core/Mage/PageCache/etc/adminhtml.xml deleted file mode 100644 index d23f8fd07eb..00000000000 --- a/app/code/core/Mage/PageCache/etc/adminhtml.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - External Page Cache - 0 - - - - - - diff --git a/app/code/core/Mage/PageCache/etc/config.xml b/app/code/core/Mage/PageCache/etc/config.xml deleted file mode 100644 index 16e6eac5529..00000000000 --- a/app/code/core/Mage/PageCache/etc/config.xml +++ /dev/null @@ -1,127 +0,0 @@ - - - - - - 1.6.0.0 - - - - - - Mage_PageCache_Model - - - - - Mage_PageCache_Helper - - - - - Mage_PageCache_Block - - - - - - - pagecache/control_zend - - - - - - - - - pagecache.xml - - - - - - - - Mage_PageCache.csv - - - - - - - - - - pagecache.xml - - - - - - - - pagecache/observer - processPreDispatch - - - - - - - - - - - - - - - - - - - - - - Mage_PageCache_Adminhtml - - - - - - - - - 0 - zend_page_cache - 3600 - - - - diff --git a/app/code/core/Mage/PageCache/etc/system.xml b/app/code/core/Mage/PageCache/etc/system.xml deleted file mode 100644 index 4fe75a1a031..00000000000 --- a/app/code/core/Mage/PageCache/etc/system.xml +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - - - - 1 - 1 - 1 - 500 - - - - select - adminhtml/system_config_source_yesno - 1 - 1 - 0 - 0 - - - - 5 - 1 - 0 - 0 - 1 - If empty, default value will be used. - - - - select - pagecache/system_config_source_controls - 10 - 1 - 0 - 0 - 1 - - - - - - - diff --git a/app/design/adminhtml/default/default/layout/pagecache.xml b/app/design/adminhtml/default/default/layout/pagecache.xml deleted file mode 100644 index 003792008c4..00000000000 --- a/app/design/adminhtml/default/default/layout/pagecache.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - diff --git a/app/design/adminhtml/default/default/template/pagecache/cache/additional.phtml b/app/design/adminhtml/default/default/template/pagecache/cache/additional.phtml deleted file mode 100644 index 49286e8d04d..00000000000 --- a/app/design/adminhtml/default/default/template/pagecache/cache/additional.phtml +++ /dev/null @@ -1,39 +0,0 @@ - - -canShowButton()): ?> - - - - - -
- - - __('External full page cache.')?> -
- diff --git a/app/design/frontend/base/default/layout/pagecache.xml b/app/design/frontend/base/default/layout/pagecache.xml deleted file mode 100644 index daf58a2fd4c..00000000000 --- a/app/design/frontend/base/default/layout/pagecache.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - diff --git a/app/design/frontend/base/default/template/pagecache/cookie.phtml b/app/design/frontend/base/default/template/pagecache/cookie.phtml deleted file mode 100644 index 1711ff03649..00000000000 --- a/app/design/frontend/base/default/template/pagecache/cookie.phtml +++ /dev/null @@ -1,36 +0,0 @@ - - - diff --git a/app/etc/modules/Mage_PageCache.xml b/app/etc/modules/Mage_PageCache.xml deleted file mode 100644 index c2d7ad6a002..00000000000 --- a/app/etc/modules/Mage_PageCache.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - true - core - - - - - - diff --git a/app/locale/en_US/Mage_PageCache.csv b/app/locale/en_US/Mage_PageCache.csv deleted file mode 100644 index 8cf0a18b013..00000000000 --- a/app/locale/en_US/Mage_PageCache.csv +++ /dev/null @@ -1,12 +0,0 @@ -"An error occurred while clearing the external full page cache.","An error occurred while clearing the external full page cache." -"Cookie Lifetime (seconds)","Cookie Lifetime (seconds)" -"Enable External Cache","Enable External Cache" -"External Cache Control","External Cache Control" -"External Full Page Cache Settings","External Full Page Cache Settings" -"External Page Cache","External Page Cache" -"External full page cache.","External full page cache." -"Failed to load external cache control","Failed to load external cache control" -"Flush External Page Cache","Flush External Page Cache" -"If empty, default value will be used.","If empty, default value will be used." -"The external full page cache has been cleaned.","The external full page cache has been cleaned." -"Zend Full Page Cache","Zend Full Page Cache"