There's a completely non-invasive method of making eZ Components available for eZ Publish installation, which would be especially useful in shared hosting environment, where custom server changes are not allowed or possible. Simply place your eZ Components bundle wherever that eZ Publish'es PHP can reach. Then create a config.php file on the eZ installation's root, and set additional include paths for PHP:
<?php
$ezcSharedHostingPath = './ezc/';
ini_set( 'include_path', ini_get( 'include_path' ). ':'.$ezcSharedHostingPath );
?>
Just adjust the path matching your environment, and that's it. eZ 4 already knows that it should look for it.
Comments
problem with windows include path?
and thanks for this useful and convenient tip :-) ... but I could not make it :-(
I created at the root of my eZ publish 4.0 installation a "config.php" file containing :
<?php
$ezcSharedHostingPath = 'H:\sites_web\ezcomponents';
ini_set( 'include_path', ini_get( 'include_path' ). ':'.$ezcSharedHostingPath );
?>
Here, H:\sites_web\ezcomponents is the Windows path for my ez components folders ("archive" , "authentification",...)
Then, I run the "ezautoloadgenerator.php" (from the admin interface, after emptying all caches) but I still receive the "fatal error: Class 'ezcFile' not found ..."
Indeed, when I check in mysite/autoload/ezp_kernel.php , the ez components classes are not present.
I dont think it is a matter of "autoload environment" because the "autoload.php" file use "Base/src/base.php" if "ezc/Base/base.php" does not exist. On the top of that, I commented the condition to let only "$baseEnabled = @include( 'Base/src/base.php' );" and it did not work better.
My feeling is that the problemn comes from my Windows environment which uses "\" instead of "/" to build the include path ; but maybe it something else...
Any solution or idea???
Thanks a lot in advance
MikRob :-)
What about relative path?
And I have no certainty about it, but I used to move my scripts around different environments and can't remember any slash-related problems.
[eZ components intallation ] even with a relative path...
and thanks for your support/patience.
I followed your advice and used a relative path but I still can't have ez Components installed.
Concretely :
1- I unzipped the archive and copied it in a folder called "ezc". This folder is located at the root of my site (between "extension" and "kernel" folders) and contains all the ez components sub-folders ("archive" , "authentification",...)
2 - then, I created at the root of my site a file called "config.php", with this code :
<?php
ini_set( 'include_path', ini_get( 'include_path' ). ':../ezc/' );
?>
In eZ publish 4.0, as covered on forums at ez.no, the file "autoload.php" requires config.php to set the include_path ; and then it includes "Base/src/base.php" file. So there shouldn't be anything more to configure to have ez Components ready for eZ publish.
But when I run "ezautoloadgenerator.php" (from the admin interface, after emptying all caches) , I still receive the "fatal error: Class 'ezcFile' not found ...on oline 283"
=> What did I miss? Is there anything more to do before ez Components classes are found and used by eZ publish?
Please help :-)
MikRob
local installation of ez components - solved
=> as I was working on a local server, I had to add the include_path for the ezc folder directly in the php.ini file of my Easyphp installation. (and there, the windows path separator is different fomr the linux one...)
And indeed, there is nothing more to do than adding an include path to have ez publish using ez components
Now I can use extensions :-)
Thanks again
Glad I could help...