Post by burrito » Wed Jun 08, 2016 5:21 pm

Using OCmod for most of my extensions I came across an unwanted effect. After installing an extension that has files, sql and xml, everything is uploaded and sql is executed, xml is added to the modification list.
If for whatever reason you want to delete the modification, only the xml is removed, not the database changes and/or files.
This creates a bloated database and also if certain files only work with the xml you can get broken functionalities.

I've been thinking about how to fix this.
My suggestion would be that an OCmod always contains the XML part and one or both of the other elements:

XML:
- install.xml -> as it is now, with the added option to only have the title tags and no files / operations in case it is for a module / feed / analytics, etc upload only, this would allow for much easier installation (and more importantly, uninstallation) of modules.
The module would show in the modifications list and be removeable through it.

SQL:
- install.sql -> to run when being installed
- uninstall.sql -> to be saved in the modifications table in case of uninstall

FILES:
- upload folder -> as it is now
- as the files are uploaded a record should be kept of which ones are uploaded. This can be saved in the modifications table so the files can be removed when the uninstall is called.


The potential issues I see:
- files are deleted upon uninstall that are used across multiple modifications -> this is solvable by querying the modifications table for all other modifications to see if the file that's about to be deleted exists elsewhere in an installed modification. If so, do not delete.
- if a modification has overwritten one of the core files, deletion of that should also not happen -> a simple array with core files to check against could be the solution.

I am willing to work on this system but I would like to know from the OC team if this is something that would be useful in your minds, I'd rather not do the work for nothing ;)
Last edited by burrito on Wed Jun 08, 2016 5:27 pm, edited 1 time in total.

Image
Opencart specialist | Our website | Our modules


User avatar
Active Member

Posts

Joined
Tue Dec 15, 2009 6:10 pm
Location - Amsterdam, The Netherlands

Post by burrito » Wed Jun 08, 2016 5:23 pm

pretty unrelated to the above functionality but still ocmod installer;
the installed upon upload should not upload desktop.ini if the file exists in the upload folder.
I find that many zipfiles contain these files, they add nothing to the webserver

Image
Opencart specialist | Our website | Our modules


User avatar
Active Member

Posts

Joined
Tue Dec 15, 2009 6:10 pm
Location - Amsterdam, The Netherlands
Who is online

Users browsing this forum: No registered users and 57 guests