Zend Framework
LICENSE
This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.
Abstract class for file transfers (Downloads and Uploads)
array $_break = 'array'
Internal list of breaks
array $_files = 'array'
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 ))
array $_filters = 'array'
Internal list of filters
array $_loaders = 'array'
Plugin loaders for filter and validation chains
array $_messages = 'array'
Internal list of messages
$_options = 'array'
Available options for file transfers
string $_tmpDir = ''
TMP directory
Zend_Translate $_translator = ''
bool $_translatorDisabled = 'false'
Is translation disabled?
array $_validators = 'array'
Internal list of validators
_detectFileSize(
array $value
)
:
string
Internal method to detect the size of a file
_detectMimeType(
array $value
)
:
string
Internal method to detect the mime type of a file
_filter(
string|array $files
=
null
)
:
boolean
Internal function to filter all given files
_getFiles(
string|array $files, boolean $names
=
false, boolean $noexception
=
false
)
:
array
Returns found files based on internal file array and given files
_getFilterIdentifier(
string $name
)
:
string
Retrieve internal identifier for a named filter
_getTmpDir(
)
:
string
Determine system TMP directory and detect if we have read access
_getValidatorIdentifier(
string $name
)
:
string
Retrieve internal identifier for a named validator
_isPathWriteable(
string $path
)
:
Tries to detect if we can read and write to the given path
_toByteString(
integer $size
)
:
string
Returns the formatted size
addFile(
string|array $file, string|array $validator
=
null, string|array $filter
=
null
)
:
Zend_File_Transfer_Adapter_Abstract
Adds one or more files
addFilter(
string|array $filter, string|array $options
=
null, string|array $files
=
null
)
:
Zend_File_Transfer_Adapter
Adds a new filter for this class
addFilters(
array $filters, string|array $files
=
null
)
:
Zend_File_Transfer_Adapter_Abstract
Add Multiple filters at once
addPrefixPath(
string $prefix, string $path, string $type
=
null
)
:
Zend_File_Transfer_Adapter_Abstract
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.
addPrefixPaths(
array $spec
)
:
Zend_File_Transfer_Exception
Add many prefix paths at once
addType(
string|array $type, string|array $validator
=
null, string|array $filter
=
null
)
:
Zend_File_Transfer_Adapter_Abstract
Adds one or more type of files
addValidator(
string|array $validator, boolean $breakChainOnFailure
=
false, string|array $options
=
null, string|array $files
=
null
)
:
Zend_File_Transfer_Adapter
Adds a new validator for this class
addValidators(
array $validators, string|array $files
=
null
)
:
Zend_File_Transfer_Adapter_Abstract
Add Multiple validators at once
clearFilters(
)
:
Zend_File_Transfer_Adapter_Abstract
Remove all filters
clearValidators(
)
:
Zend_File_Transfer_Adapter_Abstract
Remove all validators
getDestination(
null|string|array $files
=
null
)
:
null|string|array
Retrieve destination directory value
getErrors(
)
:
array
Retrieve error codes
getFile(
)
:
array
Returns all set files
getFileInfo(
string $file
=
null
)
:
array
Retrieve additional internal file informations for files
getFileName(
$file
=
null, boolean $path
=
true
)
:
string|array
Retrieves the filename of transferred files.
getFileSize(
string|array $files
=
null
)
:
string|array
Returns the real filesize of the file
getFilter(
string $name
)
:
Zend_Filter_Interface|null
Retrieve individual filter
getFilters(
string|array $files
=
null
)
:
array
Returns all set filters
getHash(
string $hash
=
crc32, string|array $files
=
null
)
:
string|array
Returns the hash for a given file
getMessages(
)
:
array
Returns found validation messages
getMimeType(
string|array $files
=
null
)
:
string|array
Returns the real mimetype of the file Uses fileinfo, when not available mime_magic and as last fallback a manual given mimetype
getOptions(
array $files
=
null
)
:
array
Returns set options for adapters or files
getPluginLoader(
string $type
)
:
Zend_Loader_PluginLoader
Retrieve plugin loader for validator or filter chain
Instantiates with default rules if none available for that type. Use 'filter' or 'validate' for $type.
getProgress(
)
:
float
Retrieve progress of transfer
getTranslator(
)
:
Zend_Translate_Adapter|null
Retrieve localization translator object
getType(
)
:
array
Returns all set types
getValidator(
string $name
)
:
Zend_Validate_Interface|null
Retrieve individual validator
getValidators(
string|array $files
=
null
)
:
null|array
Returns all set validators
hasErrors(
)
:
boolean
Are there errors registered?
hasFilter(
string $name
)
:
bool
Determine if a given filter has already been registered
hasValidator(
string $name
)
:
bool
Determine if a given validator has already been registered
isFiltered(
array|string|null $files
=
null
)
:
bool
Has the file been filtered ?
isReceived(
array|string|null $files
=
null
)
:
bool
Is file received?
isSent(
array|string|null $files
=
null
)
:
bool
Is file sent?
isUploaded(
array|string|null $files
=
null
)
:
bool
Has a file been uploaded ?
isValid(
string|array $files
=
null
)
:
boolean
Checks if the files are valid
receive(
mixed $options
=
null
)
:
bool
Receive file
removeFilter(
string $name
)
:
Zend_File_Transfer_Adapter_Abstract
Remove an individual filter
removeValidator(
string $name
)
:
Zend_File_Transfer_Adapter_Abstract
Remove an individual validator
send(
mixed $options
=
null
)
:
bool
Send file
setDestination(
string $destination, string|array $files
=
null
)
:
Zend_File_Transfer_Abstract
Sets a new destination for the given files
setDisableTranslator(
bool $flag
)
:
Zend_File_Transfer_Abstract
Indicate whether or not translation should be disabled
setFilters(
$filters, string|array $files
=
null
)
:
Zend_File_Transfer_Adapter
Sets a filter for the class, erasing all previous set
setOptions(
array $options
=
array, array $files
=
null
)
:
Sets Options for adapters
setPluginLoader(
Zend_Loader_PluginLoader_Interface $loader, string $type
)
:
Zend_File_Transfer_Adapter_Abstract
Set plugin loader to use for validator or filter chain
setTranslator(
Zend_Translate|null $translator
=
null
)
:
Zend_File_Transfer_Abstract
Set translator object for localization
setValidators(
$validators, string|array $files
=
null
)
:
Zend_File_Transfer_Adapter
Sets a validator for the class, erasing all previous set
translatorIsDisabled(
)
:
bool
Is translation disabled?