On 4/26/11 9:16 AM, Johannes Schmitt wrote:
After reading your mail, I don't really understand why, and more
importantly why now? Such a change would break almost everything out there.
Maybe you can elaborate the pros and cons of this a bit more? This
probably also has a performance impact?
Pros:
* less confusing syntax (for some people at least):
$request->request->get('foo');
$request->getRequestParam('foo');
* more straightforward in some cases:
$response->headers->setCookie();
$response->headers->set();
$response->setHeader();
$response->setCookie();
* more consistent with how we deal with properties elsewhere in the
framework.
Cons:
* It is coming late
That being said, I'm not personally in favor of one or the other. I've
sent this email because we never really talked about it and many people
seems to be annoyed by that.
Another option (BC) would be to keep the public properties and just add
some proxy methods.
Fabien
Kind regards,
Johannes
On Tue, Apr 26, 2011 at 8:12 AM, Hugo Hamon <[email protected]
<mailto:[email protected]>> wrote:
Hi Fabien,
I'm for adding proxy method to access public attributes in Request and
Response. Especially for the Response with a setCookie() method.
Hugo Hamon.
Sensio Labs Trainings Manager.
Le 26/04/11 08:09, « Fabien Potencier »
<[email protected]
<mailto:[email protected]>> a écrit :
>Hi all,
>
>I know that some of you are not comfortable with the public properties
>we have in Request and Response. These are the only examples of public
>properties in the framework:
>
>Request:
>
>$attributes
>$request
>$query
>$server
>$cookies
>$headers
>
>Response:
>
>$headers
>
>Instead of public properties, we can convert them into proper getters:
>
>getAttributes(), getQuery(), getHeaders(), ...
>
>If we do that, we should probably add proxy methods for common usage:
>
>$request->getQueryParam(), $request->getRequestParam(), ...
>$response->setCookie(), $response->setHeader()
>
>What do you think?
>
>Fabien
>
>--
>Fabien Potencier
>Sensio CEO - Symfony lead developer
>sensiolabs.com <http://sensiolabs.com> | symfony.com
<http://symfony.com> | fabien.potencier.org
<http://fabien.potencier.org>
>Tél: +33 1 40 99 80 80 <tel:%2B33%201%2040%2099%2080%2080>
>
>--
>If you want to report a vulnerability issue on symfony, please
send it to
>security at symfony-project.com <http://symfony-project.com>
>
>You received this message because you are subscribed to the Google
>Groups "symfony developers" group.
>To post to this group, send email to [email protected]
<mailto:[email protected]>
>To unsubscribe from this group, send email to
>[email protected]
<mailto:symfony-devs%[email protected]>
>For more options, visit this group at
>http://groups.google.com/group/symfony-devs?hl=en
>
>
>
--
If you want to report a vulnerability issue on symfony, please send
it to security at symfony-project.com <http://symfony-project.com>
You received this message because you are subscribed to the Google
Groups "symfony developers" group.
To post to this group, send email to [email protected]
<mailto:[email protected]>
To unsubscribe from this group, send email to
[email protected]
<mailto:symfony-devs%[email protected]>
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en
--
If you want to report a vulnerability issue on symfony, please send it
to security at symfony-project.com
You received this message because you are subscribed to the Google
Groups "symfony developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en
--
If you want to report a vulnerability issue on symfony, please send it to
security at symfony-project.com
You received this message because you are subscribed to the Google
Groups "symfony developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en