my own function: how to write it and how to use it?

Author Message

Alessandro Cipriani

Tuesday 02 March 2004 8:43:10 am

hi all
i'm writing my own php function to retrieve the session id

the function is
<?php
function getSessionId()
{
$session = & $GLOBALS["eZSessionObject"];
return $session->id();
}
?>

i'd like to know:
- is it alright or there is some error?
- where shall i place my php file with the function?
- how shall i call my function from my template?

best regards
alessandro

James Packham

Tuesday 02 March 2004 8:55:34 am

If you don't get a reply you might do better posting this in the developer forum...

Regards,

James

Alex Jones

Tuesday 02 March 2004 9:17:36 am

Alessandro, have you read the documentation about Modules? It should help guide you in the right direction.

http://www.ez.no/ez_publish/documentation/development/extensions/module

Alex

Alex
[ bald_technologist on the IRC channel (irc.freenode.net): #eZpublish ]

<i>When in doubt, clear the cache.</i>

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 19 2025 01:21:27
Script start
Timing: Jan 19 2025 01:21:27
Module start 'layout'
Timing: Jan 19 2025 01:21:27
Module start 'content'
Timing: Jan 19 2025 01:21:28
Module end 'content'
Timing: Jan 19 2025 01:21:28
Script end

Main resources:

Total runtime1.0112 sec
Peak memory usage4,096.0000 KB
Database Queries59

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0062 589.3047152.6406
Module start 'layout' 0.00620.0035 741.945339.4766
Module start 'content' 0.00970.9998 781.4219580.3906
Module end 'content' 1.00960.0016 1,361.812512.1250
Script end 1.0112  1,373.9375 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00430.4272160.0003
Check MTime0.00190.1853160.0001
Mysql Total
Database connection0.00090.084510.0009
Mysqli_queries0.954994.4253590.0162
Looping result0.00090.0882570.0000
Template Total0.969195.820.4845
Template load0.00280.278220.0014
Template processing0.966395.552320.4831
Template load and register function0.00010.013410.0001
states
state_id_array0.00130.131610.0013
state_identifier_array0.00120.116920.0006
Override
Cache load0.00240.2387300.0001
Sytem overhead
Fetch class attribute can translate value0.00260.261730.0009
Fetch class attribute name0.00120.114560.0002
XML
Image XML parsing0.00140.140830.0005
class_abstraction
Instantiating content class attribute0.00000.001160.0000
General
dbfile0.00110.1076280.0000
String conversion0.00000.000840.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/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
4content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
6content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 18
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs