[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
MichaelC
Development Team
Development Team
Posts: 889
Joined: Thu Jan 28, 2010 6:29 pm

Re: [RFC|Merged] Extensions

Post by MichaelC »

imkingdavid wrote:Ultimately, the Customisations Database should keep track of what folder name is used by each extension and disallow the submission of another extension that wants to use the same one.

Perhaps a new little tool to check to see if a name is available? (I.e. "Enter a name: ______", "Sorry, that name is taken, please try another one." or "YAY! That name is currently available. Hurry up and take it before someone else does!")

Of course that would have to be built after the CDB starts recognizing extension names.
I'm guessing it would be required for the contribution permalink (clean name) on the DB, the class name, the directory and clean name in the manifest would need to be the same with the Human Name in the manifest and the Contribution being the same. It would probably be added to the MPV (Which by the looks of it would need to have a lot of what it looks for re-written).

The permalink has to be unique anyway, but we need to think of multiple repos/CDBs.

EDIT: Just a thought, maybe not MPV as that couldn't check it was the same as the permalink in titania as it works independently. It would most likely be a third check added to the submission process.

The submission process needs revamping anyway with the differences between extensions and MODs and I am guessing they would be under the same contribution type so it would need to detect which it is (or ask) when the contrib type is MOD, then it would run either the extensions admin or automatic mod installer and then either an extensions MPV or a normal MOD MPV.

EDIT: David already covered some of this while I was typing but oh well.
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
Arty
Former Team Member
Posts: 985
Joined: Wed Mar 06, 2002 2:36 pm
Location: Mars
Contact:

Re: [RFC|Merged] Extensions

Post by Arty »

Questions: is this working and has someone created a simple working extension to test it with? Preferably one that uses templates.

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

Re: [RFC|Merged] Extensions

Post by igorw »

We have this one: https://github.com/naderman/phpbb3-example-ext also check the pull request which adds a lot of stuff.

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

Re: [RFC|Merged] Extensions

Post by MichaelC »

It works, igorw said an example.

Still being done:
- Merging Front-Facing Extension
- Finishing and merging extensions admin (but until then use the develop script or just run a query to install it)
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
Arty
Former Team Member
Posts: 985
Joined: Wed Mar 06, 2002 2:36 pm
Location: Mars
Contact:

Re: [RFC|Merged] Extensions

Post by Arty »

I'm not sure if this is a bug or intended behavior.

I have extension, located in for example ext/example
That extension has custom templates in styles/prosilver/template/

When searching for template for index_body.html, locator searches for:
1: ./ext/example/styles/prosilver/template/index_body.html
2: ./styles/prosilver/template/index_body.html
which is correct.

If I make a directory inside "template" directory of extension, like ext/example/styles/prosilver/template/test1/, locator adds one more path to that list:
1: ./ext/example/styles/prosilver/template/index_body.html
2: ./ext/example/styles/prosilver/template/test1/index_body.html
3: ./styles/prosilver/template/index_body.html
which I think is not correct. If there are more directories inside template directory of extension, it will add them all to list.

I've traced this behavior to phpbb_extension_finder class, but I have no idea how it works, so I don't know if this is a error or not.

User avatar
imkingdavid
Registered User
Posts: 1050
Joined: Thu Jul 30, 2009 12:06 pm

Re: [RFC|Merged] Extensions

Post by imkingdavid »

Arty wrote:I'm not sure if this is a bug or intended behavior.

I have extension, located in for example ext/example
That extension has custom templates in styles/prosilver/template/

When searching for template for index_body.html, locator searches for:
1: ./ext/example/styles/prosilver/template/index_body.html
2: ./styles/prosilver/template/index_body.html
which is correct.

If I make a directory inside "template" directory of extension, like ext/example/styles/prosilver/template/test1/, locator adds one more path to that list:
1: ./ext/example/styles/prosilver/template/index_body.html
2: ./ext/example/styles/prosilver/template/test1/index_body.html
3: ./styles/prosilver/template/index_body.html
which I think is not correct. If there are more directories inside template directory of extension, it will add them all to list.

I've traced this behavior to phpbb_extension_finder class, but I have no idea how it works, so I don't know if this is a error or not.
Are you referring to when you use <!-- INCLUDE index_body.html --> or when you use $template->set_filenames(array('body' => 'index_body.html')); ? Either way, i think it should only look in a subfolder if a subfolder is provided (i.e. INCLUDE test1/index_body.html).
I do custom MODs. PM for a quote!
View My: MODs | Portfolio
Please do NOT contact for support via PM or email.
Remember, the enemy's gate is down.

User avatar
Arty
Former Team Member
Posts: 985
Joined: Wed Mar 06, 2002 2:36 pm
Location: Mars
Contact:

Re: [RFC|Merged] Extensions

Post by Arty »

Both. It doesn't matter what template code is used, it affects all templates regardless of way they were included.

For some reason finder class adds incorrect paths to locator. Check function set_paths() in includes/template/locator.php.
Install any extension that has template, add dummy directory (it can be empty) inside template directory. Print $this->roots at the end of function, result will look like this:

Code: Select all

Array
(
    [0] => ./ext/example/styles/prosilver/template
    [1] => ./ext/example/styles/prosilver/template/test1
    [2] => ./ext/example/styles/prosilver/template/test2
    [3] => ./styles/prosilver/template
)
Items #1 and #2 should not be there.

As far as I can tell, those items are added inside that function. $template_paths is instance of phpbb_template_extension_path_provider class, function find() is used to retrieve those paths and something is wrong with it.

User avatar
imkingdavid
Registered User
Posts: 1050
Joined: Thu Jul 30, 2009 12:06 pm

Re: [RFC|Merged] Extensions

Post by imkingdavid »

Can you create a ticket for that? I don't have time tonight, but I (or someone) will look into it later. I agree that only the main extension style template directory (and the main phpBB style template directory) should be looked in, unless a subdirectory is explicitly prefixed to the filename. But I'll need to wait for input from Oleg or Igor or someone else who is more knowledgeable about the extension system to know what was intended.
I do custom MODs. PM for a quote!
View My: MODs | Portfolio
Please do NOT contact for support via PM or email.
Remember, the enemy's gate is down.

User avatar
Arty
Former Team Member
Posts: 985
Joined: Wed Mar 06, 2002 2:36 pm
Location: Mars
Contact:

Re: [RFC|Merged] Extensions

Post by Arty »


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

Re: [RFC|Merged] Extensions

Post by Oleg »

Sounds like a bug but Nils is the authority on that code.

Post Reply