Commit Graph

300 Commits

Author SHA1 Message Date
Johannes M. Schmitt
d94420f3a5 logout refactoring 2010-12-08 08:26:58 +01:00
Jordi Boggiano
fb41389999 [HttpFoundation] Fixed Request::create handling of full URIs 2010-12-08 07:52:33 +01:00
Fabien Potencier
e8672740c7 [HttpFoundation] allowed any HTTP method for a Request 2010-12-08 07:24:37 +01:00
Fabien Potencier
7cb5dd1fdc [Security] fixed typo 2010-12-08 07:06:08 +01:00
Kris Wallsmith
3e02eafc70 Fixed visibility of PHPUnit setUp and tearDown methods. 2010-12-06 15:52:23 +01:00
Bulat Shakirzyanov
73331cf1c1 [DependencyInjection] Interface Injection implementation 2010-11-30 20:36:56 +01:00
pablodip
314d3d06ae [DependencyInjection] format the tags in the findTaggedServiceIds method of the PhpDumper 2010-11-30 07:56:51 +01:00
Fabien Potencier
6e18a2c529 [Yaml] fixed parsing of simple inline documents 2010-11-29 21:09:02 +01:00
Ryan Weaver
7efb4630b8 [Command] Changing the InputOption::PARAMETER_* constants to InputOption::VALUE_* to more accurately reflect that these constants refer to the value or lack of value assigned to a particular option (e.g. --verbose or --em=doctrine).
To keep language consistent, three methods were changed in InputOption:

 * `InputOption::acceptParameter()` -> `InputOption::acceptValue()`
 * `InputOption::isParameterRequired()` -> InputOption::isValueRequired()`
 * `InputOption::isParameterOptional()` -> `InputOption::isValueOptional()`

The InputDefinition::asXml() method was also modified to update the `accept_value` and `is_value_required` attributes.
2010-11-27 19:56:27 +01:00
Ryan Weaver
9c8cae24f8 [Console] Fixing incorrect constant references in InputArgumentTest. 2010-11-27 19:56:19 +01:00
Ryan Weaver
739ebf92f5 [Routing] Changing the _method route requirement to be a regular expression so that it's consistent with all other requirements.
Unlike all other requirements, the _method regex requirement is case-insensitive.
2010-11-27 11:48:57 +01:00
Ryan Weaver
acb977aa88 [Routing] Tweaking the ApacheMatcherDumper formatting - no real change. 2010-11-27 11:48:00 +01:00
Ryan Weaver
1e9e1b346d [Routing] Adding tests for the ApacheMatcherDumper, PhpMatcherDumper and UrlMatcher. 2010-11-27 11:47:48 +01:00
Bulat Shakirzyanov
d171df0c3b [DependencyInjection] fixed tests to catch exception classes instead of asserting them 2010-11-26 22:39:51 +01:00
Fabien Potencier
1e983a6115 moved static Form configuration to a new class (avoid loading 7 classes just to enable CSRF -- even when no form is present in the page) 2010-11-26 17:44:17 +01:00
Fabien Potencier
944d91c1df made some method name changes to have a better coherence throughout the framework
When an object has a "main" many relation with related "things" (objects,
parameters, ...), the method names are normalized:

 * get()
 * set()
 * all()
 * replace()
 * remove()
 * clear()
 * isEmpty()
 * add()
 * register()
 * count()
 * keys()

The classes below follow this method naming convention:

 * BrowserKit\CookieJar -> Cookie
 * BrowserKit\History -> Request
 * Console\Application -> Command
 * Console\Application\Helper\HelperSet -> HelperInterface
 * DependencyInjection\Container -> services
 * DependencyInjection\ContainerBuilder -> services
 * DependencyInjection\ParameterBag\ParameterBag -> parameters
 * DependencyInjection\ParameterBag\FrozenParameterBag -> parameters
 * DomCrawler\Form -> FormField
 * EventDispatcher\Event -> parameters
 * Form\FieldGroup -> Field
 * HttpFoundation\HeaderBag -> headers
 * HttpFoundation\ParameterBag -> parameters
 * HttpFoundation\Session -> attributes
 * HttpKernel\Profiler\Profiler -> DataCollectorInterface
 * Routing\RouteCollection -> Route
 * Security\Authentication\AuthenticationProviderManager -> AuthenticationProviderInterface
 * Templating\Engine -> HelperInterface
 * Translation\MessageCatalogue -> messages

The usage of these methods are only allowed when it is clear that there is a
main relation:

 * a CookieJar has many Cookies;

 * a Container has many services and many parameters (as services is the main
   relation, we use the naming convention for this relation);

 * a Console Input has many arguments and many options. There is no "main"
   relation, and so the naming convention does not apply.

For many relations where the convention does not apply, the following methods
must be used instead (where XXX is the name of the related thing):

 * get()      -> getXXX()
 * set()      -> setXXX()
 * all()      -> getXXXs()
 * replace()  -> setXXXs()
 * remove()   -> removeXXX()
 * clear()    -> clearXXX()
 * isEmpty()  -> isEmptyXXX()
 * add()      -> addXXX()
 * register() -> registerXXX()
 * count()    -> countXXX()
 * keys()
2010-11-25 17:30:06 +01:00
Fabien Potencier
341178e869 [DependencyInjection] made some cosmetic changes to the PHP dumper output 2010-11-24 15:55:25 +01:00
Fabien Potencier
60bbb8f380 [DependencyInjection] optimized compiled containers
* removed the __call() method in Container: it means that now, there is only
   one way to get a service: via the get() method;

 * removed the $shared variable in the dumped Container classes (we now use
   the $services variable from the parent class directly -- this is where we
   have a performance improvement);

 * optimized the PHP Dumper output.
2010-11-23 22:43:09 +01:00
Fabien Potencier
ad68092291 removed the OutputEscaper component, added escape mechanism in the Templating Engine class 2010-11-23 12:59:21 +01:00
Fabien Potencier
30ccd0b794 [Form] fixed unit test paths 2010-11-23 06:59:26 +01:00
Bernhard Schussek
e0aa3f30a8 [Form] Improved FileField to store files in a temporary location in case validation fails 2010-11-23 06:51:30 +01:00
Bernhard Schussek
d95d33666d [HttpFoundation] Fixed class Request to convert empty files to NULL 2010-11-23 06:51:17 +01:00
Bernhard Schussek
f9e830caa2 [Form] Added hook method preprocessData() to FieldGroup 2010-11-23 06:51:13 +01:00
Fabien Potencier
a79ed13624 [Routing] removed the variable_prefixes and variable_regex Route options 2010-11-22 11:04:53 +01:00
Bulat Shakirzyanov
21f088d86a [DependencyInjection] replaced assertEquals(spl_object_hash()) with assertSame 2010-11-21 15:26:25 +01:00
Bernhard Schussek
e0d6aad5f4 [Form][FrameworkBundle][TwigBundle] Introduced class FieldError to wrap form errors 2010-11-19 07:11:29 +01:00
Bernhard Schussek
68cebd667a [Validator] Group sequences must now always contain the group "<ClassName>" and never the group "Default" since that group is redefined by the group sequence 2010-11-19 07:11:26 +01:00
Bernhard Schussek
a71cad480a [Validator] Added @validation:GroupSequence to annotation driver 2010-11-19 07:11:23 +01:00
Bernhard Schussek
681ce7f46a [Form] Fixed: FieldGroup::hasErrors() does not return true if only children have errors 2010-11-19 07:11:17 +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
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
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
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
3127312139 [Form] Added option 'value_transformer' and 'normalization_transformer' to Field class 2010-11-16 07:28:33 +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
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
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
519cc09488 [Translation] added some unit tests for the new YAML loader 2010-11-15 09:37:04 +01:00
Fabien Potencier
6f898a5008 [HttpKernel] made some tests more robust 2010-11-13 12:29:14 +01:00
Fabien Potencier
4aa5ef63f5 [HttpKernel] made some tests more robust 2010-11-13 12:22:38 +01:00
jeff
69cd21d8be [Validator] Fixed annotation loader to not add parent constraints twice 2010-11-12 17:56:09 +01:00