Forums / Developer / CURL function in EzPublish?

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