Friday 16 February 2007 5:38:34 am
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
|