Self-contained MODs

General discussion of development ideas and the approaches taken in the 3.x branch of phpBB. The current feature release of phpBB 3 is 3.3/Proteus.
Forum rules
Please do not post support questions regarding installing, updating, or upgrading phpBB 3.3.x. If you need support for phpBB 3.3.x please visit the 3.3.x Support Forum on phpbb.com.

If you have questions regarding writing extensions please post in Extension Writers Discussion to receive proper guidance from our staff and community.
User avatar
naderman
Consultant
Posts: 1727
Joined: Sun Jan 11, 2004 2:11 am
Location: Berlin, Germany
Contact:

Self-contained MODs

Post by naderman »

With the new hook system and the way cron works we make it possible for MODs to consist only of files to be added. However presently they still need to be located in different directories in various places. I'm wondering if we can make it so that a MOD consists of exactly one directory so that uninstalling it simply means removing that directory (and database changes of course). Any thoughts on this?

User avatar
Marc
Development Team Leader
Development Team Leader
Posts: 185
Joined: Thu Sep 09, 2010 11:36 am
Location: Munich, Germany

Re: Self-contained MODs

Post by Marc »

I like the idea and I think it should be possible. This would make the forum more clearly arranged, especially if you have many MODs installed.

Maybe this will even be possible by just defining the inclusion path of i.e. an HTML file to the MOD path. The hook system would then load the HTML file from the MOD folder and not from the normal template folder of the style.

But: What do you do if the HTML snippet or file you include is not compatible with the current style? Maybe this will break the whole page layout.

Of course it would be important to define a directory for MODs, i.e. just add the folder "mods" in the root directory.


Anyhow, I like the idea. ;)

Oleg
Posts: 1150
Joined: Tue Feb 23, 2010 2:38 am
Contact:

Re: Self-contained MODs

Post by Oleg »

The idea is worth pursuing, however if it would compromise something else I would evaluate pros and cons carefully.

User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 1904
Joined: Thu Mar 02, 2006 4:29 pm
Location: Earth
Contact:

Re: Self-contained MODs

Post by DavidIQ »

marc1706 wrote:But: What do you do if the HTML snippet or file you include is not compatible with the current style? Maybe this will break the whole page layout.
You could also have a styles directory in the MOD's directory and have the applicable template files and stylesheets, images, etc. for the MOD located there in the appropriately named style's directory. Styles would likely still be either prosilver or subsilver2 based anyways so they would theoretically work the same as they do right now.
Image

Oleg
Posts: 1150
Joined: Tue Feb 23, 2010 2:38 am
Contact:

Re: Self-contained MODs

Post by Oleg »

IRC wrote: (17:08:00) naderman: I think for a start a phpbb_class_finder('_task', $phpbb_root_path, 'includes/cron/task/') which searches the given directory as well as all MODs for classes with a _task suffix or something along those lines would work nicely
(17:08:01) nx-: my reply was not a sign-up ;)
(17:08:08) naderman: so cron could then just use that to find its tasks

keith10456
Registered User
Posts: 523
Joined: Sat Apr 22, 2006 10:29 pm
Contact:

Re: Self-contained MODs

Post by keith10456 »

naderman wrote:With the new hook system and the way cron works we make it possible for MODs to consist only of files to be added. However presently they still need to be located in different directories in various places. I'm wondering if we can make it so that a MOD consists of exactly one directory so that uninstalling it simply means removing that directory (and database changes of course). Any thoughts on this?
I don't have the technical know-how to offer a solution but this definitely makes sense... and I hope it can be implemented.

User avatar
RMcGirr83
Registered User
Posts: 360
Joined: Fri Mar 09, 2007 1:51 am
Contact:

Re: Self-contained MODs

Post by RMcGirr83 »

Styles would likely still be either prosilver or subsilver2 based anyways so they would theoretically work the same as they do right now.
But many styles change the layout or add things to the html files. Cyberaliens styles are a perfect example of that with the way he uses, eg, $CA_BLOCK stuff
Do not hire Christian Bullock he won't finish the job and will keep your money

alexemilov
Registered User
Posts: 5
Joined: Wed Sep 08, 2010 8:38 am

Re: Self-contained MODs

Post by alexemilov »

Well I love the idea, but I don't get how the mods should be parsed.The mod files should be separated from the others, but when you need http://www.example.com/some-file.php to be in the index it should be moved from 'mods folder' to the index and then we go to automod use and not separating.I don't know how this to be done, then the other part should be a bit easier.
Maybe only index files should be moved to index (they may be separated in some folder like 'base') and the other styles,includes.. should not be moved and parsed from mods folder.
Then may be created or saved mod (db, cache or simple info file) information which files are moved from base and then if we want to reinstall that mod that list of base files should be read from this 'mod info file'.This can be done by mod author (like acp modules info files) or automatically via the mod parser.

Hope developers understand it, I'm not very good with English.

User avatar
naderman
Consultant
Posts: 1727
Joined: Sun Jan 11, 2004 2:11 am
Location: Berlin, Germany
Contact:

Re: Self-contained MODs

Post by naderman »

This obviously only works for MODs that
a) do not need to modify code
b) do not need to place files into publically accessible places like the root directory.

alexemilov
Registered User
Posts: 5
Joined: Wed Sep 08, 2010 8:38 am

Re: Self-contained MODs

Post by alexemilov »

naderman wrote:This obviously only works for MODs that
a) do not need to modify code
b) do not need to place files into publically accessible places like the root directory.
What are these mods ?
Some xml parser like in automod will do the code changes and for the second it won't be very hard to make.
Nevermind I think that some engine to parse edit from one place to another will be very good (no more mod install.xml).

Post Reply