Squibz Posted February 9, 2004 Share Posted February 9, 2004 Proposal: to make a program that compares files, uses fwrite and fread to update the files (by line, not overwrite), and then logs these changes, so that an uninstall can be easily implemented. Looking for: at least one person, experienced with regex and php. I know php, and regex (but not that well on regex), and i could do it myself, but it would be nice to have a partner in crime because i dont have that much time these days (with work). Benefit: obvious benefits here. isntall multiple mods very quickly, and have a way to uninstall them just as quickly. this might be one for the OScommerce team, but i can do it soon with just a little help, which is why i am posting here - i believe oscommerce is a great program and i want to help its evolution. Please send me an email if you are experienced with regex and are willing to help. I am thinking we could get this up in one nite. Link to comment Share on other sites More sharing options...
wizardsandwars Posted February 9, 2004 Share Posted February 9, 2004 A program like this just wouldn't be feasible, mostly because of the different versions, and different modifications everyone has applied. This would only be feasible if everyone always had the exact same code base, which very rarely is the case. ------------------------------------------------------------------------------------------------------------------------- NOTE: As of Oct 2006, I'm not as active in this forum as I used to be, but I still work with osC quite a bit. If you have a question about any of my posts here, your best bet is to contact me though either Email or PM in my profile, and I'll be happy to help. Link to comment Share on other sites More sharing options...
Squibz Posted February 9, 2004 Author Share Posted February 9, 2004 It would certainly be feasible. I dont see how it couldnt be. Installing a mod consists of installing new files, and altering existing ones. As long as you logged the changes to the files you would be able to undo the changes (uninstall) automatically. This principle could be used to implement multiple changes on pretty well any file. example: File.php: print "hello world"; $i = 2; $j = 3; echo "$i+$j"; so if you wanted to insert $k=4; after line $j = 3; instead of doing it manually, what the program would see is this (what the file would look like if $k mod is the only mod installed): print "hello world"; $i = 2; $j = 3; $k=4; echo "$i+$j"; currently, most mods i have installed will have instructions like "put line x after line y" or "replace line x with line y." Why cant an "install program" make this change and also make a log of it? Simply put, it can, and that is exactly what i intend to have my install mod do. The only extra work this would require from the developers/contributers would be including the modified files. But even then, it would be possible to have the program detect phrases like 'insert after' and 'replace with' and then carry out the needed operations. This is entirely possible. Link to comment Share on other sites More sharing options...
wizardsandwars Posted February 9, 2004 Share Posted February 9, 2004 No, it wouldn't. Simply because the VAST majority of the contibutions and modifications alter the same files. This means that the file being modified is most often not going to be the same for everyone, and there is not 'universal' way to apply a new modification. You simply can't programatically take into account the modifications everyone has already made to the files. The only way this would work is if you assumed that everyone was starting from the exact same code base, meaning the exact same version, and unmodificed, and not more than one mod could alter the same portion of code. This would be severly limited. ------------------------------------------------------------------------------------------------------------------------- NOTE: As of Oct 2006, I'm not as active in this forum as I used to be, but I still work with osC quite a bit. If you have a question about any of my posts here, your best bet is to contact me though either Email or PM in my profile, and I'll be happy to help. Link to comment Share on other sites More sharing options...
Squibz Posted February 10, 2004 Author Share Posted February 10, 2004 Perhaps you do not understand what i am saying. Anyways, if i dont get a partner in crime by this weekend, I will go it alone. And believe me, it will work. Link to comment Share on other sites More sharing options...
wizardsandwars Posted February 10, 2004 Share Posted February 10, 2004 Yeah, I must not have any idea at all. Programming? Whats that mean? Is that like those punch card things? Seriously, I understnad exactly what you mean, and your suggestions has fundamental flaw. But, you'll see. Best of luck :-) ------------------------------------------------------------------------------------------------------------------------- NOTE: As of Oct 2006, I'm not as active in this forum as I used to be, but I still work with osC quite a bit. If you have a question about any of my posts here, your best bet is to contact me though either Email or PM in my profile, and I'll be happy to help. Link to comment Share on other sites More sharing options...
Druide Posted February 10, 2004 Share Posted February 10, 2004 I'll second you on this one Chris this is an IMPOSSIBLE thing to do, even if you have documented everything. Only if everything is in an API like postnuke or so then it's a little easier but still this is not a content systems manager like postnuke so a NO GO... good luch anyway.... Robert We all need to learn it once, how hard it may seem when you look at it, also you will master it someday ;) Link to comment Share on other sites More sharing options...
♥ecartz Posted February 10, 2004 Share Posted February 10, 2004 If you want to do this, install diff and patch (which is a program that compares files and updates the second). They already have the functionality you seek. Or use a version control system like CVS or RCS (both of which log changes and also include diff/patch functionality). No new development necessary. Using it is not nearly as easy as you make it out to be. The problem comes when you have situations like this: $i = 1; print $i; and another mod comes along and makes it $i = 1; $k = $i + 1; print $k; Now, how do you implement a mod that wants to take the original code and change it to look like $i = 1; print $i * 2; Just looking at it, I would need to know more to know how to modify the second code to get the effect the third tries to achieve. Any of the following could be correct: $i = 1; $k = $i + 1; print $k * 2; or $i = 1; $k = $i + 1; print $k + $i; or $i = 1; $k = 2 * $i + 1; print $k; Determining which programmatically is not feasible. The computer program needs to understand what the code does to understand how the different pieces need to fit together. Hth, Matt Always back up before making changes. Link to comment Share on other sites More sharing options...
Guest Posted February 10, 2004 Share Posted February 10, 2004 Yeah they managed to make a mod installation program for PHPBB2 which works but manly on certified mods so a mod write can choose to make his mod compatiable with the installer. Takes away the tedious job of going through lots of PHP code and editing lines. However osCommerce code base may be different? Link to comment Share on other sites More sharing options...
wizardsandwars Posted February 10, 2004 Share Posted February 10, 2004 I think that would still be the issue of what happens when there are alterations to the locig ny more than one contribution. Often, it's not as simple as just applying the change to an unaltered file. Under the described method mentioned below, the Dev team would have to take a close look at each contribution to 'approve' it or not. As busy as they are, I don't see this a a wanted burden on their part. I think they alredy have more than enough to do. ------------------------------------------------------------------------------------------------------------------------- NOTE: As of Oct 2006, I'm not as active in this forum as I used to be, but I still work with osC quite a bit. If you have a question about any of my posts here, your best bet is to contact me though either Email or PM in my profile, and I'll be happy to help. Link to comment Share on other sites More sharing options...
Guest Posted April 4, 2004 Share Posted April 4, 2004 I see a lot of "it can't be done" or "what if there's conflicts" comments, but no one seems willing to acknowledge that it HAS been done, and conflicts and versioning issues are no more a problem with an automated system than they are with the current fully manual method. Look to EasyMOD for phpBB for how to do it, and quit giving excuses. Those of us without the time or skills to manually enter all the mods we want will make it worth your while with our praises. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.