Third party libraries

Discussion forum for Extension Writers regarding Extension Development.
Post Reply
User avatar
martti
Registered User
Posts: 860
Joined: Thu Jul 31, 2014 8:23 am
Location: Belgium

Third party libraries

Post by martti »

How to include third party libraries? ( Imagine for example).
With composer, all third parties are centralised in /vendor and classes would be autoloaded but extensions have no control over that.
Creating a dedicated extension for each library with services? Where to put the files? Composer can't be used?
User avatar
MattF
Extensions Development Coordinator
Extensions Development Coordinator
Posts: 5247
Joined: Sat Jan 17, 2009 9:37 am
Location: Los Angeles, CA
Name: Matt Friedman
Contact:

Re: Third party libraries

Post by MattF »

Sure you can. All extensions use composer.

viewtopic.php?f=461&t=2256031&p=13695791
Formerly known as VSEMy ExtensionsPlease do not PM me for support.
User avatar
martti
Registered User
Posts: 860
Joined: Thu Jul 31, 2014 8:23 am
Location: Belgium

Re: Third party libraries

Post by martti »

Thanks, I overlooked that topic.
User avatar
martti
Registered User
Posts: 860
Joined: Thu Jul 31, 2014 8:23 am
Location: Belgium

Re: Third party libraries

Post by martti »

Would it then be a good idea to create an extension for each library? Kind of like Symfony2 Bundles.
That would be 'Library extentions'. Extensions that create no direct functionality for the board but only for other extensions.
User avatar
martti
Registered User
Posts: 860
Joined: Thu Jul 31, 2014 8:23 am
Location: Belgium

Re: Third party libraries

Post by martti »

Hmm, I see the downside is that admins have to activate these 'Library extensions' and the extension list would grow big in the acp.
User avatar
D@ve
Registered User
Posts: 143
Joined: Sat Aug 28, 2004 12:49 am
Location: Germany, Bretzfeld D.C.
Name: Dave Remmel
Contact:

Re: Third party libraries

Post by D@ve »

I decided to create a "common" extension for classes an files I use in more than one extension.

Or is there a way to move files to the third party folder?
2jesus.de - (german community for bible & faith)
phpBB.de - the German support community for pbpBB
User avatar
Wolfsblvt
Registered User
Posts: 634
Joined: Sun Oct 26, 2014 9:12 pm
Location: Solingen, Germany
Contact:

Re: Third party libraries

Post by Wolfsblvt »

I had the same issue and question and talked to some of the phpBB developers several times.
There is no way something like a "library extension" will be validated, so accepted to the extension database. Cause what should they test? There is nothing the extension really does other then providing functions and libraries.

The way you should go is: You should include all dependencies you need with composer, so auto-loading them. If they can't be autoloaded, include them manually in the \vendor folder.

Also for your own libraries and re-used functions. Create a library package with composer.json, so make it autoload-able and include it this way. You can include your library in every extension of yours and you can keep it up to date through composer.
If you have a specific extension request and you are willing to pay for, you can write me a PM.
My extensions (Trending: @Mention SystemAdvanced PollsUser Online Time)

»Du kamst zu uns. Deine Stimme kam. Du zeigtest uns die Sterne. Sie funkelten. Wir konnten sehen.«
User avatar
D@ve
Registered User
Posts: 143
Joined: Sat Aug 28, 2004 12:49 am
Location: Germany, Bretzfeld D.C.
Name: Dave Remmel
Contact:

Re: Third party libraries

Post by D@ve »

There is no way something like a "library extension" will be validated, so
As long as the extension that will use the "librariy extensions" will be validated I don't care.

I'm using stuff like an ajax framework, or WYSIWYG libraries. These are not even small so if I use them in more than one extension I see no reason to include them in any extension...

regards, Dave
2jesus.de - (german community for bible & faith)
phpBB.de - the German support community for pbpBB
User avatar
Wolfsblvt
Registered User
Posts: 634
Joined: Sun Oct 26, 2014 9:12 pm
Location: Solingen, Germany
Contact:

Re: Third party libraries

Post by Wolfsblvt »

D@ve wrote:As long as the extension that will use the "librariy extensions" will be validated I don't care.

I'm using stuff like an ajax framework, or WYSIWYG libraries. These are not even small so if I use them in more than one extension I see no reason to include them in any extension...
Every extension should work on its own. (Except it is an addon to an existing extension)
That is the rule.
I am no validator, but I think I have heard that an extension has to contain everything it needs to work on its own.

Is there any problem with including your libraries with composer in every extension?
If you have a specific extension request and you are willing to pay for, you can write me a PM.
My extensions (Trending: @Mention SystemAdvanced PollsUser Online Time)

»Du kamst zu uns. Deine Stimme kam. Du zeigtest uns die Sterne. Sie funkelten. Wir konnten sehen.«
User avatar
D@ve
Registered User
Posts: 143
Joined: Sat Aug 28, 2004 12:49 am
Location: Germany, Bretzfeld D.C.
Name: Dave Remmel
Contact:

Re: Third party libraries

Post by D@ve »

As I said... Some Libraries are quit huge and it's more complicated to maintain differnt extensions.

e.g. I have a CMS mod at the moment. With Chat, Statistics, seo URLs etc. I haven't published it yet, just use it in my own project. I was going to convert all of it in single extensions and publish it here... But much code is based on some basic classes and (external) libraries.

In the end I would have 10 extensions that each brings an overhead of 8 MB of stuff with it that is actually needed just once.

So I definitley WILL have a basic extension. Thats easier to maintain for me. If it won't be accepted here... so be it... I primariily need it for myself. Would be ashame

regards, Dave
2jesus.de - (german community for bible & faith)
phpBB.de - the German support community for pbpBB
Post Reply

Return to “Extension Writers Discussion”