Use Injector to create default Upload_Validator instance

Allows this class to be swapped out with a custom Upload_Validator
globally, without having to call Upload::setValidator() everywhere.
This commit is contained in:
Sean Harvey 2014-07-28 16:28:38 +12:00
parent f7a9005a8e
commit 5491a5dadc

View File

@ -74,7 +74,7 @@ class Upload extends Controller {
public function __construct() {
parent::__construct();
$this->validator = new Upload_Validator();
$this->validator = Injector::inst()->create('Upload_Validator');
$this->replaceFile = self::config()->replaceFile;
}