diff --git a/.phpstorm.meta.php/magento_blocks.meta.php b/.phpstorm.meta.php/magento_blocks.meta.php
index e4d9439c59c..f30464e92a9 100644
--- a/.phpstorm.meta.php/magento_blocks.meta.php
+++ b/.phpstorm.meta.php/magento_blocks.meta.php
@@ -22,9 +22,6 @@
'adminhtml/api_user_edit_tabs' => \Mage_Adminhtml_Block_Api_User_Edit_Tabs::class,
'adminhtml/api_user_grid' => \Mage_Adminhtml_Block_Api_User_Grid::class,
'adminhtml/api_users' => \Mage_Adminhtml_Block_Api_Users::class,
- 'adminhtml/backup' => \Mage_Adminhtml_Block_Backup::class,
- 'adminhtml/backup_dialogs' => \Mage_Adminhtml_Block_Backup_Dialogs::class,
- 'adminhtml/backup_grid' => \Mage_Adminhtml_Block_Backup_Grid::class,
'adminhtml/cache' => \Mage_Adminhtml_Block_Cache::class,
'adminhtml/cache_additional' => \Mage_Adminhtml_Block_Cache_Additional::class,
'adminhtml/cache_grid' => \Mage_Adminhtml_Block_Cache_Grid::class,
diff --git a/.phpstorm.meta.php/magento_blocks_methods.meta.php b/.phpstorm.meta.php/magento_blocks_methods.meta.php
index 5770efa0083..33913668d9d 100644
--- a/.phpstorm.meta.php/magento_blocks_methods.meta.php
+++ b/.phpstorm.meta.php/magento_blocks_methods.meta.php
@@ -22,9 +22,6 @@
'adminhtml/api_user_edit_tabs' => \Mage_Adminhtml_Block_Api_User_Edit_Tabs::class,
'adminhtml/api_user_grid' => \Mage_Adminhtml_Block_Api_User_Grid::class,
'adminhtml/api_users' => \Mage_Adminhtml_Block_Api_Users::class,
- 'adminhtml/backup' => \Mage_Adminhtml_Block_Backup::class,
- 'adminhtml/backup_dialogs' => \Mage_Adminhtml_Block_Backup_Dialogs::class,
- 'adminhtml/backup_grid' => \Mage_Adminhtml_Block_Backup_Grid::class,
'adminhtml/cache' => \Mage_Adminhtml_Block_Cache::class,
'adminhtml/cache_additional' => \Mage_Adminhtml_Block_Cache_Additional::class,
'adminhtml/cache_grid' => \Mage_Adminhtml_Block_Cache_Grid::class,
diff --git a/.phpstorm.meta.php/magento_helpers.meta.php b/.phpstorm.meta.php/magento_helpers.meta.php
index 0ccbf726e21..ffbe30c6cbc 100644
--- a/.phpstorm.meta.php/magento_helpers.meta.php
+++ b/.phpstorm.meta.php/magento_helpers.meta.php
@@ -30,8 +30,6 @@
'authorizenet/admin' => \Mage_Authorizenet_Helper_Admin::class,
'authorizenet' => \Mage_Authorizenet_Helper_Data::class,
'authorizenet/data' => \Mage_Authorizenet_Helper_Data::class,
- 'backup' => \Mage_Backup_Helper_Data::class,
- 'backup/data' => \Mage_Backup_Helper_Data::class,
'bundle/catalog_product_configuration' => \Mage_Bundle_Helper_Catalog_Product_Configuration::class,
'bundle' => \Mage_Bundle_Helper_Data::class,
'bundle/data' => \Mage_Bundle_Helper_Data::class,
diff --git a/.phpstorm.meta.php/magento_helpers_methods.meta.php b/.phpstorm.meta.php/magento_helpers_methods.meta.php
index 05fa4212d53..3981aa517d1 100644
--- a/.phpstorm.meta.php/magento_helpers_methods.meta.php
+++ b/.phpstorm.meta.php/magento_helpers_methods.meta.php
@@ -30,8 +30,6 @@
'authorizenet/admin' => \Mage_Authorizenet_Helper_Admin::class,
'authorizenet' => \Mage_Authorizenet_Helper_Data::class,
'authorizenet/data' => \Mage_Authorizenet_Helper_Data::class,
- 'backup' => \Mage_Backup_Helper_Data::class,
- 'backup/data' => \Mage_Backup_Helper_Data::class,
'bundle/catalog_product_configuration' => \Mage_Bundle_Helper_Catalog_Product_Configuration::class,
'bundle' => \Mage_Bundle_Helper_Data::class,
'bundle/data' => \Mage_Bundle_Helper_Data::class,
@@ -223,8 +221,6 @@
'authorizenet/admin' => \Mage_Authorizenet_Helper_Admin::class,
'authorizenet' => \Mage_Authorizenet_Helper_Data::class,
'authorizenet/data' => \Mage_Authorizenet_Helper_Data::class,
- 'backup' => \Mage_Backup_Helper_Data::class,
- 'backup/data' => \Mage_Backup_Helper_Data::class,
'bundle/catalog_product_configuration' => \Mage_Bundle_Helper_Catalog_Product_Configuration::class,
'bundle' => \Mage_Bundle_Helper_Data::class,
'bundle/data' => \Mage_Bundle_Helper_Data::class,
@@ -416,8 +412,6 @@
'authorizenet/admin' => \Mage_Authorizenet_Helper_Admin::class,
'authorizenet' => \Mage_Authorizenet_Helper_Data::class,
'authorizenet/data' => \Mage_Authorizenet_Helper_Data::class,
- 'backup' => \Mage_Backup_Helper_Data::class,
- 'backup/data' => \Mage_Backup_Helper_Data::class,
'bundle/catalog_product_configuration' => \Mage_Bundle_Helper_Catalog_Product_Configuration::class,
'bundle' => \Mage_Bundle_Helper_Data::class,
'bundle/data' => \Mage_Bundle_Helper_Data::class,
@@ -609,8 +603,6 @@
'authorizenet/admin' => \Mage_Authorizenet_Helper_Admin::class,
'authorizenet' => \Mage_Authorizenet_Helper_Data::class,
'authorizenet/data' => \Mage_Authorizenet_Helper_Data::class,
- 'backup' => \Mage_Backup_Helper_Data::class,
- 'backup/data' => \Mage_Backup_Helper_Data::class,
'bundle/catalog_product_configuration' => \Mage_Bundle_Helper_Catalog_Product_Configuration::class,
'bundle' => \Mage_Bundle_Helper_Data::class,
'bundle/data' => \Mage_Bundle_Helper_Data::class,
@@ -802,8 +794,6 @@
'authorizenet/admin' => \Mage_Authorizenet_Helper_Admin::class,
'authorizenet' => \Mage_Authorizenet_Helper_Data::class,
'authorizenet/data' => \Mage_Authorizenet_Helper_Data::class,
- 'backup' => \Mage_Backup_Helper_Data::class,
- 'backup/data' => \Mage_Backup_Helper_Data::class,
'bundle/catalog_product_configuration' => \Mage_Bundle_Helper_Catalog_Product_Configuration::class,
'bundle' => \Mage_Bundle_Helper_Data::class,
'bundle/data' => \Mage_Bundle_Helper_Data::class,
@@ -995,8 +985,6 @@
'authorizenet/admin' => \Mage_Authorizenet_Helper_Admin::class,
'authorizenet' => \Mage_Authorizenet_Helper_Data::class,
'authorizenet/data' => \Mage_Authorizenet_Helper_Data::class,
- 'backup' => \Mage_Backup_Helper_Data::class,
- 'backup/data' => \Mage_Backup_Helper_Data::class,
'bundle/catalog_product_configuration' => \Mage_Bundle_Helper_Catalog_Product_Configuration::class,
'bundle' => \Mage_Bundle_Helper_Data::class,
'bundle/data' => \Mage_Bundle_Helper_Data::class,
@@ -1188,8 +1176,6 @@
'authorizenet/admin' => \Mage_Authorizenet_Helper_Admin::class,
'authorizenet' => \Mage_Authorizenet_Helper_Data::class,
'authorizenet/data' => \Mage_Authorizenet_Helper_Data::class,
- 'backup' => \Mage_Backup_Helper_Data::class,
- 'backup/data' => \Mage_Backup_Helper_Data::class,
'bundle/catalog_product_configuration' => \Mage_Bundle_Helper_Catalog_Product_Configuration::class,
'bundle' => \Mage_Bundle_Helper_Data::class,
'bundle/data' => \Mage_Bundle_Helper_Data::class,
@@ -1381,8 +1367,6 @@
'authorizenet/admin' => \Mage_Authorizenet_Helper_Admin::class,
'authorizenet' => \Mage_Authorizenet_Helper_Data::class,
'authorizenet/data' => \Mage_Authorizenet_Helper_Data::class,
- 'backup' => \Mage_Backup_Helper_Data::class,
- 'backup/data' => \Mage_Backup_Helper_Data::class,
'bundle/catalog_product_configuration' => \Mage_Bundle_Helper_Catalog_Product_Configuration::class,
'bundle' => \Mage_Bundle_Helper_Data::class,
'bundle/data' => \Mage_Bundle_Helper_Data::class,
@@ -1574,8 +1558,6 @@
'authorizenet/admin' => \Mage_Authorizenet_Helper_Admin::class,
'authorizenet' => \Mage_Authorizenet_Helper_Data::class,
'authorizenet/data' => \Mage_Authorizenet_Helper_Data::class,
- 'backup' => \Mage_Backup_Helper_Data::class,
- 'backup/data' => \Mage_Backup_Helper_Data::class,
'bundle/catalog_product_configuration' => \Mage_Bundle_Helper_Catalog_Product_Configuration::class,
'bundle' => \Mage_Bundle_Helper_Data::class,
'bundle/data' => \Mage_Bundle_Helper_Data::class,
@@ -1767,8 +1749,6 @@
'authorizenet/admin' => \Mage_Authorizenet_Helper_Admin::class,
'authorizenet' => \Mage_Authorizenet_Helper_Data::class,
'authorizenet/data' => \Mage_Authorizenet_Helper_Data::class,
- 'backup' => \Mage_Backup_Helper_Data::class,
- 'backup/data' => \Mage_Backup_Helper_Data::class,
'bundle/catalog_product_configuration' => \Mage_Bundle_Helper_Catalog_Product_Configuration::class,
'bundle' => \Mage_Bundle_Helper_Data::class,
'bundle/data' => \Mage_Bundle_Helper_Data::class,
@@ -1960,8 +1940,6 @@
'authorizenet/admin' => \Mage_Authorizenet_Helper_Admin::class,
'authorizenet' => \Mage_Authorizenet_Helper_Data::class,
'authorizenet/data' => \Mage_Authorizenet_Helper_Data::class,
- 'backup' => \Mage_Backup_Helper_Data::class,
- 'backup/data' => \Mage_Backup_Helper_Data::class,
'bundle/catalog_product_configuration' => \Mage_Bundle_Helper_Catalog_Product_Configuration::class,
'bundle' => \Mage_Bundle_Helper_Data::class,
'bundle/data' => \Mage_Bundle_Helper_Data::class,
@@ -2153,8 +2131,6 @@
'authorizenet/admin' => \Mage_Authorizenet_Helper_Admin::class,
'authorizenet' => \Mage_Authorizenet_Helper_Data::class,
'authorizenet/data' => \Mage_Authorizenet_Helper_Data::class,
- 'backup' => \Mage_Backup_Helper_Data::class,
- 'backup/data' => \Mage_Backup_Helper_Data::class,
'bundle/catalog_product_configuration' => \Mage_Bundle_Helper_Catalog_Product_Configuration::class,
'bundle' => \Mage_Bundle_Helper_Data::class,
'bundle/data' => \Mage_Bundle_Helper_Data::class,
@@ -2346,8 +2322,6 @@
'authorizenet/admin' => \Mage_Authorizenet_Helper_Admin::class,
'authorizenet' => \Mage_Authorizenet_Helper_Data::class,
'authorizenet/data' => \Mage_Authorizenet_Helper_Data::class,
- 'backup' => \Mage_Backup_Helper_Data::class,
- 'backup/data' => \Mage_Backup_Helper_Data::class,
'bundle/catalog_product_configuration' => \Mage_Bundle_Helper_Catalog_Product_Configuration::class,
'bundle' => \Mage_Bundle_Helper_Data::class,
'bundle/data' => \Mage_Bundle_Helper_Data::class,
@@ -2539,8 +2513,6 @@
'authorizenet/admin' => \Mage_Authorizenet_Helper_Admin::class,
'authorizenet' => \Mage_Authorizenet_Helper_Data::class,
'authorizenet/data' => \Mage_Authorizenet_Helper_Data::class,
- 'backup' => \Mage_Backup_Helper_Data::class,
- 'backup/data' => \Mage_Backup_Helper_Data::class,
'bundle/catalog_product_configuration' => \Mage_Bundle_Helper_Catalog_Product_Configuration::class,
'bundle' => \Mage_Bundle_Helper_Data::class,
'bundle/data' => \Mage_Bundle_Helper_Data::class,
@@ -2732,8 +2704,6 @@
'authorizenet/admin' => \Mage_Authorizenet_Helper_Admin::class,
'authorizenet' => \Mage_Authorizenet_Helper_Data::class,
'authorizenet/data' => \Mage_Authorizenet_Helper_Data::class,
- 'backup' => \Mage_Backup_Helper_Data::class,
- 'backup/data' => \Mage_Backup_Helper_Data::class,
'bundle/catalog_product_configuration' => \Mage_Bundle_Helper_Catalog_Product_Configuration::class,
'bundle' => \Mage_Bundle_Helper_Data::class,
'bundle/data' => \Mage_Bundle_Helper_Data::class,
@@ -2925,8 +2895,6 @@
'authorizenet/admin' => \Mage_Authorizenet_Helper_Admin::class,
'authorizenet' => \Mage_Authorizenet_Helper_Data::class,
'authorizenet/data' => \Mage_Authorizenet_Helper_Data::class,
- 'backup' => \Mage_Backup_Helper_Data::class,
- 'backup/data' => \Mage_Backup_Helper_Data::class,
'bundle/catalog_product_configuration' => \Mage_Bundle_Helper_Catalog_Product_Configuration::class,
'bundle' => \Mage_Bundle_Helper_Data::class,
'bundle/data' => \Mage_Bundle_Helper_Data::class,
diff --git a/.phpstorm.meta.php/magento_models.meta.php b/.phpstorm.meta.php/magento_models.meta.php
index 1c6a2e33db0..09d93d6ab5f 100644
--- a/.phpstorm.meta.php/magento_models.meta.php
+++ b/.phpstorm.meta.php/magento_models.meta.php
@@ -366,15 +366,6 @@
'authorizenet/directpost_request' => \Mage_Authorizenet_Model_Directpost_Request::class,
'authorizenet/directpost_response' => \Mage_Authorizenet_Model_Directpost_Response::class,
'authorizenet/directpost_session' => \Mage_Authorizenet_Model_Directpost_Session::class,
- 'backup/backup' => \Mage_Backup_Model_Backup::class,
- 'backup/config_backend_cron' => \Mage_Backup_Model_Config_Backend_Cron::class,
- 'backup/config_source_type' => \Mage_Backup_Model_Config_Source_Type::class,
- 'backup/db' => \Mage_Backup_Model_Db::class,
- 'backup/fs_collection' => \Mage_Backup_Model_Fs_Collection::class,
- 'backup/mysql4_db' => \Mage_Backup_Model_Mysql4_Db::class,
- 'backup/observer' => \Mage_Backup_Model_Observer::class,
- 'backup/resource_db' => \Mage_Backup_Model_Resource_Db::class,
- 'backup/resource_helper_mysql4' => \Mage_Backup_Model_Resource_Helper_Mysql4::class,
'bundle/catalogIndex_data_bundle' => \Mage_Bundle_Model_CatalogIndex_Data_Bundle::class,
'bundle/mysql4_bundle' => \Mage_Bundle_Model_Mysql4_Bundle::class,
'bundle/mysql4_indexer_price' => \Mage_Bundle_Model_Mysql4_Indexer_Price::class,
@@ -3550,15 +3541,6 @@
'authorizenet/directpost_request' => \Mage_Authorizenet_Model_Directpost_Request::class,
'authorizenet/directpost_response' => \Mage_Authorizenet_Model_Directpost_Response::class,
'authorizenet/directpost_session' => \Mage_Authorizenet_Model_Directpost_Session::class,
- 'backup/backup' => \Mage_Backup_Model_Backup::class,
- 'backup/config_backend_cron' => \Mage_Backup_Model_Config_Backend_Cron::class,
- 'backup/config_source_type' => \Mage_Backup_Model_Config_Source_Type::class,
- 'backup/db' => \Mage_Backup_Model_Db::class,
- 'backup/fs_collection' => \Mage_Backup_Model_Fs_Collection::class,
- 'backup/mysql4_db' => \Mage_Backup_Model_Mysql4_Db::class,
- 'backup/observer' => \Mage_Backup_Model_Observer::class,
- 'backup/resource_db' => \Mage_Backup_Model_Resource_Db::class,
- 'backup/resource_helper_mysql4' => \Mage_Backup_Model_Resource_Helper_Mysql4::class,
'bundle/catalogIndex_data_bundle' => \Mage_Bundle_Model_CatalogIndex_Data_Bundle::class,
'bundle/mysql4_bundle' => \Mage_Bundle_Model_Mysql4_Bundle::class,
'bundle/mysql4_indexer_price' => \Mage_Bundle_Model_Mysql4_Indexer_Price::class,
diff --git a/.phpstorm.meta.php/magento_models_methods.meta.php b/.phpstorm.meta.php/magento_models_methods.meta.php
index cc6d607fb0e..a623b67ad9e 100644
--- a/.phpstorm.meta.php/magento_models_methods.meta.php
+++ b/.phpstorm.meta.php/magento_models_methods.meta.php
@@ -366,15 +366,6 @@
'authorizenet/directpost_request' => \Mage_Authorizenet_Model_Directpost_Request::class,
'authorizenet/directpost_response' => \Mage_Authorizenet_Model_Directpost_Response::class,
'authorizenet/directpost_session' => \Mage_Authorizenet_Model_Directpost_Session::class,
- 'backup/backup' => \Mage_Backup_Model_Backup::class,
- 'backup/config_backend_cron' => \Mage_Backup_Model_Config_Backend_Cron::class,
- 'backup/config_source_type' => \Mage_Backup_Model_Config_Source_Type::class,
- 'backup/db' => \Mage_Backup_Model_Db::class,
- 'backup/fs_collection' => \Mage_Backup_Model_Fs_Collection::class,
- 'backup/mysql4_db' => \Mage_Backup_Model_Mysql4_Db::class,
- 'backup/observer' => \Mage_Backup_Model_Observer::class,
- 'backup/resource_db' => \Mage_Backup_Model_Resource_Db::class,
- 'backup/resource_helper_mysql4' => \Mage_Backup_Model_Resource_Helper_Mysql4::class,
'bundle/catalogIndex_data_bundle' => \Mage_Bundle_Model_CatalogIndex_Data_Bundle::class,
'bundle/mysql4_bundle' => \Mage_Bundle_Model_Mysql4_Bundle::class,
'bundle/mysql4_indexer_price' => \Mage_Bundle_Model_Mysql4_Indexer_Price::class,
@@ -3550,15 +3541,6 @@
'authorizenet/directpost_request' => \Mage_Authorizenet_Model_Directpost_Request::class,
'authorizenet/directpost_response' => \Mage_Authorizenet_Model_Directpost_Response::class,
'authorizenet/directpost_session' => \Mage_Authorizenet_Model_Directpost_Session::class,
- 'backup/backup' => \Mage_Backup_Model_Backup::class,
- 'backup/config_backend_cron' => \Mage_Backup_Model_Config_Backend_Cron::class,
- 'backup/config_source_type' => \Mage_Backup_Model_Config_Source_Type::class,
- 'backup/db' => \Mage_Backup_Model_Db::class,
- 'backup/fs_collection' => \Mage_Backup_Model_Fs_Collection::class,
- 'backup/mysql4_db' => \Mage_Backup_Model_Mysql4_Db::class,
- 'backup/observer' => \Mage_Backup_Model_Observer::class,
- 'backup/resource_db' => \Mage_Backup_Model_Resource_Db::class,
- 'backup/resource_helper_mysql4' => \Mage_Backup_Model_Resource_Helper_Mysql4::class,
'bundle/catalogIndex_data_bundle' => \Mage_Bundle_Model_CatalogIndex_Data_Bundle::class,
'bundle/mysql4_bundle' => \Mage_Bundle_Model_Mysql4_Bundle::class,
'bundle/mysql4_indexer_price' => \Mage_Bundle_Model_Mysql4_Indexer_Price::class,
@@ -6734,15 +6716,6 @@
'authorizenet/directpost_request' => \Mage_Authorizenet_Model_Directpost_Request::class,
'authorizenet/directpost_response' => \Mage_Authorizenet_Model_Directpost_Response::class,
'authorizenet/directpost_session' => \Mage_Authorizenet_Model_Directpost_Session::class,
- 'backup/backup' => \Mage_Backup_Model_Backup::class,
- 'backup/config_backend_cron' => \Mage_Backup_Model_Config_Backend_Cron::class,
- 'backup/config_source_type' => \Mage_Backup_Model_Config_Source_Type::class,
- 'backup/db' => \Mage_Backup_Model_Db::class,
- 'backup/fs_collection' => \Mage_Backup_Model_Fs_Collection::class,
- 'backup/mysql4_db' => \Mage_Backup_Model_Mysql4_Db::class,
- 'backup/observer' => \Mage_Backup_Model_Observer::class,
- 'backup/resource_db' => \Mage_Backup_Model_Resource_Db::class,
- 'backup/resource_helper_mysql4' => \Mage_Backup_Model_Resource_Helper_Mysql4::class,
'bundle/catalogIndex_data_bundle' => \Mage_Bundle_Model_CatalogIndex_Data_Bundle::class,
'bundle/mysql4_bundle' => \Mage_Bundle_Model_Mysql4_Bundle::class,
'bundle/mysql4_indexer_price' => \Mage_Bundle_Model_Mysql4_Indexer_Price::class,
@@ -9918,15 +9891,6 @@
'authorizenet/directpost_request' => \Mage_Authorizenet_Model_Directpost_Request::class,
'authorizenet/directpost_response' => \Mage_Authorizenet_Model_Directpost_Response::class,
'authorizenet/directpost_session' => \Mage_Authorizenet_Model_Directpost_Session::class,
- 'backup/backup' => \Mage_Backup_Model_Backup::class,
- 'backup/config_backend_cron' => \Mage_Backup_Model_Config_Backend_Cron::class,
- 'backup/config_source_type' => \Mage_Backup_Model_Config_Source_Type::class,
- 'backup/db' => \Mage_Backup_Model_Db::class,
- 'backup/fs_collection' => \Mage_Backup_Model_Fs_Collection::class,
- 'backup/mysql4_db' => \Mage_Backup_Model_Mysql4_Db::class,
- 'backup/observer' => \Mage_Backup_Model_Observer::class,
- 'backup/resource_db' => \Mage_Backup_Model_Resource_Db::class,
- 'backup/resource_helper_mysql4' => \Mage_Backup_Model_Resource_Helper_Mysql4::class,
'bundle/catalogIndex_data_bundle' => \Mage_Bundle_Model_CatalogIndex_Data_Bundle::class,
'bundle/mysql4_bundle' => \Mage_Bundle_Model_Mysql4_Bundle::class,
'bundle/mysql4_indexer_price' => \Mage_Bundle_Model_Mysql4_Indexer_Price::class,
@@ -13102,15 +13066,6 @@
'authorizenet/directpost_request' => \Mage_Authorizenet_Model_Directpost_Request::class,
'authorizenet/directpost_response' => \Mage_Authorizenet_Model_Directpost_Response::class,
'authorizenet/directpost_session' => \Mage_Authorizenet_Model_Directpost_Session::class,
- 'backup/backup' => \Mage_Backup_Model_Backup::class,
- 'backup/config_backend_cron' => \Mage_Backup_Model_Config_Backend_Cron::class,
- 'backup/config_source_type' => \Mage_Backup_Model_Config_Source_Type::class,
- 'backup/db' => \Mage_Backup_Model_Db::class,
- 'backup/fs_collection' => \Mage_Backup_Model_Fs_Collection::class,
- 'backup/mysql4_db' => \Mage_Backup_Model_Mysql4_Db::class,
- 'backup/observer' => \Mage_Backup_Model_Observer::class,
- 'backup/resource_db' => \Mage_Backup_Model_Resource_Db::class,
- 'backup/resource_helper_mysql4' => \Mage_Backup_Model_Resource_Helper_Mysql4::class,
'bundle/catalogIndex_data_bundle' => \Mage_Bundle_Model_CatalogIndex_Data_Bundle::class,
'bundle/mysql4_bundle' => \Mage_Bundle_Model_Mysql4_Bundle::class,
'bundle/mysql4_indexer_price' => \Mage_Bundle_Model_Mysql4_Indexer_Price::class,
@@ -16286,15 +16241,6 @@
'authorizenet/directpost_request' => \Mage_Authorizenet_Model_Directpost_Request::class,
'authorizenet/directpost_response' => \Mage_Authorizenet_Model_Directpost_Response::class,
'authorizenet/directpost_session' => \Mage_Authorizenet_Model_Directpost_Session::class,
- 'backup/backup' => \Mage_Backup_Model_Backup::class,
- 'backup/config_backend_cron' => \Mage_Backup_Model_Config_Backend_Cron::class,
- 'backup/config_source_type' => \Mage_Backup_Model_Config_Source_Type::class,
- 'backup/db' => \Mage_Backup_Model_Db::class,
- 'backup/fs_collection' => \Mage_Backup_Model_Fs_Collection::class,
- 'backup/mysql4_db' => \Mage_Backup_Model_Mysql4_Db::class,
- 'backup/observer' => \Mage_Backup_Model_Observer::class,
- 'backup/resource_db' => \Mage_Backup_Model_Resource_Db::class,
- 'backup/resource_helper_mysql4' => \Mage_Backup_Model_Resource_Helper_Mysql4::class,
'bundle/catalogIndex_data_bundle' => \Mage_Bundle_Model_CatalogIndex_Data_Bundle::class,
'bundle/mysql4_bundle' => \Mage_Bundle_Model_Mysql4_Bundle::class,
'bundle/mysql4_indexer_price' => \Mage_Bundle_Model_Mysql4_Indexer_Price::class,
@@ -19470,15 +19416,6 @@
'authorizenet/directpost_request' => \Mage_Authorizenet_Model_Directpost_Request::class,
'authorizenet/directpost_response' => \Mage_Authorizenet_Model_Directpost_Response::class,
'authorizenet/directpost_session' => \Mage_Authorizenet_Model_Directpost_Session::class,
- 'backup/backup' => \Mage_Backup_Model_Backup::class,
- 'backup/config_backend_cron' => \Mage_Backup_Model_Config_Backend_Cron::class,
- 'backup/config_source_type' => \Mage_Backup_Model_Config_Source_Type::class,
- 'backup/db' => \Mage_Backup_Model_Db::class,
- 'backup/fs_collection' => \Mage_Backup_Model_Fs_Collection::class,
- 'backup/mysql4_db' => \Mage_Backup_Model_Mysql4_Db::class,
- 'backup/observer' => \Mage_Backup_Model_Observer::class,
- 'backup/resource_db' => \Mage_Backup_Model_Resource_Db::class,
- 'backup/resource_helper_mysql4' => \Mage_Backup_Model_Resource_Helper_Mysql4::class,
'bundle/catalogIndex_data_bundle' => \Mage_Bundle_Model_CatalogIndex_Data_Bundle::class,
'bundle/mysql4_bundle' => \Mage_Bundle_Model_Mysql4_Bundle::class,
'bundle/mysql4_indexer_price' => \Mage_Bundle_Model_Mysql4_Indexer_Price::class,
@@ -22654,15 +22591,6 @@
'authorizenet/directpost_request' => \Mage_Authorizenet_Model_Directpost_Request::class,
'authorizenet/directpost_response' => \Mage_Authorizenet_Model_Directpost_Response::class,
'authorizenet/directpost_session' => \Mage_Authorizenet_Model_Directpost_Session::class,
- 'backup/backup' => \Mage_Backup_Model_Backup::class,
- 'backup/config_backend_cron' => \Mage_Backup_Model_Config_Backend_Cron::class,
- 'backup/config_source_type' => \Mage_Backup_Model_Config_Source_Type::class,
- 'backup/db' => \Mage_Backup_Model_Db::class,
- 'backup/fs_collection' => \Mage_Backup_Model_Fs_Collection::class,
- 'backup/mysql4_db' => \Mage_Backup_Model_Mysql4_Db::class,
- 'backup/observer' => \Mage_Backup_Model_Observer::class,
- 'backup/resource_db' => \Mage_Backup_Model_Resource_Db::class,
- 'backup/resource_helper_mysql4' => \Mage_Backup_Model_Resource_Helper_Mysql4::class,
'bundle/catalogIndex_data_bundle' => \Mage_Bundle_Model_CatalogIndex_Data_Bundle::class,
'bundle/mysql4_bundle' => \Mage_Bundle_Model_Mysql4_Bundle::class,
'bundle/mysql4_indexer_price' => \Mage_Bundle_Model_Mysql4_Indexer_Price::class,
@@ -25838,15 +25766,6 @@
'authorizenet/directpost_request' => \Mage_Authorizenet_Model_Directpost_Request::class,
'authorizenet/directpost_response' => \Mage_Authorizenet_Model_Directpost_Response::class,
'authorizenet/directpost_session' => \Mage_Authorizenet_Model_Directpost_Session::class,
- 'backup/backup' => \Mage_Backup_Model_Backup::class,
- 'backup/config_backend_cron' => \Mage_Backup_Model_Config_Backend_Cron::class,
- 'backup/config_source_type' => \Mage_Backup_Model_Config_Source_Type::class,
- 'backup/db' => \Mage_Backup_Model_Db::class,
- 'backup/fs_collection' => \Mage_Backup_Model_Fs_Collection::class,
- 'backup/mysql4_db' => \Mage_Backup_Model_Mysql4_Db::class,
- 'backup/observer' => \Mage_Backup_Model_Observer::class,
- 'backup/resource_db' => \Mage_Backup_Model_Resource_Db::class,
- 'backup/resource_helper_mysql4' => \Mage_Backup_Model_Resource_Helper_Mysql4::class,
'bundle/catalogIndex_data_bundle' => \Mage_Bundle_Model_CatalogIndex_Data_Bundle::class,
'bundle/mysql4_bundle' => \Mage_Bundle_Model_Mysql4_Bundle::class,
'bundle/mysql4_indexer_price' => \Mage_Bundle_Model_Mysql4_Indexer_Price::class,
diff --git a/README.md b/README.md
index 206892f3cfa..121c73f37c3 100644
--- a/README.md
+++ b/README.md
@@ -99,6 +99,7 @@ Most important changes will be listed here, all other changes since `19.4.0` can
- search for "NULL" in backend grids [#1203](https://github.com/OpenMage/magento-lts/pull/1203)
- removed lib/flex containing unused ActionScript "file uploader" files [#2271](https://github.com/OpenMage/magento-lts/pull/2271)
- removed modules:
+ - `Mage_Backup` [#2811](https://github.com/OpenMage/magento-lts/pull/2811)
- `Mage_Compiler`
- `Mage_GoogleBase`
- `Mage_PageCache` [#2258](https://github.com/OpenMage/magento-lts/pull/2258)
@@ -106,6 +107,7 @@ Most important changes will be listed here, all other changes since `19.4.0` can
- `Phoenix_Moneybookers`
_If you rely on those modules you can reinstall them with composer:_
+- `Mage_Backup`: `composer require openmage/module-mage-backup`
- `Mage_PageCache`: `composer require openmage/module-mage-pagecache`
### Between OpenMage 19.4.18 / 20.0.16 and 19.4.19 / 20.0.17
diff --git a/app/code/core/Mage/Adminhtml/Block/Backup.php b/app/code/core/Mage/Adminhtml/Block/Backup.php
deleted file mode 100644
index 9388c1bdeb4..00000000000
--- a/app/code/core/Mage/Adminhtml/Block/Backup.php
+++ /dev/null
@@ -1,116 +0,0 @@
-
- */
-class Mage_Adminhtml_Block_Backup extends Mage_Adminhtml_Block_Template
-{
- /**
- * Block's template
- *
- * @var string
- */
- protected $_template = 'backup/list.phtml';
-
- protected function _prepareLayout()
- {
- parent::_prepareLayout();
- $this->setChild(
- 'createButton',
- $this->getLayout()->createBlock('adminhtml/widget_button')
- ->setData([
- 'label' => Mage::helper('backup')->__('Database Backup'),
- 'onclick' => "return backup.backup('" . Mage_Backup_Helper_Data::TYPE_DB . "')",
- 'class' => 'task'
- ])
- );
- $this->setChild(
- 'createSnapshotButton',
- $this->getLayout()->createBlock('adminhtml/widget_button')
- ->setData([
- 'label' => Mage::helper('backup')->__('System Backup'),
- 'onclick' => "return backup.backup('" . Mage_Backup_Helper_Data::TYPE_SYSTEM_SNAPSHOT . "')",
- 'class' => ''
- ])
- );
- $this->setChild(
- 'createMediaBackupButton',
- $this->getLayout()->createBlock('adminhtml/widget_button')
- ->setData([
- 'label' => Mage::helper('backup')->__('Database and Media Backup'),
- 'onclick' => "return backup.backup('" . Mage_Backup_Helper_Data::TYPE_MEDIA . "')",
- 'class' => ''
- ])
- );
- $this->setChild(
- 'backupsGrid',
- $this->getLayout()->createBlock('adminhtml/backup_grid')
- );
-
- $this->setChild('dialogs', $this->getLayout()->createBlock('adminhtml/backup_dialogs'));
- return $this;
- }
-
- public function getCreateButtonHtml()
- {
- return $this->getChildHtml('createButton');
- }
-
- /**
- * Generate html code for "Create System Snapshot" button
- *
- * @return string
- */
- public function getCreateSnapshotButtonHtml()
- {
- return $this->getChildHtml('createSnapshotButton');
- }
-
- /**
- * Generate html code for "Create Media Backup" button
- *
- * @return string
- */
- public function getCreateMediaBackupButtonHtml()
- {
- return $this->getChildHtml('createMediaBackupButton');
- }
-
- public function getGridHtml()
- {
- return $this->getChildHtml('backupsGrid');
- }
-
- /**
- * Generate html code for pop-up messages that will appear when user click on "Rollback" link
- *
- * @return string
- */
- public function getDialogsHtml()
- {
- return $this->getChildHtml('dialogs');
- }
-}
diff --git a/app/code/core/Mage/Adminhtml/Block/Backup/Dialogs.php b/app/code/core/Mage/Adminhtml/Block/Backup/Dialogs.php
deleted file mode 100644
index 4fe84915bd5..00000000000
--- a/app/code/core/Mage/Adminhtml/Block/Backup/Dialogs.php
+++ /dev/null
@@ -1,50 +0,0 @@
-
- */
-class Mage_Adminhtml_Block_Backup_Dialogs extends Mage_Adminhtml_Block_Template
-{
- /**
- * Block's template
- *
- * @var string
- */
- protected $_template = 'backup/dialogs.phtml';
-
- /**
- * Include backup.js file in page before rendering
- *
- * @inheritDoc
- */
- protected function _prepareLayout()
- {
- /** @var Mage_Page_Block_Html_Head $block */
- $block = $this->getLayout()->getBlock('head');
- $block->addJs('mage/adminhtml/backup.js');
- return parent::_prepareLayout();
- }
-}
diff --git a/app/code/core/Mage/Adminhtml/Block/Backup/Grid.php b/app/code/core/Mage/Adminhtml/Block/Backup/Grid.php
deleted file mode 100644
index 7ae2e11a4da..00000000000
--- a/app/code/core/Mage/Adminhtml/Block/Backup/Grid.php
+++ /dev/null
@@ -1,137 +0,0 @@
-
- */
-class Mage_Adminhtml_Block_Backup_Grid extends Mage_Adminhtml_Block_Widget_Grid
-{
- protected function _construct()
- {
- $this->setSaveParametersInSession(true);
- $this->setId('backupsGrid');
- $this->setDefaultSort('time');
- $this->setDefaultDir('desc');
- }
-
- /**
- * @inheritDoc
- */
- protected function _prepareCollection()
- {
- $collection = Mage::getSingleton('backup/fs_collection');
- $this->setCollection($collection);
- return parent::_prepareCollection();
- }
-
- /**
- * Prepare mass action controls
- *
- * @return $this
- */
- protected function _prepareMassaction()
- {
- $this->setMassactionIdField('id');
- $this->getMassactionBlock()->setFormFieldName('ids');
-
- $this->getMassactionBlock()->addItem(MassAction::DELETE, [
- 'label' => Mage::helper('adminhtml')->__('Delete'),
- 'url' => $this->getUrl('*/*/massDelete'),
- 'confirm' => Mage::helper('backup')->__('Are you sure you want to delete the selected backup(s)?')
- ]);
-
- return $this;
- }
-
- /**
- * Configuration of grid
- *
- * @return $this
- * @throws Exception
- */
- protected function _prepareColumns()
- {
- $url7zip = Mage::helper('adminhtml')->__('The archive can be uncompressed with %s on Windows systems', 'http://www.7-zip.org/', '7-Zip');
-
- $this->addColumn('time', [
- 'header' => Mage::helper('backup')->__('Time'),
- 'index' => 'date_object',
- 'type' => 'datetime',
- ]);
-
- $this->addColumn('display_name', [
- 'header' => Mage::helper('backup')->__('Name'),
- 'index' => 'display_name',
- 'filter' => false,
- 'sortable' => true,
- 'width' => 350
- ]);
-
- $this->addColumn('size', [
- 'header' => Mage::helper('backup')->__('Size, Bytes'),
- 'index' => 'size',
- 'type' => 'number',
- 'sortable' => true,
- 'filter' => false
- ]);
-
- $this->addColumn('type', [
- 'header' => Mage::helper('backup')->__('Type'),
- 'type' => 'options',
- 'options' => Mage::helper('backup')->getBackupTypes(),
- 'index' => 'type',
- 'width' => 300
- ]);
-
- $this->addColumn('download', [
- 'header' => Mage::helper('backup')->__('Download'),
- 'format' => '$extension (' . $url7zip . ')',
- 'index' => 'type',
- 'sortable' => false,
- 'filter' => false
- ]);
-
- if (Mage::helper('backup')->isRollbackAllowed()) {
- $this->addColumn('action', [
- 'header' => Mage::helper('backup')->__('Action'),
- 'type' => 'action',
- 'width' => '80px',
- 'filter' => false,
- 'actions' => [[
- 'url' => '#',
- 'caption' => Mage::helper('backup')->__('Rollback'),
- 'onclick' => 'return backup.rollback(\'$type\', \'$time\');'
- ]],
- 'index' => 'type',
- 'sortable' => false
- ]);
- }
-
- return $this;
- }
-}
diff --git a/app/code/core/Mage/Adminhtml/controllers/System/BackupController.php b/app/code/core/Mage/Adminhtml/controllers/System/BackupController.php
deleted file mode 100644
index 7bd6656e22f..00000000000
--- a/app/code/core/Mage/Adminhtml/controllers/System/BackupController.php
+++ /dev/null
@@ -1,377 +0,0 @@
-
- */
-class Mage_Adminhtml_System_BackupController extends Mage_Adminhtml_Controller_Action
-{
- /**
- * Controller pre-dispatch method
- *
- * @return Mage_Adminhtml_Controller_Action
- */
- public function preDispatch()
- {
- $this->_setForcedFormKeyActions(['create', 'massDelete']);
- return parent::preDispatch();
- }
-
- /**
- * Backup list action
- */
- public function indexAction()
- {
- $this->_title($this->__('System'))->_title($this->__('Tools'))->_title($this->__('Backups'));
-
- if ($this->getRequest()->getParam('ajax')) {
- $this->_forward('grid');
- return;
- }
-
- $this->loadLayout();
- $this->_setActiveMenu('system');
- $this->_addBreadcrumb(Mage::helper('adminhtml')->__('System'), Mage::helper('adminhtml')->__('System'));
- $this->_addBreadcrumb(Mage::helper('adminhtml')->__('Tools'), Mage::helper('adminhtml')->__('Tools'));
- $this->_addBreadcrumb(Mage::helper('adminhtml')->__('Backups'), Mage::helper('adminhtml')->__('Backup'));
-
- $this->_addContent($this->getLayout()->createBlock('adminhtml/backup', 'backup'));
-
- $this->renderLayout();
- }
-
- /**
- * Backup list action
- */
- public function gridAction()
- {
- $this->getResponse()->setBody($this->getLayout()->createBlock('adminhtml/backup_grid')->toHtml());
- }
-
- /**
- * Create backup action
- *
- * @return Mage_Adminhtml_Controller_Action
- */
- public function createAction()
- {
- if (!$this->getRequest()->isAjax()) {
- return $this->getUrl('*/*/index');
- }
-
- $response = new Varien_Object();
-
- /**
- * @var Mage_Backup_Helper_Data $helper
- */
- $helper = Mage::helper('backup');
-
- try {
- $type = $this->getRequest()->getParam('type');
-
- if ($type == Mage_Backup_Helper_Data::TYPE_SYSTEM_SNAPSHOT
- && $this->getRequest()->getParam('exclude_media')
- ) {
- $type = Mage_Backup_Helper_Data::TYPE_SNAPSHOT_WITHOUT_MEDIA;
- }
-
- $backupManager = Mage_Backup::getBackupInstance($type)
- ->setBackupExtension($helper->getExtensionByType($type))
- ->setTime(time())
- ->setBackupsDir($helper->getBackupsDir());
-
- $backupManager->setName($this->getRequest()->getParam('backup_name'));
-
- Mage::register('backup_manager', $backupManager);
-
- if ($this->getRequest()->getParam('maintenance_mode')) {
- $turnedOn = $helper->turnOnMaintenanceMode();
-
- if (!$turnedOn) {
- $response->setError(
- Mage::helper('backup')->__('You do not have sufficient permissions to enable Maintenance Mode during this operation.')
- . ' ' . Mage::helper('backup')->__('Please either unselect the "Put store on the maintenance mode" checkbox or update your permissions to proceed with the backup."')
- );
- $backupManager->setErrorMessage(Mage::helper('backup')->__("System couldn't put store on the maintenance mode"));
- return $this->getResponse()->setBody($response->toJson());
- }
- }
-
- if ($type != Mage_Backup_Helper_Data::TYPE_DB) {
- $backupManager->setRootDir(Mage::getBaseDir())
- ->addIgnorePaths($helper->getBackupIgnorePaths());
- }
-
- $successMessage = $helper->getCreateSuccessMessageByType($type);
-
- $backupManager->create();
-
- $this->_getSession()->addSuccess($successMessage);
-
- $response->setRedirectUrl($this->getUrl('*/*/index'));
- } catch (Mage_Backup_Exception_NotEnoughFreeSpace $e) {
- $errorMessage = Mage::helper('backup')->__('Not enough free space to create backup.');
- } catch (Mage_Backup_Exception_NotEnoughPermissions $e) {
- Mage::log($e->getMessage());
- $errorMessage = Mage::helper('backup')->__('Not enough permissions to create backup.');
- } catch (Exception $e) {
- Mage::log($e->getMessage());
- $errorMessage = Mage::helper('backup')->__('An error occurred while creating the backup.');
- }
-
- if (!empty($errorMessage)) {
- $response->setError($errorMessage);
- $backupManager->setErrorMessage($errorMessage);
- }
-
- if ($this->getRequest()->getParam('maintenance_mode')) {
- $helper->turnOffMaintenanceMode();
- }
-
- $this->getResponse()->setBody($response->toJson());
- }
-
- /**
- * Download backup action
- *
- * @return Mage_Adminhtml_Controller_Action
- */
- public function downloadAction()
- {
- /** @var Mage_Backup_Model_Backup $backup */
- $backup = Mage::getModel('backup/backup')->loadByTimeAndType(
- $this->getRequest()->getParam('time'),
- $this->getRequest()->getParam('type')
- );
-
- if (!$backup->getTime() || !$backup->exists()) {
- return $this->_redirect('*/*');
- }
-
- $fileName = Mage::helper('backup')->generateBackupDownloadName($backup);
-
- $this->_prepareDownloadResponse($fileName, null, 'application/octet-stream', $backup->getSize());
-
- $this->getResponse()->sendHeaders();
-
- $backup->output();
- exit();
- }
-
- /**
- * Rollback Action
- *
- * @return Mage_Adminhtml_Controller_Action
- */
- public function rollbackAction()
- {
- if (!Mage::helper('backup')->isRollbackAllowed()) {
- return $this->_forward('denied');
- }
-
- if (!$this->getRequest()->isAjax()) {
- return $this->getUrl('*/*/index');
- }
-
- $helper = Mage::helper('backup');
- $response = new Varien_Object();
-
- try {
- /** @var Mage_Backup_Model_Backup $backup */
- $backup = Mage::getModel('backup/backup')->loadByTimeAndType(
- $this->getRequest()->getParam('time'),
- $this->getRequest()->getParam('type')
- );
-
- if (!$backup->getTime() || !$backup->exists()) {
- return $this->_redirect('*/*');
- }
-
- if (!$backup->getTime()) {
- throw new Mage_Backup_Exception_CantLoadSnapshot();
- }
-
- $type = $backup->getType();
-
- $backupManager = Mage_Backup::getBackupInstance($type)
- ->setBackupExtension($helper->getExtensionByType($type))
- ->setTime($backup->getTime())
- ->setBackupsDir($helper->getBackupsDir())
- ->setName($backup->getName(), false)
- ->setResourceModel(Mage::getResourceModel('backup/db'));
-
- Mage::register('backup_manager', $backupManager);
-
- $passwordValid = Mage::getModel('backup/backup')->validateUserPassword(
- $this->getRequest()->getParam('password')
- );
-
- if (!$passwordValid) {
- $response->setError(Mage::helper('backup')->__('Invalid Password.'));
- $backupManager->setErrorMessage(Mage::helper('backup')->__('Invalid Password.'));
- return $this->getResponse()->setBody($response->toJson());
- }
-
- if ($this->getRequest()->getParam('maintenance_mode')) {
- $turnedOn = $helper->turnOnMaintenanceMode();
-
- if (!$turnedOn) {
- $response->setError(
- Mage::helper('backup')->__('You do not have sufficient permissions to enable Maintenance Mode during this operation.')
- . ' ' . Mage::helper('backup')->__('Please either unselect the "Put store on the maintenance mode" checkbox or update your permissions to proceed with the rollback."')
- );
- $backupManager->setErrorMessage(Mage::helper('backup')->__("System couldn't put store on the maintenance mode"));
- return $this->getResponse()->setBody($response->toJson());
- }
- }
-
- if ($type != Mage_Backup_Helper_Data::TYPE_DB) {
- $backupManager->setRootDir(Mage::getBaseDir())
- ->addIgnorePaths($helper->getRollbackIgnorePaths());
-
- if ($this->getRequest()->getParam('use_ftp', false)) {
- $backupManager->setUseFtp(
- $this->getRequest()->getParam('ftp_host', ''),
- $this->getRequest()->getParam('ftp_user', ''),
- $this->getRequest()->getParam('ftp_pass', ''),
- $this->getRequest()->getParam('ftp_path', '')
- );
- }
- }
-
- $backupManager->rollback();
-
- $helper->invalidateCache()->invalidateIndexer();
-
- $adminSession = $this->_getSession();
- $adminSession->unsetAll();
- $adminSession->getCookie()->delete($adminSession->getSessionName());
-
- $response->setRedirectUrl($this->getUrl('*'));
- } catch (Mage_Backup_Exception_CantLoadSnapshot $e) {
- $errorMsg = Mage::helper('backup')->__('Backup file not found');
- } catch (Mage_Backup_Exception_FtpConnectionFailed $e) {
- $errorMsg = Mage::helper('backup')->__('Failed to connect to FTP');
- } catch (Mage_Backup_Exception_FtpValidationFailed $e) {
- $errorMsg = Mage::helper('backup')->__('Failed to validate FTP');
- } catch (Mage_Backup_Exception_NotEnoughPermissions $e) {
- Mage::log($e->getMessage());
- $errorMsg = Mage::helper('backup')->__('Not enough permissions to perform rollback');
- } catch (Exception $e) {
- Mage::log($e->getMessage());
- $errorMsg = Mage::helper('backup')->__('Failed to rollback');
- }
-
- if (!empty($errorMsg)) {
- $response->setError($errorMsg);
- $backupManager->setErrorMessage($errorMsg);
- }
-
- if ($this->getRequest()->getParam('maintenance_mode')) {
- $helper->turnOffMaintenanceMode();
- }
-
- $this->getResponse()->setBody($response->toJson());
- }
-
- /**
- * Delete backups mass action
- *
- * @return Mage_Adminhtml_Controller_Action
- */
- public function massDeleteAction()
- {
- $backupIds = $this->getRequest()->getParam('ids', []);
-
- if (!is_array($backupIds) || !count($backupIds)) {
- return $this->_redirect('*/*/index');
- }
-
- /** @var Mage_Backup_Model_Backup $backupModel */
- $backupModel = Mage::getModel('backup/backup');
- $resultData = new Varien_Object();
- $resultData->setIsSuccess(false);
- $resultData->setDeleteResult([]);
- Mage::register('backup_manager', $resultData);
-
- $deleteFailMessage = Mage::helper('backup')->__('Failed to delete one or several backups.');
-
- try {
- $allBackupsDeleted = true;
-
- foreach ($backupIds as $id) {
- list($time, $type) = explode('_', $id);
- $backupModel
- ->loadByTimeAndType($time, $type)
- ->deleteFile();
-
- if ($backupModel->exists()) {
- $allBackupsDeleted = false;
- $result = Mage::helper('adminhtml')->__('failed');
- } else {
- $result = Mage::helper('adminhtml')->__('successful');
- }
-
- $resultData->setDeleteResult(
- array_merge($resultData->getDeleteResult(), [$backupModel->getFileName() . ' ' . $result])
- );
- }
-
- $resultData->setIsSuccess(true);
- if ($allBackupsDeleted) {
- $this->_getSession()->addSuccess(
- Mage::helper('backup')->__('The selected backup(s) has been deleted.')
- );
- } else {
- throw new Exception($deleteFailMessage);
- }
- } catch (Exception $e) {
- $resultData->setIsSuccess(false);
- $this->_getSession()->addError($deleteFailMessage);
- }
-
- return $this->_redirect('*/*/index');
- }
-
- /**
- * @inheritDoc
- */
- protected function _isAllowed()
- {
- return Mage::getSingleton('admin/session')->isAllowed('system/tools/backup')
- && Mage::helper('core')->isModuleEnabled('Mage_Backup')
- && !Mage::getStoreConfigFlag('advanced/modules_disable_output/Mage_Backup');
- }
-
- /**
- * Retrieve adminhtml session model
- *
- * @return Mage_Adminhtml_Model_Session
- */
- protected function _getSession()
- {
- return Mage::getSingleton('adminhtml/session');
- }
-}
diff --git a/app/code/core/Mage/Adminhtml/controllers/System/StoreController.php b/app/code/core/Mage/Adminhtml/controllers/System/StoreController.php
index 7fde1c22ac1..0e974a36c33 100644
--- a/app/code/core/Mage/Adminhtml/controllers/System/StoreController.php
+++ b/app/code/core/Mage/Adminhtml/controllers/System/StoreController.php
@@ -453,6 +453,13 @@ public function deleteStorePostAction()
*/
protected function _backupDatabase($failPath, $arguments = [])
{
+ if (!class_exists('Mage_Backup_Model_Backup')
+ || !class_exists('Mage_Backup_Model_Db')
+ || !class_exists('Mage_Backup_Helper_Data')
+ ) {
+ return $this;
+ }
+
if (!$this->getRequest()->getParam('create_backup')) {
return $this;
}
diff --git a/app/code/core/Mage/Backup/Exception.php b/app/code/core/Mage/Backup/Exception.php
deleted file mode 100644
index 7da3d3f93af..00000000000
--- a/app/code/core/Mage/Backup/Exception.php
+++ /dev/null
@@ -1,29 +0,0 @@
-
- */
-class Mage_Backup_Exception extends Zend_Exception
-{
-}
diff --git a/app/code/core/Mage/Backup/Helper/Data.php b/app/code/core/Mage/Backup/Helper/Data.php
deleted file mode 100644
index efb2d23a301..00000000000
--- a/app/code/core/Mage/Backup/Helper/Data.php
+++ /dev/null
@@ -1,327 +0,0 @@
-
- */
-class Mage_Backup_Helper_Data extends Mage_Core_Helper_Abstract
-{
- /**
- * Backup type constant for database backup
- */
- public const TYPE_DB = 'db';
-
- /**
- * Backup type constant for filesystem backup
- */
- public const TYPE_FILESYSTEM = 'filesystem';
-
- /**
- * Backup type constant for full system backup(database + filesystem)
- */
- public const TYPE_SYSTEM_SNAPSHOT = 'snapshot';
-
- /**
- * Backup type constant for media and database backup
- */
- public const TYPE_MEDIA = 'media';
-
- /**
- * Backup type constant for full system backup excluding media folder
- */
- public const TYPE_SNAPSHOT_WITHOUT_MEDIA = 'nomedia';
-
- protected $_moduleName = 'Mage_Backup';
-
- /**
- * Get all possible backup type values with descriptive title
- *
- * @return array
- */
- public function getBackupTypes()
- {
- return [
- self::TYPE_DB => $this->__('Database'),
- self::TYPE_MEDIA => $this->__('Database and Media'),
- self::TYPE_SYSTEM_SNAPSHOT => $this->__('System'),
- self::TYPE_SNAPSHOT_WITHOUT_MEDIA => $this->__('System (excluding Media)')
- ];
- }
-
- /**
- * Get all possible backup type values
- *
- * @return array
- */
- public function getBackupTypesList()
- {
- return [
- self::TYPE_DB,
- self::TYPE_SYSTEM_SNAPSHOT,
- self::TYPE_SNAPSHOT_WITHOUT_MEDIA,
- self::TYPE_MEDIA
- ];
- }
-
- /**
- * Get default backup type value
- *
- * @return string
- */
- public function getDefaultBackupType()
- {
- return self::TYPE_DB;
- }
-
- /**
- * Get directory path where backups stored
- *
- * @return string
- */
- public function getBackupsDir()
- {
- return Mage::getBaseDir('var') . DS . 'backups';
- }
-
- /**
- * Get backup file extension by backup type
- *
- * @param string $type
- * @return string
- */
- public function getExtensionByType($type)
- {
- $extensions = $this->getExtensions();
- return $extensions[$type] ?? '';
- }
-
- /**
- * Get all types to extensions map
- *
- * @return array
- */
- public function getExtensions()
- {
- return [
- self::TYPE_SYSTEM_SNAPSHOT => 'tgz',
- self::TYPE_SNAPSHOT_WITHOUT_MEDIA => 'tgz',
- self::TYPE_MEDIA => 'tgz',
- self::TYPE_DB => 'gz'
- ];
- }
-
- /**
- * Generate backup download name
- *
- * @param Mage_Backup_Model_Backup $backup
- * @return string
- */
- public function generateBackupDownloadName(Mage_Backup_Model_Backup $backup)
- {
- $additionalExtension = $backup->getType() == self::TYPE_DB ? '.sql' : '';
- return $backup->getType() . '-' . date('YmdHis', $backup->getTime()) . $additionalExtension . '.'
- . $this->getExtensionByType($backup->getType());
- }
-
- /**
- * Check Permission for Rollback
- *
- * @return bool
- */
- public function isRollbackAllowed()
- {
- return Mage::getSingleton('admin/session')->isAllowed('system/tools/backup/rollback');
- }
-
- /**
- * Get paths that should be ignored when creating system snapshots
- *
- * @return array
- */
- public function getBackupIgnorePaths()
- {
- return [
- '.svn',
- 'maintenance.flag',
- Mage::getBaseDir('var') . DS . 'session',
- Mage::getBaseDir('var') . DS . 'cache',
- Mage::getBaseDir('var') . DS . 'full_page_cache',
- Mage::getBaseDir('var') . DS . 'locks',
- Mage::getBaseDir('var') . DS . 'log',
- Mage::getBaseDir('var') . DS . 'report'
- ];
- }
-
- /**
- * Get paths that should be ignored when rolling back system snapshots
- *
- * @return array
- */
- public function getRollbackIgnorePaths()
- {
- return [
- '.svn',
- 'maintenance.flag',
- Mage::getBaseDir('var') . DS . 'session',
- Mage::getBaseDir('var') . DS . 'locks',
- Mage::getBaseDir('var') . DS . 'log',
- Mage::getBaseDir('var') . DS . 'report',
- Mage::getBaseDir('app') . DS . 'Mage.php',
- Mage::getBaseDir() . DS . 'errors',
- Mage::getBaseDir() . DS . 'index.php'
- ];
- }
-
- /**
- * Put store into maintenance mode
- *
- * @return bool
- */
- public function turnOnMaintenanceMode()
- {
- $maintenanceFlagFile = $this->getMaintenanceFlagFilePath();
- $result = file_put_contents($maintenanceFlagFile, 'maintenance');
-
- return $result !== false;
- }
-
- /**
- * Turn off store maintenance mode
- *
- * @SuppressWarnings(PHPMD.ErrorControlOperator)
- */
- public function turnOffMaintenanceMode()
- {
- $maintenanceFlagFile = $this->getMaintenanceFlagFilePath();
- @unlink($maintenanceFlagFile);
- }
-
- /**
- * Get backup create success message by backup type
- *
- * @param string $type
- * @return string
- */
- public function getCreateSuccessMessageByType($type)
- {
- $messagesMap = [
- self::TYPE_SYSTEM_SNAPSHOT => $this->__('The system backup has been created.'),
- self::TYPE_SNAPSHOT_WITHOUT_MEDIA => $this->__('The system (excluding Media) backup has been created.'),
- self::TYPE_MEDIA => $this->__('The database and media backup has been created.'),
- self::TYPE_DB => $this->__('The database backup has been created.')
- ];
-
- if (!isset($messagesMap[$type])) {
- return;
- }
-
- return $messagesMap[$type];
- }
-
- /**
- * Get path to maintenance flag file
- *
- * @return string
- */
- protected function getMaintenanceFlagFilePath()
- {
- return Mage::getBaseDir() . DS . 'maintenance.flag';
- }
-
- /**
- * Invalidate Cache
- * @return $this
- */
- public function invalidateCache()
- {
- if ($cacheTypesNode = Mage::getConfig()->getNode(Mage_Core_Model_Cache::XML_PATH_TYPES)) {
- $cacheTypesList = array_keys($cacheTypesNode->asArray());
- Mage::app()->getCacheInstance()->invalidateType($cacheTypesList);
- }
- return $this;
- }
-
- /**
- * Invalidate Indexer
- *
- * @return $this
- */
- public function invalidateIndexer()
- {
- foreach (Mage::getResourceModel('index/process_collection') as $process) {
- $process->changeStatus(Mage_Index_Model_Process::STATUS_REQUIRE_REINDEX);
- }
- return $this;
- }
-
- /**
- * Creates backup's display name from it's name
- *
- * @param string $name
- * @return string
- */
- public function nameToDisplayName($name)
- {
- return str_replace('_', ' ', $name);
- }
-
- /**
- * Extracts information from backup's filename
- *
- * @param string $filename
- * @return Varien_Object
- */
- public function extractDataFromFilename($filename)
- {
- $extensions = $this->getExtensions();
-
- $filenameWithoutExtension = $filename;
-
- foreach ($extensions as $extension) {
- $filenameWithoutExtension = preg_replace(
- '/' . preg_quote($extension, '/') . '$/',
- '',
- $filenameWithoutExtension
- );
- }
-
- $filenameWithoutExtension = substr($filenameWithoutExtension, 0, strrpos($filenameWithoutExtension, "."));
-
- list($time, $type) = explode("_", $filenameWithoutExtension);
-
- $name = str_replace($time . '_' . $type, '', $filenameWithoutExtension);
-
- if (!empty($name)) {
- $name = substr($name, 1);
- }
-
- $result = new Varien_Object();
- $result->addData([
- 'name' => $name,
- 'type' => $type,
- 'time' => $time
- ]);
-
- return $result;
- }
-}
diff --git a/app/code/core/Mage/Backup/Model/Backup.php b/app/code/core/Mage/Backup/Model/Backup.php
deleted file mode 100644
index 31f67d6a9b5..00000000000
--- a/app/code/core/Mage/Backup/Model/Backup.php
+++ /dev/null
@@ -1,400 +0,0 @@
-
- */
-class Mage_Backup_Model_Backup extends Varien_Object
-{
- /* internal constants */
- public const COMPRESS_RATE = 9;
-
- /**
- * Type of backup file
- *
- * @var string
- */
- private $_type = 'db';
-
- /**
- * Gz file pointer
- *
- * @var resource
- */
- protected $_handler = null;
-
- /**
- * Load backup file info
- *
- * @param string $fileName
- * @param string $filePath
- * @return $this
- */
- public function load($fileName, $filePath)
- {
- $backupData = Mage::helper('backup')->extractDataFromFilename($fileName);
-
- $this->addData([
- 'id' => $filePath . DS . $fileName,
- 'time' => (int)$backupData->getTime(),
- 'path' => $filePath,
- 'extension' => Mage::helper('backup')->getExtensionByType($backupData->getType()),
- 'display_name' => Mage::helper('backup')->nameToDisplayName($backupData->getName()),
- 'name' => $backupData->getName(),
- 'date_object' => new Zend_Date((int)$backupData->getTime(), Mage::app()->getLocale()->getLocaleCode())
- ]);
-
- $this->setType($backupData->getType());
- return $this;
- }
-
- /**
- * Checks backup file exists.
- *
- * @return bool
- */
- public function exists()
- {
- return is_file($this->getPath() . DS . $this->getFileName());
- }
-
- /**
- * Return file name of backup file
- *
- * @return string
- */
- public function getFileName()
- {
- $filename = $this->getTime() . "_" . $this->getType();
- $backupName = $this->getName();
-
- if (!empty($backupName)) {
- $filename .= '_' . $backupName;
- }
-
- $filename .= '.' . Mage::helper('backup')->getExtensionByType($this->getType());
-
- return $filename;
- }
-
- /**
- * Sets type of file
- *
- * @param string $value
- * @return $this
- */
- public function setType($value = 'db')
- {
- $possibleTypes = Mage::helper('backup')->getBackupTypesList();
- if (!in_array($value, $possibleTypes)) {
- $value = Mage::helper('backup')->getDefaultBackupType();
- }
-
- $this->_type = $value;
- $this->setData('type', $this->_type);
-
- return $this;
- }
-
- /**
- * Returns type of backup file
- *
- * @return string
- */
- public function getType()
- {
- return $this->_type;
- }
-
- /**
- * Set the backup file content
- *
- * @param string $content
- * @return $this
- * @throws Mage_Backup_Exception
- */
- public function setFile(&$content)
- {
- if (!$this->hasData('time') || !$this->hasData('type') || !$this->hasData('path')) {
- Mage::throwException(Mage::helper('backup')->__('Wrong order of creation for new backup.'));
- }
-
- $ioProxy = new Varien_Io_File();
- $ioProxy->setAllowCreateFolders(true);
- $ioProxy->open(['path' => $this->getPath()]);
-
- $compress = 0;
- if (extension_loaded("zlib")) {
- $compress = 1;
- }
-
- $rawContent = '';
- if ($compress) {
- $rawContent = gzcompress($content, self::COMPRESS_RATE);
- } else {
- $rawContent = $content;
- }
-
- $fileHeaders = pack("ll", $compress, strlen($rawContent));
- $ioProxy->write($this->getFileName(), $fileHeaders . $rawContent);
- return $this;
- }
-
- /**
- * Return content of backup file
- *
- * @todo rewrite to Varien_IO, but there no possibility read part of files.
- * @return string
- * @throws Mage_Backup_Exception
- *
- * @SuppressWarnings(PHPMD.ErrorControlOperator)
- */
- public function &getFile()
- {
- if (!$this->exists()) {
- Mage::throwException(Mage::helper('backup')->__("Backup file does not exist."));
- }
-
- $fResource = @fopen($this->getPath() . DS . $this->getFileName(), "rb");
- if (!$fResource) {
- Mage::throwException(Mage::helper('backup')->__("Cannot read backup file."));
- }
-
- $content = '';
- $compressed = 0;
-
- $info = unpack("lcompress/llength", fread($fResource, 8));
- if ($info['compress']) { // If file compressed by zlib
- $compressed = 1;
- }
-
- if ($compressed && !extension_loaded("zlib")) {
- fclose($fResource);
- Mage::throwException(Mage::helper('backup')->__('The file was compressed with Zlib, but this extension is not installed on server.'));
- }
-
- if ($compressed) {
- $content = gzuncompress(fread($fResource, $info['length']));
- } else {
- $content = fread($fResource, $info['length']);
- }
-
- fclose($fResource);
-
- return $content;
- }
-
- /**
- * Delete backup file
- *
- * @throws Mage_Backup_Exception
- * @return $this
- */
- public function deleteFile()
- {
- if (!$this->exists()) {
- Mage::throwException(Mage::helper('backup')->__("Backup file does not exist."));
- }
-
- $ioProxy = new Varien_Io_File();
- $ioProxy->open(['path' => $this->getPath()]);
- $ioProxy->rm($this->getFileName());
- return $this;
- }
-
- /**
- * Open backup file (write or read mode)
- *
- * @param bool $write
- * @return $this
- *
- * @SuppressWarnings(PHPMD.ErrorControlOperator)
- */
- public function open($write = false)
- {
- if (is_null($this->getPath())) {
- Mage::exception('Mage_Backup', Mage::helper('backup')->__('Backup file path was not specified.'));
- }
-
- $ioAdapter = new Varien_Io_File();
- try {
- $path = $ioAdapter->getCleanPath($this->getPath());
- $ioAdapter->checkAndCreateFolder($path);
- $filePath = $path . DS . $this->getFileName();
- } catch (Exception $e) {
- Mage::exception('Mage_Backup', $e->getMessage());
- }
-
- if ($write && $ioAdapter->fileExists($filePath)) {
- $ioAdapter->rm($filePath);
- }
- if (!$write && !$ioAdapter->fileExists($filePath)) {
- Mage::exception('Mage_Backup', Mage::helper('backup')->__('Backup file "%s" does not exist.', $this->getFileName()));
- }
-
- $mode = $write ? 'wb' . self::COMPRESS_RATE : 'rb';
-
- $this->_handler = @gzopen($filePath, $mode);
-
- if (!$this->_handler) {
- throw new Mage_Backup_Exception_NotEnoughPermissions(
- Mage::helper('backup')->__('Backup file "%s" cannot be read from or written to.', $this->getFileName())
- );
- }
-
- return $this;
- }
-
- /**
- * Read backup uncomressed data
- *
- * @param int $length
- * @return string
- */
- public function read($length)
- {
- if (is_null($this->_handler)) {
- Mage::exception('Mage_Backup', Mage::helper('backup')->__('Backup file handler was unspecified.'));
- }
-
- return gzread($this->_handler, $length);
- }
-
- public function eof()
- {
- if (is_null($this->_handler)) {
- Mage::exception('Mage_Backup', Mage::helper('backup')->__('Backup file handler was unspecified.'));
- }
-
- return gzeof($this->_handler);
- }
-
- /**
- * Write to backup file
- *
- * @param string $string
- * @return $this
- */
- public function write($string)
- {
- if (is_null($this->_handler)) {
- Mage::exception('Mage_Backup', Mage::helper('backup')->__('Backup file handler was unspecified.'));
- }
-
- try {
- gzwrite($this->_handler, $string);
- } catch (Exception $e) {
- Mage::exception('Mage_Backup', Mage::helper('backup')->__('An error occurred while writing to the backup file "%s".', $this->getFileName()));
- }
-
- return $this;
- }
-
- /**
- * Close open backup file
- *
- * @return $this
- *
- * @SuppressWarnings(PHPMD.ErrorControlOperator)
- */
- public function close()
- {
- @gzclose($this->_handler);
- $this->_handler = null;
-
- return $this;
- }
-
- /**
- * Print output
- *
- */
- public function output()
- {
- if (!$this->exists()) {
- return ;
- }
-
- $ioAdapter = new Varien_Io_File();
- $ioAdapter->open(['path' => $this->getPath()]);
-
- $ioAdapter->streamOpen($this->getFileName(), 'r');
- while ($buffer = $ioAdapter->streamRead()) {
- echo $buffer;
- }
- $ioAdapter->streamClose();
- }
-
- public function getSize()
- {
- if (!is_null($this->getData('size'))) {
- return $this->getData('size');
- }
-
- if ($this->exists()) {
- $this->setData('size', filesize($this->getPath() . DS . $this->getFileName()));
- return $this->getData('size');
- }
-
- return 0;
- }
-
- /**
- * Validate user password
- *
- * @param string $password
- * @return bool
- */
- public function validateUserPassword($password)
- {
- $userPasswordHash = Mage::getModel('admin/session')->getUser()->getPassword();
- return Mage::helper('core')->validateHash($password, $userPasswordHash);
- }
-
- /**
- * Load backup by it's type and creation timestamp
- *
- * @param int $timestamp
- * @param string $type
- * @return $this
- */
- public function loadByTimeAndType($timestamp, $type)
- {
- $backupsCollection = Mage::getSingleton('backup/fs_collection');
- $backupId = $timestamp . '_' . $type;
-
- foreach ($backupsCollection as $backup) {
- if ($backup->getId() == $backupId) {
- $this->setType($backup->getType())
- ->setTime($backup->getTime())
- ->setName($backup->getName())
- ->setPath($backup->getPath());
- break;
- }
- }
-
- return $this;
- }
-}
diff --git a/app/code/core/Mage/Backup/Model/Config/Backend/Cron.php b/app/code/core/Mage/Backup/Model/Config/Backend/Cron.php
deleted file mode 100644
index e80a8bb9b24..00000000000
--- a/app/code/core/Mage/Backup/Model/Config/Backend/Cron.php
+++ /dev/null
@@ -1,82 +0,0 @@
-
- */
-class Mage_Backup_Model_Config_Backend_Cron extends Mage_Core_Model_Config_Data
-{
- public const CRON_STRING_PATH = 'crontab/jobs/system_backup/schedule/cron_expr';
- public const CRON_MODEL_PATH = 'crontab/jobs/system_backup/run/model';
-
- public const XML_PATH_BACKUP_ENABLED = 'groups/backup/fields/enabled/value';
- public const XML_PATH_BACKUP_TIME = 'groups/backup/fields/time/value';
- public const XML_PATH_BACKUP_FREQUENCY = 'groups/backup/fields/frequency/value';
-
- /**
- * Cron settings after save
- *
- * @return $this
- */
- protected function _afterSave()
- {
- $enabled = $this->getData(self::XML_PATH_BACKUP_ENABLED);
- $time = $this->getData(self::XML_PATH_BACKUP_TIME);
- $frequency = $this->getData(self::XML_PATH_BACKUP_FREQUENCY);
-
- $frequencyWeekly = Mage_Adminhtml_Model_System_Config_Source_Cron_Frequency::CRON_WEEKLY;
- $frequencyMonthly = Mage_Adminhtml_Model_System_Config_Source_Cron_Frequency::CRON_MONTHLY;
-
- if ($enabled) {
- $cronExprArray = [
- (int) $time[1], # Minute
- (int) $time[0], # Hour
- ($frequency == $frequencyMonthly) ? '1' : '*', # Day of the Month
- '*', # Month of the Year
- ($frequency == $frequencyWeekly) ? '1' : '*', # Day of the Week
- ];
- $cronExprString = implode(' ', $cronExprArray);
- } else {
- $cronExprString = '';
- }
-
- try {
- Mage::getModel('core/config_data')
- ->load(self::CRON_STRING_PATH, 'path')
- ->setValue($cronExprString)
- ->setPath(self::CRON_STRING_PATH)
- ->save();
-
- Mage::getModel('core/config_data')
- ->load(self::CRON_MODEL_PATH, 'path')
- ->setValue((string) Mage::getConfig()->getNode(self::CRON_MODEL_PATH))
- ->setPath(self::CRON_MODEL_PATH)
- ->save();
- } catch (Exception $e) {
- Mage::throwException(Mage::helper('backup')->__('Unable to save the cron expression.'));
- }
- return $this;
- }
-}
diff --git a/app/code/core/Mage/Backup/Model/Config/Source/Type.php b/app/code/core/Mage/Backup/Model/Config/Source/Type.php
deleted file mode 100644
index 7018a2ddfff..00000000000
--- a/app/code/core/Mage/Backup/Model/Config/Source/Type.php
+++ /dev/null
@@ -1,47 +0,0 @@
-
- */
-class Mage_Backup_Model_Config_Source_Type
-{
- /**
- * return possible options
- *
- * @return array
- */
- public function toOptionArray()
- {
- $backupTypes = [];
- foreach (Mage::helper('backup')->getBackupTypes() as $type => $label) {
- $backupTypes[] = [
- 'label' => $label,
- 'value' => $type,
- ];
- }
- return $backupTypes;
- }
-}
diff --git a/app/code/core/Mage/Backup/Model/Db.php b/app/code/core/Mage/Backup/Model/Db.php
deleted file mode 100644
index 2cca471514a..00000000000
--- a/app/code/core/Mage/Backup/Model/Db.php
+++ /dev/null
@@ -1,178 +0,0 @@
-
- */
-class Mage_Backup_Model_Db
-{
- /**
- * Buffer length for multi rows
- * default 100 Kb
- *
- */
- public const BUFFER_LENGTH = 102400;
-
- /**
- * List of tables which data should not be backed up
- *
- * @var array
- */
- protected $_ignoreDataTablesList = [
- 'importexport/importdata'
- ];
-
- /**
- * Retrieve resource model
- *
- * @return Mage_Backup_Model_Resource_Db
- */
- public function getResource()
- {
- return Mage::getResourceSingleton('backup/db');
- }
-
- public function getTables()
- {
- return $this->getResource()->getTables();
- }
-
- public function getTableCreateScript($tableName, $addDropIfExists = false)
- {
- return $this->getResource()->getTableCreateScript($tableName, $addDropIfExists);
- }
-
- public function getTableDataDump($tableName)
- {
- return $this->getResource()->getTableDataDump($tableName);
- }
-
- public function getHeader()
- {
- return $this->getResource()->getHeader();
- }
-
- public function getFooter()
- {
- return $this->getResource()->getFooter();
- }
-
- public function renderSql()
- {
- ini_set('max_execution_time', 0);
- $sql = $this->getHeader();
-
- $tables = $this->getTables();
- foreach ($tables as $tableName) {
- $sql .= $this->getTableCreateScript($tableName, true);
- $sql .= $this->getTableDataDump($tableName);
- }
-
- $sql .= $this->getFooter();
- return $sql;
- }
-
- /**
- * Create backup and stream write to adapter
- *
- * @param Mage_Backup_Model_Backup $backup
- * @return $this
- */
- public function createBackup(Mage_Backup_Model_Backup $backup)
- {
- $backup->open(true);
-
- $this->getResource()->beginTransaction();
- try {
- $tables = $this->getResource()->getTables();
-
- $backup->write($this->getResource()->getHeader());
-
- $ignoreDataTablesList = $this->getIgnoreDataTablesList();
-
- foreach ($tables as $table) {
- $backup->write($this->getResource()->getTableHeader($table)
- . $this->getResource()->getTableDropSql($table) . "\n");
- $backup->write($this->getResource()->getTableCreateSql($table, false) . "\n");
-
- $tableStatus = $this->getResource()->getTableStatus($table);
-
- if ($tableStatus->getRows() && !in_array($table, $ignoreDataTablesList)) {
- $backup->write($this->getResource()->getTableDataBeforeSql($table));
-
- if ($tableStatus->getDataLength() > self::BUFFER_LENGTH) {
- if ($tableStatus->getAvgRowLength() > 0 && $tableStatus->getAvgRowLength() < self::BUFFER_LENGTH) {
- // Process rows in batches
- $limit = floor(self::BUFFER_LENGTH / $tableStatus->getAvgRowLength());
- $multiRowsLength = ceil($tableStatus->getRows() / $limit);
- } else {
- // Process rows one by one
- $limit = 1;
- $multiRowsLength = $tableStatus->getRows();
- }
- } else {
- // Process all rows at once
- $limit = $tableStatus->getRows();
- $multiRowsLength = 1;
- }
-
- for ($i = 0; $i < $multiRowsLength; $i++) {
- $backup->write($this->getResource()->getTableDataSql($table, $limit, $i * $limit));
- }
-
- $backup->write($this->getResource()->getTableDataAfterSql($table));
- }
- }
- $backup->write($this->getResource()->getTableForeignKeysSql());
- $backup->write($this->getResource()->getFooter());
-
- $this->getResource()->commitTransaction();
- } catch (Exception $e) {
- $this->getResource()->rollBackTransaction();
- throw $e;
- }
-
- $backup->close();
-
- return $this;
- }
-
- /**.
- * Returns the list of tables which data should not be backed up
- *
- * @return array
- */
- public function getIgnoreDataTablesList()
- {
- $result = [];
- $resource = Mage::getSingleton('core/resource');
-
- foreach ($this->_ignoreDataTablesList as $table) {
- $result[] = $resource->getTableName($table);
- }
-
- return $result;
- }
-}
diff --git a/app/code/core/Mage/Backup/Model/Fs/Collection.php b/app/code/core/Mage/Backup/Model/Fs/Collection.php
deleted file mode 100644
index fa3818932fe..00000000000
--- a/app/code/core/Mage/Backup/Model/Fs/Collection.php
+++ /dev/null
@@ -1,88 +0,0 @@
-
- */
-class Mage_Backup_Model_Fs_Collection extends Varien_Data_Collection_Filesystem
-{
- /**
- * Folder, where all backups are stored
- *
- * @var string
- */
- protected $_baseDir;
-
- /**
- * Set collection specific parameters and make sure backups folder will exist
- */
- public function __construct()
- {
- parent::__construct();
-
- $this->_baseDir = Mage::getBaseDir('var') . DS . 'backups';
-
- // check for valid base dir
- $ioProxy = new Varien_Io_File();
- $ioProxy->mkdir($this->_baseDir);
- if (!is_file($this->_baseDir . DS . '.htaccess')) {
- $ioProxy->open(['path' => $this->_baseDir]);
- $ioProxy->write('.htaccess', 'deny from all', 0644);
- }
-
- // set collection specific params
- $extensions = Mage::helper('backup')->getExtensions();
-
- foreach ($extensions as $key => $value) {
- $extensions[] = '(' . preg_quote($value, '/') . ')';
- }
- $extensions = implode('|', $extensions);
-
- $this
- ->setOrder('time', self::SORT_ORDER_DESC)
- ->addTargetDir($this->_baseDir)
- ->setFilesFilter('/^[a-z0-9\-\_]+\.' . $extensions . '$/')
- ->setCollectRecursively(false);
- }
-
- /**
- * Get backup-specific data from model for each row
- *
- * @param string $filename
- * @return array
- */
- protected function _generateRow($filename)
- {
- $row = parent::_generateRow($filename);
- foreach (Mage::getSingleton('backup/backup')->load($row['basename'], $this->_baseDir)
- ->getData() as $key => $value
- ) {
- $row[$key] = $value;
- }
- $row['size'] = filesize($filename);
- $row['id'] = $row['time'] . '_' . $row['type'];
- return $row;
- }
-}
diff --git a/app/code/core/Mage/Backup/Model/Mysql4/Db.php b/app/code/core/Mage/Backup/Model/Mysql4/Db.php
deleted file mode 100644
index 44015d1782d..00000000000
--- a/app/code/core/Mage/Backup/Model/Mysql4/Db.php
+++ /dev/null
@@ -1,32 +0,0 @@
-
- * @deprecated
- */
-class Mage_Backup_Model_Mysql4_Db extends Mage_Backup_Model_Resource_Db
-{
-}
diff --git a/app/code/core/Mage/Backup/Model/Observer.php b/app/code/core/Mage/Backup/Model/Observer.php
deleted file mode 100644
index b8597d2cecc..00000000000
--- a/app/code/core/Mage/Backup/Model/Observer.php
+++ /dev/null
@@ -1,88 +0,0 @@
-
- */
-class Mage_Backup_Model_Observer
-{
- public const XML_PATH_BACKUP_ENABLED = 'system/backup/enabled';
- public const XML_PATH_BACKUP_TYPE = 'system/backup/type';
- public const XML_PATH_BACKUP_MAINTENANCE_MODE = 'system/backup/maintenance';
-
- /**
- * Error messages
- *
- * @var array
- */
- protected $_errors = [];
-
- /**
- * Create Backup
- *
- * @return $this
- */
- public function scheduledBackup()
- {
- if (!Mage::getStoreConfigFlag(self::XML_PATH_BACKUP_ENABLED)) {
- return $this;
- }
-
- if (Mage::getStoreConfigFlag(self::XML_PATH_BACKUP_MAINTENANCE_MODE)) {
- Mage::helper('backup')->turnOnMaintenanceMode();
- }
-
- $type = Mage::getStoreConfig(self::XML_PATH_BACKUP_TYPE);
-
- $this->_errors = [];
- try {
- $backupManager = Mage_Backup::getBackupInstance($type)
- ->setBackupExtension(Mage::helper('backup')->getExtensionByType($type))
- ->setTime(time())
- ->setBackupsDir(Mage::helper('backup')->getBackupsDir());
-
- Mage::register('backup_manager', $backupManager);
-
- if ($type != Mage_Backup_Helper_Data::TYPE_DB) {
- $backupManager->setRootDir(Mage::getBaseDir())
- ->addIgnorePaths(Mage::helper('backup')->getBackupIgnorePaths());
- }
-
- $backupManager->create();
- Mage::log(Mage::helper('backup')->getCreateSuccessMessageByType($type));
- } catch (Exception $e) {
- $this->_errors[] = $e->getMessage();
- $this->_errors[] = $e->getTrace();
- Mage::log($e->getMessage(), Zend_Log::ERR);
- Mage::logException($e);
- }
-
- if (Mage::getStoreConfigFlag(self::XML_PATH_BACKUP_MAINTENANCE_MODE)) {
- Mage::helper('backup')->turnOffMaintenanceMode();
- }
-
- return $this;
- }
-}
diff --git a/app/code/core/Mage/Backup/Model/Resource/Db.php b/app/code/core/Mage/Backup/Model/Resource/Db.php
deleted file mode 100644
index d024ce5afd8..00000000000
--- a/app/code/core/Mage/Backup/Model/Resource/Db.php
+++ /dev/null
@@ -1,330 +0,0 @@
-
- */
-class Mage_Backup_Model_Resource_Db
-{
- /**
- * Database connection adapter
- *
- * @var Varien_Db_Adapter_Pdo_Mysql
- */
- protected $_write;
-
- /**
- * tables Foreign key data array
- * [tbl_name] = array(create foreign key strings)
- *
- * @var array
- */
- protected $_foreignKeys = [];
-
- /**
- * Initialize Backup DB resource model
- *
- */
- public function __construct()
- {
- $this->_write = Mage::getSingleton('core/resource')->getConnection('backup_write');
- }
-
- /**
- * @deprecated after 1.4.0.0-alpha2
- *
- */
- public function crear()
- {
- $this->clear();
- }
-
- /**
- * Clear data
- *
- */
- public function clear()
- {
- $this->_foreignKeys = [];
- }
-
- /**
- * Retrieve table list
- *
- * @return array
- */
- public function getTables()
- {
- return $this->_write->listTables();
- }
-
- /**
- * Retrieve SQL fragment for drop table
- *
- * @param string $tableName
- * @return string
- */
- public function getTableDropSql($tableName)
- {
- /** @var Mage_Backup_Model_Resource_Helper_Mysql4 $helper */
- $helper = Mage::getResourceHelper('backup');
- return $helper->getTableDropSql($tableName);
- }
-
- /**
- * Retrieve SQL fragment for create table
- *
- * @param string $tableName
- * @param bool $withForeignKeys
- * @return string
- */
- public function getTableCreateSql($tableName, $withForeignKeys = false)
- {
- /** @var Mage_Backup_Model_Resource_Helper_Mysql4 $helper */
- $helper = Mage::getResourceHelper('backup');
- return $helper->getTableCreateSql($tableName, $withForeignKeys = false);
- }
-
- /**
- * Retrieve foreign keys for table(s)
- *
- * @param string|null $tableName
- * @return string
- */
- public function getTableForeignKeysSql($tableName = null)
- {
- $fkScript = '';
- if (!$tableName) {
- $tables = $this->getTables();
- /** @var Mage_Backup_Model_Resource_Helper_Mysql4 $helper */
- $helper = Mage::getResourceHelper('backup');
- foreach ($tables as $table) {
- $tableFkScript = $helper->getTableForeignKeysSql($table);
- if (!empty($tableFkScript)) {
- $fkScript .= "\n" . $tableFkScript;
- }
- }
- } else {
- $fkScript = $this->getTableForeignKeysSql($tableName);
- }
- return $fkScript;
- }
-
- /**
- * Retrieve table status
- *
- * @param string $tableName
- * @return Varien_Object|false
- */
- public function getTableStatus($tableName)
- {
- $row = $this->_write->showTableStatus($tableName);
-
- if ($row) {
- $statusObject = new Varien_Object();
- $statusObject->setIdFieldName('name');
- foreach ($row as $field => $value) {
- $statusObject->setData(strtolower($field), $value);
- }
-
- $cntRow = $this->_write->fetchRow(
- $this->_write->select()->from($tableName, 'COUNT(1) as rows')
- );
- $statusObject->setRows($cntRow['rows']);
-
- return $statusObject;
- }
-
- return false;
- }
-
- /**
- * Quote Table Row
- *
- * @deprecated
- *
- * @param string $tableName
- * @param array $row
- * @return array
- */
- protected function _quoteRow($tableName, array $row)
- {
- return $row;
- }
-
- /**
- * Retrieve table partical data SQL insert
- *
- * @param string $tableName
- * @param int $count
- * @param int $offset
- * @return string
- */
- public function getTableDataSql($tableName, $count = null, $offset = null)
- {
- /** @var Mage_Backup_Model_Resource_Helper_Mysql4 $helper */
- $helper = Mage::getResourceHelper('backup');
- return $helper->getPartInsertSql($tableName, $count, $offset);
- }
-
- /**
- * @param string $tableName
- * @param bool $addDropIfExists
- * @return string
- */
- public function getTableCreateScript($tableName, $addDropIfExists = false)
- {
- /** @var Mage_Backup_Model_Resource_Helper_Mysql4 $helper */
- $helper = Mage::getResourceHelper('backup');
- return $helper->getTableCreateScript($tableName, $addDropIfExists);
- }
-
- /**
- * Retrieve table header comment
- *
- * @param string $tableName
- * @return string
- */
- public function getTableHeader($tableName)
- {
- $quotedTableName = $this->_write->quoteIdentifier($tableName);
- return "\n--\n"
- . "-- Table structure for table {$quotedTableName}\n"
- . "--\n\n";
- }
-
- /**
- * Return table data dump
- *
- * @param string $tableName
- * @param bool $step
- * @return string
- */
- public function getTableDataDump($tableName, $step = false)
- {
- return $this->getTableDataSql($tableName);
- }
-
- /**
- * Returns SQL header data
- *
- * @return string
- */
- public function getHeader()
- {
- /** @var Mage_Backup_Model_Resource_Helper_Mysql4 $helper */
- $helper = Mage::getResourceHelper('backup');
- return $helper->getHeader();
- }
-
- /**
- * Returns SQL footer data
- *
- * @return string
- */
- public function getFooter()
- {
- /** @var Mage_Backup_Model_Resource_Helper_Mysql4 $helper */
- $helper = Mage::getResourceHelper('backup');
- return $helper->getFooter();
- }
-
- /**
- * Retrieve before insert data SQL fragment
- *
- * @param string $tableName
- * @return string
- */
- public function getTableDataBeforeSql($tableName)
- {
- /** @var Mage_Backup_Model_Resource_Helper_Mysql4 $helper */
- $helper = Mage::getResourceHelper('backup');
- return $helper->getTableDataBeforeSql($tableName);
- }
-
- /**
- * Retrieve after insert data SQL fragment
- *
- * @param string $tableName
- * @return string
- */
- public function getTableDataAfterSql($tableName)
- {
- /** @var Mage_Backup_Model_Resource_Helper_Mysql4 $helper */
- $helper = Mage::getResourceHelper('backup');
- return $helper->getTableDataAfterSql($tableName);
- }
-
- /**
- * Start transaction mode
- *
- * @return $this
- */
- public function beginTransaction()
- {
- /** @var Mage_Backup_Model_Resource_Helper_Mysql4 $helper */
- $helper = Mage::getResourceHelper('backup');
- $helper->turnOnSerializableMode();
- $this->_write->beginTransaction();
- return $this;
- }
-
- /**
- * Commit transaction
- *
- * @return $this
- */
- public function commitTransaction()
- {
- $this->_write->commit();
- /** @var Mage_Backup_Model_Resource_Helper_Mysql4 $helper */
- $helper = Mage::getResourceHelper('backup');
- $helper->turnOnReadCommittedMode();
- return $this;
- }
-
- /**
- * Rollback transaction
- *
- * @return $this
- */
- public function rollBackTransaction()
- {
- $this->_write->rollBack();
- return $this;
- }
-
- /**
- * Run sql code
- *
- * @param string|Zend_Db_Select $command
- * @return $this
- */
- public function runCommand($command)
- {
- $this->_write->query($command);
- return $this;
- }
-}
diff --git a/app/code/core/Mage/Backup/Model/Resource/Helper/Mysql4.php b/app/code/core/Mage/Backup/Model/Resource/Helper/Mysql4.php
deleted file mode 100644
index 0087c9653df..00000000000
--- a/app/code/core/Mage/Backup/Model/Resource/Helper/Mysql4.php
+++ /dev/null
@@ -1,320 +0,0 @@
-
- */
-class Mage_Backup_Model_Resource_Helper_Mysql4 extends Mage_Core_Model_Resource_Helper_Mysql4
-{
- /**
- * Tables foreign key data array
- * [tbl_name] = array(create foreign key strings)
- *
- * @var array
- */
- protected $_foreignKeys = [];
-
- /**
- * Retrieve SQL fragment for drop table
- *
- * @param string $tableName
- * @return string
- */
- public function getTableDropSql($tableName)
- {
- $quotedTableName = $this->_getReadAdapter()->quoteIdentifier($tableName);
- return sprintf('DROP TABLE IF EXISTS %s;', $quotedTableName);
- }
-
- /**
- * Retrieve foreign keys for table(s)
- *
- * @param string|null $tableName
- * @return string|false
- */
- public function getTableForeignKeysSql($tableName = null)
- {
- $sql = false;
-
- if ($tableName === null) {
- $sql = '';
- foreach ($this->_foreignKeys as $table => $foreignKeys) {
- $sql .= $this->_buildForeignKeysAlterTableSql($table, $foreignKeys);
- }
- } elseif (isset($this->_foreignKeys[$tableName])) {
- $foreignKeys = $this->_foreignKeys[$tableName];
- $sql = $this->_buildForeignKeysAlterTableSql($tableName, $foreignKeys);
- }
-
- return $sql;
- }
-
- /**
- * Build sql that will add foreign keys to it
- *
- * @param string $tableName
- * @param array $foreignKeys
- * @return string
- */
- protected function _buildForeignKeysAlterTableSql($tableName, $foreignKeys)
- {
- if (!is_array($foreignKeys) || empty($foreignKeys)) {
- return '';
- }
-
- return sprintf(
- "ALTER TABLE %s\n %s;\n",
- $this->_getReadAdapter()->quoteIdentifier($tableName),
- implode(",\n ", $foreignKeys)
- );
- }
-
- /**
- * Get create script for table
- *
- * @param string $tableName
- * @param bool $addDropIfExists
- * @return string
- */
- public function getTableCreateScript($tableName, $addDropIfExists = false)
- {
- $script = '';
- $quotedTableName = $this->_getReadAdapter()->quoteIdentifier($tableName);
-
- if ($addDropIfExists) {
- $script .= 'DROP TABLE IF EXISTS ' . $quotedTableName . ";\n";
- }
- //TODO fix me
- $sql = 'SHOW CREATE TABLE ' . $quotedTableName;
- $data = $this->_getReadAdapter()->fetchRow($sql);
- $script .= isset($data['Create Table']) ? $data['Create Table'] . ";\n" : '';
-
- return $script;
- }
- /**
- * Retrieve SQL fragment for create table
- *
- * @param string $tableName
- * @param bool $withForeignKeys
- * @return false|string
- */
- public function getTableCreateSql($tableName, $withForeignKeys = false)
- {
- $adapter = $this->_getReadAdapter();
- $quotedTableName = $adapter->quoteIdentifier($tableName);
- $query = 'SHOW CREATE TABLE ' . $quotedTableName;
- $row = $adapter->fetchRow($query);
-
- if (!$row || !isset($row['Table']) || !isset($row['Create Table'])) {
- return false;
- }
-
- $regExp = '/,\s+CONSTRAINT `([^`]*)` FOREIGN KEY \(`([^`]*)`\) '
- . 'REFERENCES `([^`]*)` \(`([^`]*)`\)'
- . '( ON DELETE (RESTRICT|CASCADE|SET NULL|NO ACTION))?'
- . '( ON UPDATE (RESTRICT|CASCADE|SET NULL|NO ACTION))?/';
- $matches = [];
- preg_match_all($regExp, $row['Create Table'], $matches, PREG_SET_ORDER);
-
- if (is_array($matches)) {
- foreach ($matches as $match) {
- $this->_foreignKeys[$tableName][] = sprintf(
- 'ADD CONSTRAINT %s FOREIGN KEY (%s) REFERENCES %s (%s)%s%s',
- $adapter->quoteIdentifier($match[1]),
- $adapter->quoteIdentifier($match[2]),
- $adapter->quoteIdentifier($match[3]),
- $adapter->quoteIdentifier($match[4]),
- $match[5] ?? '',
- $match[7] ?? ''
- );
- }
- }
-
- if ($withForeignKeys) {
- $sql = $row['Create Table'];
- } else {
- $sql = preg_replace($regExp, '', $row['Create Table']);
- }
-
- return $sql . ';';
- }
- /**
- * Returns SQL header data, move from original resource model
- *
- * @return string
- */
- public function getHeader()
- {
- $dbConfig = $this->_getReadAdapter()->getConfig();
-
- $versionRow = $this->_getReadAdapter()->fetchRow('SHOW VARIABLES LIKE \'version\'');
- $hostName = !empty($dbConfig['unix_socket']) ? $dbConfig['unix_socket']
- : (!empty($dbConfig['host']) ? $dbConfig['host'] : 'localhost');
-
- return "-- Magento DB backup\n"
- . "--\n"
- . "-- Host: {$hostName} Database: {$dbConfig['dbname']}\n"
- . "-- ------------------------------------------------------\n"
- . "-- Server version: {$versionRow['Value']}\n\n"
- . "/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;\n"
- . "/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;\n"
- . "/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;\n"
- . "/*!40101 SET NAMES utf8 */;\n"
- . "/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;\n"
- . "/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;\n"
- . "/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;\n"
- . "/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;\n";
- }
-
- /**
- * Returns SQL footer data, move from original resource model
- *
- * @return string
- */
- public function getFooter()
- {
- return "\n/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;\n"
- . "/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; \n"
- . "/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;\n"
- . "/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;\n"
- . "/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;\n"
- . "/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;\n"
- . "/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;\n"
- . "\n-- Dump completed on " . Mage::getSingleton('core/date')->gmtDate() . " GMT";
- }
-
- /**
- * Retrieve before insert data SQL fragment
- *
- * @param string $tableName
- * @return string
- */
- public function getTableDataBeforeSql($tableName)
- {
- $quotedTableName = $this->_getReadAdapter()->quoteIdentifier($tableName);
- return "\n--\n"
- . "-- Dumping data for table {$quotedTableName}\n"
- . "--\n\n"
- . "LOCK TABLES {$quotedTableName} WRITE;\n"
- . "/*!40000 ALTER TABLE {$quotedTableName} DISABLE KEYS */;\n";
- }
-
- /**
- * Retrieve after insert data SQL fragment
- *
- * @param string $tableName
- * @return string
- */
- public function getTableDataAfterSql($tableName)
- {
- $quotedTableName = $this->_getReadAdapter()->quoteIdentifier($tableName);
- return "/*!40000 ALTER TABLE {$quotedTableName} ENABLE KEYS */;\n"
- . "UNLOCK TABLES;\n";
- }
-
- /**
- * Return table part data SQL insert
- *
- * @param string $tableName
- * @param int $count
- * @param int $offset
- * @return string
- */
- public function getPartInsertSql($tableName, $count = null, $offset = null)
- {
- $sql = null;
- $adapter = $this->_getWriteAdapter();
- $select = $adapter->select()
- ->from($tableName)
- ->limit($count, $offset);
- $query = $adapter->query($select);
-
- while ($row = $query->fetch()) {
- if ($sql === null) {
- $sql = sprintf('INSERT INTO %s VALUES ', $adapter->quoteIdentifier($tableName));
- } else {
- $sql .= ',';
- }
-
- $sql .= $this->_quoteRow($tableName, $row);
- }
-
- if ($sql !== null) {
- $sql .= ';' . "\n";
- }
-
- return $sql;
- }
- /**
- * Return table data SQL insert
- *
- * @param string $tableName
- * @return string
- */
- public function getInsertSql($tableName)
- {
- return $this->getPartInsertSql($tableName);
- }
- /**
- * Quote Table Row
- *
- * @param string $tableName
- * @param array $row
- * @return string
- */
- protected function _quoteRow($tableName, array $row)
- {
- $adapter = $this->_getReadAdapter();
- $describe = $adapter->describeTable($tableName);
- $dataTypes = ['bigint', 'mediumint', 'smallint', 'tinyint'];
- $rowData = [];
- foreach ($row as $k => $v) {
- if ($v === null) {
- $value = 'NULL';
- } elseif (in_array(strtolower($describe[$k]['DATA_TYPE']), $dataTypes)) {
- $value = $v;
- } else {
- $value = $adapter->quoteInto('?', $v);
- }
- $rowData[] = $value;
- }
-
- return sprintf('(%s)', implode(',', $rowData));
- }
-
- /**
- * Turn on serializable mode
- */
- public function turnOnSerializableMode()
- {
- $this->_getReadAdapter()->query("SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE");
- }
-
- /**
- * Turn on read committed mode
- */
- public function turnOnReadCommittedMode()
- {
- $this->_getReadAdapter()->query("SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED");
- }
-}
diff --git a/app/code/core/Mage/Backup/etc/adminhtml.xml b/app/code/core/Mage/Backup/etc/adminhtml.xml
deleted file mode 100644
index a4a09edfb29..00000000000
--- a/app/code/core/Mage/Backup/etc/adminhtml.xml
+++ /dev/null
@@ -1,62 +0,0 @@
-
-
-
__('Backups') ?> |
- - getCreateSnapshotButtonHtml(); ?> - getCreateMediaBackupButtonHtml(); ?> - getCreateButtonHtml(); ?> - | -