[RFC] Extensions Meta-Data File

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

[RFC] Extensions Meta-Data File

Post by MichaelC »

Why JSON?
A number of reasons:
  • It allows us to use composer (more on this later)
  • JSON is faster than XML
  • Simplistic and Lighweight
  • Easily readable/writeable by human and machine
  • JSON Encode & Decode have been in PHP since 5.2 and JSON Last Error has been in PHP since 5.3
  • Doesn't require much learning/adaptation
  • It is part of JavaScript which gives it more extensibility
You can see a good (if slightly biased) comparison of features on JSON's site here)

Whats composer?
Composer, in a nutshell is a PHP package manager. It was designed by Nils Adermann (naderman) and Jordi Boggiano (seldaek).

Why is composer being used for PHP?
Because its a popular commonly used system used by a high volume of developers and it suits phpBB's needs. At this time it will just use the extension.json file based on composer.json but the plan is eventually to fully integrate composer into phpBB.

Tools
Because it can no longer perform actions tools such as the Generator, Editor etc. will most likely be abandonded when MODX is.
However some new tools will be added:
  • JSON Generator - This will allow you to, on a UI enter the information and it will then generate the file for you
  • JSON Validator - This will check for syntax errors etc. with your JSON file. This will most likely be added to titania. This will be built on JSON Lint
  • JSON Schema Validator - This will check the file against the schema to ensure that only the correct items are used, that they match and all required elements have been completed. Again this will be added to titania. It will use something similar to the code here
Disadvantages
  • No multi-language support - XML supports multiple fields for descriptions etc. in different languages. The new JSON file does not.
  • No nice browser UI - While it can be opened in all modern browsers (IE8, FF 3.5, Opera 10, Chrome, Safari 4), it does not have a nice UI quite like XML does. However, the file is designed to be ready by validators (code reviewers), authors and phpBB. phpBB then shows all the information on the details page when it is uploaded.
A schema adapted from the composer-scheme.json file is currently in progress.

You can see the (currently slightly out-of-date) specification here:
Extensions Meta-Data File Specification.pdf
Extensions Meta-Data File Specification.docx
Schema
An HTML version of the specification is coming soon.

The example is in the post below
Last edited by MichaelC on Wed Feb 29, 2012 9:07 pm, edited 17 times in total.
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
brunoais
Registered User
Posts: 964
Joined: Fri Dec 18, 2009 3:55 pm

Re: [RFC] Extension Admin

Post by brunoais »

Unknown Bliss wrote:Manifest Specification - First Draft.
...
Thoughts? Especially from the MOD Team.
Don't MOD ppl need to specify the minimum PHP version for their MOD to work? Say... Need php 5.3 caused by a function needed that exists only in php5.3?
"php-version": "5.3.*",

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

[RFC] Extensions package description format

Post by MichaelC »

brunoais wrote:
Unknown Bliss wrote:Manifest Specification - First Draft.
...
Thoughts? Especially from the MOD Team.
Don't MOD ppl need to specify the minimum PHP version for their MOD to work? Say... Need php 5.3 caused by a function needed that exists only in php5.3?
"php-version": "5.3.*",
Thats author notes, an author can put anything they want in there for server requirements etc. Author Notes already exist and that's just one use of them.
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
brunoais
Registered User
Posts: 964
Joined: Fri Dec 18, 2009 3:55 pm

Re: [RFC] Extension Admin

Post by brunoais »

The main purpose is not to let the forum install the MOD unless it follows that requirement.
If it's in the notes, the forum has no control in deciding to mark as incompatible unless it sniffs the comments themselves.

User avatar
callumacrae
Former Team Member
Posts: 1046
Joined: Tue Apr 27, 2010 9:37 am
Location: England
Contact:

Re: [RFC] Extension Admin

Post by callumacrae »

brunoais wrote:The main purpose is not to let the forum install the MOD unless it follows that requirement.
If it's in the notes, the forum has no control in deciding to mark as incompatible unless it sniffs the comments themselves.
+1

But >= {version} should be used, IMO. It should also be possible to ignore it ("Mod requires version bla, you only have version bla, are you sure you wish to install?")
Made by developers, for developers!
My blog

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

Re: [RFC] Extensions package description format

Post by MichaelC »

I've spoken to igorw and it will now be re-based off the composer JSON manifest, which will support what you just described better. ;)
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
brunoais
Registered User
Posts: 964
Joined: Fri Dec 18, 2009 3:55 pm

Re: [RFC] Extensions package description format

Post by brunoais »

^ good :)

User avatar
callumacrae
Former Team Member
Posts: 1046
Joined: Tue Apr 27, 2010 9:37 am
Location: England
Contact:

Re: [RFC] Extensions package description format

Post by callumacrae »

Looks very similar to Nodes package.json syntax, I can see myself getting confused 0_o
Made by developers, for developers!
My blog

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

Re: [RFC] Extensions package description format

Post by MichaelC »

callumacrae wrote:Looks very similar to Nodes package.json syntax, I can see myself getting confused 0_o
It will be changing slightly to be rebased off composer.json, should be finished shortly.
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] Extensions package description format

Post by MichaelC »

New specification, done properly, is now in the main post. If anyone wants an editable copy, PM me.

I've also moved the example here:
There are three examples here that are being kept up-to-date
Last edited by MichaelC on Tue Feb 28, 2012 7:32 am, edited 1 time in total.
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