This site has been archived. To learn more about our current products Ibexa Content, Ibexa Experience, Ibexa Commerce head over to the Ibexa Developer Portal

eZ Community » Forums » Discussions » loading external libraries in extensions

Wednesday 06 October 2010 1:38:01 pm - 10 replies

» Read full blog post


Often you need to include external 3rd party libraries or your own libraries in the extensions (like for example a SOAP library). The problem comes when you have to include the same library in several extensions.

Here is how to do it without having to copy the same library in every extension directory.

Friday 08 October 2010 3:28:26 pm

Put the library in its own extension, maybe?

Modified on Friday 08 October 2010 3:37:20 pm by Quoc-Huy NGUYEN DINH

Monday 11 October 2010 10:32:25 am

Yes Quoc, that's exactly what's described here.

Note that you can also load external libraries that are not inside your eZ installation, but that's a little bit more advanced usage.

Monday 11 October 2010 5:20:29 pm

Hi Marko

Bad on me, I misread the post, I thought you were asking how to do it.

I didn't realize this is a tutorial, very interesting, I'm reading it now

Monday 11 October 2010 5:28:30 pm

This post rocks, keep up Marko !

Tuesday 12 October 2010 1:32:44 am

Thanks for the feedback.

A good enhanchement for eZ would be the possibility to load external libraries that are not inside the extension directory (and even outside the eZP installation), but without the need for such advanced usage as described in this blog post.

For example, to have a possibility to specify a parameter like this:

php bin/php/ezpgenerateautoloads.php --external-dir=/path/to/your/external/library

would be really nice.

This would be very usefull when you have several eZ installations on the same server that all have extensions that use the same external libraries.

Modified on Tuesday 12 October 2010 11:07:01 am by Nicolas Pastorino

Tuesday 12 October 2010 11:09:20 am

Hi Marko,

Have you taken a look at the end of the <ezp-root>/config.php-RECOMMENDED file ? The external loading mechanism described is maybe what you are looking for.

Cheers !

Tuesday 12 October 2010 2:10:17 pm

Yes Nicolas, the part of the config.php you described is basically the same thing I described here in the "For advanced users" paragraph.

What I'm proposing is to add a parameter to the ezpgenerateautoloads.php script that will allow to autoload external libraries in an easy way without having to create your own autoload function and register it with spl_autoload_register().

If there's already autoload functionality in ezpgenerateautoloads.php for extensions, why not reuse it and add the ability to autoload any external library?

Wednesday 20 October 2010 2:12:30 pm

HI Marko,

This idea is worth reporting there , i'd say.

Cheers !

Saturday 08 January 2011 11:15:45 pm

OK, I've reported it on the tracker:

Monday 10 January 2011 3:30:23 pm

OK, I've reported it on the tracker:

Excellent, thanks Marko !


You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from