Coding standard question about autoloads

Author Message

Jean-Yves Zinsou

Wednesday 19 August 2009 9:29:38 am

Hi to all,
I am rewriting one of my extension following the ezcomponents coding standards.
A question that i could not answer clearly :

I have a module that uses a class defined in a class directory in the extension.

The coding standard says not to use include_once and rely on php 5's autoload function.
Where am i supposed to put the file that contains my autoload array ?

In the autoload directory of the extension ?

thanx for any answer..

Jey

Do Androids Dream of Electric Sheep?
I dream of eZpubliSheep....
------------------------------------------------------------------------
http://www.alma.fr

André R.

Wednesday 19 August 2009 11:55:11 am

Unless your writing a component, then you don't need to think about that, let the eZ Publish autoload system handle it. No autoload array needed, just press the button in admin or use the bin script to regenerate it when you add a class / extension.

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

Jean-Yves Zinsou

Wednesday 19 August 2009 1:47:47 pm

Thanks !

Do Androids Dream of Electric Sheep?
I dream of eZpubliSheep....
------------------------------------------------------------------------
http://www.alma.fr

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 31 2025 04:19:45
Script start
Timing: Jan 31 2025 04:19:45
Module start 'layout'
Timing: Jan 31 2025 04:19:45
Module start 'content'
Timing: Jan 31 2025 04:19:45
Module end 'content'
Timing: Jan 31 2025 04:19:45
Script end

Main resources:

Total runtime0.0181 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0055 588.2656151.2266
Module start 'layout' 0.00550.0033 739.492236.6797
Module start 'content' 0.00880.0077 776.171990.1875
Module end 'content' 0.01650.0016 866.359433.9922
Script end 0.0181  900.3516 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002715.1336140.0002
Check MTime0.00126.5045140.0001
Mysql Total
Database connection0.00073.640810.0007
Mysqli_queries0.002916.188730.0010
Looping result0.00000.143610.0000
Template Total0.00126.510.0012
Template load0.00094.965910.0009
Template processing0.00031.491110.0003
Override
Cache load0.00063.419510.0006
General
dbfile0.002916.236280.0004
String conversion0.00000.051440.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