Opencart - 如何在public_html之外移动vqmod文件夹?

For some security issues I need to put vqmod folder outside of public_html, How should I do this job to keep vqmod working?

I also wanted to put vqmod somewhere else and it seems to be possible with some effort. Assuming that vqmod directory and public_html (where is the rest, like catalog, admin, index.php, etc.) are in the same top level directory, you can update definitions in configs like this (first you have to point $oc_path to wherever top-level directory you have): config.php :

define('DIR_VQMOD',       $oc_path . 'vqmod/');
define('DIR_APPLICATION', $oc_path . 'public_html/catalog/');
...

admin/config.php :

define('DIR_VQMOD',       $oc_path . 'vqmod/');
define('DIR_APPLICATION', $oc_path . 'public_html/admin/');
...

then modify indexes like this :

index.php :

require_once(DIR_VQMOD . 'vqmod.php');

admin/index.php :

require_once(DIR_VQMOD . 'vqmod.php');

then modify vqmod.php around line 622 in function _parseMods :

replace this : $fullPath = $this->_vqmod->path($fileToMod);

by this : $fullPath = $this->_vqmod->path('public_html/' . $fileToMod);

and around line 91 in function modCheck :

replace this : $sourcePath = $this->path($sourceFile);

by this : $sourcePath = $this->path('public_html/' . $sourceFile);

This works for me without problems at least with my version of OpenCart(1.5.5.1) and vqmod(2.3.2). You certainly need to delete some caches. I have deleted all the cached stuff in : vqmod/vqcache/*, vqmod/mods.cache, public_html/system/cache/*.

I have tested this with htdocs instead of public_html. Underscore has special meaning with vqmod paths, so I am not sure whether it works with it, you might need to use path without _.