Commit Graph

2394 Commits

Author SHA1 Message Date
Jeremy Mikola
f9138d313b [FrameworkBundle] Implemented single-pass config loading with intelligent option merging for FrameworkExtension
Restructured config format to make processing more straightforward. Important changes that might break existing configs:

 * Added "enabled" option for translator (improves multi-format compat)
 * Removed hash variation of validation annotations option (only boolean)
 * Moved namespace option directly under validation (improves multi-format compat)

The new merge process depends on an internal array of all supported options and their default values, which is used for both validating the config schema and inferring how to merge options (as an added benefit, it helps make the extension self-documenting). Exceptions will now be thrown for merge errors resulting from unrecognized options or invalid types. Since incoming configurations are all merged atop the defaults, many isset() checks were removed. As a rule of thumb, we probably only want to ignore null values when an option would be used to set a parameter.

Also:

 * Added missing attributes to symfony-1.0.xsd
   * profiler: added only-exceptions attribute
   * session: fix types and add pdo attributes
 * Create FrameworkExtension tests with PHP/XML/YAML fixtures
 * Use "%" syntax instead of calling getParameter() within FrameworkExtension
 * Normalize config keys and arrays with helper methods for PHP/XML/YAML compatibility

Earlier changes:

 * Remove nonexistent "DependencyInjection/Resources/" path from XmlFileLoaders
 * Remove hasDefinition() checks, as register methods should only execute once
 * Remove first-run logic from registerTranslatorConfiguration(), as it is only run once
 * Removed apparently obsolete clearTags() calls on definitions for non-enabled features
2011-02-05 20:01:15 +01:00
Fabien Potencier
199e6bf893 [BrowserKit] removed annotation in a unit test to fix coverage 2011-02-05 16:02:59 +01:00
Fabien Potencier
2ae542748a [TwigBundle] made error message more explicit 2011-02-05 01:17:59 +01:00
Fabien Potencier
e2ea634df4 [TwigBundle] fixed inheritance problem 2011-02-04 22:14:25 +01:00
Fabien Potencier
67c9fdf412 [TwigBundle] fixed theme for forms 2011-02-04 21:19:38 +01:00
Fabien Potencier
7f6fc6f0fb [TwigBundle] fixed form template inheritance 2011-02-04 20:41:31 +01:00
Fabien Potencier
37537e3e8c fixed previous commit 2011-02-04 19:38:42 +01:00
Lukas Kahwe Smith
dd71501f54 some fixes by just "blindly" trying to make phpStorm code analysis happier 2011-02-04 19:30:28 +01:00
Fabien Potencier
195c971da6 removed load() from EngineInterface 2011-02-04 19:28:14 +01:00
Martijn Evers
1e3dc1479c [Testing][HttpKernel] Added possibility to functional test raw body data 2011-02-04 13:07:13 +01:00
Fabien Potencier
710a1e56b0 [TwigBundle] added support for template as Twig_Template instances 2011-02-04 13:04:02 +01:00
Fabien Potencier
c68b326665 [TwigBundle] fixed error messages when an error occurs during template compilation 2011-02-04 12:54:53 +01:00
Fabien Potencier
2dfac2a881 fixed typo 2011-02-04 12:20:47 +01:00
Fabien Potencier
f455700b88 fixed previous commit 2011-02-04 12:18:26 +01:00
Victor Berchet
3ed47114d6 [Bundle] Make getPath() less error prone by allowing both backward and forward slashes 2011-02-04 12:12:19 +01:00
Victor Berchet
2a97f89897 [Bundle] Small optimization 2011-02-04 12:10:16 +01:00
Victor Berchet
84bbb945d7 [UniversalClassLoader] Small optimization 2011-02-04 12:10:16 +01:00
marc.weistroff
1316fb547e Reverted e557500c97 and edf57fc392 which deleted the getRequest() method in HttpCache as this methods is needed in the Esi class. 2011-02-04 11:37:09 +01:00
Bernhard Schussek
2276b98fc1 [Form] Fixed: ChoiceFields never validated 2011-02-04 11:30:49 +01:00
Fabien Potencier
6ed7dc1e5a made a small optimization 2011-02-04 05:45:07 +01:00
Kris Wallsmith
ea536b0d9e [FrameworkBundle] added cache warmer priority 2011-02-04 00:59:44 +01:00
Fabien Potencier
6b7e4ad2f9 [TwigBundle] fixed typo 2011-02-04 00:54:09 +01:00
Justin Hileman
5516ac21a2 Fix Doctrine Migrations commands to work with new bundles. 2011-02-04 00:37:02 +01:00
Lukas Kahwe Smith
661d5d236c fixed method call, cosmetic variable rename 2011-02-04 00:32:15 +01:00
Fabien Potencier
93fc26d869 [EventDispatcher] simplified code (thanks Kris Wallsmith for the tip) 2011-02-04 00:29:28 +01:00
Daniel Holmes
b01805a5c4 [FrameworkBundle] added port number to the context passed in to the router 2011-02-04 00:26:18 +01:00
Daniel Holmes
f4282eea98 [Routing] added support for non-standard port numbers in absolute urls 2011-02-04 00:25:25 +01:00
Fabien Potencier
b6f400a2bc [DependencyInjection] made an optimization on dumped DIC
When dumping a Container, and if it is frozen, we use a plain
PHP array for parameters instead of a ParameterBag.
2011-02-04 00:17:51 +01:00
Fabien Potencier
2d69369c69 [ClassLoader] added the possibility to define more than one directory for a namespace or a prefix 2011-02-03 22:44:22 +01:00
Fabien Potencier
c05fb03c7d [HttpKernel] changed the core.view event to only be notified when the controller does not return a Response 2011-02-03 19:39:28 +01:00
Bernhard Schussek
a725415440 [Form] Fixed RepeatedField not to trigger NotNull/NotBlank errors if any of the fields was filled in 2011-02-03 13:28:29 +01:00
Bernhard Schussek
39c148197f [Form] Fixed form validation
Separated validation of data and form had serious drawbacks. When a form had nested form whose data was not connected to the data of the root form, this data would not be validated.

The new implementation validates the whole object graph at once. Class Form has a new method validateData(), that manually passes the data to the GraphWalker of the Validator and overrides the Default group with the groups set in the form.
2011-02-03 13:21:44 +01:00
Bernhard Schussek
1a34743990 [Validator] Fixed: Collections annotated with @Valid may contain scalar values. These values are ignored by the GraphWalker 2011-02-03 13:21:37 +01:00
Bernhard Schussek
50955a3919 [Validator] Fixed PropertyPath to read array indices with special characters 2011-02-03 11:28:51 +01:00
Bernhard Schussek
55a97ec78e [Validator] Made GraphWalker::validateReference() method public 2011-02-03 11:00:03 +01:00
Bernhard Schussek
5ed4d91bb8 [Validator] Implemented Execute constraint 2011-02-03 11:00:03 +01:00
Benjamin Eberlei
d8e03ac782 [DoctrineBundle] Add support to setting the Annotations prefix to @orm: for EntityGeneration beginning with Doctrine ORM 2.0.2-DEV. 2011-02-03 05:38:58 +01:00
Bernhard Schussek
eb918ac86d [Form] Fixed prototype option in CollectionField 2011-02-02 17:52:58 +01:00
Bernhard Schussek
7c9c7af863 [Form] Fixed arrays not to be passed to the validator 2011-02-02 17:32:24 +01:00
Penny Leach
1c3e3f7744 [Form] Removed required="required" from hidden fields to make them HTML5 compliant 2011-02-02 15:51:17 +01:00
Bernhard Schussek
5e3fab214e [Form] The form is now validated seperatedly from its data. The form is validated in group "Default", the data in the group set in option "validation_groups" 2011-02-02 15:25:05 +01:00
Bernhard Schussek
c923af2879 [Form] Adapted constructor of CollectionField to match the constructors of the other fields. The field prototype is now optional. 2011-02-02 14:46:33 +01:00
Bernhard Schussek
265cdd148f [Form] Removed unused property from Field 2011-02-02 14:46:33 +01:00
Bernhard Schussek
4f0283a508 [Form] Removed Form::isBound(). Form::bind() is only a shortcut method now, use Form::isSubmitted() if you want to find out whether a form was submitted. 2011-02-02 14:46:33 +01:00
Bernhard Schussek
628a4d1fd8 [Form] Refactored validation logic into validate() method. Removed bindGlobals() to reduce API clutter 2011-02-02 14:46:33 +01:00
Fabien Potencier
a204e0df7f [TwigBundle] added previous exception when possible 2011-02-02 14:41:03 +01:00
Daniel Holmes
f217022ad5 [TwigBundle] fixed Twig template throwing InvalidArgumentException rather than returning false 2011-02-02 14:38:43 +01:00
Fabien Potencier
5288381f61 Revert "[Security] Missing Event namespace in SwitchUserListener"
This reverts commit 0169892dcd.
2011-02-02 14:35:29 +01:00
Thomas
e6dc155e89 fix validator class metadata warning 2011-02-02 11:37:41 +01:00
Christophe Coevoet
de401fd94c [DoctrineBundle] Fixed doctrine:generate:entities help message 2011-02-02 11:34:47 +01:00