From b593c3a9b90bc35e7bfa320acffb63b9b0f3de93 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Tue, 21 Jun 2016 18:18:06 -0700 Subject: 1. provide automatic relocation of important links in items that are imported or synced to clones 2. provide framework for custom curl request bodies using custom/non-standard request methods. This was a real nightmare because curl doesn't actually let you specify a string to send as the request body (except when doing POST). You have to treat it as a file upload using a custom file handler function which provides the actual content in chunks as if it were buffered I/O. 3. item_store and item_store_update now return the item that was stored --- include/network.php | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include/network.php') diff --git a/include/network.php b/include/network.php index 41d13a40e..91dac936e 100644 --- a/include/network.php +++ b/include/network.php @@ -62,7 +62,17 @@ function z_fetch_url($url, $binary = false, $redirects = 0, $opts = array()) { @curl_setopt($ch, CURLOPT_HEADER, $false); } + if(x($opts,'upload')) + @curl_setopt($ch, CURLOPT_UPLOAD, $opts['upload']); + + if(x($opts,'infile')) + @curl_setopt($ch, CURLOPT_INFILE, $opts['infile']); + + if(x($opts,'infilesize')) + @curl_setopt($ch, CURLOPT_INFILESIZE, $opts['infilesize']); + if(x($opts,'readfunc')) + @curl_setopt($ch, CURLOPT_READFUNCTION, $opts['readfunc']); if(x($opts,'headers')) @curl_setopt($ch, CURLOPT_HTTPHEADER, $opts['headers']); -- cgit v1.2.3