Safe Mods

Discussion forum for MOD Writers regarding MOD Development.
User avatar
christhatsme
Registered User
Posts: 1811
Joined: Sun Jan 16, 2005 10:42 am
Location: London, UK

Re: Safe Mods

Post by christhatsme » Thu Jun 21, 2007 9:52 am

It is if someone rights a ptach generator, but its if the MOD team would except it?

I would happily release patches if there was an easy way (copy and paste in changes :P)
All MOD downloads should be back now - Sorry for that and serious lack of support! - If anyone wants to take over or help with any of my MODs the offer would be apreciated as I have little time for phpBB Modding recently!

Again very sorry for not supporting these MODs recently.

User avatar
poyntesm
Registered User
Posts: 1671
Joined: Tue Jan 18, 2005 11:19 am
Location: Dublin, Ireland
Contact:

Re: Safe Mods

Post by poyntesm » Thu Jun 21, 2007 10:32 am

Do not quote me on this, but it should be possible to use the update engine from phpBB3

So in your MOD you would include a ZIP in the contrib folder. The ZIP would be the MOD1.0.0->MOD1.0.1 or such.

Let assume you only need to update a UCP module, then it would look as below.

./install/databse_update.php (only needed if doing DB work I think)
./install/index.php
./install/install_main.php
./install/install_update.php
./install/phpinfo.php
./install/update/index.php
./install/update/old/includes/ucp/ucp_yourmod.php (file from v1.0.0)
./install/update/new/includes/ucp/ucp_yourmod.php (file from v1.0.1)

./install/update/index.php would be something like

Code: Select all

<?php

if (!defined('IN_PHPBB'))
{
    exit;
}

// Set update info with file structure to update
$update_info = array(
    'version'    => array('from' => '1.0.0', 'to' => '1.0.1'),
'files'        => array(
    'includes/ucp/ucp_yourmod.php'),
'binary'    => array(
    ),
);

?>
I plan on playing with this soon...

User avatar
michaelo
Registered User
Posts: 1292
Joined: Thu Jun 13, 2002 3:49 am
Location: Dublin, Ireland
Name: Michael O'Toole
Contact:

Re: Safe Mods

Post by michaelo » Thu Jun 21, 2007 1:13 pm

The freedom to modify core code is a thing of the past (if it was ever really allowed)...

If we consider the new module system employed in phpBB3, it would appear (to me anyway), this is intended as framework for future inclusion of mods. The code for each phpBB modules contains functions (currently empty as they are no need in this case) to install and remove modules... All the necessary structure to manage additional modules is already included in the core and I suggest it would not be beyond the imagination to extrapolate the intend... I suggest the code is not just for the installation and management of the phpBB core but also to support future development of a plug-in system...

Lets assume for a moment I got it right, this would indicate that future mods could and dare I say it, should! be self contained... i.e. they would be in effect... plug-ins and being so would not edit or modify the core.

Now quite a few php-back-ends exist that already employ a plug-in manager to support the installation and removal of modules on the fly... one suck back-end is e107... This is a good example of what can be achieved without modify core code and yet provides all the mods anyone could want...

phpBB3 has advanced to the next level, it supplies all the necessary code to create advanced modules in the form of plug-ins... is it not time that mod development caught up?

If you think the discussion has changed for proposals to plug-ins you missed the plot... they are one and the same...
Mike
Contributions: Mods & Styles Extensions
(site is down): Kiss Portal Engine

User avatar
poyntesm
Registered User
Posts: 1671
Joined: Tue Jan 18, 2005 11:19 am
Location: Dublin, Ireland
Contact:

Re: Safe Mods

Post by poyntesm » Thu Jun 21, 2007 1:27 pm

The freedom to modify core code is a thing of the past (if it was ever really allowed)...
That is a fairly swooping statement. Of course it was allowed. Look at the MODDB. ;) :roll:

Prizem
Registered User
Posts: 249
Joined: Sun Sep 07, 2003 9:14 am
Contact:

Re: Safe Mods

Post by Prizem » Thu Jun 21, 2007 2:48 pm

I'm being reminded of the plugins functionality of WordPress. I was surprised as a user at how easy it was to install things there. Just by dropping the plugins into the designated plugins folder, they dynamically add themselves to the deployment of the system. And there is a page in the admin panel that allows you to turn on/off these plugins whenever you like. (There are sometimes additional instructions for if you're using non-standard templates, but they're in the form of functions that contain a check for whether or not it's turned on.)

I'm not sure if the ideas contained within this topic are aimed at moving towards something as completely contained as these plugins, or if that's even possible with the way the current phpBB core is structured, but I do like the idea and believe it has some potential.

User avatar
poyntesm
Registered User
Posts: 1671
Joined: Tue Jan 18, 2005 11:19 am
Location: Dublin, Ireland
Contact:

Re: Safe Mods

Post by poyntesm » Thu Jun 21, 2007 4:04 pm

Mike...just wanted to clear one thing up. I agree making use of modules make sense ;)
Image
But it is not the case all MODs can be written as modules. If you want to change core functionality which is often the desire of a MOD then often a module is not the correct way. It is really about using the correct tool for the correct job.

If you need a permission system in your MOD - use the phpBB system. If you need caching in your MOD - use the acm. If you MOD can be standalone - look into writing it as a module. What if you wanted to change the way phpBB does topic tracking for whatever reason. A module could not do that. You would want to edit the core files and adjust to your desired method and in my opinion thats 100% OK.

User avatar
MHobbit
Former Team Member
Posts: 4761
Joined: Thu Mar 18, 2004 5:32 pm
Location: There and Back Again

Re: Safe Mods

Post by MHobbit » Fri Jun 22, 2007 7:24 pm

poyntesm wrote:If you need a permission system in your MOD - use the phpBB system. If you need caching in your MOD - use the acm. If you MOD can be standalone - look into writing it as a module. What if you wanted to change the way phpBB does topic tracking for whatever reason. A module could not do that. You would want to edit the core files and adjust to your desired method and in my opinion thats 100% OK.
I agree. Modifying "core code" isn't always a bad thing; it just depends on what you want to accomplish. Plugins and other modular things are nice, but not everything can be like them due to their nature.
Former phpBB MOD Team member
No private support is offered.
"There’s too many things to get done, and I’m running out of days..."

User avatar
michaelo
Registered User
Posts: 1292
Joined: Thu Jun 13, 2002 3:49 am
Location: Dublin, Ireland
Name: Michael O'Toole
Contact:

Re: Safe Mods

Post by michaelo » Wed Jun 27, 2007 7:14 am

poyntesm... I like sweeping statements but yes your right... I guess modifying the core is allowed but still...

It does appear the concept of Safe Mods is/was only wishful thinking on my part... mind you I have built several mods using the rules and procedures... everything work perfectly... maybe I won't give up on it yet... who know, phpBB4 :?

For now I guess it's back to building my portal and plugin manager... :mrgreen:
Thanks guys....
Mike

PS poyntesm, if you do any more work on this (a previous post above): http://www.phpbb.com/community/viewtopi ... 7#p3053527
let me know... looks very interesting....
Contributions: Mods & Styles Extensions
(site is down): Kiss Portal Engine

User avatar
Freitag
Registered User
Posts: 143
Joined: Mon Jul 11, 2005 10:17 pm

Re: Safe Mods

Post by Freitag » Thu Jun 28, 2007 3:52 am

michaelo wrote:It does appear the concept of Safe Mods is/was only wishful thinking on my part.

Well I thought it was a good idea. Still do.
No clever .sig here

lysp
Registered User
Posts: 10
Joined: Mon Mar 19, 2007 7:42 am

Re: Safe Mods

Post by lysp » Thu Jun 28, 2007 3:55 am

Personally i'm in total agreement with the OP.

If I had my way mods shouldn't touch ANY code at all. They should be all be created through extending the core functions or by callbacks/interfaces/events/delegates.

Take gallery2 as an example. All plugin's are separated in their own directory and no modification of php is required at all.

While this hasn't been on the agenda for phpbb3, i think it should be for later versions.

Personally i would like:

Code: Select all

thread.onpost = new handler(data, *myposthandler)

myposthandler(data) 
  if (post allowed using my own logic) 
     return true;
  else 
    return false;
I can't believe people are complaining because adding a bit of extra code is "too hard". If it's too hard, then don't code.

The one main downside i've always seen to phpbb2 is the mess that mods have made to the code. If you install 10-15 mods and you get regular dot releases up to .22 (like it is currently), i personally do not want to re-install mods 10 * 22 (220) times.

With a plugin system, i will have to install it once. If i have version limiting built into plugins, then it'll automatically disable itself until i modify it to work with the current version. All without changing a single bit of base-code.


Plus per mod, you'd expect maybe 4-5 if statements (as proposed). 4-5 if statements is NOT going to slow down a page. That is plain ridiculous. A loop with 20,000 iterations, or something similar you can start to get me to start to believe that, but 4-5 if statements.. come on.

wGEric
Former Team Member
Posts: 8805
Joined: Sun Oct 13, 2002 3:01 am
Location: Friday
Name: Eric Faerber
Contact:

Re: Safe Mods

Post by wGEric » Thu Jun 28, 2007 4:48 pm

IMO it is a good idea (well some of the things) but at this point, it's not practical and not efficient. phpBB needs to be written in a way that allows this to happen easily. Something along the lines of WordPress's plug in system comes to mind.

Until then, if it ever happens, MOD Authors can edit the files and the database as they want.

The MOD Team doesn't like it when you change delete anything in the database though. You can add columns and tables but when it comes to deleting columns, we don't like it. We will accept MODs that do this though but the author has to have a good reason on why he/she is doing what they are doing.
Eric

User avatar
3Di
Former Team Member
Posts: 14482
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: Safe Mods

Post by 3Di » Thu Jun 28, 2007 5:23 pm

MennoniteHobbit wrote:Modifying "core code" isn't always a bad thing; it just depends on what you want to accomplish.
usually I name it 'fork', though.
Please PM me only to request paid works. Thx.
Want to compensate me for my interest? Donate
My development's activity º PhpStorm's proud user
Extensions, Scripts, MOD porting, Update/Upgrades
✒️ Black Friday 2019 @ The Studio ▪️◾️

User avatar
michaelo
Registered User
Posts: 1292
Joined: Thu Jun 13, 2002 3:49 am
Location: Dublin, Ireland
Name: Michael O'Toole
Contact:

Re: Safe Mods

Post by michaelo » Thu Jun 28, 2007 11:30 pm

3Di wrote:
MennoniteHobbit wrote:Modifying "core code" isn't always a bad thing; it just depends on what you want to accomplish.
usually I name it 'fork', though.
:mrgreen:
wGEric wrote:IMO it is a good idea (well some of the things) but at this point, it's not practical and not efficient. phpBB needs to be written in a way that allows this to happen easily. Something along the lines of WordPress's plug in system comes to mind.

Until then, if it ever happens, MOD Authors can edit the files and the database as they want.

The MOD Team doesn't like it when you change delete anything in the database though. You can add columns and tables but when it comes to deleting columns, we don't like it. We will accept MODs that do this though but the author has to have a good reason on why he/she is doing what they are doing.
I have always imagined this was the case, unfortunately if you allow such changes, then, over time you could end up with something other than a true phpBB core product.... mind you, database changes are rare and can probably be dealt with easily enough but php core changes (I don't mean code additions) are very common and in MHO do more damage....

Having said that, can you imagine how much easier for everyone if 'find and replace' were not be allowed in mods... besides there are many new code segments that point towards module based inclusion...

Mike
Contributions: Mods & Styles Extensions
(site is down): Kiss Portal Engine

Edwartine
Registered User
Posts: 34
Joined: Sun May 07, 2006 2:37 pm
Contact:

Re: Safe Mods

Post by Edwartine » Fri Jun 29, 2007 1:30 am

in my opinion, if your installing a non-validated phpBB mod, you better know enough about PHP to be able to undo it yourself/and or try to correct any errors it creates.

if NOT, then you should only use VALIDATED phpbb mods, which obviously if they are validated will rarely if ever have any issues. Why? They've been tested. Obviously sometimes there may be something that sneaks by, but ... thats not a likely case.

It's the same concept as the phpBB3 betas, and even the RC, don't use unless you know what your doing. Anything unvalidated should be considered unstable, and you should thus only install if your capable enough to handle it on your own.
Edwartine - proclaimer of Technological Truth and Justice...the geekian way.
My Dot Com - My Revised PHPbb Storyboard -
ServantsOfGrace Online Community

wGEric
Former Team Member
Posts: 8805
Joined: Sun Oct 13, 2002 3:01 am
Location: Friday
Name: Eric Faerber
Contact:

Re: Safe Mods

Post by wGEric » Sat Jun 30, 2007 5:46 am

michaelo wrote:Having said that, can you imagine how much easier for everyone if 'find and replace' were not be allowed in mods... besides there are many new code segments that point towards module based inclusion...
We don't like people to use REPLACE WITH but use IN-LINE actions instead. Although, there are instances where IN-LINE actions can't be used and you need to use REPLACE WITH.
Eric

Locked

Return to “[3.0.x] MOD Writers Discussion”