久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

Magento 不支持模塊的卸載/降級有什么原因嗎

is there a reason why Magento shouldn#39;t support uninstall/downgrade for modules(Magento 不支持模塊的卸載/降級有什么原因嗎)
本文介紹了Magento 不支持模塊的卸載/降級有什么原因嗎的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

自動即時回滾是企業級部署機制的重要特性.目前,使用 Magento 的內置安裝工具無法實現這一點.

Automated instant rollback is an important feature of enterprise-grade deployment mechanisms. Currently, it's not possible to achieve this using Magento's built-in installation tools.

鑒于 Magento 的 core_resource 機制允許順序執行安裝或升級模塊的安裝腳本(通過執行 SQL 和 PHP),恕我直言,它應該支持相同的過程似乎是合乎邏輯的相反.

Given that Magento's core_resource mechanism allows for the sequential execution of setup scripts for installation or upgrade of modules (via execution of SQL and also PHP), it seems logical IMHO that it should support the same process in reverse.

現在,一些不支持它的明顯原因:

Now, some obvious reasons not to support it:

  1. 回滾腳本要獨立(并且可能是冪等的?)將具有挑戰性.我認為這不是避免該功能的正當理由,充其量只是一個借口.

  1. It would be challenging for the rollback scripts to be independent (and possibly idempotent?). I don't see this to be a valid reason to avoid the feature, it's an excuse at best.

其他模塊可能依賴于已安裝的模塊.模塊的 xml 聲明 節點可用于標記這些鏈接.

Other modules might have dependencies on the installed module. The module's xml declaration <depends/> node could be used to flag these linkages.

開發人員可能想要暫時禁用模塊而不進行完全卸載.這可能需要 xml 聲明 節點中的新狀態.

A developer might want to temporarily disable a module without doing a full uninstall. This could require a new status in the xml declaration <active/> node.

對您的想法感興趣.
京東

Interested in your thoughts.
JD

推薦答案

我看過一些關于此類的帖子,并且我自己也調查了 SQL 部署的相同場景.我不得不同意企業級 Magento 應該內置這種類型的功能.好消息是,至少在一些形式或時尚方面,我不確定它有多完整.以下是異?;貪L示例:

I have seen some postings in regards to such and have investigated the same scenarios for SQL deployment myself. I would have to agree that being Enterprise grade Magento should have this type of functionality built-in. The good news it IS, at least in SOME form or fashion, how complete it is I'm not really sure. Here's a sample of a rollback upon exception:

try {
    $write = Mage::getSingleton('core/resource')->getConnection('core_write');
    $write->beginTransaction();

// do stuff here

    $write->commit();
} catch (Exception $e) {
    mage::log(__METHOD__ . ':' . __LINE__ . ': Rollback happened.');
    $write->rollback();
}

現在,如果您查看 app/code/core/Mage/Core/Model/Resource/Setup.php,您會發現很多有趣的方法.特別是:_getModifySqlFiles、_rollbackResourceDb_modifyResourceDb.

Now if you take a look at app/code/core/Mage/Core/Model/Resource/Setup.php you'll find quite a bit of interesting methods. In particular: _getModifySqlFiles, _rollbackResourceDb and _modifyResourceDb.

_modifyResourceDb 對我來說是最有趣的,因為這里的 $actionType 也可以回滾和卸載 - 另請注意,您也可以將 PHP 文件用于安裝文件.

_modifyResourceDb is the most interesting to me, since the $actionType here can be rollback and uninstall as well - also note you can use PHP files for your setup files as well.

// Read resource files
$arrAvailableFiles = array();
$sqlDir = dir($sqlFilesDir);
while (false !== ($sqlFile = $sqlDir->read())) {
    $matches = array();
    if (preg_match('#^'.$resModel.'-'.$actionType.'-(.*).(sql|php)$#i', $sqlFile, $matches)) {
        $arrAvailableFiles[$matches[1]] = $sqlFile;
    }
}

這段代碼執行后:

$arrModifyFiles = $this->_getModifySqlFiles($actionType, $fromVersion, $toVersion, $arrAvailableFiles);

但在這里我假設核心 Magento 開發人員迷失在 EAV 資源模型的內部,只是讓它部分完成.

But heres where I'm assuming core Magento devs got lost in the bowels of the EAV resource model and just left it partially complete.

protected function _getModifySqlFiles($actionType, $fromVersion, $toVersion, $arrFiles)
{
    $arrRes = array();

    switch ($actionType) {
        case 'install':
        case 'data-install':
...
        case 'rollback':
            break;

        case 'uninstall':
            break;
    }
    return $arrRes;
}

我還沒有機會真正測試上述內容,但僅從我對 magento 和自動加載的 ORM 的初步調查以及另一位開發人員對他的調查結果的投入來看.

I've not had a chance to really test out the above, but from just my initial investigations of the ORM that is magento and the Autoloading as well as another developer's input on his findings as well.

最終,如果我們可以在版本控制系統中保持所有更改至少模塊明智,那將是理想的.顯然,不應該以這種方式管理需要導入的龐大數據集,但是對于這些小的增量更改,我想推送到暫存、生產測試,如果失敗,則將其拉回一個版本,一切都恢復正常.

Ultimately it would be ideal if we can keep all of our changes at least module wise within a version controlled system. Obviously huge data sets that need to be imported shouldn't be managed this way but for these small incremental changes I want to push to staging, production test and if it fails pull it back one version and everything is back to normal.

顯然沒有一種理想的解決方案可以用于部署具有不同要求和需求的如此多的客戶,但執行此操作的通用方法將有助于代碼/SQL 部署.具有諷刺意味的是,Enterprise 有 CMS 登臺,以及代碼模塊化開發的能力,但 DB 卻沒有得到那么多的愛.

Obviously theres no one ideal solution for deployment with so many clients having different requirements and needs but a general way of doing this would help with code/SQL deployment. It's kind of ironic that Enterprise has CMS staging, and the ability for modular development of code, but the DB has not gotten as much love.

有一個相關的問題是指出我們目前如何使用一些自制"的專門腳本來做到這一點:

There is a related question that is noting how currently we are doing it with some specialized scripts "home-brewed" that essentially do:

執行 MySQLDump 或備份,然后替換 SQL 文件中的 BASE_URL.

Doing a MySQLDump or backup, then doing a replace on the BASE_URLs in the SQL file.

Magento 部署最佳實踐

另一個需要查看的工具是 Phing.

Another tool to look at would be Phing.

如果有人有時間調查似乎實施的回滾"和卸載"過程并報告他們的發現對我也有幫助.

If anyone has time to investigate the "rollback" and "uninstall" processes that seem to be implemented and report their findings would be helpful to me as well.

這篇關于Magento 不支持模塊的卸載/降級有什么原因嗎的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

Joining 2 tables in SELECT(MYSQL/PHP)(在 SELECT(MYSQL/PHP) 中加入 2 個表)
How to make lt;option selected=quot;selectedquot;gt; set by MySQL and PHP?(如何使lt;option selected=“selectedgt;由 MySQL 和 PHP 設置?)
Auto populate a select box using an array in PHP(使用 PHP 中的數組自動填充選擇框)
PHP SQL SELECT where like search item with multiple words(PHP SQL SELECT where like search item with multiple words)
json_encode produce JSON_ERROR_UTF8 from MSSQL-SELECT(json_encode 從 MSSQL-SELECT 產生 JSON_ERROR_UTF8)
MySQL ORDER BY rand(), name ASC(MySQL ORDER BY rand(),名稱 ASC)
主站蜘蛛池模板: 天天综合91 | 日韩一级电影免费观看 | 91影院| 在线观看的av | 精品一区二区三区四区视频 | 亚洲精品一区二区三区在线观看 | 欧美 日韩 综合 | 黑人巨大精品欧美一区二区免费 | 国产精品久久久久久久久久久久 | 国产亚洲高清视频 | 国产一区二区三区四区在线观看 | 精品久久香蕉国产线看观看亚洲 | 一级片免费网站 | 久久亚洲国产 | 久久出精品 | 亚洲天天干| 1区2区视频| 欧美日韩亚洲一区 | 亚洲视频一区二区三区 | 97caoporn国产免费人人 | 亚洲视频手机在线 | h视频在线观看免费 | 欧美老妇交乱视频 | 99热在线免费 | 2019精品手机国产品在线 | 九九免费视频 | 免费观看成人鲁鲁鲁鲁鲁视频 | 超碰精品在线 | 成人午夜毛片 | 亚洲欧美激情国产综合久久久 | 99这里只有精品视频 | 成人福利在线 | 欧美精品一区二区三区在线 | 亚州综合一区 | 亚洲一区二区三区在线播放 | 91极品尤物在线播放国产 | 久久久久久久久国产成人免费 | 99久久婷婷国产亚洲终合精品 | 亚洲国产精品99久久久久久久久 | 嫩草研究影院 | 在线观看成人小视频 |