__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <[email protected]> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\Exception\ConstraintDefinitionException; /** * @Annotation * @Target({"PROPERTY", "METHOD", "ANNOTATION"}) * * @property int $maxSize * * @author Bernhard Schussek <[email protected]> */ #[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class File extends Constraint { // Check the Image constraint for clashes if adding new constants here public const NOT_FOUND_ERROR = 'd2a3fb6e-7ddc-4210-8fbf-2ab345ce1998'; public const NOT_READABLE_ERROR = 'c20c92a4-5bfa-4202-9477-28e800e0f6ff'; public const EMPTY_ERROR = '5d743385-9775-4aa5-8ff5-495fb1e60137'; public const TOO_LARGE_ERROR = 'df8637af-d466-48c6-a59d-e7126250a654'; public const INVALID_MIME_TYPE_ERROR = '744f00bc-4389-4c74-92de-9a43cde55534'; public const INVALID_EXTENSION_ERROR = 'c8c7315c-6186-4719-8b71-5659e16bdcb7'; public const FILENAME_TOO_LONG = 'e5706483-91a8-49d8-9a59-5e81a3c634a8'; protected const ERROR_NAMES = [ self::NOT_FOUND_ERROR => 'NOT_FOUND_ERROR', self::NOT_READABLE_ERROR => 'NOT_READABLE_ERROR', self::EMPTY_ERROR => 'EMPTY_ERROR', self::TOO_LARGE_ERROR => 'TOO_LARGE_ERROR', self::INVALID_MIME_TYPE_ERROR => 'INVALID_MIME_TYPE_ERROR', self::INVALID_EXTENSION_ERROR => 'INVALID_EXTENSION_ERROR', self::FILENAME_TOO_LONG => 'FILENAME_TOO_LONG', ]; /** * @deprecated since Symfony 6.1, use const ERROR_NAMES instead */ protected static $errorNames = self::ERROR_NAMES; public $binaryFormat; public $mimeTypes = []; public ?int $filenameMaxLength = null; public array|string|null $extensions = []; public $notFoundMessage = 'The file could not be found.'; public $notReadableMessage = 'The file is not readable.'; public $maxSizeMessage = 'The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}.'; public $mimeTypesMessage = 'The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}.'; public string $extensionsMessage = 'The extension of the file is invalid ({{ extension }}). Allowed extensions are {{ extensions }}.'; public $disallowEmptyMessage = 'An empty file is not allowed.'; public $filenameTooLongMessage = 'The filename is too long. It should have {{ filename_max_length }} character or less.|The filename is too long. It should have {{ filename_max_length }} characters or less.'; public $uploadIniSizeErrorMessage = 'The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}.'; 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.'; protected $maxSize; /** * @param array<string|string[]>|string $extensions */ public function __construct( ?array $options = null, int|string|null $maxSize = null, ?bool $binaryFormat = null, array|string|null $mimeTypes = null, ?int $filenameMaxLength = null, ?string $notFoundMessage = null, ?string $notReadableMessage = null, ?string $maxSizeMessage = null, ?string $mimeTypesMessage = null, ?string $disallowEmptyMessage = null, ?string $filenameTooLongMessage = null, ?string $uploadIniSizeErrorMessage = null, ?string $uploadFormSizeErrorMessage = null, ?string $uploadPartialErrorMessage = null, ?string $uploadNoFileErrorMessage = null, ?string $uploadNoTmpDirErrorMessage = null, ?string $uploadCantWriteErrorMessage = null, ?string $uploadExtensionErrorMessage = null, ?string $uploadErrorMessage = null, ?array $groups = null, mixed $payload = null, array|string|null $extensions = null, ?string $extensionsMessage = null, ) { parent::__construct($options, $groups, $payload); $this->maxSize = $maxSize ?? $this->maxSize; $this->binaryFormat = $binaryFormat ?? $this->binaryFormat; $this->mimeTypes = $mimeTypes ?? $this->mimeTypes; $this->filenameMaxLength = $filenameMaxLength ?? $this->filenameMaxLength; $this->extensions = $extensions ?? $this->extensions; $this->notFoundMessage = $notFoundMessage ?? $this->notFoundMessage; $this->notReadableMessage = $notReadableMessage ?? $this->notReadableMessage; $this->maxSizeMessage = $maxSizeMessage ?? $this->maxSizeMessage; $this->mimeTypesMessage = $mimeTypesMessage ?? $this->mimeTypesMessage; $this->extensionsMessage = $extensionsMessage ?? $this->extensionsMessage; $this->disallowEmptyMessage = $disallowEmptyMessage ?? $this->disallowEmptyMessage; $this->filenameTooLongMessage = $filenameTooLongMessage ?? $this->filenameTooLongMessage; $this->uploadIniSizeErrorMessage = $uploadIniSizeErrorMessage ?? $this->uploadIniSizeErrorMessage; $this->uploadFormSizeErrorMessage = $uploadFormSizeErrorMessage ?? $this->uploadFormSizeErrorMessage; $this->uploadPartialErrorMessage = $uploadPartialErrorMessage ?? $this->uploadPartialErrorMessage; $this->uploadNoFileErrorMessage = $uploadNoFileErrorMessage ?? $this->uploadNoFileErrorMessage; $this->uploadNoTmpDirErrorMessage = $uploadNoTmpDirErrorMessage ?? $this->uploadNoTmpDirErrorMessage; $this->uploadCantWriteErrorMessage = $uploadCantWriteErrorMessage ?? $this->uploadCantWriteErrorMessage; $this->uploadExtensionErrorMessage = $uploadExtensionErrorMessage ?? $this->uploadExtensionErrorMessage; $this->uploadErrorMessage = $uploadErrorMessage ?? $this->uploadErrorMessage; if (null !== $this->maxSize) { $this->normalizeBinaryFormat($this->maxSize); } } /** * @return void */ public function __set(string $option, mixed $value) { if ('maxSize' === $option) { $this->normalizeBinaryFormat($value); return; } parent::__set($option, $value); } public function __get(string $option): mixed { if ('maxSize' === $option) { return $this->maxSize; } return parent::__get($option); } public function __isset(string $option): bool { if ('maxSize' === $option) { return true; } return parent::__isset($option); } private function normalizeBinaryFormat(int|string $maxSize): void { $factors = [ 'k' => 1000, 'ki' => 1 << 10, 'm' => 1000 * 1000, 'mi' => 1 << 20, 'g' => 1000 * 1000 * 1000, 'gi' => 1 << 30, ]; if (ctype_digit((string) $maxSize)) { $this->maxSize = (int) $maxSize; $this->binaryFormat ??= false; } elseif (preg_match('/^(\d++)('.implode('|', array_keys($factors)).')$/i', $maxSize, $matches)) { $this->maxSize = $matches[1] * $factors[$unit = strtolower($matches[2])]; $this->binaryFormat ??= 2 === \strlen($unit); } else { throw new ConstraintDefinitionException(sprintf('"%s" is not a valid maximum size.', $maxSize)); } } }
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| AbstractComparison.php | File | 2.19 KB | 0664 |
|
| AbstractComparisonValidator.php | File | 4.1 KB | 0664 |
|
| All.php | File | 1.02 KB | 0664 |
|
| AllValidator.php | File | 1.31 KB | 0664 |
|
| AtLeastOneOf.php | File | 1.93 KB | 0664 |
|
| AtLeastOneOfValidator.php | File | 2.54 KB | 0664 |
|
| Bic.php | File | 3.29 KB | 0664 |
|
| BicValidator.php | File | 6.13 KB | 0664 |
|
| Blank.php | File | 1.19 KB | 0664 |
|
| BlankValidator.php | File | 1.07 KB | 0664 |
|
| Callback.php | File | 1.58 KB | 0664 |
|
| CallbackValidator.php | File | 2.09 KB | 0664 |
|
| CardScheme.php | File | 2.28 KB | 0664 |
|
| CardSchemeValidator.php | File | 5.01 KB | 0664 |
|
| Cascade.php | File | 1.26 KB | 0664 |
|
| Choice.php | File | 3.12 KB | 0664 |
|
| ChoiceValidator.php | File | 4.37 KB | 0664 |
|
| Cidr.php | File | 2.78 KB | 0664 |
|
| CidrValidator.php | File | 2.32 KB | 0664 |
|
| Collection.php | File | 3.7 KB | 0664 |
|
| CollectionValidator.php | File | 3.4 KB | 0664 |
|
| Composite.php | File | 5.44 KB | 0664 |
|
| Compound.php | File | 1.39 KB | 0664 |
|
| CompoundValidator.php | File | 1002 B | 0664 |
|
| Count.php | File | 3.5 KB | 0664 |
|
| CountValidator.php | File | 2.8 KB | 0664 |
|
| Country.php | File | 1.64 KB | 0664 |
|
| CountryValidator.php | File | 1.55 KB | 0664 |
|
| CssColor.php | File | 3.7 KB | 0664 |
|
| CssColorValidator.php | File | 5.36 KB | 0664 |
|
| Currency.php | File | 1.56 KB | 0664 |
|
| CurrencyValidator.php | File | 1.54 KB | 0664 |
|
| Date.php | File | 1.33 KB | 0664 |
|
| DateTime.php | File | 1.8 KB | 0664 |
|
| DateTimeValidator.php | File | 2.71 KB | 0664 |
|
| DateValidator.php | File | 2.12 KB | 0664 |
|
| DisableAutoMapping.php | File | 1.27 KB | 0664 |
|
| DivisibleBy.php | File | 956 B | 0664 |
|
| DivisibleByValidator.php | File | 1.52 KB | 0664 |
|
| Email.php | File | 3.45 KB | 0664 |
|
| EmailValidator.php | File | 4.79 KB | 0664 |
|
| EnableAutoMapping.php | File | 1.27 KB | 0664 |
|
| EqualTo.php | File | 999 B | 0664 |
|
| EqualToValidator.php | File | 723 B | 0664 |
|
| Existence.php | File | 612 B | 0664 |
|
| Expression.php | File | 2.63 KB | 0664 |
|
| ExpressionLanguageProvider.php | File | 1.09 KB | 0664 |
|
| ExpressionLanguageSyntax.php | File | 1.84 KB | 0664 |
|
| ExpressionLanguageSyntaxValidator.php | File | 2.37 KB | 0664 |
|
| ExpressionSyntax.php | File | 1.44 KB | 0664 |
|
| ExpressionSyntaxValidator.php | File | 1.92 KB | 0664 |
|
| ExpressionValidator.php | File | 2.05 KB | 0664 |
|
| File.php | File | 7.84 KB | 0664 |
|
| FileValidator.php | File | 11.92 KB | 0664 |
|
| GreaterThan.php | File | 1001 B | 0664 |
|
| GreaterThanOrEqual.php | File | 1020 B | 0664 |
|
| GreaterThanOrEqualValidator.php | File | 795 B | 0664 |
|
| GreaterThanValidator.php | File | 767 B | 0664 |
|
| GroupSequence.php | File | 2.62 KB | 0664 |
|
| GroupSequenceProvider.php | File | 790 B | 0664 |
|
| Hostname.php | File | 1.37 KB | 0664 |
|
| HostnameValidator.php | File | 2.03 KB | 0664 |
|
| Iban.php | File | 1.92 KB | 0664 |
|
| IbanValidator.php | File | 12.93 KB | 0664 |
|
| IdenticalTo.php | File | 1.02 KB | 0664 |
|
| IdenticalToValidator.php | File | 741 B | 0664 |
|
| Image.php | File | 9.63 KB | 0664 |
|
| ImageValidator.php | File | 9.21 KB | 0664 |
|
| Ip.php | File | 3.32 KB | 0664 |
|
| IpValidator.php | File | 2.48 KB | 0664 |
|
| IsFalse.php | File | 1.19 KB | 0664 |
|
| IsFalseValidator.php | File | 1.12 KB | 0664 |
|
| IsNull.php | File | 1.19 KB | 0664 |
|
| IsNullValidator.php | File | 1.05 KB | 0664 |
|
| IsTrue.php | File | 1.19 KB | 0664 |
|
| IsTrueValidator.php | File | 1.11 KB | 0664 |
|
| Isbn.php | File | 2.78 KB | 0664 |
|
| IsbnValidator.php | File | 5.55 KB | 0664 |
|
| Isin.php | File | 1.65 KB | 0664 |
|
| IsinValidator.php | File | 2.46 KB | 0664 |
|
| Issn.php | File | 2.24 KB | 0664 |
|
| IssnValidator.php | File | 4.07 KB | 0664 |
|
| Json.php | File | 1.19 KB | 0664 |
|
| JsonValidator.php | File | 1.37 KB | 0664 |
|
| Language.php | File | 1.65 KB | 0664 |
|
| LanguageValidator.php | File | 1.55 KB | 0664 |
|
| Length.php | File | 4.64 KB | 0664 |
|
| LengthValidator.php | File | 3.73 KB | 0664 |
|
| LessThan.php | File | 998 B | 0664 |
|
| LessThanOrEqual.php | File | 1017 B | 0664 |
|
| LessThanOrEqualValidator.php | File | 787 B | 0664 |
|
| LessThanValidator.php | File | 759 B | 0664 |
|
| Locale.php | File | 1.66 KB | 0664 |
|
| LocaleValidator.php | File | 1.62 KB | 0664 |
|
| Luhn.php | File | 1.55 KB | 0664 |
|
| LuhnValidator.php | File | 3.15 KB | 0664 |
|
| Negative.php | File | 653 B | 0664 |
|
| NegativeOrZero.php | File | 681 B | 0664 |
|
| NoSuspiciousCharacters.php | File | 4.61 KB | 0664 |
|
| NoSuspiciousCharactersValidator.php | File | 4.17 KB | 0664 |
|
| NotBlank.php | File | 1.8 KB | 0664 |
|
| NotBlankValidator.php | File | 1.36 KB | 0664 |
|
| NotCompromisedPassword.php | File | 1.63 KB | 0664 |
|
| NotCompromisedPasswordValidator.php | File | 3.58 KB | 0664 |
|
| NotEqualTo.php | File | 1003 B | 0664 |
|
| NotEqualToValidator.php | File | 734 B | 0664 |
|
| NotIdenticalTo.php | File | 1.02 KB | 0664 |
|
| NotIdenticalToValidator.php | File | 749 B | 0664 |
|
| NotNull.php | File | 1.19 KB | 0664 |
|
| NotNullValidator.php | File | 1.06 KB | 0664 |
|
| Optional.php | File | 431 B | 0664 |
|
| PasswordStrength.php | File | 1.79 KB | 0664 |
|
| PasswordStrengthValidator.php | File | 3.06 KB | 0664 |
|
| Positive.php | File | 656 B | 0664 |
|
| PositiveOrZero.php | File | 684 B | 0664 |
|
| Range.php | File | 4.73 KB | 0664 |
|
| RangeValidator.php | File | 7.21 KB | 0664 |
|
| Regex.php | File | 3.92 KB | 0664 |
|
| RegexValidator.php | File | 1.71 KB | 0664 |
|
| Required.php | File | 431 B | 0664 |
|
| Sequentially.php | File | 1.35 KB | 0664 |
|
| SequentiallyValidator.php | File | 1.18 KB | 0664 |
|
| Time.php | File | 1.5 KB | 0664 |
|
| TimeValidator.php | File | 2.21 KB | 0664 |
|
| Timezone.php | File | 3.24 KB | 0664 |
|
| TimezoneValidator.php | File | 3.76 KB | 0664 |
|
| Traverse.php | File | 1.1 KB | 0664 |
|
| Type.php | File | 1.6 KB | 0664 |
|
| TypeValidator.php | File | 2.92 KB | 0664 |
|
| Ulid.php | File | 1.56 KB | 0664 |
|
| UlidValidator.php | File | 2.37 KB | 0664 |
|
| Unique.php | File | 1.96 KB | 0664 |
|
| UniqueValidator.php | File | 2.46 KB | 0664 |
|
| Url.php | File | 1.97 KB | 0664 |
|
| UrlValidator.php | File | 4.81 KB | 0664 |
|
| Uuid.php | File | 3.93 KB | 0664 |
|
| UuidValidator.php | File | 8.51 KB | 0664 |
|
| Valid.php | File | 1.29 KB | 0664 |
|
| ValidValidator.php | File | 1.02 KB | 0664 |
|
| When.php | File | 2.23 KB | 0664 |
|
| WhenValidator.php | File | 1.72 KB | 0664 |
|
| ZeroComparisonConstraintTrait.php | File | 1.23 KB | 0664 |
|