Question about classes folder of custom extension

Author Message

John Moritz

Friday 03 July 2009 7:12:23 pm

I made a custom extension where i have some .php class files. I placed this files on the classes folder of my extension. On the Module script i have included the class file with:

include_once( 'extension/name/classes/class.php' );

After searchin for some errors i commented this line out. What i am wondering now is the fact, that the class ist still included!

So my question is, when i place a class file on the classes folder, is there any ezPublish functionality which includes this file automaticly? And if yes, which script can use the classes? Is it possible that a second extension can use classes of the first without including the file manually? Is it available on the whole installation?

It´s 4.1.2.
I am a little bit confused.

Heath

Friday 03 July 2009 10:47:49 pm

I think your looking for ...

<i>bin/php/ezpgenerateautoloads.php</i>

<i>bin/php/ezcache.php</i>

I think you can comment out your include_once/etc.

eZ Publish has an autoload system to load php classes.

Regenerate the autoload array for extensions

The autoload system has also some changes, for example the autoload array for extensions is now placed in var/autoload of your eZ Publish installation (along teh class changes in extensions itself).

To regenerate the autoload array, execute the following script from

php bin/php/ezpgenerateautoloads.php --extension

Clearing the caches

Whenever an eZ Publish solution is upgraded, all caches must be cleared in a proper way. This should be done from within a system shell:

Navigate into the eZ Publish 4.1 directory. Run the script using the following shell command:

php bin/php/ezcache.php --clear-all --purge

Cheers,
Heath

Brookins Consulting | http://brookinsconsulting.com/
Certified | http://auth.ez.no/certification/verify/380350
Solutions | http://projects.ez.no/users/community/brookins_consulting
eZpedia community documentation project | http://ezpedia.org

John Moritz

Saturday 04 July 2009 1:44:38 am

Wow, thats awesome!
i Took a look at var/autoload and now it dawns to me.

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 15:19:42
Script start
Timing: Jan 18 2025 15:19:42
Module start 'layout'
Timing: Jan 18 2025 15:19:42
Module start 'content'
Timing: Jan 18 2025 15:19:43
Module end 'content'
Timing: Jan 18 2025 15:19:43
Script end

Main resources:

Total runtime0.7803 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0064 589.1719152.6406
Module start 'layout' 0.00640.0026 741.812539.4766
Module start 'content' 0.00910.7697 781.2891535.9844
Module end 'content' 0.77880.0015 1,317.273412.1250
Script end 0.7803  1,329.3984 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00360.4607160.0002
Check MTime0.00140.1828160.0001
Mysql Total
Database connection0.00140.179210.0014
Mysqli_queries0.727693.2459570.0128
Looping result0.00060.0786550.0000
Template Total0.735694.320.3678
Template load0.00260.338320.0013
Template processing0.733093.930420.3665
Template load and register function0.00010.016810.0001
states
state_id_array0.00270.348810.0027
state_identifier_array0.00150.188420.0007
Override
Cache load0.00210.2726290.0001
Sytem overhead
Fetch class attribute can translate value0.00050.068120.0003
Fetch class attribute name0.00070.093940.0002
XML
Image XML parsing0.00070.084220.0003
class_abstraction
Instantiating content class attribute0.00000.000940.0000
General
dbfile0.00090.1133170.0001
String conversion0.00000.000640.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
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
6content/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
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 16
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs