cakephp/cakephp — pull request #4449 by lorenzo (2014-08-31 15:59:23+00:00)
Title: 3.0 cleaner validation

This introduces a breaking change in the validation class and also remove its dependency to the File class.

This removes the ability to `localize` validation via having external validation classes. I always felt that was the wrong solution to the problem and it is one that I have never used myself. The alternatives in 3.0 are much nicer, when using the `Validator` class and injecting providers. For example:

```php

class FrValidation {
...
}

$validator->provider('localized', new FrValidation);
$validator->add('phone', 'french_phone' ['rule' => 'phone', 'provider' => 'french']);
```
There is also the possibility of completely swapping the default Validation class as a provider and inject your localized validation methods there.

Removing the usage of file makes for better exception messages and also more secure validation. As the File class is too helpful trying to guess the file mimetype, this is not something you'd want while validating use input. The `mimetype()` validation function will now use `fileinfo` or fail.