Abstract Class Zend_File_Transfer_Adapter_Abstract

Description

Abstract class for file transfers (Downloads and Uploads)

  • copyright: Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
  • abstract:
  • license: New BSD License

Located in /File/Transfer/Adapter/Abstract.php (line 30)


	
			
Direct descendents
Class Description
 class Zend_File_Transfer_Adapter_Http File transfer adapter class for the HTTP protocol
Class Constant Summary
 FILTER = 'FILTER'
 VALIDATE = 'VALIDATE'
Variable Summary
Method Summary
 static float getProgress ()
 static string _toByteString (integer $size)
 Zend_File_Transfer_Adapter_Abstract addFile (string|array $file, [string|array $validator = null], [string|array $filter = null])
 Zend_File_Transfer_Adapter addFilter (string|array $filter, [string|array $options = null], [string|array $files = null])
 Zend_File_Transfer_Adapter_Abstract addFilters ( $filters, [string|array $files = null])
 Zend_File_Transfer_Adapter_Abstract addPrefixPath (string $prefix, string $path, [string $type = null])
 Zend_File_Transfer_Adapter_Abstract addType (string|array $type, [string|array $validator = null], [string|array $filter = null])
 Zend_File_Transfer_Adapter addValidator (string|array $validator, [boolean $breakChainOnFailure = false], [string|array $options = null], [string|array $files = null])
 Zend_File_Transfer_Adapter_Abstract addValidators ( $validators, [string|array $files = null])
 null|string|array getDestination ([null|string|array $files = null])
 array getErrors ()
 array getFile ()
 array getFileInfo ([string $file = null])
 string|array getFileName ([ $file = null], [boolean $path = true], string $fileelement)
 string|array getFileSize ([string|array $files = null])
 Zend_Filter_Interface|null getFilter (string $name)
 array getFilters ([string|array $files = null])
 string|array getHash ([string $hash = 'crc32'], [string|array $files = null])
 array getMessages ()
 string|array getMimeType ([string|array $files = null])
 array getOptions ([array $files = null])
 array getType ()
 Zend_Validate_Interface|null getValidator (string $name)
 null|array getValidators ([string|array $files = null])
 boolean hasErrors ()
 bool hasFilter (string $name)
 bool hasValidator (string $name)
 bool isFiltered ([array|string|null $files = null])
 bool isReceived ([array|string|null $files = null])
 bool isSent ([array|string|null $files = null])
 bool isUploaded ([array|string|null $files = null])
 boolean isValid ([string|array $files = null])
 bool receive ([mixed $options = null])
 bool send ([mixed $options = null])
 Zend_File_Transfer_Abstract setDestination (string $destination, [string|array $files = null])
 Zend_File_Transfer_Abstract setDisableTranslator (bool $flag)
 Zend_File_Transfer_Adapter setFilters ( $filters, [string|array $files = null], string|array $filter)
 void setOptions ([array $options = array()], [array $files = null])
 Zend_File_Transfer_Abstract setTranslator ([Zend_Translate|null $translator = null])
 Zend_File_Transfer_Adapter setValidators ( $validators, [string|array $files = null], string|array $validator)
 string _detectFileSize (array $value)
 string _detectMimeType (array $value)
 boolean _filter ([string|array $files = null])
 array _getFiles (string|array $files, [boolean $names = false], [boolean $noexception = false])
 string _getFilterIdentifier (string $name)
 string _getTmpDir ()
 string _getValidatorIdentifier (string $name)
 void _isPathWriteable (string $path)
Variables
array $_break = array() (line 44)

Internal list of breaks

  • access: protected
array $_files = array() (line 101)

Internal list of files

This array looks like this: array(form => array( - Form is the name within the form or, if not set the filename name, - Original name of this file type, - Mime type of this file size, - Filesize in bytes tmp_name, - Internalally temporary filename for uploaded files error, - Error which has occured destination, - New destination for this file validators, - Set validator names for this file files - Set file names for this file ))

  • access: protected
array $_filters = array() (line 51)

Internal list of filters

  • access: protected
array $_loaders = array() (line 58)

Plugin loaders for filter and validation chains

  • access: protected
array $_messages = array() (line 65)

Internal list of messages

  • access: protected
mixed $_options = array(
'ignoreNoFile' => false,
'useByteString' => true,
'magicFile' => null,
'detectInfos' => true,
)
(line 112)

Available options for file transfers

  • access: protected
string $_tmpDir (line 107)

TMP directory

  • access: protected
Zend_Translate $_translator (line 70)
  • access: protected
bool $_translatorDisabled = false (line 77)

Is translation disabled?

  • access: protected
array $_validators = array() (line 83)

Internal list of validators

  • access: protected
Methods
static getProgress (line 172)

Retrieve progress of transfer

  • access: public
static float getProgress ()

Redefined in descendants as:
static _toByteString (line 1326)

Returns the formatted size

  • access: protected
static string _toByteString (integer $size)
  • integer $size
addFile (line 987)

Adds one or more files

  • throws: Zend_File_Transfer_Exception Not implemented
  • access: public
Zend_File_Transfer_Adapter_Abstract addFile (string|array $file, [string|array $validator = null], [string|array $filter = null])
  • string|array $file: File to add
  • string|array $validator: Validators to use for this file, must be set before
  • string|array $filter: Filters to use for this file, must be set before
addFilter (line 749)

Adds a new filter for this class

  • access: public
Zend_File_Transfer_Adapter addFilter (string|array $filter, [string|array $options = null], [string|array $files = null])
  • string|array $filter: Type of filter to add
  • string|array $options: Options to set for the filter
  • string|array $files: Files to limit this filter to
addFilters (line 777)

Add Multiple filters at once

  • access: public
Zend_File_Transfer_Adapter_Abstract addFilters ( $filters, [string|array $files = null])
  • array $filters
  • string|array $files
addPrefixPath (line 256)

Add prefix path for plugin loader

If no $type specified, assumes it is a base path for both filters and validators, and sets each according to the following rules:

  • filters: $prefix = $prefix . '_Filter'
  • validators: $prefix = $prefix . '_Validate'
Otherwise, the path prefix is set on the appropriate plugin loader.

  • throws: Zend_File_Transfer_Exception for invalid type
  • access: public
Zend_File_Transfer_Adapter_Abstract addPrefixPath (string $prefix, string $path, [string $type = null])
  • string $prefix
  • string $path
  • string $type
addPrefixPaths (line 288)

Add many prefix paths at once

  • access: public
Zend_File_Transfer_Exception addPrefixPaths ( $spec)
  • array $spec
addType (line 1014)

Adds one or more type of files

  • throws: Zend_File_Transfer_Exception Not implemented
  • access: public
Zend_File_Transfer_Adapter_Abstract addType (string|array $type, [string|array $validator = null], [string|array $filter = null])
  • string|array $type: Type of files to add
  • string|array $validator: Validators to use for this file, must be set before
  • string|array $filter: Filters to use for this file, must be set before
addValidator (line 333)

Adds a new validator for this class

  • access: public
Zend_File_Transfer_Adapter addValidator (string|array $validator, [boolean $breakChainOnFailure = false], [string|array $options = null], [string|array $files = null])
  • string|array $validator: Type of validator to add
  • boolean $breakChainOnFailure: If the validation chain should stop an failure
  • string|array $options: Options to set for the validator
  • string|array $files: Files to limit this validator to
addValidators (line 379)

Add Multiple validators at once

  • access: public
Zend_File_Transfer_Adapter_Abstract addValidators ( $validators, [string|array $files = null])
  • array $validators
  • string|array $files
clearFilters (line 915)

Remove all filters

  • access: public
clearValidators (line 542)

Remove all validators

  • access: public

Redefined in descendants as:
getDestination (line 1067)

Retrieve destination directory value

  • access: public
null|string|array getDestination ([null|string|array $files = null])
  • null|string|array $files
getErrors (line 726)

Retrieve error codes

  • access: public
array getErrors ()
getFile (line 930)

Returns all set files

  • return: List of set files
  • throws: Zend_File_Transfer_Exception Not implemented
  • access: public
array getFile ()
getFileInfo (line 973)

Retrieve additional internal file informations for files

  • access: public
array getFileInfo ([string $file = null])
  • string $file: (Optional) File to get informations for
getFileName (line 943)

Retrieves the filename of transferred files.

  • access: public
string|array getFileName ([ $file = null], [boolean $path = true], string $fileelement)
  • string $fileelement: (Optional) Element to return the filename for
  • boolean $path: (Optional) Should the path also be returned ?
  • $file
getFileSize (line 1200)

Returns the real filesize of the file

  • return: Filesize
  • throws: Zend_File_Transfer_Exception When the file does not exist
  • access: public
string|array getFileSize ([string|array $files = null])
  • string|array $files: Files to get the filesize from
getFilter (line 844)

Retrieve individual filter

  • access: public
Zend_Filter_Interface|null getFilter (string $name)
  • string $name
getFilters (line 859)

Returns all set filters

  • return: List of set filters
  • throws: Zend_File_Transfer_Exception When file not found
  • access: public
array getFilters ([string|array $files = null])
  • string|array $files: (Optional) Returns the filter for this files
getHash (line 1166)

Returns the hash for a given file

  • return: Hashstring
  • throws: Zend_File_Transfer_Exception On unknown hash algorithm
  • access: public
string|array getHash ([string $hash = 'crc32'], [string|array $files = null])
  • string $hash: Hash algorithm to use
  • string|array $files: Files to return the hash for
getMessages (line 716)

Returns found validation messages

  • access: public
array getMessages ()
getMimeType (line 1253)

Returns the real mimetype of the file Uses fileinfo, when not available mime_magic and as last fallback a manual given mimetype

  • return: MimeType
  • throws: Zend_File_Transfer_Exception When the file does not exist
  • access: public
string|array getMimeType ([string|array $files = null])
  • string|array $files: Files to get the mimetype from
getOptions (line 597)

Returns set options for adapters or files

  • return: Options for given files
  • access: public
array getOptions ([array $files = null])
  • array $files: (Optional) Files to return the options for
getPluginLoader (line 210)

Retrieve plugin loader for validator or filter chain

Instantiates with default rules if none available for that type. Use 'filter' or 'validate' for $type.

  • throws: Zend_File_Transfer_Exception on invalid type.
  • access: public
Zend_Loader_PluginLoader getPluginLoader (string $type)
  • string $type
getTranslator (line 1127)

Retrieve localization translator object

  • access: public
Zend_Translate_Adapter|null getTranslator ()
getType (line 999)

Returns all set types

  • return: List of set types
  • throws: Zend_File_Transfer_Exception Not implemented
  • access: public
array getType ()
getValidator (line 470)

Retrieve individual validator

  • access: public
Zend_Validate_Interface|null getValidator (string $name)
  • string $name
getValidators (line 484)

Returns all set validators

  • return: List of set validators
  • access: public
null|array getValidators ([string|array $files = null])
  • string|array $files: (Optional) Returns the validator for this files
hasErrors (line 736)

Are there errors registered?

  • access: public
boolean hasErrors ()
hasFilter (line 833)

Determine if a given filter has already been registered

  • access: public
bool hasFilter (string $name)
  • string $name
hasValidator (line 459)

Determine if a given validator has already been registered

  • access: public
bool hasValidator (string $name)
  • string $name
isFiltered (line 165)

Has the file been filtered ?

  • abstract:
  • access: public
bool isFiltered ([array|string|null $files = null])
  • array|string|null $files

Redefined in descendants as:
isReceived (line 149)

Is file received?

  • abstract:
  • access: public
bool isReceived ([array|string|null $files = null])
  • array|string|null $files

Redefined in descendants as:
isSent (line 141)

Is file sent?

  • abstract:
  • access: public
bool isSent ([array|string|null $files = null])
  • array|string|null $files

Redefined in descendants as:
isUploaded (line 157)

Has a file been uploaded ?

  • abstract:
  • access: public
bool isUploaded ([array|string|null $files = null])
  • array|string|null $files

Redefined in descendants as:
isValid (line 617)

Checks if the files are valid

  • return: True if all checks are valid
  • access: public
boolean isValid ([string|array $files = null])
  • string|array $files: (Optional) Files to check

Redefined in descendants as:
receive (line 133)

Receive file

  • abstract:
  • access: public
bool receive ([mixed $options = null])
  • mixed $options

Redefined in descendants as:
removeFilter (line 888)

Remove an individual filter

  • access: public
Zend_File_Transfer_Adapter_Abstract removeFilter (string $name)
  • string $name
removeValidator (line 513)

Remove an individual validator

  • access: public
Zend_File_Transfer_Adapter_Abstract removeValidator (string $name)
  • string $name

Redefined in descendants as:
send (line 125)

Send file

  • abstract:
  • access: public
bool send ([mixed $options = null])
  • mixed $options

Redefined in descendants as:
setDestination (line 1029)

Sets a new destination for the given files

  • deprecated: Will be changed to be a filter!!!
  • throws: Zend_File_Transfer_Exception when the given destination is not a directory or does not exist
  • access: public
Zend_File_Transfer_Abstract setDestination (string $destination, [string|array $files = null])
  • string $destination: New destination directory
  • string|array $files: Files to set the new destination for
setDisableTranslator (line 1142)

Indicate whether or not translation should be disabled

  • access: public
Zend_File_Transfer_Abstract setDisableTranslator (bool $flag)
  • bool $flag
setFilters (line 821)

Sets a filter for the class, erasing all previous set

  • access: public
Zend_File_Transfer_Adapter setFilters ( $filters, [string|array $files = null], string|array $filter)
  • string|array $filter: Filter to set
  • string|array $files: Files to limit this filter to
  • array $filters
setOptions (line 559)

Sets Options for adapters

  • access: public
void setOptions ([array $options = array()], [array $files = null])
  • array $options: Options to set
  • array $files: (Optional) Files to set the options for
setPluginLoader (line 186)

Set plugin loader to use for validator or filter chain

  • throws: Zend_File_Transfer_Exception on invalid type
  • access: public
Zend_File_Transfer_Adapter_Abstract setPluginLoader ( $loader, string $type)
setTranslator (line 1106)

Set translator object for localization

  • access: public
Zend_File_Transfer_Abstract setTranslator ([Zend_Translate|null $translator = null])
setValidators (line 447)

Sets a validator for the class, erasing all previous set

  • access: public
Zend_File_Transfer_Adapter setValidators ( $validators, [string|array $files = null], string|array $validator)
  • string|array $validator: Validator to set
  • string|array $files: Files to limit this validator to
  • array $validators

Redefined in descendants as:
translatorIsDisabled (line 1153)

Is translation disabled?

  • access: public
bool translatorIsDisabled ()
_detectFileSize (line 1232)

Internal method to detect the size of a file

  • return: Filesize of given file
  • access: protected
string _detectFileSize (array $value)
  • array $value: File infos
_detectMimeType (line 1281)

Internal method to detect the mime type of a file

  • return: Mimetype of given file
  • access: protected
string _detectMimeType (array $value)
  • array $value: File infos
_filter (line 1342)

Internal function to filter all given files

  • return: False on error
  • access: protected
boolean _filter ([string|array $files = null])
  • string|array $files: (Optional) Files to check
_getFiles (line 1456)

Returns found files based on internal file array and given files

  • return: Found files
  • throws: Zend_File_Transfer_Exception On false filename
  • access: protected
array _getFiles (string|array $files, [boolean $names = false], [boolean $noexception = false])
  • string|array $files: (Optional) Files to return
  • boolean $names: (Optional) Returns only names on true, else complete info
  • boolean $noexception: (Optional) Allows throwing an exception, otherwise returns an empty array
_getFilterIdentifier (line 1549)

Retrieve internal identifier for a named filter

  • access: protected
string _getFilterIdentifier (string $name)
  • string $name
_getTmpDir (line 1374)

Determine system TMP directory and detect if we have read access

  • throws: Zend_File_Transfer_Exception if unable to determine directory
  • access: protected
string _getTmpDir ()
_getValidatorIdentifier (line 1528)

Retrieve internal identifier for a named validator

  • access: protected
string _getValidatorIdentifier (string $name)
  • string $name
_isPathWriteable (line 1427)

Tries to detect if we can read and write to the given path

  • access: protected
void _isPathWriteable (string $path)
  • string $path
Class Constants
FILTER = 'FILTER' (line 35)
VALIDATE = 'VALIDATE' (line 36)

Documentation generated on Mon, 21 Jun 2010 15:05:42 -0400 by phpDocumentor 1.4.3