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

eZ debug

Timing: Jan 18 2025 10:55:06
Script start
Timing: Jan 18 2025 10:55:06
Module start 'content'
Timing: Jan 18 2025 10:55:07
Module end 'content'
Timing: Jan 18 2025 10:55:07
Script end

Main resources:

Total runtime0.9402 sec
Peak memory usage4,096.0000 KB
Database Queries205

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0070 588.8281180.8359
Module start 'content' 0.00700.7526 769.6641615.7891
Module end 'content' 0.75960.1806 1,385.4531337.0625
Script end 0.9401  1,722.5156 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00410.4393210.0002
Check MTime0.00150.1604210.0001
Mysql Total
Database connection0.00100.109510.0010
Mysqli_queries0.846089.97902050.0041
Looping result0.00250.27082030.0000
Template Total0.905996.420.4530
Template load0.00210.226220.0011
Template processing0.903896.127620.4519
Template load and register function0.00020.021210.0002
states
state_id_array0.00170.178810.0017
state_identifier_array0.00170.186020.0009
Override
Cache load0.00180.1870350.0001
Sytem overhead
Fetch class attribute can translate value0.00220.233640.0005
Fetch class attribute name0.00140.153980.0002
XML
Image XML parsing0.00340.361640.0008
class_abstraction
Instantiating content class attribute0.00000.002090.0000
General
dbfile0.01081.1454350.0003
String conversion0.00000.000630.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

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
6content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
9content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
4content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 24
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs