Opencart system/modifications文件夹如何起作用? [英] How does the Opencart system/modifications folder function?

查看:223
本文介绍了Opencart system/modifications文件夹如何起作用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对OC 2.X还是很陌生,当我对未显示的站点进行更改时,我注意到了.当我在system/modifications文件夹中进行更改时,出现了更改.我认为该文件夹是新文件夹,与vqmod无关.我认为这是一个文件管理员,基本上比核心文件具有优先权.

I am quite new to OC 2.X and I noticed as I was making changes to the site they werent appearing. When I went to change within the system/modifications folder the changes appeared. I assumed this folder was something new and nothing to do with vqmod. I thought it was a foler that would basically take priority over the core file.

不幸的是,当我安装一个插件时,它也重新构建了该文件夹,因此我丢失了所有更改(我以为就是这样).

Unfortunately when I installed a plugin it also rebuilt that folder so Ive lost all my changes (Im assuming thats what happened).

我想知道这整体如何运作吗?我必须为要更改的每个内容都进行新的扩展吗?

Im wondering how does this work overall? Must I make a new extension for every change I would like to make?

我找不到清晰简洁的解释,可以从开发人员的角度进行解释.

I cannot find a clear and concise explanation that explains it for a developers point of view.

推荐答案

您可以说ocmodvqmod相同,但是在某些方面有所不同,并且默认情况下在opencart 2.0及更高版本中提供.每次对模块进行任何更改时,都必须重置修改缓存以查看其效果.像vqmod ocmod一样,还会生成缓存文件,这些文件位于修改文件夹中.并且此文件夹中的文件将比原始文件优先.由于我认为您正在修改文件中的文件,因此如果您从管理面板中清除修改缓存,则可能会丢失它们.

You can say that ocmod is same as vqmod but it differs in some ways and provided by default in opencart 2.0 and above version. You have to reset modification cache every time you make any changes to your module to see its effect. Like vqmod ocmod also generates cache files which are placed in modification folder. And files in this folder will get prior then the original one. As i think you were modifying files in modification file you might lose them if you clear modification cache from admin panel.

您可以检查system/startup.php文件以了解更多信息.

You can check system/startup.php file for more understanding.

// Modification Override
function modification($filename) {
if (!defined('DIR_CATALOG')) {
    $file = DIR_MODIFICATION . 'catalog/' . substr($filename, strlen(DIR_APPLICATION));
} else {
    $file = DIR_MODIFICATION . 'admin/' .  substr($filename, strlen(DIR_APPLICATION));
}

if (substr($filename, 0, strlen(DIR_SYSTEM)) == DIR_SYSTEM) {
    $file = DIR_MODIFICATION . 'system/' . substr($filename, strlen(DIR_SYSTEM));
}

if (is_file($file)) {
    return $file;
}

return $filename;
}

这篇关于Opencart system/modifications文件夹如何起作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆