This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
Go to file
Fabien Potencier a0887224bb merged branch arnaud-lb/apache-dumper (PR #5792)
This PR was merged into the master branch.

Commits
-------

c7a8f7a [Routing] fixed possible parameters conflict in apache url matcher

Discussion
----------

[Routing] fixed possible parameters conflict in apache url matcher

Bug fix: yes
Feature addition: no
Backwards compatibility break: no (as long as rewrite rules are generated after upgrading)
Symfony2 tests pass: yes

- This fixes a conflict in route parameters:

  The rewrite rules currently pass route informations through environment variables:

  `_ROUTING_DEFAULT_x`: passes the default value of parameter x
  `_ROUTING__allow_x`: passes the information that method x was allowed for this route
  `_ROUTING_x`: passes the value of parameter x

  The problem is that naming a route parameter `DEFAULT_*` or `_allow_*` would not behave as expected.

  I fixed this by namespacing all environment variables; e.g. parameters are in `_ROUTING_param_*`, defaults in `_ROUTING_default_*`, etc.

- The PR fixes a second issue: sometimes the variables are prefixed with multiple REDIRECT_. This PR handles this case by ignoring them all.

- This also improves performance a little:

  Matching a route with two parameters and two default parameters 100K times: (`$_SERVER` was copied from a real request, so with many non `_ROUTING_` variables)
  master: 6.6s
  this branch: 4.7s

---------------------------------------------------------------------------

by fabpot at 2012-10-27T13:37:24Z

Any news on this PR? Is it mergeable?

---------------------------------------------------------------------------

by arnaud-lb at 2012-10-27T14:50:08Z

There is an issue with default parameter values, I can't find how to fix that in a simple way. Before this PR, default values are never used (if a parameter is an optional not present in the url, the parameter's value is the empty string); after this PR, when a parameter is present and empty (e.g. a requirement like `.*`), its value is set to its default value.

---------------------------------------------------------------------------

by Tobion at 2012-10-29T01:36:08Z

The problem is, it's not consistent with the default php matcher. So one cannot safely exchange it with the apache matcher because it behaves differently under some (special) circumstances.

---------------------------------------------------------------------------

by fabpot at 2012-11-05T08:05:54Z

We need to move forward as I want to merge the hostname support in the routing ASAP to have plenty of time for feedback before the 2.2 release.

Does it sound reasonable to merge this PR as is an open a ticket about the remaining issue (which should not occur that often anyways)?

---------------------------------------------------------------------------

by arnaud-lb at 2012-11-05T09:22:02Z

@fabpot it sounds reasonable to me. Also, I've the hostname support branch is currently rebased so that it can be merged without this one.

---------------------------------------------------------------------------

by Tobion at 2012-11-11T21:50:20Z

Btw, does the ApacheMatcherDumper handle the _scheme requirement? It doesn't look like it. This would be another bug.
Anyway, we can probably merge this PR and open new issues for the remaining bugs.
2012-11-12 10:36:54 +01:00
src/Symfony merged branch arnaud-lb/apache-dumper (PR #5792) 2012-11-12 10:36:54 +01:00
.editorconfig Add EditorConfig File 2012-06-16 14:08:15 +02:00
.gitignore ignore composer.phar 2012-04-20 14:10:06 +01:00
.travis.yml Merge branch '2.1' 2012-09-20 10:40:30 +02:00
autoload.php.dist removed manual locale stub autoload 2012-10-03 13:58:05 +03:00
CHANGELOG-2.0.md updated CHANGELOG for 2.0.18 2012-10-25 10:56:03 +02:00
CHANGELOG-2.1.md updated CHANGELOG for 2.1.3 2012-10-30 09:13:22 +01:00
composer.json Add missing symfony/stopwatch in the replace section of composer.json 2012-11-10 18:59:49 +01:00
CONTRIBUTING.md Create CONTRIBUTING.md file for auto-linking in PR's 2012-09-17 14:40:53 -04:00
CONTRIBUTORS.md update CONTRIBUTORS for 2.1.3 2012-10-30 09:13:54 +01:00
LICENSE Updated LICENSE files copyright 2012-02-22 10:10:37 +01:00
phpunit.xml.dist [Locale] Fixed tests 2012-09-24 10:11:13 +02:00
README.md Point to information on how to run the test suite. (closes #5405) 2012-09-01 08:52:18 +02:00
UPGRADE-2.1.md Update UPGRADE-2.1.md 2012-11-07 13:13:48 +01:00
UPGRADE-2.2.md [FrameworkBundle] move change note to changelog of FrameworkBundle instead of master UPGRADE-2.2 2012-11-11 21:12:12 +01:00

README

Build Status

What is Symfony2?

Symfony2 is a PHP 5.3 full-stack web framework. It is written with speed and flexibility in mind. It allows developers to build better and easy to maintain websites with PHP.

Symfony can be used to develop all kind of websites, from your personal blog to high traffic ones like Dailymotion or Yahoo! Answers.

Requirements

Symfony2 is only supported on PHP 5.3.3 and up.

Be warned that PHP versions before 5.3.8 are known to be buggy and might not work for you:

Installation

The best way to install Symfony2 is to download the Symfony Standard Edition available at http://symfony.com/download.

Documentation

The "Quick Tour" tutorial gives you a first feeling of the framework. If, like us, you think that Symfony2 can help speed up your development and take the quality of your work to the next level, read the official Symfony2 documentation.

Contributing

Symfony2 is an open source, community-driven project. If you'd like to contribute, please read the Contributing Code part of the documentation. If you're submitting a pull request, please follow the guidelines in the Submitting a Patch section.

Running Symfony2 Tests

Information on how to run the Symfony2 test suite can be found in the Running Symfony2 Tests section.