From 5f0d83662cad94a10eb68f648432a5e3ebb49ab3 Mon Sep 17 00:00:00 2001 From: Michel Weimerskirch Date: Thu, 24 Feb 2011 04:30:23 -0800 Subject: [PATCH 1/3] Simplified EmailValidator using native PHP validation function. --- src/Symfony/Component/Validator/Constraints/EmailValidator.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Symfony/Component/Validator/Constraints/EmailValidator.php b/src/Symfony/Component/Validator/Constraints/EmailValidator.php index 0933a39de91f2..1532baaf648fa 100644 --- a/src/Symfony/Component/Validator/Constraints/EmailValidator.php +++ b/src/Symfony/Component/Validator/Constraints/EmailValidator.php @@ -17,7 +17,6 @@ class EmailValidator extends ConstraintValidator { - const PATTERN = '/^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i'; public function isValid($value, Constraint $constraint) { @@ -31,7 +30,7 @@ public function isValid($value, Constraint $constraint) $value = (string)$value; - if (!preg_match(self::PATTERN, $value)) { + if (!filter_var($value, FILTER_VALIDATE_EMAIL)) { $this->setMessage($constraint->message, array('{{ value }}' => $value)); return false; From 6998e593e0a116285db7ede9b2b94f0425f96cd8 Mon Sep 17 00:00:00 2001 From: Michel Weimerskirch Date: Thu, 24 Feb 2011 06:47:45 -0800 Subject: [PATCH 2/3] Added line number to TransChoiceTokenParser exception message (TwigBundle). --- .../Bundle/TwigBundle/TokenParser/TransChoiceTokenParser.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Bundle/TwigBundle/TokenParser/TransChoiceTokenParser.php b/src/Symfony/Bundle/TwigBundle/TokenParser/TransChoiceTokenParser.php index dce3d07034f62..c9f4fe6da83f2 100644 --- a/src/Symfony/Bundle/TwigBundle/TokenParser/TransChoiceTokenParser.php +++ b/src/Symfony/Bundle/TwigBundle/TokenParser/TransChoiceTokenParser.php @@ -55,7 +55,7 @@ public function parse(\Twig_Token $token) $body = $this->parser->subparse(array($this, 'decideTransChoiceFork'), true); if (!$body instanceof \Twig_Node_Text && !$body instanceof \Twig_Node_Expression) { - throw new \Twig_Error_Syntax('A message must be a simple text', -1); + throw new \Twig_Error_Syntax(sprintf('A message must be a simple text (line %s)', $lineno), -1); } $stream->expect(\Twig_Token::BLOCK_END_TYPE); From 1aa6257f00317b9533bf98dfec5fbc41b7c4a18f Mon Sep 17 00:00:00 2001 From: Michel Weimerskirch Date: Mon, 28 Feb 2011 15:41:09 -0800 Subject: [PATCH 3/3] Documentation corrected in EnsureProductionSettingsDoctrineCommand.php --- .../Command/EnsureProductionSettingsDoctrineCommand.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Bundle/DoctrineBundle/Command/EnsureProductionSettingsDoctrineCommand.php b/src/Symfony/Bundle/DoctrineBundle/Command/EnsureProductionSettingsDoctrineCommand.php index 1ff8cb08eeec8..33163ddf4ca3e 100644 --- a/src/Symfony/Bundle/DoctrineBundle/Command/EnsureProductionSettingsDoctrineCommand.php +++ b/src/Symfony/Bundle/DoctrineBundle/Command/EnsureProductionSettingsDoctrineCommand.php @@ -34,13 +34,13 @@ protected function configure() ->setName('doctrine:ensure-production-settings') ->addOption('em', null, InputOption::VALUE_OPTIONAL, 'The entity manager to use for this command.') ->setHelp(<<doctrine:cache:clear-metadata command clears all metadata cache for the default entity manager: +The doctrine:ensure-production-settings command ensures that Doctrine is properly configured for a production environment.: - ./app/console doctrine:cache:clear-metadata + ./app/console doctrine:ensure-production-settings -You can also optionally specify the --em option to specify which entity manager to clear the cache for: +You can also optionally specify the --em option to specify which entity manager to use: - ./app/console doctrine:cache:clear-metadata --em=default + ./app/console doctrine:ensure-production-settings --em=default EOT ); }