Thursday 15 February 2007 1:59:30 pm - 6 replies
I'd like to change tiny lines of code in some classes of the core of eZ Publish.
But, in order to avoid problems later when upgrading my eZ Publish version, I'd like to do all my changes in an unique extension. So that, when upgrading or re-installing my site, I only have to activate my extension.
Firstly, it seems pretty cool to me and I thought I can do that easily with eZ Publish. But now, I have to do it, I have no idea how to do that.
Any help ?
Thanks.
Fred
Friday 16 February 2007 5:17:32 am
This is a subject of keen interest for those more suited to php code modifications of the eZ publish kernel, lib aka stock eZ publish.
<i>http://ezpedia.org/wiki/en/ez/cre...aining_an_ez_publish_patch</i>
While brief and over simplified here is a starting point for others to share their experiences with this subject with everyone.
//kracker
<i>eminem - the way i am .. (instrumentals)</i>
Modified on Friday 16 February 2007 5:18:20 am by kracker
Friday 16 February 2007 2:38:34 pm
Hi Frederic
PHP uses the include path to find files that are included in other files with include(...) or require(...). If you change the include path, you can make sure that eZ looks first looks in whatever directory you specified, before looking in the default eZ directories.
Example:
Add this to the index.php
$path = 'my_ez_core_replacements'; set_include_path($path . PATH_SEPARATOR . get_include_path());
my_ez_core_replacements is the name of the directory where your patched files are located.
Please note that you can set the include path also in the htaccess or php.ini, which might be better, just check the PHP docu.
Now, when eZ runs a script where include_once('kernel/classes/ezcontentobjecttreenode.php') is called (which is jsut an arbitrary example), PHP will first look for the file my_ez_core_replacements/kernel/classes/ezcontentobjecttreenode.php. If it does not find the file there, it will check the other directories in the include_path.
This will not work like an extension, but you still can keep your changed files in one location and just need to change the include path of your PHP to use the new files.
Claudia
You must be logged in to post messages in this topic!