2010-06-24 09:40:05 +01:00
|
|
|
<?php
|
|
|
|
|
2010-10-02 11:42:31 +01:00
|
|
|
/*
|
2011-01-15 13:29:43 +00:00
|
|
|
* This file is part of the Symfony package.
|
2010-10-02 11:42:31 +01:00
|
|
|
*
|
2011-03-06 11:40:06 +00:00
|
|
|
* (c) Fabien Potencier <fabien@symfony.com>
|
2010-10-02 11:42:31 +01:00
|
|
|
*
|
2011-01-15 13:29:43 +00:00
|
|
|
* For the full copyright and license information, please view the LICENSE
|
|
|
|
* file that was distributed with this source code.
|
2010-10-02 11:42:31 +01:00
|
|
|
*/
|
|
|
|
|
2011-01-15 13:29:43 +00:00
|
|
|
namespace Symfony\Component\Validator\Constraints;
|
|
|
|
|
2011-05-19 08:34:54 +01:00
|
|
|
use Symfony\Component\Validator\Constraint;
|
|
|
|
|
2011-07-20 09:37:57 +01:00
|
|
|
/**
|
|
|
|
* @Annotation
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2011-05-19 08:34:54 +01:00
|
|
|
class File extends Constraint
|
2010-06-24 09:40:05 +01:00
|
|
|
{
|
2010-06-24 10:24:08 +01:00
|
|
|
public $maxSize = null;
|
|
|
|
public $mimeTypes = array();
|
2012-04-13 15:47:58 +01:00
|
|
|
public $notFoundMessage = 'The file could not be found.';
|
|
|
|
public $notReadableMessage = 'The file is not readable.';
|
|
|
|
public $maxSizeMessage = 'The file is too large ({{ size }}). Allowed maximum size is {{ limit }}.';
|
|
|
|
public $mimeTypesMessage = 'The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}.';
|
2011-07-05 19:05:01 +01:00
|
|
|
|
2012-04-13 15:47:58 +01:00
|
|
|
public $uploadIniSizeErrorMessage = 'The file is too large. Allowed maximum size is {{ limit }}.';
|
|
|
|
public $uploadFormSizeErrorMessage = 'The file is too large.';
|
|
|
|
public $uploadPartialErrorMessage = 'The file was only partially uploaded.';
|
|
|
|
public $uploadNoFileErrorMessage = 'No file was uploaded.';
|
|
|
|
public $uploadNoTmpDirErrorMessage = 'No temporary folder was configured in php.ini.';
|
|
|
|
public $uploadCantWriteErrorMessage = 'Cannot write temporary file to disk.';
|
|
|
|
public $uploadExtensionErrorMessage = 'A PHP extension caused the upload to fail.';
|
|
|
|
public $uploadErrorMessage = 'The file could not be uploaded.';
|
2010-06-24 09:40:05 +01:00
|
|
|
}
|