Advertisement:

Author Topic: Modifications Install/Uninstall  (Read 1080 times)

Offline Petee

  • Semi-Newbie
  • *
  • Posts: 31
Modifications Install/Uninstall
« 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:

Code: [Select]
<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:

Code: [Select]
// 1
// 2
// 3
// 4
// 5
// 6
?>

Then, a mod author could say:

Code: [Select]
<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?

Offline 青山 素子

  • Server Team
  • SMF Super Hero
  • *
  • Posts: 17,066
  • 戦場ヶ原、蕩れ!
    • srvrguy on GitHub
    • @motokochan on Twitter
    • Nekomusume Moe
Re: Modifications Install/Uninstall
« Reply #1 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.
Motoko-chan
Director, Simple Machines

Note: Unless otherwise stated, my posts are not representative of any official position or opinion of Simple Machines.