Topic: Announcing: PunMod beta v0.9.2

Announcing PunMod

PunMod version 0.9.2 (BETA) has been released for testing.

PunMod is a mod installation system for PunBB.

What this means, is that you can write simple mod installation scripts that apply various changes to the PunBB source code in a safe and controlled manner.

Why did I make this: well, if it's not obvious smile .. upgrading to newer versions, when you have already applied various mods, can be a lot of work - because you're most likely unable to remember which files you modified and how, so you end up having to go through the manual installation of every mod over again. Or worse, you end up not upgrading at all. With PunMod, you can safely and easily apply all your source code changes to a newer version, usually with very little or no manual work.

The syntax for mod scripts is extremely simple, somewhat similar to the original MDK-1.1 specification, and it takes only 10 minutes to learn - most of your existing mods can probably be rewritten into mod scripts in a few minutes.

Some of the most important features include:

- Apply all your mods in one go, in a transactional and safe manner: all changes are performed in memory first, so that if one or more mods fail, no changes are applied to any files.

- Apply your mods in any order: you can modify the order in which the mods are applied - for example, if there is a problem applying one mod before another, because the second mod relies on information that was changed by the previous mod, this will be detected and you can then change the order.

- Many potential problems (such as conflicting modes, different versions of the same mod, already installed mods etc.) are detected and prevented at an early stage, before any damage can be done by a mod.

This beta release includes only a few mods, one for testing and a couple of my own mods ready to install. I encourage you to download and test this release, and to start writing your own mod scripts. Detailed instructions and help for using the PunMod installer itself, is built into the script. The syntax for writing your own mod scripts is explained in the included textfiles.

WARNING: BACK UP YOUR PUNBB FOLDER BEFORE APPLYING MODS!

Please post your feedback, bug reports, suggestions, requests, ideas and favorite recipes! smile

Download here:

http://www.mindplay.dk/temp/punmod092.zip

Re: Announcing: PunMod beta v0.9.2

Amazing! This is exactly what the mod community needs. I'm definately gonna have a look at this tonight.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: Announcing: PunMod beta v0.9.2

wow, like easymod for phpbb but much much better big_smile,

suggestions:
* for 1.2 this should definatly be a admin plugin
* for now maybe it should check the user is logged in as punbb admin?

Re: Announcing: PunMod beta v0.9.2

well, I thought about integrating it with the admin screen, but it doesn't seem like there's much point? well, depends on how you intend to use it of course - but in any case, you should always backup the database and all scripts before applying mods, and I guess if you can do that, you already have server administration privileges of some sort, so ... I don't know, but for my own purposes, I will probably use it to apply all of my mods, and testing locally, before uploading - I don't think it would be a good idea to encourage the use of this tool as a means of just testing any mod on your production copy of your forum, since there is no way to uninstall a mod or undo the changes to the database. Doesn't seem like a good idea. Or?

Re: Announcing: PunMod beta v0.9.2

It looks really nice! I've only looked at it briefly, not installed any mods with it. I'll probably take a closer look when I've got the time, and maybe "convert" my mods to it :)

Re: Announcing: PunMod beta v0.9.2

most people who use this though i guess will use it on a live enviroment... people are not very good at doing local tests and backups and stuff, also in 1.2 it would be very easy to integrate into the admin panel,

couple more ides:
* make a sql command so that more of it can be included in the .pun file?
* dunno if this is a good idea but maybe add a create file so that all of the data can be in the .pun file?

Re: Announcing: PunMod beta v0.9.2

The SQL command is definitely a good idea, I will add that.

As for create file .. I think this would clutter the .pun files too much, they wouldn't be readable - you already have the INSTALL command anwyays. Might be useful for smaller files though, I guess. Maybe I'll add this too, will see...

Re: Announcing: PunMod beta v0.9.2

yeh i was thinking because some mods have a little extra file and it would be much easier if it could just be one "pack"although i realise some mods have to many file that are too big to do that

9

Re: Announcing: PunMod beta v0.9.2

i must admit it is really great that should save alot of work for everybody

Re: Announcing: PunMod beta v0.9.2

Connorhd wrote:

yeh i was thinking because some mods have a little extra file and it would be much easier if it could just be one "pack"although i realise some mods have to many file that are too big to do that

Good point, I'll add a command for that too then smile

Re: Announcing: PunMod beta v0.9.2

maybe a better way to do it (i sunno if this is a bit extreme) is to allow the .pun file to be zipped up with all the files needed for the mod and then for the zip file to be uploaded, the mod installer could then extract it and all files could always be in one file

12 (edited by mindplay 2004-10-29 07:07)

Re: Announcing: PunMod beta v0.9.2

That seems a bit overkill? For distribution, you can already just use zip like you would for any other file ... with the SQL and CREATE commands, almost every mod can already be done in a single file anyways. Speaking of which ... smile

PunMod version 0.9.3 (BETA) has been released for testing.

Download here:

http://www.mindplay.dk/temp/punmod093.zip

New: CREATE command added, allows embedding text/script files in your mods.

New: SQL command, allows running arbitrary SQL statements through a specified PunBB database abstraction layer.

Improved: more useful error messages for mod developers.

Updated: all relevant documentation.

Re: Announcing: PunMod beta v0.9.2

yeh probably is a bit overkill wink anyway looks cool i might try the one mod i have made on it later ;D

Re: Announcing: PunMod beta v0.9.2

*stick*

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: Announcing: PunMod beta v0.9.2

Any of you been testing this?

Anyone got other ideas or bugreports?

Only thing on my to-do list right now is subdirectory scanning, which will allow you to (optionally) put your mod and any external files in a subfolder - imo, this is better than zipping them, since if they were zipped, PunMod would have to unzip them all every time the page loads (to find titles and descriptions etc.) ...

If nobody else has anything, I'll probably just get that done, and stick a one-point-oh on it smile

Re: Announcing: PunMod beta v0.9.2

By the way, I also plan on doing a separate tool, which will compare two installations of PunBB, and generate a PunMod script to automatically implement all source code changes between one installation (the original) and another (your modified installation) ...

This would be useful first of all, if you want to build a new mod - if you start with a clean installation and make your changes on that, you can then afterwards automatically generate the complete mod (minus database changes).

It would also be useful if you already have a lot of customizations applied (who doesn't), and wish to upgrade to a newer version of PunBB - you can then generate a custom mod by comparing the original release your installation is based on, to your customized one, then install a clean new updated release, and then apply your mod on it.

I've only barely started on this yet, so I don't know when it will be ready for testing...

Re: Announcing: PunMod beta v0.9.2

That sounds like an excellent idea. I can't wait to play with this once 1.2 is out.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: Announcing: PunMod beta v0.9.2

i dunno if this is a crazy idea (i usually think of crazy ideas) but have you though about it downloading the mods too, you could have a simple uploader built into the generater thing you are making, then the installer could get a list of mods from the site (like the plugin manager) you could tick the ones you like, it would download them to a temp folder and then the proccess would start from where it does now, checking they will install ok etc, people could then download your tool and select all th mods they want without having to go look for them, not sure how well it would work for big mods or mods with lots of files though

Re: Announcing: PunMod beta v0.9.2

What happens if two mods changes the same line?

Re: Announcing: PunMod beta v0.9.2

Jansson wrote:

What happens if two mods changes the same line?

That can't happen - if you try to install two mods that rely on finding and changing the same part of a file, you'll get an error message, and the process will be aborted without applying any of the mods.

@Connorhd:

Yes, I thought about doing something similar ... what I had in mind, is a simple mod archive site - the mod parser function is in a separate include for this reason, and can do a "quick scan" (like it does on startup now), not fully loading the mod, but only getting the title and description etc. ... this was intended to be used for a mod archive also. What I figured is, such an archive would also expose a small script that PunMod installations can load from the outside, to check for newer versions of installed mods. This stuff isn't at the top of my to-do list right now though, but if somebody else wants to do an archive, reusing the include file should be very very simple - it's just one function call to parse and load information from a mod, and returns everything as an assoc.array ...

Re: Announcing: PunMod beta v0.9.2

chacmool just made a system like this forum plugins (althouhg plugins can be downloaded anytime maybe his upload and download thing could be "stolen" for this i dunno, wuld be very very cool though wink

Re: Announcing: PunMod beta v0.9.2

let's take a look, where is it? smile

Re: Announcing: PunMod beta v0.9.2

well its not released yet i don't think, i have it but i dunno if he wants to keep it as a test atm...

Re: Announcing: PunMod beta v0.9.2

ok, i'm just trying to make my rating mod as a .pun file but i have a problem with the mysql, how does it work with db prefixes?

Re: Announcing: PunMod beta v0.9.2

oops ... well, I don't use a prefix myself, and I hadn't thought about that at all ... I'm not sure how to best handle that?

But I guess we'll have to use some sort of replaceable symbol, so you'd write something like <prefix>, and then PunBB can replace this with the prefix before running the query?

Or what would you suggest?