C.37 HttpGetTask

This task will download a file through HTTP GET and save it to a specified directory. You need an installed version of Guzzle to use this task.

Table C.38: Attributes

urlStringThe request URLn/aYes
dirStringThe directory to save the filen/aYes
filenameStringThe filename for the downloaded fileThe filename part of the URLNo
followRedirectsBooleanWhether to follow HTTP redirectsfalseNo
sslVerifyPeerBooleanWhether to verify SSL certificatestrueNo
authUserStringThe authentication user namen/aNo
authPasswordStringThe authentication passwordn/aNo
authSchemeStringThe authentication schemebasicNo
quietBooleanIf true, set default log level to Project.MSG_ERRfalseNo

C.37.1 Example

<httpget url="http://buildserver.com/builds/latest.stable.tar.bz2" dir="/usr/local/lib"/>

C.37.2 Supported Nested Tags

  • config

    Holds additional config data. See Guzzle documentation for supported values.

    Table C.39: Attributes

    nameStringConfig parameter namen/aYes
    valueMixedConfig valuen/aYes

  • header

    Holds additional header name and value.

    Table C.40: Attributes

    nameStringHeader namen/aYes
    valueStringHeader valuen/aYes

C.37.3 Global configuration

In addition to configuring a particular instance of Guzzle via nested <config> tags it is also possible to set default configuration values for HttpGetTask / HttpRequestTask / VisualizerTask by setting phing.http.* properties.

<property name="phing.http.proxy" value="socks5://localhost:1080/"/>
<!-- This request will go through the default proxy -->
<httpget url="http://example.com/file.zip" dir="./"/>
<httpget url="http://example.org/file.exe" dir="./">
    <!-- This proxy will be used instead of the default one -->
    <config name="proxy" value="http://foo:[email protected]:3128/"/>