eZ Community » Forums » eZ Publish 5 Platform » Installing EZ Publish 5
expandshrink

Installing EZ Publish 5

Installing EZ Publish 5

Wednesday 20 March 2013 12:03:20 pm - 9 replies

I'm trying to embed ez publish into an existing project, however I am getting the following error. How can I get the autoloader to pick up the web/extension or legacy extension for this?

FatalErrorException: Error: Class 'ezxFormToken' not found in /opt/src/web/symfony/vendor/ezsystems/ezpublish-kernel/eZ/Bundle/EzPublishLegacyBundle/LegacyMapper/Configuration.php line 126
in /opt/src/web/symfony/vendor/ezsystems/ezpublish-kernel/eZ/Bundle/EzPublishLegacyBundle/LegacyMapper/Configuration.php line 126

Thanks

Modified on Wednesday 20 March 2013 4:05:51 pm by Andrew Johnstone

Wednesday 20 March 2013 12:08:43 pm

Hi Andrew

eZ Publish legacy autoloader is already loaded by EzPublishLegacyBundle. You probably need to regenerate autoloads from the legacy part :

php bin/php/ezpgenerateautoloads.php -e -p

Note that it's important to run this command from inside the ezpublish_legacy folder.

Wednesday 20 March 2013 12:21:24 pm

Thanks was literally just looking at that... Need to correct the include path tho as that fails...

 a
root@andrew:/opt/src/web/symfony/ezpublish_legacy# php bin/php/ezpgenerateautoloads.php -e -p
PHP Warning:  require(Base/src/base.php): failed to open stream: No such file or directory in /opt/src/web/symfony/ezpublish_legacy/bin/php/ezpgenerateautoloads.php on line 45
Warning: require(Base/src/base.php): failed to open stream: No such file or directory in /opt/src/web/symfony/ezpublish_legacy/bin/php/ezpgenerateautoloads.php on line 45PHP Fatal error:  require(): Failed opening required 'Base/src/base.php' (include_path='.:/usr/share/php:/usr/share/pear') in /opt/src/web/symfony/ezpublish_legacy/bin/php/ezpgenerateautoloads.php on line 45
Fatal error: require(): Failed opening required 'Base/src/base.php' (include_path='.:/usr/share/php:/usr/share/pear') in /opt/src/web/symfony/ezpublish_legacy/bin/php/ezpgenerateautoloads.php on line 45

Modified on Wednesday 20 March 2013 4:06:59 pm by Andrew Johnstone

Wednesday 20 March 2013 12:39:55 pm

Mmm. Which version of eZ Publish (legacy + 5.x) are you using ? It seems that you have a wrong version of eZ Publish legacy here... 

Wednesday 20 March 2013 12:51:16 pm

Quote from Jérôme Vieilledent :

Mmm. Which version of eZ Publish (legacy + 5.x) are you using ? It seems that you have a wrong version of eZ Publish legacy here... 

I've been following the instructions from here https://github.com/ezsystems/ezpublish-community/blob/master/INSTALL.md, which I have installed successfully standalone.

git submodule add https://github.com/ezsystems/ezpublish-legacy.git web/symfony/ezpublish_legacy
cd web/symfony/ezpublish_legacy && git pull master && git checkout master
 

I've copied config.php-RECOMMENDED to config.php and modified to

ini_set( 'include_path', ini_get( 'include_path' ). PATH_SEPARATOR . '../vendor/zetacomponents/base/src/' );
define( 'EZC_BASE_PATH', '../vendor/zetacomponents/base/src/base.php' );

I assume I am correct that base.php is supposed to come from zetacomponents.

Currently I am getting the following error, am I going down the wrong route?

root@andrew:/opt/src/web/symfony/ezpublish_legacy# php bin/php/ezpgenerateautoloads.php -e -pPHP Fatal error:  Couldn't find autoload directory '/opt/src/web/symfony/vendor/zetacomponents/base/src/../../autoload/' in /opt/src/web/symfony/vendor/zetacomponents/base/src/base.php on line 222
Fatal error: Couldn't find autoload directory '/opt/src/web/symfony/vendor/zetacomponents/base/src/../../autoload/' in /opt/src/web/symfony/vendor/zetacomponents/base/src/base.php on line 222

Thanks for your help

Modified on Wednesday 20 March 2013 12:52:31 pm by Andrew Johnstone

Wednesday 20 March 2013 2:32:01 pm

OK You installed legacy as standalone in a git submodule, that's why happy.gif Emoticon. This issue would not happen in a regular distribution. So here what you need to do (assuming you also use git dev-master for ezpublish-kernel) :

  1. Comment EZC_BASE_PATH constant in config.php (legacy). It's not intended to work with zetacomponents distributed via Composer.
  2. In ezpublish-kernel master dev branch, we recently added a command allowing to run legacy scripts from Symfony command line. So to regenerate autoloads, please run :

    php ezpublish/console  ezpublish:legacy:script bin/php/ezpgenerateautoloads.php --extension -p

    If you have a different application directory, replace ezpublish/ by your app directly. 

Hope this helps

Wednesday 20 March 2013 3:20:55 pm

Unfortunately cannot run that due to the dependency on ezxFormToken, despite commenting out EZC_BASE_PATH

root@andrew:/opt/src/web/symfony# php app/console ezpublish:legacy:script bin/php/ezpgenerateautoloads.php --extension -p
Running script 'bin/php/ezpgenerateautoloads.php' in eZ Publish legacy context
PHP Fatal error: Class 'ezxFormToken' not found in /opt/src/web/symfony/vendor/ezsystems/ezpublish-kernel/eZ/Bundle/EzPublishLegacyBundle/LegacyMapper/Configuration.php on line 126
Fatal error: Class 'ezxFormToken' not found in /opt/src/web/symfony/vendor/ezsystems/ezpublish-kernel/eZ/Bundle/EzPublishLegacyBundle/LegacyMapper/Configuration.php on line 126 

Modified on Wednesday 20 March 2013 3:33:52 pm by Andrew Johnstone

Wednesday 20 March 2013 3:35:53 pm

I guess you have this issue because you run from pure git, and autoloads are generated by our build system.

Anyway, to run ezpgenerateautoloads.php from legacy, you'll need the zeta components, which are usually bundled in regular distributions (see download section). You can of course install them via PEAR, like explained in their documentation.

But my suggestion would rather to take ezpublish legacy from a regular distribution (take the latest from community project, should be fine.)

Wednesday 20 March 2013 3:53:12 pm

Thanks for your help, really appreciated, resolved by the following...

Ideally needs some work to avoid this catch 22 situation, maybe worth adding to the documentation if people are importing ez publish5 into an existing symfony application.

root@andrew:/opt/src/web/symfony# pear channel-discover components.ez.no
Adding Channel "components.ez.no" succeeded
Discovery of channel "components.ez.no" succeeded
 
root@andrew:/opt/src/web/symfony# pear install -a ezc/eZComponents
downloading eZComponents-2009.2.1.tgz ...
....
cd /opt/src/web/symfony/ezpublish_legacy
 
root@andrew:/opt/src/web/symfony/ezpublish_legacy# php bin/php/ezpgenerateautoloads.php --extension -pScanning for PHP-files.
........................................................
Scan complete. Found 56 PHP files.
Searching for classes (tokenizing).
56 / 56 [+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>] 100.00%
Found 30 classes, added 30 of them to the autoload array. 

Modified on Wednesday 20 March 2013 3:58:43 pm by Andrew Johnstone

Wednesday 20 March 2013 3:57:37 pm

Glad I could help you Andrew !

And you're right, we should have this kind of doc.

expandshrink

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

36 542 Users on board!

Forums menu

Proudly Developed with from