Forums / Extensions / Duplicate php classes in extensions

Duplicate php classes in extensions

Author Message

Kostadinka Ignatieva

Thursday 25 June 2009 6:32:48 am

Hi,

I have the following problem in a project. In two of the used extensions (ezcore and ezmultiupload) there is a definition of the same php class (eZAjaxContent). After I run autoloads script, I get the following warning:

Warning:
Class eZAjaxContent in file extension/ezmultiupload/classes/ezajaxcontent.php is already defined in:
extension/ezcore/classes/ezajaxcontent.php (var/autoload/ezp_extension.php)
This class was not added to the autoload array.

The two php files, however, are the same (just some slight differences in comments), so this is not a problem for the extensions, at least for now, but I would really want to know what is best to be done in such cases.

Thanks!
Regards

Iguana IT - http://www.iguanait.com

Ɓukasz Serwatka

Thursday 25 June 2009 6:37:10 am

Hi,

This is one of the cases where we should use a prefixes for a content class names...
I would check if the classes are exactly the same, if so then remove one and update the autoload array.

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Kostadinka Ignatieva

Thursday 25 June 2009 6:53:55 am

Thanks for the quick reply!
I will follow your advice.

Iguana IT - http://www.iguanait.com