Zend Framework  3.0
Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Attributes | List of all members
Http Class Reference

File transfer adapter class for the HTTP protocol. More...

Public Member Functions

 __construct ($options=[])
 Constructor for Http File Transfers.
 
 setValidators (array $validators, $files=null)
 Sets a validator for the class, erasing all previous set.
 
 removeValidator ($name)
 Remove an individual validator.
 
 clearValidators ()
 Clear the validators.
 
 send ($options=null)
 Send the file to the client (Download)
 
 isValid ($files=null)
 Checks if the files are valid.
 
 receive ($files=null)
 Receive the file from the client (Upload)
 
 isSent ($files=null)
 Checks if the file was already sent.
 
 isReceived ($files=null)
 Checks if the file was already received.
 
 isFiltered ($files=null)
 Checks if the file was already filtered.
 
 isUploaded ($files=null)
 Has a file been uploaded ?
 
- Public Member Functions inherited from AbstractAdapter
 send ($options=null)
 Send file.
 
 receive ($options=null)
 Receive file.
 
 isSent ($files=null)
 Is file sent?
 
 isReceived ($files=null)
 Is file received?
 
 isUploaded ($files=null)
 Has a file been uploaded ?
 
 isFiltered ($files=null)
 Has the file been filtered ?
 
 setFilterManager (FilterPluginManager $filterManager)
 Adds one or more files.
 
 getFilterManager ()
 Get the filter plugin manager instance.
 
 setValidatorManager (ValidatorPluginManager $validatorManager)
 Set the validator plugin manager instance.
 
 getValidatorManager ()
 Get the validator plugin manager instance.
 
 addValidator ($validator, $breakChainOnFailure=false, $options=null, $files=null)
 Adds a new validator for this class.
 
 addValidators (array $validators, $files=null)
 Add Multiple validators at once.
 
 setValidators (array $validators, $files=null)
 Sets a validator for the class, erasing all previous set.
 
 hasValidator ($name)
 Determine if a given validator has already been registered.
 
 getValidator ($name)
 Retrieve individual validator.
 
 getValidators ($files=null)
 Returns all set validators.
 
 removeValidator ($name)
 Remove an individual validator.
 
 clearValidators ()
 Remove all validators.
 
 setOptions ($options=[], $files=null)
 Sets Options for adapters.
 
 getOptions ($files=null)
 Returns set options for adapters or files.
 
 isValid ($files=null)
 Checks if the files are valid.
 
 getMessages ()
 Returns found validation messages.
 
 getErrors ()
 Retrieve error codes.
 
 hasErrors ()
 Are there errors registered?
 
 addFilter ($filter, $options=null, $files=null)
 Adds a new filter for this class.
 
 addFilters (array $filters, $files=null)
 Add Multiple filters at once.
 
 setFilters (array $filters, $files=null)
 Sets a filter for the class, erasing all previous set.
 
 hasFilter ($name)
 Determine if a given filter has already been registered.
 
 getFilter ($name)
 Retrieve individual filter.
 
 getFilters ($files=null)
 Returns all set filters.
 
 removeFilter ($name)
 Remove an individual filter.
 
 clearFilters ()
 Remove all filters.
 
 getFileName ($file=null, $path=true)
 Retrieves the filename of transferred files.
 
 getFileInfo ($file=null)
 Retrieve additional internal file informations for files.
 
 setDestination ($destination, $files=null)
 Sets a new destination for the given files.
 
 getDestination ($files=null)
 Retrieve destination directory value.
 
 setTranslator (Translator $translator=null, $textDomain=null)
 Sets translator to use in helper.
 
 getTranslator ()
 Retrieve localization translator object.
 
 hasTranslator ()
 Checks if the helper has a translator.
 
 setTranslatorEnabled ($flag=true)
 Indicate whether or not translation should be enabled.
 
 isTranslatorEnabled ()
 Is translation enabled?
 
 setTranslatorTextDomain ($textDomain= 'default')
 Set translation text domain.
 
 getTranslatorTextDomain ()
 Return the translation text domain.
 
 getHash ($hash= 'crc32', $files=null)
 Returns the hash for a given file.
 
 getFileSize ($files=null)
 Returns the real filesize of the file.
 
 getMimeType ($files=null)
 Returns the real mimetype of the file Uses fileinfo, when not available mime_magic and as last fallback a manual given mimetype.
 
- Public Member Functions inherited from TranslatorAwareInterface
 setTranslator (TranslatorInterface $translator=null, $textDomain=null)
 Sets translator to use in helper.
 

Static Public Member Functions

static getProgress ($id=null)
 Returns the actual progress of file up-/downloads.
 
static isApcAvailable ()
 Checks the APC extension for progress information.
 
static isUploadProgressAvailable ()
 Checks the UploadProgress extension for progress information.
 

Protected Member Functions

 prepareFiles ()
 Prepare the $_FILES array to match the internal syntax of one file per entry.
 
- Protected Member Functions inherited from AbstractAdapter
 detectFileSize ($value)
 Internal method to detect the size of a file.
 
 detectMimeType ($value)
 Internal method to detect the mime type of a file.
 
 filter ($files=null)
 Internal function to filter all given files.
 
 getTmpDir ()
 Determine system TMP directory and detect if we have read access.
 
 isPathWriteable ($path)
 Tries to detect if we can read and write to the given path.
 
 getFiles ($files, $names=false, $noexception=false)
 Returns found files based on internal file array and given files.
 
 getValidatorIdentifier ($name)
 Retrieve internal identifier for a named validator.
 
 getFilterIdentifier ($name)
 Retrieve internal identifier for a named filter.
 

Static Protected Attributes

static $callbackApc = 'apc_fetch'
 
static $callbackUploadProgress = 'uploadprogress_get_info'
 

Additional Inherited Members

- Public Attributes inherited from AbstractAdapter
const FILTER = 'FILTER'
 @+ Plugin loader Constants
 
const VALIDATOR = 'VALIDATOR'
 
- Static Protected Member Functions inherited from AbstractAdapter
static toByteString ($size)
 Returns the formatted size.
 
- Protected Attributes inherited from AbstractAdapter
 $break = []
 
 $filterManager
 
 $filters = []
 
 $loaders = []
 
 $messages = []
 
 $translator
 
 $translatorEnabled = true
 
 $translatorTextDomain = 'default'
 
 $validatorManager
 
 $validators = []
 
 $files = []
 
 $tmpDir
 
 $options
 Available options for file transfers.
 

Detailed Description

File transfer adapter class for the HTTP protocol.

Deprecated:
since 2.7.0, and scheduled for removal with 3.0.0

Constructor & Destructor Documentation

__construct (   $options = [])

Constructor for Http File Transfers.

Parameters
array$optionsOPTIONAL Options to set
Exceptions
Exception\PhpEnvironmentExceptionif file uploads are not allowed

Member Function Documentation

clearValidators ( )

Clear the validators.

Returns
AbstractAdapter
static getProgress (   $id = null)
static

Returns the actual progress of file up-/downloads.

Parameters
string | array$idThe upload to get the progress for
Returns
array|null
Exceptions
Exception\PhpEnvironmentExceptionwhether APC nor UploadProgress extension installed
Exception\RuntimeException
static isApcAvailable ( )
static

Checks the APC extension for progress information.

Returns
bool
isFiltered (   $files = null)

Checks if the file was already filtered.

Parameters
string | array$files(Optional) Files to check
Returns
bool
isReceived (   $files = null)

Checks if the file was already received.

Parameters
string | array$files(Optional) Files to check
Returns
bool
isSent (   $files = null)

Checks if the file was already sent.

Parameters
string | array$filesFiles to check
Returns
bool
Exceptions
Exception\BadMethodCallExceptionNot implemented
isUploaded (   $files = null)

Has a file been uploaded ?

Parameters
array | string | null$files
Returns
bool
static isUploadProgressAvailable ( )
static

Checks the UploadProgress extension for progress information.

Returns
bool
isValid (   $files = null)

Checks if the files are valid.

Parameters
string | array$files(Optional) Files to check
Returns
bool True if all checks are valid
prepareFiles ( )
protected

Prepare the $_FILES array to match the internal syntax of one file per entry.

Returns
Http
receive (   $files = null)

Receive the file from the client (Upload)

Parameters
string | array$files(Optional) Files to receive
Returns
bool
removeValidator (   $name)

Remove an individual validator.

Parameters
string$name
Returns
AbstractAdapter
send (   $options = null)

Send the file to the client (Download)

Parameters
string | array$optionsOptions for the file(s) to send
Returns
void
Exceptions
Exception\BadMethodCallExceptionNot implemented
setValidators ( array  $validators,
  $files = null 
)

Sets a validator for the class, erasing all previous set.

Parameters
array$validatorsValidator to set
string | array$filesFiles to limit this validator to
Returns
AbstractAdapter

Member Data Documentation

$callbackApc = 'apc_fetch'
staticprotected
$callbackUploadProgress = 'uploadprogress_get_info'
staticprotected