Mantis Bugtracker
  

Viewing Issue Advanced Details Jump to Notes ] View Simple ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0003104 [Quercus] minor always 11-29-08 14:23 12-10-08 09:14
Reporter koreth View Status public  
Assigned To nam
Priority normal Resolution fixed Platform
Status closed   OS
Projection none   OS Version
ETA none Fixed in Version 4.0.0 Product Version 3.2.1
  Product Build
Summary 0003104: curl_getinfo doesn't support default behavior
Description PHP docs say curl_getinfo() is supposed to return an array of all the values if no particular option is specified. Quercus logs "Unknown CURL getinfo option" if you try that.

Patch:

--- a/modules/quercus/src/com/caucho/quercus/lib/curl/CurlModule.java
+++ b/modules/quercus/src/com/caucho/quercus/lib/curl/CurlModule.java
@@ -379,9 +379,43 @@ public class CurlModule
     if (curl == null)
       return BooleanValue.FALSE;
 
+ if (option instanceof DefaultValue) {
+ ArrayValue result = new ArrayValueImpl();
+ putInfo(env, curl, result, "url", CURLINFO_EFFECTIVE_URL);
+ putInfo(env, curl, result, "content_type", CURLINFO_CONTENT_TYPE);
+ putInfo(env, curl, result, "http_code", CURLINFO_HTTP_CODE);
+ putInfo(env, curl, result, "header_size", CURLINFO_HEADER_SIZE);
+ putInfo(env, curl, result, "request_size", CURLINFO_REQUEST_SIZE);
+ putInfo(env, curl, result, "filetime", CURLINFO_FILETIME);
+ putInfo(env, curl, result, "total_time", CURLINFO_TOTAL_TIME);
+ putInfo(env, curl, result, "namelookup_time", CURLINFO_NAMELOOKUP_TIME);
+ putInfo(env, curl, result, "connect_time", CURLINFO_CONNECT_TIME);
+ putInfo(env, curl, result, "pretransfer_time", CURLINFO_PRETRANSFER_TIME);
+ putInfo(env, curl, result, "size_upload", CURLINFO_SIZE_UPLOAD);
+ putInfo(env, curl, result, "size_download", CURLINFO_SIZE_DOWNLOAD);
+ putInfo(env, curl, result, "speed_download", CURLINFO_SPEED_DOWNLOAD);
+ putInfo(env, curl, result, "speed_upload", CURLINFO_SPEED_UPLOAD);
+ putInfo(env, curl, result, "download_content_length", CURLINFO_CONTENT_LENGTH_DOWNLOAD);
+ putInfo(env, curl, result, "upload_content_length", CURLINFO_CONTENT_LENGTH_UPLOAD);
+ putInfo(env, curl, result, "starttransfer_time", CURLINFO_STARTTRANSFER_TIME);
+ putInfo(env, curl, result, "redirect_time", CURLINFO_REDIRECT_TIME);
+ // Constant defined but not recognized by getInfo
+ //putInfo(env, curl, result, "redirect_count", CURLINFO_REDIRECT_COUNT);
+ // Not implemented and constant not defined
+ //putInfo(env, curl, result, "ssl_verify_result", CURLINFO_SSL_VERIFYRESULT);
+ return result;
+ }
     return getInfo(env, curl, option.toInt());
   }
 
+ private static void putInfo(Env env,
+ CurlResource curl,
+ ArrayValue array,
+ String name,
+ int option) {
+ array.put(new StringBuilderValue(name), getInfo(env, curl, option));
+ }
+
   private static Value getInfo(Env env,
                               CurlResource curl,
                               int option)
Steps To Reproduce
Additional Information
Attached Files

- Relationships

- Notes
(0003585)
nam
12-10-08 09:14

php/5040
 

- Issue History
Date Modified Username Field Change
11-29-08 14:23 koreth New Issue
12-08-08 10:38 nam Status new => assigned
12-08-08 10:38 nam Assigned To  => nam
12-10-08 09:14 nam Status assigned => closed
12-10-08 09:14 nam Note Added: 0003585
12-10-08 09:14 nam Resolution open => fixed
12-10-08 09:14 nam Fixed in Version  => 4.0.0


Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
29 total queries executed.
26 unique queries executed.
Powered by Mantis Bugtracker