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
Name | Type | Description | Default | Required |
---|---|---|---|---|
url | String | The request URL | n/a | Yes |
dir | String | The directory to save the file | n/a | Yes |
filename | String | The filename for the downloaded file | The filename part of the URL | No |
followRedirects | Boolean | Whether to follow HTTP redirects | false | No |
sslVerifyPeer | Boolean | Whether to verify SSL certificates | true | No |
authUser | String | The authentication user name | n/a | No |
authPassword | String | The authentication password | n/a | No |
authScheme | String | The authentication scheme | basic | No |
quiet | Boolean | If true, set default log level to Project.MSG_ERR | false | No |
<httpget url="http://buildserver.com/builds/latest.stable.tar.bz2" dir="/usr/local/lib"/>
config
Holds additional config data. See Guzzle documentation for supported values.
Table C.39: Attributes
Name | Type | Description | Default | Required |
---|---|---|---|---|
name | String | Config parameter name | n/a | Yes |
value | Mixed | Config value | n/a | Yes |
header
Holds additional header name
and
value
.
Table C.40: Attributes
Name | Type | Description | Default | Required |
---|---|---|---|---|
name | String | Header name | n/a | Yes |
value | String | Header value | n/a | Yes |
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/"/> </httpget>