Commit Graph

321 Commits

Author SHA1 Message Date
Bulat Shakirzyanov
ff9e9ac315 [DependencyInjection] fixed a typo in PhpDumper 2010-12-13 18:55:37 +01:00
Johannes M. Schmitt
b3081c79e9 CS fixes 2010-12-13 11:10:55 +01:00
Jordi Boggiano
583340db7b [HttpFoundation] Added a way to grab the request body as a resource 2010-12-13 07:55:40 +01:00
Jordi Boggiano
ac7e0bc35f [DependencyInjection] Fixes a loading order issue
ab7ad4808b introduced a regression when using a parameter in an extension config that is defined in the same file, the ParameterBag can not resolve it
2010-12-13 07:52:09 +01:00
jeff
e6d0385778 [HttpFoundation] fixed Request::create() when using HTTPS and getUri()/getPathForUri() when script name should be removed.
Original explanation from pull request:

I'm Using symfony2 with URL Rewriting to 'hide' index.php.
On form authentication, symfony2 redirect to http://host:port/index.php/login_path instead of http://host:port/login_path. I do understand that, in my case, redirect is set into one of :
FormAuthenticationEntryPoint with getUriForPath()
FormAuthenticationListener with getUriForPath()
Security/Firewal/ExceptionListener with getUri()

This path modify getUri and getUriForPath to :
remove default port from URI
remove script name if not initially present
2010-12-12 14:08:35 +01:00
Johannes Schmitt
abe8047262 added authentication trust resolver 2010-12-12 10:49:43 +01:00
Johannes Schmitt
763bba9b89 bug fix 2010-12-12 10:27:15 +01:00
Fabien Potencier
48e30537c4 added exception when a loaded YAML resource is not an array 2010-12-12 08:39:37 +01:00
Bernhard Schussek
1b2ca259f1 [Validator] Fixed string-based constraint validators to accept empty values 2010-12-10 14:28:11 +01:00
Gustavo Falco
af291bb0f1 [Validator] Fixed UrlValidator to accept empty strings (closes #9297) 2010-12-10 14:28:07 +01:00
GordonsLondon
f73b6b4e1c [PropertyPath] Fixed usage of __get() and __set() when accessing properties that exist in the object but are not public 2010-12-10 14:28:04 +01:00
Bernhard Schussek
e80aa9a5ab [Form] Fixed: The data in a CollectionField is resized down if fields are removed 2010-12-10 14:27:57 +01:00
Bernhard Schussek
131b3fe373 [Form] Refactored Field and FieldGroup to facilitate modifications in subclasses 2010-12-10 14:27:54 +01:00
pablodip
984a857a96 [Validator] fixed the static method loader to not repeat the loading when the static method is in the parent classes 2010-12-10 14:27:49 +01:00
Jeremy Mikola
c8c9fba7d9 [Routing] Add optional "type" param for loader hinting when resource strings are ambiguous
Currently, ambiguities only arise for PHP files, as PhpFileLoader and AnnotationFileLoader would both claim support.  Future conflicts may occur if the XML, YAML, or PHP loaders were to receive Directory and Glob loaders (as annotations have).

Since the "type" parameter is optional, loader resolution will default to awarding resolution to the first loader to claim support.  A previous hack in PhpFileLoader to avoid an AnnotationFileLoader conflict was removed, so that should be the only lost backwards compatibility with this patch.  Unit tests were also created for the various loader classes, although only the supports() method is being tested.

This implementation was proposed on the symfony-dev mailing list in response to Fabien's RFC for custom loader notation: http://groups.google.com/group/symfony-devs/browse_thread/thread/3104c1a9e45799d2/20fbe393c1afe088
2010-12-10 09:48:10 +01:00
Fabien Potencier
0c0853c636 fixed unit tests 2010-12-10 09:30:44 +01:00
Ryan Weaver
be94daba66 [HttpKernel] Reworking the HttpException class constructor to be more consistent with normal OO classes. Additionally, the base HttpException constructor was changed to require a code argument as it doesn't make sense to create an exception that will translate into a status code of 0 (in fact it'll cause a strange error). 2010-12-10 08:47:25 +01:00
Kris Wallsmith
5da423be20 [HttpKernel] Added getRequest() to HttpKernelInterface. 2010-12-10 08:43:05 +01:00
Jeremy Mikola
7eea4882db [HttpKernel] Move request-stashing behavior to the Kernel class
Previously, HttpKernel performed request-stashing.  By moving this to the Kernel class, the request is now available immediately after the kernel becomes aware of it.  If the kernel is allowed to boot lazily (during the first call to handle()), this also allows an actual master Request to be available during booting.

The old "request" service definition (with a bogus class name) can be replaced with a factory-aware definition that retrieves the request directly from the kernel.
2010-12-09 09:38:17 +01:00
Jeremy Mikola
2ff474fc3a [HttpKernel][FrameworkBundle] Rename BaseHttpKernel to HttpKernel
The original HttpKernel class can be deleted, as it's request-stashing will be moved to the Kernel class.  FrameworkBundle's list of compiled classes must also be modified to respect this change.
2010-12-09 09:38:13 +01:00
Fabien Potencier
7c653305a3 [DependencyInjection] fixed typo 2010-12-08 14:33:58 +01:00
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