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

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 30 2025 19:47:44
Script start
Timing: Jan 30 2025 19:47:44
Module start 'layout'
Timing: Jan 30 2025 19:47:44
Module start 'content'
Timing: Jan 30 2025 19:47:44
Module end 'content'
Timing: Jan 30 2025 19:47:44
Script end

Main resources:

Total runtime0.0241 sec
Peak memory usage4,096.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0049 588.1563151.2109
Module start 'layout' 0.00490.0040 739.3672220.6875
Module start 'content' 0.00890.0135 960.0547997.8047
Module end 'content' 0.02240.0016 1,957.859433.9922
Script end 0.0241  1,991.8516 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002610.8037140.0002
Check MTime0.00114.6354140.0001
Mysql Total
Database connection0.00062.664110.0006
Mysqli_queries0.00249.857630.0008
Looping result0.00000.058410.0000
Template Total0.00124.910.0012
Template load0.00093.905010.0009
Template processing0.00020.958910.0002
Override
Cache load0.00062.561110.0006
General
dbfile0.00073.043180.0001
String conversion0.00000.028740.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs