This site has been archived and you can no longer log in or post new messages. For up-to-date community resources please visit ezplatform.com

eZ Community » Forums » eZ Publish 5 Platform » Autoload issues with module...
expandshrink

Autoload issues with module developped for ezp4

Autoload issues with module developped for ezp4

Monday 10 December 2012 3:34:50 pm - 7 replies

Hi,

I'm migrating a website written in eZ Publish 4.3 which have a custom module, using some eZ Components classes for indexing XML contents.

When directly accessing a module within the eZ Publish Legacy by pointing my document root to it, no problem, classes are loaded properly with autoloads.

But when I try to access the very same module/view, some of the classes can't be loaded :/

PHP Fatal error:  Class 'ezcSearchSolrHandler' not found in /path/to/documentroot/ezpublish_legacy/extension/extname/modules/module/view.php on line 51

Where should I start to search for an answer ?

Thanks in advance,
Arnaud

Monday 10 December 2012 3:54:35 pm

Hi Arnaud

This is because eZ Publish 5 does not come with zetacomponents/search. You'll need to install your dependency with Composer.

Except for eZ Publish legacy, now all libs/bundles are being installed this way, just like for a regular Symfony application happy.gif Emoticon.

Monday 10 December 2012 4:46:36 pm

That was it Jérome, thanks.

I thought that all the Zeta Components were enabled in eZ Publish 5, but it's not the case. Maybe you could remove the ones which are not needed from ezpublish_legacy/lib/ezc so that nobody get lost and it's clear for everyone that we need to specify it in the composer.json

Modified on Monday 10 December 2012 4:47:17 pm by Arnaud Lafon

Tuesday 11 December 2012 12:04:39 pm

@arnaud I think there are 2 clear, separate needs here:

- new installs: ship no ZC at all, will install the needed ones via composer

- upgrade installs: expect all of the ZC to be there. eZ will only use some, but custom extension might expect more to be available

And for the unclear need: a new install which uses LS / an LS-application which depends on some ZC...

This is hard to manage in a perfect way. First of all we should make sure no-one ends up with 2 different versions of the same component onboard. Then we should make sure that no-one spends days tearing his hair off because of something he expected to be there has magically disappeared. Last, we should of course remove legacy cruft.

Btw: the 5.0 EE package still contains the full set of ZC in ezpublish_legacy/lib/ezc, as well as a partial copy in vendor/zetacomponents. Take care!

Wednesday 12 December 2012 1:41:48 pm

What do you think of removing it from ezpublish_legacy/lib/ezc and creating a symlink to vendor/src/... with something like 'php ezpublish/console ezpublish:legacy:ezc_intall' ?

Wednesday 12 December 2012 2:49:26 pm

> What do you think of removing it from ezpublish_legacy/lib/ezc and creating a symlink to vendor/src/..

That is one option, the existing alternative discussed is to fix legacy autoload.php so it is cable of detecting it is in ezpublish5 context and load ../ezpublish/autoload.php if Composer autoloader is not already loaded. This should be done before "if ( !defined( 'EZCBASE_ENABLED' ) )".

 

Similar thing needs to happen to autoloading in ezp-next so we don't have to bundle vendors twice because build tests depends on boostrap.php in ezp-next.

Modified on Wednesday 12 December 2012 3:15:52 pm by André R

Tuesday 12 November 2013 2:15:14 pm

Hi,

what is the best way to use e.g. the Url lib of the zeta components? They are not shipped with ez 5.2 any more.

Best wishes,

Georg.

Tuesday 12 November 2013 3:36:27 pm

Hi

Just add it to the main composer.json happy.gif Emoticon

expandshrink

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

36 542 Users on board!

Forums menu

Proudly Developed with from