phpBB

Development Discussion Board

phpBB's testing ground of bleeding edge code
Advanced search

[RFC] Extensions Meta-Data File

Publish your own request for comments or patches for the next version of phpBB. Discuss the contributions and proposals of others. Upcoming releases are 3.1/Ascraeus and 3.2/Arsia.

[RFC] Extensions Meta-Data File

Postby MichaelC » Wed Feb 15, 2012 12:36 am

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.
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
Website Team
Website Team
 
Posts: 797
Joined: Thu Jan 28, 2010 6:29 pm

Re: [RFC] Extension Admin

Postby brunoais » Wed Feb 15, 2012 7:36 am

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.*",
brunoais
Registered User
 
Posts: 626
Joined: Fri Dec 18, 2009 3:55 pm

[RFC] Extensions package description format

Postby MichaelC » Wed Feb 15, 2012 9:41 am

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.
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
Website Team
Website Team
 
Posts: 797
Joined: Thu Jan 28, 2010 6:29 pm

Re: [RFC] Extension Admin

Postby brunoais » Wed Feb 15, 2012 9:43 am

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.
brunoais
Registered User
 
Posts: 626
Joined: Fri Dec 18, 2009 3:55 pm

Re: [RFC] Extension Admin

Postby callumacrae » Wed Feb 15, 2012 9:52 am

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?")
"In JavaScript, there is a beautiful, elegant, highly expressive language that is buried under a steaming pile of good intentions and blunders"
—Douglas Crockford

View my MOD, phpBB Mobile
User avatar
callumacrae
Website Team
Website Team
 
Posts: 882
Joined: Tue Apr 27, 2010 9:37 am
Location: England

Re: [RFC] Extensions package description format

Postby MichaelC » Wed Feb 15, 2012 9:56 am

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. ;)
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
Website Team
Website Team
 
Posts: 797
Joined: Thu Jan 28, 2010 6:29 pm

Re: [RFC] Extensions package description format

Postby brunoais » Wed Feb 15, 2012 9:57 am

^ good :)
brunoais
Registered User
 
Posts: 626
Joined: Fri Dec 18, 2009 3:55 pm

Re: [RFC] Extensions package description format

Postby callumacrae » Wed Feb 15, 2012 11:29 am

Looks very similar to Nodes package.json syntax, I can see myself getting confused 0_o
"In JavaScript, there is a beautiful, elegant, highly expressive language that is buried under a steaming pile of good intentions and blunders"
—Douglas Crockford

View my MOD, phpBB Mobile
User avatar
callumacrae
Website Team
Website Team
 
Posts: 882
Joined: Tue Apr 27, 2010 9:37 am
Location: England

Re: [RFC] Extensions package description format

Postby MichaelC » Wed Feb 15, 2012 12:09 pm

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.
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
Website Team
Website Team
 
Posts: 797
Joined: Thu Jan 28, 2010 6:29 pm

Re: [RFC] Extensions package description format

Postby MichaelC » Wed Feb 15, 2012 5:49 pm

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.
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
Website Team
Website Team
 
Posts: 797
Joined: Thu Jan 28, 2010 6:29 pm

Next

Return to [3.x] RFCs

Who is online

Users browsing this forum: No registered users and 8 guests