Page 1 of 1

How to automatically install and uninstall a php library from a custom module for OpenCart 4.1.0.2

Posted: Sat Mar 22, 2025 9:37 pm
by velko
I am making my module for version 4.1.0.2 and I would like to install a php library in the following directory www/system/library/export_import/Classes/PHPExcel.
I would like the entire library to be automatically copied there and removed when the module is uninstalled.
How can I do it in the latest version of opencart.

Re: How to automatically install and uninstall a php library from a custom module for OpenCart 4.1.0.2

Posted: Tue Mar 25, 2025 7:45 pm
by OSWorX
velko wrote:
Sat Mar 22, 2025 9:37 pm
I am making my module for version 4.1.0.2 and I would like to install a php library in the following directory www/system/library/export_import/Classes/PHPExcel.
I would like the entire library to be automatically copied there and removed when the module is uninstalled.
How can I do it in the latest version of opencart.
I would like to say, if you able to "build" a module (= extension), then you should be able also to know how such files get into the folder structure.
Simply read the existing core files (especially the installer) and then you know how it works.
A second option is to build you own logic and copy the needed files to the correct place out from the installer package (with the logic to remove them when uninstalling).