CRM_Utils_HttpClient
class CRM_Utils_HttpClient
This class handles HTTP downloads
FIXME: fetch() and get() report errors differently -- e.g. fetch() returns fatal and get() returns an error code. Should refactor both (or get a third-party HTTP library) but don't want to deal with that so late in the 4.3 dev cycle.
Constants
| STATUS_OK | 
                     
  | 
            
| STATUS_WRITE_ERROR | 
                     
  | 
            
| STATUS_DL_ERROR | 
                     
  | 
            
Properties
| static protected CRM_Utils_HttpClient | $singleton | ||
| protected int|null | $connectionTimeout | 
Methods
                    static CRM_Utils_HttpClient
                
                
                    singleton()
        
                                            
                
            No description
                    __construct(null $connectionTimeout = NULL)
        
                                            
                
            No description
                    STATUS_OK|STATUS_WRITE_ERROR|STATUS_DL_ERROR
                
                
                    fetch(string $remoteFile, string $localFile)
        
                                            
                
            Download the remote zipfile.
                    array
                
                
                    get(string $remoteFile)
        
                                            
                
            Send an HTTP GET for a remote resource.
                    array
                
                
                    post(string $remoteFile, array $params)
        
                                            
                
            Send an HTTP POST for a remote resource.
                    array
                
                
                    createCurl(string $remoteFile)
        
                                            
                
            No description
                    bool
                
                
                    isRedirectSupported()
        
                                            
                
            No description
Details
        at         line 59
                static            CRM_Utils_HttpClient
    singleton()
        
    
    
        at         line 69
                            
    __construct(null $connectionTimeout = NULL)
        
    
    
        at         line 82
                            STATUS_OK|STATUS_WRITE_ERROR|STATUS_DL_ERROR
    fetch(string $remoteFile, string $localFile)
        
    
    Download the remote zipfile.
        at         line 120
                            array
    get(string $remoteFile)
        
    
    Send an HTTP GET for a remote resource.
        at         line 160
                            array
    post(string $remoteFile, array $params)
        
    
    Send an HTTP POST for a remote resource.