Skip to content

Conversation

@Gregwar
Copy link
Contributor

@Gregwar Gregwar commented Sep 7, 2011

Adding ->getReferer() for obtaining the server's HTTP_REFERER entry

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Referrer is written with two Rs. The HTTP header, in its valid form, has a typo, but we shouldn't reproduce that everywhere imo :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, I agree, the benefits of this class is mostly to forget about the "$_SERVER's" entries so it would be better with the two Rs

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The benefit of this class isn't really to forget how to write PHP I'd say :) The main thing is that this provides encapsulation, allows you to run many request/responses within one process (for testing, subrequests, app server in php etc).

@fabpot
Copy link
Member

fabpot commented Sep 7, 2011

I'm -1 on adding this method. You can already access it via the headers and as this information should not be relied upon, I don't think we need to make it easier to access it.

@Gregwar
Copy link
Contributor Author

Gregwar commented Sep 7, 2011

@fabpot, it's not reliable but can be useful for statistics, and why wouldn't you provide a method for this since you provide one for almost each properties of the request ?

@stof
Copy link
Member

stof commented Sep 7, 2011

@Gregwar there is no methods for all the headers. these one are retrieved from the HeaderBag: $request->headers->get('referer');

@Gregwar
Copy link
Contributor Author

Gregwar commented Sep 7, 2011

Ok, this was just an idea

@Gregwar Gregwar closed this Sep 7, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants