CURL function in EzPublish?

Author Message

Roberto Sacchi

Tuesday 13 January 2009 9:10:00 am

Is there a function in the eZclasses to save a content of a page directly into a file? (like CURL in php).

Or Any template operator/function to do that?

Thanks in advance

Rob

Christophe Condomines

Tuesday 13 January 2009 11:47:07 am

As far as I know, there isn't.
What's your need exactly?

Microblau SL
http://www.microblau.net

Ɓukasz Serwatka

Tuesday 13 January 2009 1:02:07 pm

eZHTTPTool class uses CURL. There is a method getDataByURL() which uses CURL when available but you still need to take care about saving fetched data on your on.

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Roberto Sacchi

Wednesday 14 January 2009 6:43:25 am

getDataByURL() works great.

Now I've some problem to catch the URL of the view I would like to fetch.

I'm writing he view in extension/venus/modules/integration/writedata
and I would like to save the view: extension/venus/modules/integration/getdata on a file.

I would like to use eZPathElement::getPath() to get writedata path, but it's not static function.
When I tried to create an eZPathElement oblject I've some problems with parameters costructor.

Please help

Roberto Sacchi

Wednesday 14 January 2009 8:05:58 am

I rewrite my problem:

I need to get the server path of the view I'm writing.

For example:

I'm writing the file c:/htdocs/ezpublish/extension/venus/modules/integration/writedata.php

and I need to get "http://localhost/ezpublish/index.php/integration/writedata" path, using a ez function.

How to do?
Show some code if it's possible.

Thanks.

Christophe Condomines

Thursday 15 January 2009 2:47:08 am

Have a look to "kernel/classes/ezstaticcache.php"

This file generates the static cache and is probably a good example for your case.

Microblau SL
http://www.microblau.net

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

Main resources:

Total runtime0.0233 sec
Peak memory usage6,144.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0045 588.1328151.2109
Module start 'layout' 0.00450.0036 739.3438220.6875
Module start 'content' 0.00810.0136 960.03131,001.7891
Module end 'content' 0.02170.0016 1,961.820337.9922
Script end 0.0233  1,999.8125 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002711.5643140.0002
Check MTime0.00104.4155140.0001
Mysql Total
Database connection0.00073.064810.0007
Mysqli_queries0.002410.356830.0008
Looping result0.00000.051210.0000
Template Total0.00114.910.0011
Template load0.00093.712510.0009
Template processing0.00031.167610.0003
Override
Cache load0.00062.540910.0006
General
dbfile0.00135.385680.0002
String conversion0.00000.025640.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