Commit Graph

1244 Commits

Author SHA1 Message Date
henrikbjorn
c5ceb37f8b Changed bag.php and request_panel.php to dump arrays and objects as yaml. 2010-11-18 19:54:29 +01:00
Fabien Potencier
333504a201 [OutputEscaper] fixed output escaping when a variable was decorated with SafeDecorator and passed to another part of the system where decoration also happens on the same un-decorated variable
This is the case for instance when you pass a variable to a template like this:

new SafeDecorator($var);

and in the template, you pass it again to another embedded template:

$view->render('...', array('var' => $var);

The second time, $var will be escaped as the SafeDecorator wrapper will have been removed
by the escaper.
2010-11-18 19:25:18 +01:00
Fabien Potencier
3ce745cf6e fixed typo 2010-11-18 18:49:08 +01:00
Fabien Potencier
b6923dd7b9 changed Cache-Control default value behavior
The PHP native cache limiter feature has been disabled as this is now managed
by the HeaderBag class directly instead (see below.)

The HeaderBag class uses the following rules to define a sensible and
convervative default value for the Response 'Cache-Control' header:

 * If no cache header is defined ('Cache-Control', 'ETag', 'Last-Modified',
   and 'Expires'), 'Cache-Control' is set to 'no-cache';

 * If 'Cache-Control' is empty, its value is set to "private, max-age=0,
   must-revalidate";

 * But if at least one 'Cache-Control' directive is set, and no 'public' or
   'private' directives have been explicitely added, Symfony2 adds the
   'private' directive automatically (except when 's-maxage' is set.)

So, remember to explicitly add the 'public' directive to 'Cache-Control' when
you want shared caches to store your application resources:

    // The Response is private by default
    $response->setEtag($etag);
    $response->setLastModified($date);
    $response->setMaxAge(10);

    // Change the Response to be public
    $response->setPublic();

    // Set cache settings in one call
    $response->setCache(array(
        'etag'          => $etag,
        'last_modified' => $date,
        'max_age'       => 10,
        'public'        => true,
    ));
2010-11-18 17:05:05 +01:00
Thomas
d9239d1c64 fix doctrine command getBundleMetadatas function 2010-11-18 16:48:28 +01:00
Thomas
e204a1845b [DoctrineBundle] make the task works with vendor bundle namespace 2010-11-18 16:48:18 +01:00
Jordi Boggiano
ac0081f8b9 Switching doctypes to HTML5, it's the future 2010-11-18 07:01:03 +01:00
Jordi Boggiano
e69c5ae860 Coding style fixes 2010-11-18 07:00:03 +01:00
Jordi Boggiano
db3e12b122 [Routing] Fixed tests for windows 2010-11-18 06:59:16 +01:00
Jordi Boggiano
7a255fe39f [HttpFoundation] Fixed tests for windows 2010-11-18 06:59:12 +01:00
Jordi Boggiano
b2bd7ce57d [Validator] Skipping AnnotationLoader tests if doctrine-common is not present 2010-11-18 06:59:09 +01:00
Jordi Boggiano
b3ae62e2c4 [Finder] Fixed tests on windows 2010-11-18 06:59:05 +01:00
Jordi Boggiano
a0f933163f [Console] Fixing tests breaking on windows 2010-11-18 06:59:01 +01:00
Fabien Potencier
69d2568339 [HttpKernel] fixed typo in a unit test 2010-11-17 17:10:50 +01:00
Bernhard Schussek
46145d8de7 [Validator] Fixed exception thrown in Valid constraint to be thrown only when the options are not empty 2010-11-17 10:55:48 +01:00
Bernhard Schussek
940ce9aedf [Validator] Group "Default" is now propagated to validated references when group sequences are validated
This conforms to JSR303 (see version 1.0 final, page 39).
2010-11-17 08:02:10 +01:00
Bernhard Schussek
6a148465da [Validator][Form] Removed support for match-all group "*"
The constraint "Valid" does not accept any options or groups anymore. As per
JSR303 1.0 final, section 3.5.1 "Object graph validation" (page 39),
properties  annotated with valid should be cascaded independent of the current
group (i.e. always). Thus the group "*" is not necessary anymore and was
removed from the "Valid" constraint in the Form validation.xml.
2010-11-17 08:02:06 +01:00
Bernhard Schussek
8df966f507 [Validator] Made class Constraint abstract because it must not be instantiated 2010-11-17 08:02:03 +01:00
Bernhard Schussek
1bbdb5ec07 [Form][FrameworkBundle][TwigBundle] Refactored the PHP and Twig templating layer
Support for theming in PHP templates has been dropped.

True theming should support theme inheritance, e.g. mytheme <- table <- default.
Currently, the Templating component does not support such inheritance. As the
only purpose of the themes so far was to style field groups with tables or
divs, and because automatic rendering of field groups/forms through the render()
method is discouraged and only recommended for rapid prototyping, themes are
dropped for now.
2010-11-16 22:26:35 +01:00
Fabien Potencier
23d7967f81 [FrameworkBundle] fixed phpunit when ran from the app directory directly without -c 2010-11-16 11:17:42 +01:00
Bernhard Schussek
3127312139 [Form] Added option 'value_transformer' and 'normalization_transformer' to Field class 2010-11-16 07:28:33 +01:00
Bernhard Schussek
ece9691d5a [Form] Fixed documentation typo 2010-11-16 07:28:29 +01:00
Jordi Boggiano
c6dbbb857a [Form] Removed dead code 2010-11-16 07:28:24 +01:00
Jordi Boggiano
fbc29f061c [Form] Coding style fixes 2010-11-16 07:28:20 +01:00
Jordi Boggiano
b8987e1bde [DoctrineBundle] Form transformers shouldn't explode if they're passed null as a value 2010-11-16 07:28:17 +01:00
Jordi Boggiano
0bdb271608 [Form] Added parent calls to all configure() methods of Fields and Transformers
The calls that were on top of the function have also been moved to the bottom for safety (see previous commit)
2010-11-16 07:28:12 +01:00
GordonsLondon
23ac47e011 [Form] Added support for __get and __set in PropertyPath 2010-11-16 07:28:07 +01:00
Benjamin Eberlei
5aeb358721 [Validator] Made the namespace prefix for annotations configurable
Modified the framework bundle to use validation => Symfony\Component\Validator\Validator defaults.
Enhanced Framework Extension validator configuration to allow to extend this configuration with
user-specified annotations, for example:

    validation:
        enabled: true
        annotations:
            namespaces:
                myprojectvalidator: MyProject\Validator\

to register @myprojectvalidator:Validator(...)
2010-11-16 07:28:02 +01:00
Fabien Potencier
0131ff21c5 [Translation] removed unneeded assignement 2010-11-16 07:22:39 +01:00
Jordi Boggiano
3cbc99c180 [Translation] Added flatten method on ArrayLoader
This allows the translations to be deeply nested arrays that will be flattened, allowing for namespacing of translations easily.

The following:
  'key' => array('key2' => array('key3' => 'value'))
Becomes:
  'key.key2.key3' => 'value'

This isn't applied to Xliff since it does not make sense within the scope of the XLIFF standard
2010-11-16 07:20:57 +01:00
Fabien Potencier
4e5c99dab0 [EventDispatcher] removed the possibility to remove one listener for an event 2010-11-15 23:14:36 +01:00
Jordi Boggiano
d9295058b1 [FrameworkBundle] Make the security context optional 2010-11-15 18:32:02 +01:00
Jordi Boggiano
aa1b2efb15 [TwigBundle] Base form templates now using div instead of tables 2010-11-15 15:04:56 +01:00
Jordi Boggiano
d45954af07 [Form][TwigBundle] Making sure all field types are rendered with the proper template 2010-11-15 14:54:11 +01:00
Fabien Potencier
f21c58c56b [FrameworkBundle] finished code migration after the removal of the ArrayAccess interface for the Container 2010-11-15 11:13:01 +01:00
Fabien Potencier
f6cc63c99c removed ArrayAccess interface for Container and Controller 2010-11-15 10:05:28 +01:00
Fabien Potencier
53dd4e39c7 [DependencyInjection] changed the YAML notation for optional services from @@ to @? 2010-11-15 10:00:59 +01:00
Fabien Potencier
92f3d9e7ec [DependencyInjection] removed the leading _ for anonymous service ids (the usage of strtr() in the conversion between ids and methods does not take leading _ into account like camelize() does) 2010-11-15 09:56:20 +01:00
Fabien Potencier
a45baed812 [HttpFoundation] removed optimization for setLocale() as it breaks when locale is not the default and the user wants to switch back to the default locale 2010-11-15 09:50:01 +01:00
Ryan Weaver
58a240baba [HttpFoundation] Allow the SERVER_PORT key of the server ParameterBag in Request to be a string value without confusing Request::getHttpHost().
The idea of a string port is probably semantically wrong, but it actually follows the convention of at least some web servers ($_SERVER['SERVER_PORT'] is actually a string). And since the $port variable is used as a string in getHttpHost(), it's correct to allow the types not to match.
2010-11-15 09:45:59 +01:00
Kris Wallsmith
6428544cd8 [DoctrineMongoDBBundle] added a phpdoc block 2010-11-15 09:43:39 +01:00
Kris Wallsmith
b932441ac9 [DoctrineMongoDBBundle] added ability to register global listeners and subscribers via the DIC 2010-11-15 09:43:32 +01:00
Kris Wallsmith
da188734d8 [DoctrineMongoDBBundle] added support for multiple event managers to the DIC extension 2010-11-15 09:42:45 +01:00
Kris Wallsmith
9ab33e4ae4 [DoctrineMongoDBBundle] added registration of event listeners and subscribers via service container tags 2010-11-15 09:40:28 +01:00
Fabien Potencier
519cc09488 [Translation] added some unit tests for the new YAML loader 2010-11-15 09:37:04 +01:00
Jordi Boggiano
3813eecf17 [Translation] Added YamlFileLoader 2010-11-15 09:33:00 +01:00
Jordi Boggiano
f2107e4b3a [Translation] Explicitly mark methods as public 2010-11-15 09:29:18 +01:00
Ryan Weaver
81272b22fa [HttpFoundation] Adding PHPDoc to the Request class and removing two unused variables. 2010-11-13 16:03:57 +01:00
Jordi Boggiano
7bf77cb500 [FrameworkBundle] Add comment to clarify the request service issue 2010-11-13 14:50:32 +01:00
Francis Besset
35148c5ac3 [FrameworkBundle] added routing internationalization
In your routing.yml:

homepage:
    pattern:  /:_locale
    defaults: { _controller: MyBundle:MyController:index, _locale: en }
    requirements: { _locale: (en|fr) }

In your PHP template:

<?php echo $view['session']->getLocale() ?>
2010-11-13 14:33:47 +01:00