【问题标题】:how to disable compiler in magento2?如何在 magento2 中禁用编译器?
【发布时间】:2016-04-01 15:18:27
【问题描述】:

如何在 magento 2.0 中禁用编译器?

我已经安装了 Magento 2.0,然后从 theme-forest 安装了一个主题“Porto”。但是安装了主题之后,编译的时候报错了。

magento_user:/var/www/html/magento2$ sudo php bin/magento setup:di:compile
Compilation was started.
Interception cache generation... 6/7 [========================>---]  85% 2 mins 418.2 MiBErrors during compilation:
        Smartwave\Filterproducts\Helper\Data
                Extra parameters passed to parent construct: $data. File: /var/www/html/magento2/app/code/Smartwave/Filterproducts/Helper/Data.php
        Smartwave\Filterproducts\Block\FeaturedList
                Incorrect dependency in class Smartwave\Filterproducts\Block\FeaturedList in /var/www/html/magento2/app/code/Smartwave/Filterproducts/Block/FeaturedList.php
\Magento\Framework\App\Config\ScopeConfigInterface already exists in context object
\Magento\Catalog\Helper\Image already exists in context object
        Smartwave\Filterproducts\Block\Home\FeaturedList
                Incorrect dependency in class Smartwave\Filterproducts\Block\Home\FeaturedList in /var/www/html/magento2/app/code/Smartwave/Filterproducts/Block/Home/FeaturedList.php
\Magento\Framework\App\Config\ScopeConfigInterface already exists in context object
\Magento\Catalog\Helper\Image already exists in context object
        Smartwave\Filterproducts\Block\Home\LatestList
                Incorrect dependency in class Smartwave\Filterproducts\Block\Home\LatestList in /var/www/html/magento2/app/code/Smartwave/Filterproducts/Block/Home/LatestList.php
\Magento\Framework\App\Config\ScopeConfigInterface already exists in context object
\Magento\Catalog\Helper\Image already exists in context object
        Smartwave\Filterproducts\Block\LatestList
                Incorrect dependency in class Smartwave\Filterproducts\Block\LatestList in /var/www/html/magento2/app/code/Smartwave/Filterproducts/Block/LatestList.php
\Magento\Framework\App\Config\ScopeConfigInterface already exists in context object
\Magento\Catalog\Helper\Image already exists in context object
Total Errors Count: 5

主题供应商说我需要禁用编译。如何在 Magento 2.0 中做到这一点?

我在 magento2 文档中寻找过这个,但找不到任何答案。我可以使用下面的这个命令禁用模块,但哪个是编译器模块

sudo php bin/magento module:disable Magento_xxxx

任何帮助/指针将不胜感激。我的网站现在已关闭,需要尽快恢复

【问题讨论】:

  • 公认的解决方案是说没有办法禁用编译器。那么你是如何解决这个问题的呢?
  • 供应商提供了更新版本,我没有遇到这个问题

标签: magento2


【解决方案1】:

您不能禁用编译器。为什么主题开发人员说要这样做?听起来很奇怪。

在默认模式和开发者模式下,编译器始终处于启用状态;一般来说,这是一件好事。在生产模式下,编译器被禁用。但是在默认模式或开发者模式下都无法禁用编译器。

【讨论】:

  • 例如,因为我们的 FE 开发者自己管理主题的编译。如果我们上传资产,那么 magento 编译器无法编译较少的文件,如果我们删除的文件比静态内容部署的文件少,则编译正在搜索不存在的文件......
  • 这里是供应商为 Magento 2.x 提供错误说明的另一个示例。 documentation.boostmyshop.com/embedded_erp/… 在安装他们的模块之前说“必须禁用 Magento 编译”。
猜你喜欢
  • 2011-08-11
  • 2010-11-15
  • 1970-01-01
  • 2019-04-19
  • 2021-02-22
  • 1970-01-01
  • 2018-08-31
  • 2018-04-14
  • 2022-10-24
相关资源
最近更新 更多