VirtueMart  3.2.14.9808
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
VmConnector Class Reference

Public Member Functions

 sendFile ($file, $mime, $overrideFileName='')
 
 http_rangeRequest ($size, $exitOnError=true)
 

Static Public Member Functions

 sendHeaderAndContent ($http_status=200, $content='', $mime_type='text/html')
 
static handleCommunication ($url, $postData='', $headers=array(), $fileToSaveData=null)
 

Public Attributes

 $handle = null
 

Detailed Description

Provides general tools to handle connections (http, headers, ... )

Author
soeren
Since
VirtueMart 1.1.0

Member Function Documentation

static VmConnector::handleCommunication (   $url,
  $postData = '',
  $headers = array(),
  $fileToSaveData = null 
)
static

This is a general function to safely open a connection to a server, post data when needed and read the result. Tries using cURL and switches to fopen/fsockopen if cURL is not available

Since
VirtueMart 1.1.0
Parameters
string$url
string$postData
array$headers
resource$fileToSaveData
Returns
mixed
VmConnector::http_rangeRequest (   $size,
  $exitOnError = true 
)

Checks and sets headers to handle range requets

Author
Andreas Gohr andi@.nosp@m.spli.nosp@m.tbrai.nosp@m.n.or.nosp@m.g
Returns
array The start byte and the amount of bytes to send
Parameters
intThe file size
VmConnector::sendFile (   $file,
  $mime,
  $overrideFileName = '' 
)

Set headers and send the file to the client

Author
Andreas Gohr andi@.nosp@m.spli.nosp@m.tbrai.nosp@m.n.or.nosp@m.g
Parameters
stringThe full path to the file
stringThe Mime Type of the file
VmConnector::sendHeaderAndContent (   $http_status = 200,
  $content = '',
  $mime_type = 'text/html' 
)
static

Clears the output buffer, sends a http status code and a content if given

Parameters
int$http_status
string$mime_type
string$content

Member Data Documentation

VmConnector::$handle = null

The documentation for this class was generated from the following file: