qa:temp:ext:curl
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
qa:temp:ext:curl [2009/05/09 11:52] – code block for file fallback mattijs | qa:temp:ext:curl [2017/09/22 13:28] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 4: | Line 4: | ||
===== With a webserver ===== | ===== With a webserver ===== | ||
- | The cURL extensions tests can be run with the help of a file on a webserver that can be reached by the machine the tests are run on. An environmental variable pointing to the host needs to be set as follows (on Unix):\\ | + | The cURL extensions tests can be run with the help of both a file on a webserver |
- | < | + | < |
+ | export PHP_CURL_HTTP_REMOTE_SERVER=http:// | ||
+ | export PHP_CURL_FTP_REMOTE_SERVER=" | ||
+ | export PHP_CURL_FTP_REMOTE_USER=" | ||
+ | export PHP_CURL_FTP_REMOTE_PASSWD=" | ||
+ | </ | ||
Where http:// | Where http:// | ||
- | The file that is requisted | + | The '' |
===== With a local file ===== | ===== With a local file ===== | ||
- | Proposal for file fallback. | + | Some cURL tests work with a local file. The '' |
+ | |||
+ | The following piece of code is used to make sure a file is always present. | ||
+ | < | ||
// Figure out what handler to use | // Figure out what handler to use | ||
if(!empty($_ENV[' | if(!empty($_ENV[' | ||
Line 24: | Line 32: | ||
file_put_contents($tempname, | file_put_contents($tempname, | ||
} | } | ||
+ | |||
+ | /* .. your test .. */ | ||
+ | |||
+ | // Cleanup | ||
+ | isset( $tempname ) and unlink( $tempname ); | ||
</ | </ | ||
+ | |||
+ | When the '' |
qa/temp/ext/curl.1241869942.txt.gz · Last modified: 2017/09/22 13:28 (external edit)