[RFC] composer phpBB versions and installation

Note: We are moving the topics of this forum and it will be deleted at some point

Publish your own request for comments/change or patches for the next version of phpBB. Discuss the contributions and proposals of others. Upcoming releases are 3.2/Rhea and 3.3.
User avatar
RMcGirr83
Registered User
Posts: 360
Joined: Fri Mar 09, 2007 1:51 am
Contact:

[RFC] composer phpBB versions and installation

Post by RMcGirr83 »

I have run into an issue recently where a user of a 3.1.1 phpBB version installed an extension that needed at least phpBB version 3.1.3 due to additional template events.

As this information is set into composer file for the extension, eg

Code: Select all

	"extra": {
"display-name": "xxxxxxxxxxxx",
"soft-require": {
"phpbb/phpbb": ">=3.1.4,<3.2.*@dev"
could we not disable the enable button in the ACP if the phpBB version in use doesn't meet the requirements of the soft-require?

Or should it be left up to the extension author using some code in the migration file (hints are welcome :) ) that effectively stops the enabling of the extension?

Is there a "hard-require" parameter?
Do not hire Christian Bullock he won't finish the job and will keep your money

User avatar
kasimi
Extension Customisations
Extension Customisations
Posts: 17
Joined: Thu May 24, 2012 1:54 pm

Re: [RFC] composer phpBB versions and installation

Post by kasimi »

Add this to your migration. Enabling the extension on any earlier version will fail.

Code: Select all

static public function depends_on()
{
    return array('\phpbb\db\migration\data\v31x\v313');
} 
I'd also be interested in a solution for extensions that don't have migrations.

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

Re: [RFC] composer phpBB versions and installation

Post by DavidIQ »

I agree the option to enable an extension should not be given if the requirements aren't met. Right now however it's all just informational so it's a little misleading to the extension author since the format of the composer.json file makes it seem like those requirements are going to actually mean something come time to enable an extension. I was kind of hoping that "is_enableable" would do exactly that but it's not being set at all.
Image

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

Re: [RFC] composer phpBB versions and installation

Post by RMcGirr83 »

kasimi wrote:Add this to your migration. Enabling the extension on any earlier version will fail.

Code: Select all

static public function depends_on()
{
    return array('\phpbb\db\migration\data\v31x\v313');
} 
I'd also be interested in a solution for extensions that don't have migrations.
Thanks!

Wonder what happens when that is invoked eg return array('\phpbb\db\migration\data\v31x\v314rc1');. Hope it doesn't give the "something went wrong during install" message...that would just lead to support topics for the extension.
DavidIQ wrote:I was kind of hoping that "is_enableable" would do exactly that but it's not being set at all.
+1

EDIT: This is what happens
Noname.jpg
Do not hire Christian Bullock he won't finish the job and will keep your money

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

Re: [RFC] composer phpBB versions and installation

Post by DavidIQ »

I think I'd rather go for something cleaner like actually setting is_enableable based in the requirements, although I guess that's something that can be set from within the extension? Not really sure. Can you create a ticket for it?
Image

User avatar
MattF
Extension Customisations
Extension Customisations
Posts: 675
Joined: Mon Mar 08, 2010 9:18 am

Re: [RFC] composer phpBB versions and installation

Post by MattF »

RMcGirr83 wrote:I have run into an issue recently where a user of a 3.1.1 phpBB version installed an extension that needed at least phpBB version 3.1.3 due to additional template events.
DavidIQ wrote:I think I'd rather go for something cleaner like actually setting is_enableable based in the requirements, although I guess that's something that can be set from within the extension? Not really sure. Can you create a ticket for it?
No need for any ticket. This is something that is already done in the ext.php file using is_enableable()

https://github.com/phpbb-extensions/boa ... er/ext.php

The resulting error message for users is: 'The selected extension cannot be enabled, please verify the extension’s requirements.'
Has an irascible disposition.

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

Re: [RFC] composer phpBB versions and installation

Post by RMcGirr83 »

Thanks Matt!
Do not hire Christian Bullock he won't finish the job and will keep your money

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

Re: [RFC] composer phpBB versions and installation

Post by DavidIQ »

VSE wrote:No need for any ticket. This is something that is already done in the ext.php file using is_enableable()

https://github.com/phpbb-extensions/boa ... er/ext.php

The resulting error message for users is: 'The selected extension cannot be enabled, please verify the extension’s requirements.'
Yes I know this but what is the point of having this information in composer.json then? Requirements are being stated there yet one has to jump through hoops to make them mean anything. Sounds like an oversight.
Image

User avatar
nickvergessen
Former Team Member
Posts: 733
Joined: Sun Oct 07, 2007 11:54 am
Location: Stuttgart, Germany
Contact:

Re: [RFC] composer phpBB versions and installation

Post by nickvergessen »

RMcGirr83 wrote:could we not disable the enable button in the ACP if the phpBB version in use doesn't meet the requirements of the soft-require?
That's the plan, we just didn't manage to finish that in time for 3.1
Member of the Development-TeamNo Support via PM

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

Re: [RFC] composer phpBB versions and installation

Post by RMcGirr83 »

nickvergessen wrote:That's the plan, we just didn't manage to finish that in time for 3.1
Ticket or no Joas? I'll open one if one doesn't exist.
Do not hire Christian Bullock he won't finish the job and will keep your money

Post Reply