Commit Graph

2159 Commits

Author SHA1 Message Date
Victor Berchet
717efd14fd [Kernel] some tweaks 2011-02-09 18:43:01 +01:00
Jordi Boggiano
6a7d6843ae [Form] Removed unnecessary code 2011-02-09 15:49:05 +01:00
hhamon
d076ee4f3a [DoctrineMongoDBBundle] use namespace in MongoDB data fixtures command 2011-02-09 07:09:34 +01:00
hhamon
56dc1281d0 [DoctrineBundle] use namespace and fix double variable declaration 2011-02-09 07:09:34 +01:00
Sven Paulus
5d87d83a10 optimize duplication of Request objects 2011-02-09 06:59:36 +01:00
Tim Nagel
06e2c01e76 [CssSelector] PHPDoc additions 2011-02-09 06:55:44 +01:00
Tim Nagel
76e9b6ec97 [Console] PHPDoc fixes 2011-02-09 06:55:12 +01:00
Jeremy Mikola
9f77cabd2f [TwigBundle] Cast non-array resources argument to array in form_field() twig function
Methods within FormExtension later type-hint this parameter as an array, but it's convenient to allow a single string to be passed from Twig if we ensure it's wrapped in an array.
2011-02-09 06:53:10 +01:00
Fabien Potencier
fae8a557f9 [Console] fixed typo 2011-02-08 22:37:21 +01:00
Fabien Potencier
7e0ed2759b [HttpKernel] fixed phpdoc 2011-02-08 22:36:58 +01:00
Fabien Potencier
f35f1e1f3c [FrameworkBundle] fixed init:bundle command 2011-02-08 22:36:36 +01:00
Marc Weistroff
9f52333bf6 [HttpKernel] Fixed DataCollector Request attributes when attributes have objects 2011-02-08 19:18:38 +01:00
Bernhard Schussek
f51dafca3f [Form] Fixed: "data_constructor" option is used even if "data_class" option is not set 2011-02-08 04:14:56 +01:00
Bernhard Schussek
5b95805340 [Form] Added option "data_constructor" to Form. When a Form is initialized with NULL, an object is automatically created using this constructor. If no constructor is given but the option "data_class" is set, an object of that class is created with the default constructor instead. 2011-02-08 04:14:56 +01:00
Bernhard Schussek
09a50c3c55 [Form] Fixed: "by_reference" option is ignored if reading from/writing to an array 2011-02-08 04:14:55 +01:00
Bernhard Schussek
59bf50bf41 [Form] Disabled by reference handling for arrays 2011-02-08 04:14:55 +01:00
Kris Wallsmith
ef43b22546 [HttpFoundation] fixed test cleanup 2011-02-08 04:14:39 +01:00
Bulat Shakirzyanov
97679e5bda [DoctrineAbstractBundle] added test for new Loader 2011-02-08 04:11:47 +01:00
Bulat Shakirzyanov
d447d22809 [DoctrineBundle, DoctrineAbstractBundle, DoctrineMongoDBBundle] added container aware fixture loader
Updated load data fixtures command in DoctrineMongoDBBundle to be identical to the one in DoctrineBundle
Created custom loader, that passes $container to all ContainerAware DataFixtures
2011-02-08 04:11:47 +01:00
Bulat Shakirzyanov
734be8107c [DoctrineMongoDBBundle] fixed UniqueValidatorTest to mark skipped if Doctrine\ODM classes not found 2011-02-08 04:11:47 +01:00
Xavier Perez
2f9b9f5521 [Templating] Added some missing PHPDoc 2011-02-07 16:25:20 +01:00
Xavier Perez
4c65161953 [Yaml] Added PHPDoc on getTimestampRegex() 2011-02-07 16:25:19 +01:00
Fabien Potencier
9f30e42c16 added --debug/-d and --env/-d to console 2011-02-07 03:03:02 +01:00
pborreli
41bf849a63 [HttpFoundation] Request coverage 2011-02-07 02:49:14 +01:00
Tim Nagel
f3b6e1a30c PHPDoc for Console 2011-02-07 01:54:10 +01:00
ornicar
4252680ccf [HttpKernel] Catch exception when SQLite profiler storage fails to cleanup 2011-02-07 01:52:10 +01:00
Marc Weistroff
ea4ab77b6d [HttpKernel] HttpCache now sends maxage=0 cache-control directive in case of Esi presence. 2011-02-07 01:43:19 +01:00
Marc Weistroff
bebdcb242d [HttpKernel] Added response cache-control modification if page is composed of ESIs.
Rules are :
- If one of the ESI has validation cache strategy, the whole page will be
forced to validate.
- In none of the ESI has validation, the response will feature a Cache-Control
directive with s-maxage value equals to the smallest TTL of ESIs.
2011-02-07 01:34:14 +01:00
ornicar
2201382fa1 [HttpKernel] Fix issue in SQLite profiler storage when PDO fails to prepare a statement 2011-02-07 01:25:34 +01:00
Tim Nagel
93fd935b70 PHPDoc style fix 2011-02-07 01:02:56 +01:00
ornicar
803cc91b8b [FrameworkBundle] Fix TemplateNameParser template name exception message 2011-02-07 00:45:46 +01:00
Tim Nagel
0d6a6b79f0 PHPDoc fixes 2011-02-07 00:44:48 +01:00
Tim Nagel
108efc6ec9 Classloader PHPDoc 2011-02-07 00:44:48 +01:00
Tim Nagel
69672bad59 Added phpdoc to BrowserKit 2011-02-07 00:44:48 +01:00
Marcin Sikon
b9ed739d75 fixed RedirectController - removed parmanent attribute before generate new url, added tests 2011-02-07 00:15:22 +01:00
pborreli
7ad4f99153 [HttpFoundation] File/UploadedFile, MimeTest, Exception full coverage 2011-02-06 21:53:36 +01:00
Fabien Potencier
33c8d12b9a [FrameworkBundle] fixed XSD for the new exception-controller option 2011-02-06 21:44:04 +01:00
Lukas Kahwe Smith
44e6a5d45f added exception_controller config option 2011-02-06 21:42:51 +01:00
ornicar
afad113297 [HttpKernel] Fix notice in Kernel 2011-02-06 21:42:17 +01:00
Fabien Potencier
86631a9fee [FrameworkBundle] fixed template loaders in configuration 2011-02-06 21:39:30 +01:00
Fabien Potencier
7cb42d2a68 Revert "[TwigBundle] fixed error messages when an error occurs during template compilation"
This reverts commit c68b326665.
2011-02-06 21:05:37 +01:00
Jeremy Mikola
099b9dee1f [FrameworkBundle] Integrate Configuration\Builder class for config merging and normalization
This fixes some BC problems introduced in f9138d313b. Some top-level can now be simply enabled by providing true/null in PHP/YAML. Additionally, the Configuration\Builder allows options to be unset by providing "false" (helpful for overriding activation in a previous config file). All options supporting these behaviors can be found in the Configuration.php file (look for canBeUnset() and treatNull/TrueLike()).

Major changes:

 * Removed "enabled" option for profiler config. Profiler is now enabled if its config is true, null or a map.
 * Restore original config structure for validation namespaces. In PHP/YAML, namespaces are defined under annotations as an alternative to false (disabled) and true/null (enabled). For XML, annotation remains a boolean attribute for validation and a one or more optional namespace tags may appear within <app:validation />. During config normalization, namespace tags under validation will be moved to annotations to conform to the PHP/YAML structure (this occurs transparently to the user).
 * Restore behavior for router/templating config sections being optional (as shown in changes to session/validation test fixtures). If either top-level section is unset in the configuration, neither feature will be enabled and the user will no longer receive exceptions due to missing a resource option (router) or engines (templating). Resource/engines will still be properly required if the respective feature is enabled.
 * Remove unused router type option from XML config XSD. Type is only relevant for import statements, so this option is likely useless.

Additional small changes:

 * Added isset()'s, since config options may be unset
 * Wrap registerXxxConfiguration() calls in isset() checks
 * Load translation.xml in configLoad(), since it's always required
 * Default cache_warmer value (!kernel.debug) is determined via Configuration class

Things to be fixed:

 * Configuration\Builder doesn't seem to respect isRequired() and requiresAtLeastOneElement() (or I haven't set it properly); this should replace the need for FrameworkExtension to throw exceptions for bad router/templating configs
 * The config nodes for session options don't have the "pdo." prefix, as dots are not allowed in node names. To preserve BC for now, the "pdo." prefix is still allowed (and mandated by XSD) in configuration files. In the future, we may just want to do away with the "pdo." prefix.
 * Translator has an "enabled" option. If there's no use case for setting "fallback" independently (when "enabled" is false), perhaps "enabled" should be removed entirely and translator should function like profiler currently does.
 * Profiler matcher merging might need to be adjusted so multiple configs simply overwrite matcher instead of merging its array keys.
2011-02-06 20:50:12 +01:00
Johannes M. Schmitt
2b256a0804 [DependencyInjection] allow null for scalar nodes 2011-02-06 20:50:03 +01:00
Fabien Potencier
cdff8b2bf8 [FrameworkBundle] fixed error message for template as an array 2011-02-06 20:22:57 +01:00
Johannes Schmitt
2316c90ec2 [Security] fixes a regression 2011-02-06 20:11:08 +01:00
Johannes M. Schmitt
c7ef8d98d6 [DependencyInjection] append new elements for prototype nodes without a key attribute 2011-02-06 20:11:08 +01:00
Johannes Schmitt
0b8fef2347 [Security/DependencyInjection] adds support for merging security configurations
The merging is done in three steps:

    1. Normalization:
    =================
    All passed config arrays will be transformed into the same structure
    regardless of what format they come from.

    2. Merging:
    ===========
    This is the step when the actual merging is performed. Starting at the root
    the configs will be passed along the tree until a node has no children, or
    the merging of sub-paths of the current node has been specifically disabled.

       Left-Side       Right-Side      Merge Result
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       -nothing-       array           Right-Side will be taken.
       scalar          scalar          Right-Side will be taken.
       array           false           Right-Side will be taken if ->canBeUnset()
                                       was called on the array node.
       false           array           Right-Side will be taken.
       array           array           Each value in the array will be passed to
                                       the specific child node, or the prototype
                                       node (whatever is present).

    3. Finalization:
    ================
    The normalized, and merged config will be passed through the config tree to
    perform final validation on the submitted values, and set default values
    where this has been requested.

You can influence this process in various ways, here is a list with some examples.
All of these methods must be called on the node on which they should be applied.

  * isRequired(): Node must be present in at least one config file.
  * requiresAtLeastOneElement(): PrototypeNode must have at least one element.
  * treatNullLike($value): Replaces null with $value during normalization.
  * treatTrueLike($value): Same as above just for true
  * treatFalseLike($value): Same as above just for false
  * defaultValue($value): Sets a default value for this node (only for scalars)
  * addDefaultsIfNotSet(): Whether to add default values of an array which has not
                           been defined in any configuration file.
  * disallowNewKeysInSubsequentConfigs(): All keys for this array must be defined
                                          in one configuration file, subsequent
                                          configurations may only overwrite these.
  * fixXmlConfig($key, $plural = null): Transforms XML config into same structure
                                        as YAML, and PHP configurations.
  * useAttributeAsKey($name): Defines which XML attribute to use as array key.
  * cannotBeOverwritten(): Declares a certain sub-path as non-overwritable. All
                           configuration for this path must be defined in the same
                           configuration file.
  * cannotBeEmpty(): If value is set, it must be non-empty.
  * canBeUnset(): If array values should be unset if false is specified.

Architecture:
=============
The configuration consists basically out of two different sets of classes.

  1. Builder classes: These classes provide the fluent interface and
                      are used to construct the config tree.

  2. Node classes: These classes contain the actual logic for normalization,
                   merging, and finalizing configurations.

After you have added all the metadata to your builders, the call to
->buildTree() will convert this metadata to actual node classes. Most of the
time, you will not have to interact with the config nodes directly, but will
delegate this to the Processor class which will call the respective methods
on the config node classes.
2011-02-06 20:11:08 +01:00
ornicar
c5fb96b86b [HttpKernel] Add more unit tests for Kernel 2011-02-06 20:05:49 +01:00
Bernhard Schussek
74d0ac82f7 [Form] Cleaned up ValueTransformerInterface
This commit removes CollectionToStringTransformer. Transformers should never change the state of the outside world, otherwise hard-to-track bugs might creap in.

This functionality needs to be implemented as a custom FieldType (see EntityChoiceField).
2011-02-06 19:46:29 +01:00
Bernhard Schussek
bd3e6c6b49 [Form] Fixed: Form::bind() throws an exception if form is anonymous 2011-02-06 19:46:28 +01:00