Adding a new Operator

Author Message

John van der Boom

Tuesday 29 July 2003 9:53:47 am

Im tying to add a new operator to eZ wich I will share with the community when I'm finished with it.

I took a look at the operators in the contribution (ezIPCountry and eZRSSFeed). Now my Q is: should one always use the functions: modify and namedParameterList() ?

Thanks

John van der Boom

Tuesday 29 July 2003 12:53:54 pm

Next problem I bumping into is that Ez is not seeing my new operator as a registered one.

Operator 'ezcookie' is not registered

I added these line into all the site.ini(.append.php) files:

[ExtensionSettings]
ActiveExtensions[]=ezcookie

AutoloadPath=lib/eztemplate/classes/;kernel/common/;extension/ezcookie/kernel/common

Any ideas?

John van der Boom

Wednesday 30 July 2003 4:50:28 am

I'm also having problem with these operators:

Operator 'ezcookie' is not registered

upword
shorten

Am I missing something?

Paul Borgermans

Wednesday 30 July 2003 9:54:25 am

Maybe this:

AutoloadPath=lib/eztemplate/classes/;kernel/common/;extension/ezcookie/kernel/common

should be

AutoloadPath=lib/eztemplate/classes/;kernel/common/;extension/ezcookie/kernel/common/

Can you install the contributed ezenv operator? It is doing what you want but for post/get vars. Session and cookie variables should be almost the same.

-paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

John van der Boom

Wednesday 30 July 2003 11:25:23 am

I installed the ezenvoperator. And I think it's working, because it's not giving me the ezenv not registered warning. Si it's the ezcookie operator that's giving me problem.

You're telling me that cookie and session vars should be the same. I have a cookie named member_id so:

{"member_id"|ezenv}

should work right?
That's not the case :(
I took a closer look at the ezenv operator and it wn't work with cookies. Because it's using eZHTTPTool.
I don't think eZHTTPTool can handle cookies. Correct me if I'm wrong.

This cookie thing is giving me a headache. Am I the only one trying to do something with cookies or having problem with cookies? I'm getting desperate here.

Paul Borgermans

Thursday 31 July 2003 2:20:39 am

the ezenv operator indeed only works for post/get vars. Can't you use the $GLOBALS array directly and look up the cookie vars? Which server sets these cookies (it should be done within your ezp server, otherwise it won't show up)?

Make sure you disable viewcaching.

-paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

John van der Boom

Thursday 31 July 2003 10:05:46 am

$_COOKIE is working correctly in the index.php of ezP.
But when I call the $_COOKIE in the template (using the insert operator for a php file) to call the $_COOKIE I get nothing.

Printing the $_COOKIE array also shows me blank, nada, null :-(
eZ isn't showing me the cookies. I'm working on the same server here.

So index.php: cookie are showed perfectly
In template using (insert operator for php): no cookies

John van der Boom

Friday 01 August 2003 2:25:17 am

Can anyone try to show there $COOKIE vars in a template.

Then I will know it's something I'm doing wrong or that this functionality has yet to be implemented in eZ.
Thank you

John van der Boom

Friday 01 August 2003 3:05:23 pm

Found a solution for the cookie problem:

IFRAME!!

Iframe the .php file and everything is working just fine.

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 16:10:38
Script start
Timing: Jan 18 2025 16:10:38
Module start 'layout'
Timing: Jan 18 2025 16:10:38
Module start 'content'
Timing: Jan 18 2025 16:10:39
Module end 'content'
Timing: Jan 18 2025 16:10:39
Script end

Main resources:

Total runtime1.2578 sec
Peak memory usage4,096.0000 KB
Database Queries75

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0056 589.0234152.6094
Module start 'layout' 0.00560.0026 741.632839.4141
Module start 'content' 0.00821.2480 781.0469605.3516
Module end 'content' 1.25630.0015 1,386.398416.1875
Script end 1.2578  1,402.5859 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.2627160.0002
Check MTime0.00130.1044160.0001
Mysql Total
Database connection0.00090.072210.0009
Mysqli_queries1.192394.7897750.0159
Looping result0.00070.0538730.0000
Template Total1.215496.620.6077
Template load0.00210.166120.0010
Template processing1.213396.459420.6066
Template load and register function0.00020.018210.0002
states
state_id_array0.00130.106210.0013
state_identifier_array0.00150.119920.0008
Override
Cache load0.00180.1465570.0000
Sytem overhead
Fetch class attribute can translate value0.00080.059920.0004
Fetch class attribute name0.00110.0897100.0001
XML
Image XML parsing0.00120.098320.0006
class_abstraction
Instantiating content class attribute0.00000.0017110.0000
General
dbfile0.00110.0913170.0001
String conversion0.00000.000540.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
9content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
15content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
7content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
2content/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: 35
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs