[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
igorw
Registered User
Posts: 500
Joined: Thu Jan 04, 2007 11:47 pm

[RFC] New front pages in extensions

Post by igorw »

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 »

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 »

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 ?

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

Re: [RFC|Merged] Extensions

Post by igorw »

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 »

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.

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

Re: [RFC|Merged] Extensions

Post by igorw »

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 »

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.

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

Re: [RFC|Merged] Extensions

Post by igorw »

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 »

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 »

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