[RFC|Merged] Extensions

These requests for comments/change have lead to an implemented feature that has been successfully merged into the 3.1/Ascraeus branch. Everything listed in this forum will be available in phpBB 3.1.
Post Reply
User avatar
igorw
Registered User
Posts: 500
Joined: Thu Jan 04, 2007 11:47 pm

[RFC] New front pages in extensions

Post by igorw » Sat Nov 26, 2011 4:36 pm

For those interested, here is an example extension with a cron task: https://github.com/igorw/ascraeus-foobar-extension

sajaki
Registered User
Posts: 86
Joined: Mon Jun 21, 2010 8:28 pm

Re: [RFC|Merged] Extensions

Post by sajaki » Mon Jan 02, 2012 10:07 pm

in common.php 3.1 there is now a new line :
$phpbb_extension_manager = new phpbb_extension_manager($db, EXT_TABLE, $phpbb_root_path, ".$phpEx", $cache->get_driver());
is this where extensions, a.k.a mod classes will be loaded ?

sajaki
Registered User
Posts: 86
Joined: Mon Jun 21, 2010 8:28 pm

Re: [RFC|Merged] Extensions

Post by sajaki » Sun Jan 08, 2012 12:49 pm

naderman wrote:What are extensions?
  • XCP Module:
    phpBB/ext/<ext>/xcp/xcp_<name>_module.php
    phpBB/ext/<ext>/xcp/xcp_<name>_info.php
what's an xcp module ?

User avatar
igorw
Registered User
Posts: 500
Joined: Thu Jan 04, 2007 11:47 pm

Re: [RFC|Merged] Extensions

Post by igorw » Sun Jan 08, 2012 1:27 pm

acp/mcp/ucp.

User avatar
MichaelC
Development Team
Development Team
Posts: 889
Joined: Thu Jan 28, 2010 6:29 pm

Re: [RFC|Merged] Extensions

Post by MichaelC » Tue Feb 07, 2012 10:52 pm

What is ext_state used for in the ext table? As there is already an ext_active column and as far as I can see on here it can only be active or inactive (or it can be purged but thats an action)?

Also, wouldn't it make sense to have a column for ext_id (set as primary key and auto increase) to use an identifier as you could have two (for example) blog MODs both called phpBB Blog, released on different sites and because of the index it would not allow the second one to be added.

EDIT: Also how would the SQL changes be shown, in the manifest or in a db_changes.php or another file?

Also the chat log from earlier about manifests:
https://gist.github.com/1762789
Formerly known as Unknown Bliss
psoTFX wrote: I went with Olympus because as I said to the teams ... "It's been one hell of a hill to climb"
No unsolicited PMs please except for quotes.

User avatar
igorw
Registered User
Posts: 500
Joined: Thu Jan 04, 2007 11:47 pm

Re: [RFC|Merged] Extensions

Post by igorw » Wed Feb 08, 2012 9:36 am

Unknown Bliss wrote:What is ext_state used for in the ext table? As there is already an ext_active column and as far as I can see on here it can only be active or inactive (or it can be purged but thats an action)?
The state contains extension-specific data that is persisted between requests during installation (more specific: during the extension enabling/disabling process). This allows for multi-step changes when enabling an ext.

User avatar
MichaelC
Development Team
Development Team
Posts: 889
Joined: Thu Jan 28, 2010 6:29 pm

Re: [RFC|Merged] Extensions

Post by MichaelC » Wed Feb 08, 2012 4:01 pm

Ok, in that case what is used to show whether an extension has been previously activated then deactivated? As the installer would need to know this?
Formerly known as Unknown Bliss
psoTFX wrote: I went with Olympus because as I said to the teams ... "It's been one hell of a hill to climb"
No unsolicited PMs please except for quotes.

User avatar
igorw
Registered User
Posts: 500
Joined: Thu Jan 04, 2007 11:47 pm

Re: [RFC|Merged] Extensions

Post by igorw » Wed Feb 08, 2012 4:07 pm

As long as the extension is not active, the state is used for activation. As soon as it is active, the state is used for deactivation.

User avatar
MichaelC
Development Team
Development Team
Posts: 889
Joined: Thu Jan 28, 2010 6:29 pm

Re: [RFC|Merged] Extensions

Post by MichaelC » Wed Feb 08, 2012 5:41 pm

igorw wrote:As long as the extension is not active, the state is used for activation. As soon as it is active, the state is used for deactivation.
But once deactivated it doesn't remove any SQL, when activated then it runs the SQL. So to prevent it running the SQL on every activation...?
Formerly known as Unknown Bliss
psoTFX wrote: I went with Olympus because as I said to the teams ... "It's been one hell of a hill to climb"
No unsolicited PMs please except for quotes.

User avatar
MichaelC
Development Team
Development Team
Posts: 889
Joined: Thu Jan 28, 2010 6:29 pm

Re: [RFC|Merged] Extensions

Post by MichaelC » Sun Feb 12, 2012 2:03 am

Something which came up on IRC and I've vaguely mentioned here.

I would suggest adding the following:
An ext_history column which would display the number of times it had been enabled
An ext_id column to use as an identifier rather than name

The first because DB changes should only be run on the first time it is enabled. This doesn't matter so much until migrations.
The second because it makes more sense to use a unique numeric id as an identifier than a unique extension name and it can be used as the primary key.
Formerly known as Unknown Bliss
psoTFX wrote: I went with Olympus because as I said to the teams ... "It's been one hell of a hill to climb"
No unsolicited PMs please except for quotes.

Post Reply