Commit Graph

6620 Commits

Author SHA1 Message Date
Fabien Potencier
a6670c214a [Routing] fixed a caching issue when annotations are used on a base class used by more than one concrete class
Doctrine caches annotations. For methods, it uses PHP reflection and the getDeclaringClass() to create
a unique cache key. Unfortunately, if you have 2 classes that extend another one, the cache will be shared.
It's not a problem except that before this patch, the default route name was also cached (as the cache is serialized
after we changed the object). So, all other classes inherited this default route name. The fix is quite easy:
just don't change the read annotation object.
2011-08-30 21:39:58 +02:00
Fabien Potencier
946ccb6bd2 [Routing] fixed annotation loaders for abstract classes, added more unit tests 2011-08-30 20:57:43 +02:00
Fabien Potencier
6a81f07862 [Routing] made a small speed optimization 2011-08-30 20:53:32 +02:00
Fabien Potencier
c8d6c60192 merged branch sonata-project/fix_directory_resource (PR #2057)
Commits
-------

74cbf96 fix directory resource

Discussion
----------

fix directory resource

fix regression introduces by 0eae562cb2 (diff-15)
2011-08-30 12:57:01 +02:00
Thomas Rabaix
74cbf96418 fix directory resource 2011-08-30 12:47:56 +02:00
Fabien Potencier
053b42158e [Templating] added better support for encoding problems when escaping a string (available as of PHP 5.4)
From the PHP CHANGELOG:

The flag ENT_SUBSTITUTE makes invalid multibyte sequences be replaced by
U+FFFD (UTF-8) or &#FFFD; by htmlspecialchars and htmlentities. It is an
alternative to the default behavior, which just returns an empty string and to
ENT_IGNORE, which is a security risk. The behavior follows the recommendations
of Unicode Technical Report #36.
2011-08-30 07:43:00 +02:00
Fabien Potencier
5bbc67bb53 updated CHANGELOG for 2.1 2011-08-29 15:38:12 +02:00
Fabien Potencier
93ea745397 merged branch henrikbjorn/autoload (PR #1857)
Commits
-------

ae3b128 [ClassLoader] Support for autoloading include_path incl. tests.

Discussion
----------

Autoload

GH Issue #1823

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

by stof at 2011/07/29 00:42:10 -0700

note that another fix was proposed in #1852 but this implementation is cleaner IMO

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

by henrikbjorn at 2011/08/12 01:57:45 -0700

@fabpot @stof any suggestions? need this kind of badly

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

by stof at 2011/08/12 02:06:54 -0700

for me it is fine. I guess you need to wait the end of @fabpot's holydays to see it merged.

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

by henrikbjorn at 2011/08/25 02:24:13 -0700

Added tests in the hope it will make it in soon :)

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

by henrikbjorn at 2011/08/29 03:31:08 -0700

Any other requests / suggestions ?

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

by stof at 2011/08/29 03:36:15 -0700

could you rebase the PR ? Github says that it conflicts.

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

by henrikbjorn at 2011/08/29 04:11:43 -0700

Should be rebased now or that is what git cli says :)

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

by henrikbjorn at 2011/08/29 04:16:28 -0700

And squashed.
2011-08-29 15:37:03 +02:00
alexandresalome
9f0bd0325b [HttpKernel] Update tests for FileProfilerStorage 2011-08-29 15:35:28 +02:00
alexandresalome
b7032bc971 [HttpKernel] Update FileProfileStorage to search from EOF 2011-08-29 15:34:31 +02:00
Fabien Potencier
7b4bf37088 changed format of the 2.1 CHANGELOG for better rendering on Github 2011-08-29 15:31:57 +02:00
Fabien Potencier
6b09498248 [Translation] simplified tests 2011-08-29 15:30:52 +02:00
Fabien Potencier
0eae562cb2 converted file_exists calls to either is_file or is_dir where it makes sense 2011-08-29 15:28:26 +02:00
Fabien Potencier
4e70b1aed4 fixed tab problem 2011-08-29 15:04:45 +02:00
Fabien Potencier
230be6815c updated CHANGELOG for 2.1 2011-08-29 14:45:37 +02:00
Fabien Potencier
b217d7092a merged branch michelsalib/translation-formatter (PR #2045)
Commits
-------

6278fcb -- add dumpers for translation component

Discussion
----------

[2.1] Add dumpers for translation catalogs

As seen here #1283, I push just the translation catalogs dumpers. It involved renaming and some essentially.

I also included a Pot dumper/loader that have been provided here : https://github.com/michelsalib/BCCExtraToolsBundle/pull/12.

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

by fabpot at 2011/08/28 11:12:30 -0700

Can you add the license header? and the main phpdoc block for each class?

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

by michelsalib at 2011/08/29 02:32:50 -0700

Done !

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

by fabpot at 2011/08/29 03:17:43 -0700

Last, but not the least, can you add some unit tests and squash all your commits? Thanks a lot.

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

by michelsalib at 2011/08/29 03:21:43 -0700

How do I squash it, should I make a new PR ?

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

by fabpot at 2011/08/29 03:25:09 -0700

No need to make a new PR, you can just force the push with `-f`.

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

by fabpot at 2011/08/29 03:33:59 -0700

Also, in the tests, it would great if you can add some that do a load/dump/load, just to be sure that everything work fine.

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

by michelsalib at 2011/08/29 03:39:41 -0700

What is the need of such a test, considering that the current tests that I am writing are using the same fixtures ?

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

by fabpot at 2011/08/29 03:47:50 -0700

The goal is to ensure that the load/dump calls are idempotent.

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

by michelsalib at 2011/08/29 03:56:12 -0700

Ye. Actually the load is using referenc files from the fixtures directory. My new tests will be using the dumper with the same files. Isn't that enough ? I try to stay DRY on this one.

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

by michelsalib at 2011/08/29 05:09:52 -0700

I just add unit tests and squash the commits.

I still need to be conviced about the load/dump/load unit tests. But if I did not made a point, I'll do as requested on next answer.
2011-08-29 14:24:14 +02:00
Michel Salib
6278fcb306 -- add dumpers for translation component
-- update license and phpDoc

-- fix CS

-- remove pot file loader

-- add unit tests
2011-08-29 14:06:21 +02:00
alexandresalome
188a5fa1ab [HttpKernel] Override the existing tokens in FileProfilerStorage 2011-08-29 13:58:35 +02:00
alexandresalome
b1b1424f48 [HttpKernel] Delete folders in the profiler cache 2011-08-29 13:57:30 +02:00
alexandresalome
88bc3ecf3d [HttpKernel] Fixes standards of FileProfilerStorage 2011-08-29 13:52:48 +02:00
alexandresalome
affe66c949 Merge remote-tracking branch 'origin/master' into new-profiler-storage 2011-08-29 13:44:52 +02:00
Henrik Bjørnskov
ae3b12801f [ClassLoader] Support for autoloading include_path incl. tests. 2011-08-29 13:15:35 +02:00
Fabien Potencier
8497f5f7fc merged branch aggressivex/translation-pcre-patch (PR #2047)
Commits
-------

723cb71 [Translation] Add compatibility to PCRE 6.6.0 for explicit interval pluralization

Discussion
----------

[Translation] Add compatibility to PCRE 6.6.0 for explicit interval pluralization

[Translation] Add compatibility to PCRE 6.6.0 for explicit interval pluralization

Corrected branches: From 2.0 to 2.0

more info: https://github.com/symfony/symfony/pull/2038
2011-08-28 22:32:31 +02:00
Luis Muñoz
723cb71390 [Translation] Add compatibility to PCRE 6.6.0 for explicit interval pluralization 2011-08-28 22:05:29 +02:00
Fabien Potencier
a74605532e merged branch chEbba/xdebug_file_link_format (PR #1927)
Commits
-------

cc098a3 [HttpKernel] Add support for xdebug.file_link_format to Debug\ExceptionHandler.php

Discussion
----------

[HttpKernel] Add support for xdebug.file_link_format to Debug\ExceptionHandler

Format file and line as url, if xdebug.file_link_format is set. Inspired by #1893
2011-08-27 08:08:25 +02:00
Fabien Potencier
07a56edc5e updated CHANGELOG 2011-08-27 08:03:17 +02:00
Fabien Potencier
34c1868a91 merged branch stloyd/tests_fix (PR #1860)
Commits
-------

838237d [Tests] Use proper phpunit assertion functions: "assertTrue", "assertFalse", "assertNull"

Discussion
----------

[2.1][Tests] Use proper phpunit assertion functions

Use proper phpunit assertion functions: `assertTrue()`, `assertFalse()`, `assertNull()`.
2011-08-27 08:01:17 +02:00
Fabien Potencier
f9be0f2623 merged branch brikou/finder_exclude_dirs (PR #1926)
Commits
-------

5be62f6 made exclude method accept array of dirs

Discussion
----------

[2.1] [Finder] made "exclude" method accept array of dirs (as "in" method)
2011-08-27 08:00:11 +02:00
Fabien Potencier
07bdb8ac84 merged branch stloyd/patch-3 (PR #2011)
Commits
-------

020fa51 [RedirectResponse] Added missing `doctype` and `title` tag

Discussion
----------

[RedirectResponse] Added missing `doctype` and `title` tag
2011-08-26 18:08:50 +02:00
Fabien Potencier
8d6c7d830e udpated CHANGELOG 2011-08-26 17:50:21 +02:00
Fabien Potencier
2ccee10c51 merged branch stealth35/mime_guesser (PR #1874)
Commits
-------

ea0db2d [HttpFoundation] Remove useless ContentTypeMimeTypeGuesser

Discussion
----------

[2.1] [HttpFoundation] Remove useless ContentTypeMimeTypeGuesser

`mime_content_type` exists just for the compat between the old PHP 5.2
`mime_magic` extension and `file_info` extension

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

by fabpot at 2011/08/19 05:31:25 -0700

I will merge it in 2.1 as some people might rely on it.

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

by stealth35 at 2011/08/19 05:46:02 -0700

ok in the meantime, we can invert the guesser checker :

```php
/**
 * Registers all natively provided mime type guessers
 */
private function __construct()
{
    if (FileBinaryMimeTypeGuesser::isSupported()) {
        $this->register(new FileBinaryMimeTypeGuesser());
    }

    if (FileinfoMimeTypeGuesser::isSupported()) {
        $this->register(new FileinfoMimeTypeGuesser());
    }

    if (ContentTypeMimeTypeGuesser::isSupported()) {
        $this->register(new ContentTypeMimeTypeGuesser());
    }
}
```

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

by stloyd at 2011/08/19 05:48:38 -0700

@stealth35 You should make new PR for change you mentioned above.

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

by stealth35 at 2011/08/19 05:53:12 -0700

@stloyd done PR #1989

EDIT : forget this
2011-08-26 17:49:56 +02:00
Fabien Potencier
fc793e668b added a CHANGELOG for 2.1 2011-08-26 17:45:40 +02:00
Fabien Potencier
a8609e1eab merged branch lsmith77/add_patch_support (PR #1916)
Commits
-------

007e395 do not set a default CONTENT_TYPE for PATCH
fa2c027 Added support for the PATCH method

Discussion
----------

[2.1] [HttpFoundation] Added support for the PATCH method

http://tools.ietf.org/html/rfc2068#section-19.6.1.1
http://tools.ietf.org/html/rfc5789

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

by Seldaek at 2011/08/07 03:23:20 -0700

According to the spec it seems that PATCH requests shouldn't be of application/x-www-form-urlencoded content-type so it shouldn't match the first if, and in the second it's probably wrong to default to application/x-www-form-urlencoded, no?

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

by lsmith77 at 2011/08/07 03:31:48 -0700

Hmm you are right. I assumed the diff would be encoded as ``application/x-www-form-urlencoded`` but there indeed is no indication of that in the spec. But given that the second case would still need some sort of handling for PATCH, just not sure what exactly ``$defaults['CONTENT_TYPE']`` should be set to.

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

by Seldaek at 2011/08/07 03:48:53 -0700

As I understand it, a PATCH request must specify a content-type or it's invalid, so we could just skip the second behavior if no content-type is present.

As your first link says:

    The list of differences is in a format defined by the media type of the entity (e.g.,
    "application/diff") and MUST include sufficient information to allow
    the server to recreate the changes necessary to convert the original
    version of the resource to the desired version.

Sounds like PATCH is highly application specific, and not so standardized, probably because it's not very useful for most purposes.

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

by lsmith77 at 2011/08/07 04:02:43 -0700

Yes, but to me this means that the patch is actually correct aside from the fact that its setting a default Content-Type, which I just corrected (not sure if this use of switch is ok with our coding style). Now if the Content-Type does end up being ``application/x-www-form-urlencoded`` then I would say its correct to decode it.
2011-08-26 17:44:39 +02:00
Fabien Potencier
62bbad41b7 merged branch jalliot/assets-install-ignore-vcs (PR #2026)
Commits
-------

24bacdc Ignore VCS files in assets:install command (closes #2025)

Discussion
----------

Ignore VCS files in assets:install command (closes #2025)

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

by stloyd at 2011/08/25 06:10:22 -0700

`ignoreVCS` is set to `true` by default, AFAIK also `getIterator()` is not needed.

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

by jalliot at 2011/08/25 06:30:32 -0700

@stloyd I knew about ``ignoreVCS`` defaulting to ``true`` but I thought it made it clearer but you're right it's not really useful.
As for ``getIterator`` I thought the conversion couldn't be made automatically on a method call like here but apparently it works so I changed it.
Thanks.

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

by tiagojsag at 2011/08/25 08:41:02 -0700

This approach creates another problem: the already existing VCS files are deleted when the command is executed, which makes at least SVN throw errors.

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

by jalliot at 2011/08/25 08:50:55 -0700

@tiagojsag If you remove the call to ``remove`` on line 83, does everything work?
Because I'm not really sure we need to remove the entire dir first since ``mirror`` should be able to adapt itself.

BTW, wouldn't it be better if you didn't commit the ``web/bundles`` dir in your SVN and instead ask to call the ``assets:install`` command each time?

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

by stof at 2011/08/25 08:58:16 -0700

Great news about SVN: the incoming 1.7 version stops adding a ``.svn`` folder in every directory but uses a single one at the root of the project (like git does for instance), solving this sort of issues about copying files :)

@tiagojsag this command has always removed the old asset folders before copying the new ones, and there is not real mean to do otherwise by keeping things simple. You could consider ignoring the ``vendor/bundles`` folder in the SVN and running the command when doing checkout (thus allowing devs to use symlinks if they want)

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

by tiagojsag at 2011/08/25 09:01:39 -0700

yes, that was the solution I was using before submitting this bug report. I also agree that it's the simplest and fastest way to address this, provided that docs get updated, so that no one spends their time trying to figure out why files are not synced with their svn repo.

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

by jalliot at 2011/08/25 09:03:11 -0700

@stof That's really great to hear!
But still this PR should be merged to avoid legacy files from current versions of SVN or other VCS.

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

by stof at 2011/08/25 09:04:31 -0700

@jalliot sure. My comment was mainly about the opposite issue raised by @tiagojsag
2011-08-26 17:41:12 +02:00
Fabien Potencier
ff7f654175 merged branch jalliot/simplified-copy (PR #2030)
Commits
-------

9a05db0 Simplified Filesystem->copy()
707e8aa merged 2.0 branch
98966c8 updated VERSION and deps

Discussion
----------

Simplified Filesystem->copy()
2011-08-26 12:06:03 +02:00
Jordan Alliot
9a05db0e7e Simplified Filesystem->copy() 2011-08-26 09:37:17 +01:00
Jordan Alliot
24bacdcd3b Ignore VCS files in assets:install command (closes #2025) 2011-08-26 09:36:52 +01:00
Fabien Potencier
707e8aaecb merged 2.0 branch 2011-08-26 10:01:25 +02:00
Fabien Potencier
98966c8779 updated VERSION and deps 2011-08-26 09:59:43 +02:00
Fabien Potencier
bb8a3f1ae5 updated vendors 2011-08-26 09:42:19 +02:00
Fabien Potencier
9f40ba6c2a bumped Symfony version to 2.0.2-DEV 2011-08-26 09:34:52 +02:00
Fabien Potencier
7cb402d806 updated VENDORS for 2.0.1 2011-08-26 08:46:48 +02:00
Fabien Potencier
7275c88777 updated CHANGELOG for 2.0.1 2011-08-26 08:46:45 +02:00
Fabien Potencier
f9ce68fad4 update VERSION for 2.0.1 2011-08-26 08:45:13 +02:00
Fabien Potencier
8f50592f31 [HttpFoundation] changed \LogicException to \InvalidArgumentException 2011-08-26 08:45:12 +02:00
Fabien Potencier
194d2a7219 update CONTRIBUTORS for 2.0.1 2011-08-26 08:45:12 +02:00
stloyd
838237dc32 [Tests] Use proper phpunit assertion functions: "assertTrue", "assertFalse", "assertNull" 2011-08-25 15:41:15 +02:00
Fabien Potencier
1c7694ff30 [HttpFoundation] added a missing exception 2011-08-25 10:38:08 +02:00
Fabien Potencier
a79f22544e [HttpKernel] added a test for uploading a file via an array instead of an UploadedFile instance 2011-08-25 10:07:28 +02:00
Fabien Potencier
9112bed669 merged branch stloyd/patch-4 (PR #2018)
Commits
-------

542cfd6 [ServerBag] Skip unnecessary loop in `getHeaders()`

Discussion
----------

[ServerBag] Skip unnecessary loop in `getHeaders()`
2011-08-25 09:45:41 +02:00