Removing deprecated validator functions on Upload

Use Upload_Validator instead.
This commit is contained in:
Sean Harvey 2012-11-15 11:13:47 +13:00
parent 9eca2d676f
commit e52db56ac8

View File

@ -221,88 +221,6 @@ class Upload extends Controller {
$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()})
*/