Simple Machines Community Forum

Archived Boards and Threads... => Archived Boards => SMF Feedback and Discussion => Topic started by: Petee on January 29, 2009, 04:50:14 PM

Title: Modifications Install/Uninstall
Post by: Petee on January 29, 2009, 04:50:14 PM
As do most regulars to SMF, I install and uninstall a lot of mods while trying them out. I have become used to having to manually uninstall mods, rather than having the package manager do the work. So, I got to thinking that there has to be a better way.

Currently, several mods may edit the same file with the code below. Only the last added mod will uninstall successfully.  All others will fail and require a user to manually edit the code, which more than not leads to problems with inexperienced users.  Here is an example of a common one that causes problems:

<search position="after"><![CDATA[
?>]]></search>
<add><![CDATA[


Why not put in a bunch of comments at key points through-out most of the heavily modified php files? These comments would be used as indexes for a mod.  So, if by default, the end of the file actually looked like:


// 1
// 2
// 3
// 4
// 5
// 6
?>


Then, a mod author could say:

<search position="after"><![CDATA[
//2]]></search>
<add><![CDATA[


The SMF team would reserve that "after" //2" for this particular mod.  The next mod that came along would use //3 and so forth.  You could put dozens/hundreds of these comments throughout the file at key points and just assign them to a mod as they are submitted.

Installs and uninstalls would pass without errors a lot more. Obviously, there would be some that you have to manually uninstall and some coding that is still in-line with functions that this wouldn't be a viable option to use, but it seems to me like this would prevent a lot of headaches.

Does that make sense?
Title: Re: Modifications Install/Uninstall
Post by: 青山 素子 on January 29, 2009, 09:10:57 PM
What do you consider "key points"? What might be appropriate for some modifications might not be for others, and in many cases you might need to edit around a line of code. Trying to do this kind of thing and maintain it (I can easily see this kind of thing going to 100 or over) would be painful to develop around and balloon the size of the code.

It's a creative idea, but I personally don't see that it would be practical.