From 2cced6a4a5423e70ade817068432854d8b8fb24a Mon Sep 17 00:00:00 2001 From: Ramon Gutierrez Date: Wed, 10 Jan 2018 04:28:21 +0800 Subject: [PATCH] Add validation component to symfony --- composer.json | 1 + composer.lock | 154 ++++++++++++++++++++++++++++++- config/packages/translation.yaml | 7 ++ config/services.yaml | 1 + symfony.lock | 12 +++ translations/.gitignore | 0 6 files changed, 174 insertions(+), 1 deletion(-) create mode 100644 config/packages/translation.yaml create mode 100644 translations/.gitignore diff --git a/composer.json b/composer.json index 4b4704bc..441ffb48 100644 --- a/composer.json +++ b/composer.json @@ -15,6 +15,7 @@ "symfony/profiler-pack": "^1.0", "symfony/security-bundle": "^4.0", "symfony/twig-bundle": "^4.0", + "symfony/validator": "^4.0", "symfony/yaml": "^4.0" }, "require-dev": { diff --git a/composer.lock b/composer.lock index 0557ff40..484da244 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "ae93696c5d16286657ac856844efd058", + "content-hash": "fbadcd66cd0e9e22f1a2a16996a31d2a", "packages": [ { "name": "doctrine/annotations", @@ -2942,6 +2942,74 @@ "homepage": "https://symfony.com", "time": "2017-11-09T12:45:29+00:00" }, + { + "name": "symfony/translation", + "version": "v4.0.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/translation.git", + "reference": "2bb1b9dac38d32c5afb00edc9371b5db4cf6d000" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/translation/zipball/2bb1b9dac38d32c5afb00edc9371b5db4cf6d000", + "reference": "2bb1b9dac38d32c5afb00edc9371b5db4cf6d000", + "shasum": "" + }, + "require": { + "php": "^7.1.3", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/config": "<3.4", + "symfony/dependency-injection": "<3.4", + "symfony/yaml": "<3.4" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "~3.4|~4.0", + "symfony/dependency-injection": "~3.4|~4.0", + "symfony/finder": "~2.8|~3.0|~4.0", + "symfony/intl": "~3.4|~4.0", + "symfony/yaml": "~3.4|~4.0" + }, + "suggest": { + "psr/log": "To use logging capability in translator", + "symfony/config": "", + "symfony/yaml": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Translation\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Translation Component", + "homepage": "https://symfony.com", + "time": "2018-01-03T07:38:00+00:00" + }, { "name": "symfony/twig-bridge", "version": "v4.0.2", @@ -3105,6 +3173,90 @@ "homepage": "https://symfony.com", "time": "2017-12-04T12:31:58+00:00" }, + { + "name": "symfony/validator", + "version": "v4.0.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/validator.git", + "reference": "dac55edb2d1a59026d2e51a04def7f9a1f19f365" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/validator/zipball/dac55edb2d1a59026d2e51a04def7f9a1f19f365", + "reference": "dac55edb2d1a59026d2e51a04def7f9a1f19f365", + "shasum": "" + }, + "require": { + "php": "^7.1.3", + "symfony/polyfill-mbstring": "~1.0", + "symfony/translation": "~3.4|~4.0" + }, + "conflict": { + "phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0", + "symfony/dependency-injection": "<3.4", + "symfony/http-kernel": "<3.4", + "symfony/yaml": "<3.4" + }, + "require-dev": { + "doctrine/annotations": "~1.0", + "doctrine/cache": "~1.0", + "egulias/email-validator": "^1.2.8|~2.0", + "symfony/cache": "~3.4|~4.0", + "symfony/config": "~3.4|~4.0", + "symfony/dependency-injection": "~3.4|~4.0", + "symfony/expression-language": "~3.4|~4.0", + "symfony/http-foundation": "~3.4|~4.0", + "symfony/http-kernel": "~3.4|~4.0", + "symfony/intl": "~3.4|~4.0", + "symfony/property-access": "~3.4|~4.0", + "symfony/var-dumper": "~3.4|~4.0", + "symfony/yaml": "~3.4|~4.0" + }, + "suggest": { + "doctrine/annotations": "For using the annotation mapping. You will also need doctrine/cache.", + "doctrine/cache": "For using the default cached annotation reader and metadata cache.", + "egulias/email-validator": "Strict (RFC compliant) email validation", + "psr/cache-implementation": "For using the metadata cache.", + "symfony/config": "", + "symfony/expression-language": "For using the Expression validator", + "symfony/http-foundation": "", + "symfony/intl": "", + "symfony/property-access": "For accessing properties within comparison constraints", + "symfony/yaml": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Validator\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Validator Component", + "homepage": "https://symfony.com", + "time": "2018-01-03T17:15:19+00:00" + }, { "name": "symfony/var-dumper", "version": "v4.0.2", diff --git a/config/packages/translation.yaml b/config/packages/translation.yaml new file mode 100644 index 00000000..1edfbe23 --- /dev/null +++ b/config/packages/translation.yaml @@ -0,0 +1,7 @@ +framework: + default_locale: '%locale%' + translator: + paths: + - '%kernel.project_dir%/translations' + fallbacks: + - '%locale%' diff --git a/config/services.yaml b/config/services.yaml index b2fb58f4..73566498 100644 --- a/config/services.yaml +++ b/config/services.yaml @@ -1,6 +1,7 @@ # Put parameters here that don't need to change on each machine where the app is deployed # https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration parameters: + locale: 'en' services: # default configuration for services in *this* file diff --git a/symfony.lock b/symfony.lock index e82e3c10..2b2eb0e8 100644 --- a/symfony.lock +++ b/symfony.lock @@ -212,6 +212,15 @@ "symfony/stopwatch": { "version": "v4.0.2" }, + "symfony/translation": { + "version": "3.3", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "master", + "version": "3.3", + "ref": "6bcd6c570c017ea6ae5a7a6a027c929fd3542cd8" + } + }, "symfony/twig-bridge": { "version": "v4.0.2" }, @@ -224,6 +233,9 @@ "ref": "f75ac166398e107796ca94cc57fa1edaa06ec47f" } }, + "symfony/validator": { + "version": "v4.0.3" + }, "symfony/var-dumper": { "version": "v4.0.2" }, diff --git a/translations/.gitignore b/translations/.gitignore new file mode 100644 index 00000000..e69de29b