Moodle  2.2.1
http://www.collinsharper.com
Zend_Validate_File_Upload Class Reference
Inheritance diagram for Zend_Validate_File_Upload:
Collaboration diagram for Zend_Validate_File_Upload:

Public Member Functions

 __construct ($files=array())
 getFiles ($file=null)
 setFiles ($files=array())
 isValid ($value, $file=null)

Data Fields

const INI_SIZE = 'fileUploadErrorIniSize'
const FORM_SIZE = 'fileUploadErrorFormSize'
const PARTIAL = 'fileUploadErrorPartial'
const NO_FILE = 'fileUploadErrorNoFile'
const NO_TMP_DIR = 'fileUploadErrorNoTmpDir'
const CANT_WRITE = 'fileUploadErrorCantWrite'
const EXTENSION = 'fileUploadErrorExtension'
const ATTACK = 'fileUploadErrorAttack'
const FILE_NOT_FOUND = 'fileUploadErrorFileNotFound'
const UNKNOWN = 'fileUploadErrorUnknown'

Protected Member Functions

 _throw ($file, $errorType)

Protected Attributes

 $_messageTemplates
 $_files = array()

Detailed Description

Definition at line 35 of file Upload.php.


Constructor & Destructor Documentation

__construct ( files = array())

Sets validator options

The array $files must be given in syntax of Zend_File_Transfer to be checked If no files are given the $_FILES array will be used automatically. NOTE: This validator will only work with HTTP POST uploads!

Parameters:
array | Zend_Config$filesArray of files in syntax of Zend_File_Transfer
Returns:
void

Definition at line 84 of file Upload.php.

Here is the call graph for this function:


Member Function Documentation

_throw ( file,
errorType 
) [protected]

Throws an error of the given type

Parameters:
string$file
string$errorType
Returns:
false

Definition at line 235 of file Upload.php.

Here is the call graph for this function:

Here is the caller graph for this function:

getFiles ( file = null)

Returns the array of set files

Parameters:
string$files(Optional) The file to return in detail
Returns:
array
Exceptions:
Zend_Validate_ExceptionIf file is not found

Definition at line 100 of file Upload.php.

isValid ( value,
file = null 
)

Defined by Zend_Validate_Interface

Returns true if and only if the file was uploaded without errors

Parameters:
string$valueSingle file to check for upload errors, when giving null the $_FILES array from initialization will be used
Returns:
boolean

Definition at line 157 of file Upload.php.

Here is the call graph for this function:

setFiles ( files = array())

Sets the files to be checked

Parameters:
array$filesThe files to check in syntax of Zend_File_Transfer
Returns:
Zend_Validate_File_Upload Provides a fluent interface

Definition at line 131 of file Upload.php.

Here is the caller graph for this function:


Field Documentation

$_files = array() [protected]

Definition at line 72 of file Upload.php.

$_messageTemplates [protected]
Initial value:
 array(
        self::INI_SIZE       => "File '%value%' exceeds the defined ini size",
        self::FORM_SIZE      => "File '%value%' exceeds the defined form size",
        self::PARTIAL        => "File '%value%' was only partially uploaded",
        self::NO_FILE        => "File '%value%' was not uploaded",
        self::NO_TMP_DIR     => "No temporary directory was found for file '%value%'",
        self::CANT_WRITE     => "File '%value%' can't be written",
        self::EXTENSION      => "A PHP extension returned an error while uploading the file '%value%'",
        self::ATTACK         => "File '%value%' was illegally uploaded. This could be a possible attack",
        self::FILE_NOT_FOUND => "File '%value%' was not found",
        self::UNKNOWN        => "Unknown error while uploading file '%value%'"
    )

Reimplemented from Zend_Validate_Abstract.

Definition at line 55 of file Upload.php.

const ATTACK = 'fileUploadErrorAttack'

Definition at line 47 of file Upload.php.

const CANT_WRITE = 'fileUploadErrorCantWrite'

Definition at line 45 of file Upload.php.

const EXTENSION = 'fileUploadErrorExtension'

Definition at line 46 of file Upload.php.

const FILE_NOT_FOUND = 'fileUploadErrorFileNotFound'

Definition at line 48 of file Upload.php.

const FORM_SIZE = 'fileUploadErrorFormSize'

Definition at line 41 of file Upload.php.

const INI_SIZE = 'fileUploadErrorIniSize'

#+ string Error constants

Definition at line 40 of file Upload.php.

const NO_FILE = 'fileUploadErrorNoFile'

Definition at line 43 of file Upload.php.

const NO_TMP_DIR = 'fileUploadErrorNoTmpDir'

Definition at line 44 of file Upload.php.

const PARTIAL = 'fileUploadErrorPartial'

Definition at line 42 of file Upload.php.

const UNKNOWN = 'fileUploadErrorUnknown'

Definition at line 49 of file Upload.php.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations