content edit handler has to have the same name as extension

Author Message

Marko Žmak

Wednesday 29 June 2011 3:45:27 pm

By looking at the code that loads content edit handlers from extensions I see this line:

$fileName = eZExtension::baseDirectory() . '/' . $extensionDirectory . '/content/' . $extensionDirectory . 'handler.php';

This means that the name of the file containing content edit hanlder has to be in this form:

<extension_name>handler.php

And by looking furthermore, I see that the name of the handler class has to be in form:

<extension_name>Handler

Why is this restriction in efect? Is there a good reason fo it? Shouldn't things like this be configurable?

Because this means that you can have only one content edit handler per extension.

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

André R.

Thursday 30 June 2011 12:46:56 am

To be able to get rid of this it will need to switch the handler setting to one that is a list of class names instead of extension names, hence use autoloader instead of the 3.x way of loading handlers.

Basically similar to how we changed lots of handlers in 4.1 to use autoload, feel free to create a pull request for it but remember: Do not re use same setting name, extensions should be able to support old and new eZ Publish versions. And remember to add bc note about it.

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

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 18 2025 02:47:33
Script start
Timing: Jan 18 2025 02:47:33
Module start 'layout'
Timing: Jan 18 2025 02:47:33
Module start 'content'
Timing: Jan 18 2025 02:47:34
Module end 'content'
Timing: Jan 18 2025 02:47:34
Script end

Main resources:

Total runtime0.6169 sec
Peak memory usage4,096.0000 KB
Database Queries54

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0053 588.1719152.6563
Module start 'layout' 0.00530.0034 740.828139.5156
Module start 'content' 0.00870.6068 780.3438540.6250
Module end 'content' 0.61550.0013 1,320.968812.0938
Script end 0.6168  1,333.0625 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.5556160.0002
Check MTime0.00140.2223160.0001
Mysql Total
Database connection0.00060.100710.0006
Mysqli_queries0.566891.8883540.0105
Looping result0.00070.1081520.0000
Template Total0.586895.120.2934
Template load0.00290.466420.0014
Template processing0.583994.647720.2919
Template load and register function0.00010.019310.0001
states
state_id_array0.00090.144110.0009
state_identifier_array0.00070.111520.0003
Override
Cache load0.00230.3701180.0001
Sytem overhead
Fetch class attribute can translate value0.00070.110520.0003
Fetch class attribute name0.00120.194740.0003
XML
Image XML parsing0.00100.170120.0005
class_abstraction
Instantiating content class attribute0.00000.001340.0000
General
dbfile0.00110.1742250.0000
String conversion0.00000.001740.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
4content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
2content/datatype/view/ezxmltags/strong.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/strong.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 13
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs