Wednesday 06 October 2010 4:38:01 am - 10 replies

Introduction

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.

» Read full blog post

Author Message

Quoc Huy Nguyen Dinh

Friday 08 October 2010 6:28:26 am

Put the library in its own extension, maybe?

Marko Žmak

Monday 11 October 2010 1: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.

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Quoc Huy Nguyen Dinh

Monday 11 October 2010 8:20:29 am

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

Nicolas Pastorino

Monday 11 October 2010 8:28:30 am

This post rocks, keep up Marko !

--
Nicolas Pastorino
Director Community - eZ
Member of the Community Project Board

eZ Publish Community on twitter: http://twitter.com/ezcommunity

t : http://twitter.com/jeanvoye
G+ : http://plus.tl/jeanvoye

Marko Žmak

Moderated by: Nicolas Pastorino

Monday 11 October 2010 4:32:44 pm

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.

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Nicolas Pastorino

Tuesday 12 October 2010 2: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 !

--
Nicolas Pastorino
Director Community - eZ
Member of the Community Project Board

eZ Publish Community on twitter: http://twitter.com/ezcommunity

t : http://twitter.com/jeanvoye
G+ : http://plus.tl/jeanvoye

Marko Žmak

Tuesday 12 October 2010 5:10:17 am

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?

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Nicolas Pastorino

Wednesday 20 October 2010 5:12:30 am

HI Marko,

This idea is worth reporting there http://issues.ez.no/ezpublish , i'd say.

Cheers !

--
Nicolas Pastorino
Director Community - eZ
Member of the Community Project Board

eZ Publish Community on twitter: http://twitter.com/ezcommunity

t : http://twitter.com/jeanvoye
G+ : http://plus.tl/jeanvoye

Marko Žmak

Saturday 08 January 2011 2:15:45 pm

OK, I've reported it on the tracker:

http://issues.ez.no/IssueView.php?Id=17826

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Nicolas Pastorino

Monday 10 January 2011 6:30:23 am

"

OK, I've reported it on the tracker:

http://issues.ez.no/IssueView.php?Id=17826

"

Excellent, thanks Marko !

--
Nicolas Pastorino
Director Community - eZ
Member of the Community Project Board

eZ Publish Community on twitter: http://twitter.com/ezcommunity

t : http://twitter.com/jeanvoye
G+ : http://plus.tl/jeanvoye

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

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 00:06:58
Script start
Timing: Jan 18 2025 00:06:58
Module start 'layout'
Timing: Jan 18 2025 00:06:58
Module start 'content'
Timing: Jan 18 2025 00:06:59
Module end 'content'
Timing: Jan 18 2025 00:06:59
Script end

Main resources:

Total runtime0.2006 sec
Peak memory usage4,096.0000 KB
Database Queries93

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0074 588.0469152.6406
Module start 'layout' 0.00740.0028 740.687539.4844
Module start 'content' 0.01020.1892 780.1719801.3750
Module end 'content' 0.19950.0011 1,581.546930.3984
Script end 0.2006  1,611.9453 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00321.6145160.0002
Check MTime0.00140.6797160.0001
Mysql Total
Database connection0.00150.749610.0015
Mysqli_queries0.098248.9277930.0011
Looping result0.00080.4149910.0000
Template Total0.173786.620.0869
Template load0.00211.029720.0010
Template processing0.171785.562620.0858
Template load and register function0.00010.066310.0001
states
state_id_array0.00120.581720.0006
state_identifier_array0.00100.474430.0003
Override
Cache load0.00190.9578530.0000
Sytem overhead
Fetch class attribute name0.00140.6832140.0001
Fetch class attribute can translate value0.00050.270730.0002
class_abstraction
Instantiating content class attribute0.00010.0310210.0000
XML
Image XML parsing0.00160.805030.0005
General
dbfile0.00100.5120320.0000
String conversion0.00000.005040.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplforum_topic/full.tplextension/community_design/design/suncana/override/templates/forum_topic/full.tplEdit templateOverride template
11content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
13content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
10content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1content/datatype/view/ezxmltags/quote.tpldatatype/ezxmltext/quote.tplextension/ezwebin/design/ezwebin/override/templates/datatype/ezxmltext/quote.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 38
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs