Skip to content

Commit

Permalink
Removing deprecated validator functions on Upload
Browse files Browse the repository at this point in the history
Use Upload_Validator instead.
  • Loading branch information
Sean Harvey committed Nov 15, 2012
1 parent 9eca2d6 commit e52db56
Showing 1 changed file with 0 additions and 82 deletions.
82 changes: 0 additions & 82 deletions filesystem/Upload.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,88 +221,6 @@ public function setFile($file) {
$this->file = $file;
}

/**
* Get maximum file size for all or specified file extension.
*
* @deprecated 2.5 Please use Upload_Validator::getAllowedMaxFileSize() instead
*
* @param string $ext
* @return int Filesize in bytes
*/
public function getAllowedMaxFileSize($ext = null) {
Deprecation::notice('2.5', 'Use Upload_Validator::getAllowedMaxFileSize() instead.');
return $this->validator->getAllowedMaxFileSize($ext);
}

/**
* Set filesize maximums (in bytes).
* Automatically converts extensions to lowercase
* for easier matching.
*
* Example:
* <code>
* array('*' => 200, 'jpg' => 1000)
* </code>
*
* @deprecated 2.5 Please use Upload_Validator::setAllowedMaxFileSize() instead
*
* @param array|int $rules
*/
public function setAllowedMaxFileSize($rules) {
Deprecation::notice('2.5', 'Use Upload_Validator::setAllowedMaxFileSize() instead.');
$this->validator->setAllowedMaxFileSize($rules);
}

/**
* @deprecated 2.5 Please use Upload_Validator::getAllowedExtensions() instead
* @return array
*/
public function getAllowedExtensions() {
Deprecation::notice('2.5', 'Use Upload_Validator::getAllowedExtensions() instead.');
return $this->validator->getAllowedExtensions();
}

/**
* @deprecated 2.5 Please use Upload_Validator::setAllowedExtensions() instead
* @param array $rules
*/
public function setAllowedExtensions($rules) {
Deprecation::notice('2.5', 'Use Upload_Validator::setAllowedExtensions() instead.');
$this->validator->setAllowedExtensions($rules);
}

/**
* Determines if the bytesize of an uploaded
* file is valid - can be defined on an
* extension-by-extension basis in {$allowedMaxFileSize}
*
* @deprecated 2.5 Please use Upload_Validator::isValidExtension() instead
*
* @param array $tmpFile
* @return boolean
*/
public function isValidSize($tmpFile) {
Deprecation::notice('2.5', 'Use Upload_Validator::isValidSize() instead.');
$validator = new Upload_Validator();
$validator->setTmpFile($tmpFile);
return $validator->isValidSize();
}

/**
* Determines if the temporary file has a valid extension
*
* @deprecated 2.5 Please use Upload_Validator::isValidExtension() instead
*
* @param array $tmpFile
* @return boolean
*/
public function isValidExtension($tmpFile) {
Deprecation::notice('2.5', 'Use Upload_Validator::isValidExtension() instead.');
$validator = new Upload_Validator();
$validator->setTmpFile($tmpFile);
return $validator->isValidExtension();
}

/**
* Clear out all errors (mostly set by {loadUploaded()})
*/
Expand Down

0 comments on commit e52db56

Please sign in to comment.