Commit Graph

6966 Commits

Author SHA1 Message Date
jdreesen
1134c1a1d8 [Validator] Fixed typo in Image constraint 2011-09-06 16:59:08 +02:00
jdreesen
428a01c521 Merge branch 'master' of git://github.com/symfony/symfony into trans-update-2 2011-09-06 16:56:40 +02:00
jdreesen
3843afab84 [FrameworkBundle] Improved German validator translation 2011-09-06 16:53:23 +02:00
jdreesen
ac540809c2 [FrameworkBundle] Updated German translations for image validator 2011-09-06 16:43:48 +02:00
Fabien Potencier
6353de2ce4 merged branch aboks/image_constraint_typo (PR #2111)
Commits
-------

522adde [Validator] Fixed typo in Image constraint

Discussion
----------

[Validator] Fixed typo in Image constraint
2011-09-06 15:44:41 +02:00
Arnout Boks
522addebe5 [Validator] Fixed typo in Image constraint 2011-09-06 14:34:25 +02:00
Fabien Potencier
c5541dc206 merged branch stewe/2.0 (PR #2109)
Commits
-------

cd40ed4 Added missing method to HTTP Digest entry point

Discussion
----------

Added missing method to HTTP Digest entry point

Re-submitting to 2.0 branch as it is a bugfix, thanks!
2011-09-06 13:55:49 +02:00
Fabien Potencier
227eebc0fa merged branch jalliot/updated-french-trans (PR #2106)
Commits
-------

f23413c Updated french translations for image validator

Discussion
----------

Updated french translations for image validator
2011-09-06 13:55:04 +02:00
Fabien Potencier
924b9f7fd1 merged branch stloyd/patch-4 (PR #2108)
Commits
-------

7139154 [Validator] Translate image validation errors into polish

Discussion
----------

[2.1][Validator] Translate image validation errors into polish
2011-09-06 13:54:54 +02:00
Stefano Sala
cd40ed43a3 Added missing method to HTTP Digest entry point 2011-09-06 13:32:33 +02:00
Fabien Potencier
bde551ab70 [FrameworkBundle] fixed typo 2011-09-06 12:56:36 +02:00
Joseph Bielawski
7139154b99 [Validator] Translate image validation errors into polish 2011-09-06 12:37:32 +03:00
Jordan Alliot
f23413cd58 Updated french translations for image validator 2011-09-06 10:14:51 +01:00
Fabien Potencier
1c0b48930d Merge branch '2.0'
* 2.0:
  [Validator] Sync polish translation
  [FrameworkBundle] sanitize target arg in asset:install command
  few optimisations for XliffFileLoader and XmlFileLoader
  [FrameworkBundle] Sync the Russian translations
  [FrameworkBundle] Added Dutch validator translation for trans-unit 41
  [FrameworkBundle] Updated German validator translation
  [FrameworkBundle] Fixed a typo in the translation file per @PeymanHR
2011-09-06 09:00:04 +02:00
Fabien Potencier
100c644a05 [FrameworkBundle] fixed typo 2011-09-06 08:59:53 +02:00
Fabien Potencier
9685b0015c merged branch brki/mimetype-extension-guesser-refactor (PR #1386)
Commits
-------

34494b3 whitespace fixes
1a86a4a Refactor mime-type to file extension guessing
e7481a3 Decouple mime-type to extension logic from File class

Discussion
----------

[2.1] Decouple mimetype-to-extension logic from File class

This allows guessing the extension from a given mime type
without requiring the existence of a local file.

If a file's meta information (mime-type, etc.) is already available (i.e. it's
been extracted once and stored in some persistent data store), it would be
nice to be able to make a best-guess on the extension based on the known mime-type.

A concrete use case of this is for the symfony-cmf, where a file has been stored
in the jackrabbit data store.  When delivering this file or saving it to disk, we'd like to
use an extension that's created based on the known mime type of the file.

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

by brki at 2011/06/21 04:35:13 -0700

Now implemented similarly to the existing MimeTypeGuesser.

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

by brki at 2011/06/21 07:51:22 -0700

whitespace removed

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

by stof at 2011/09/04 05:04:54 -0700

@fabpot @brki what is the status of this PR ?
2011-09-06 08:57:16 +02:00
Fabien Potencier
769b71f02a updated CHANGELOG for 2.1 2011-09-06 08:19:05 +02:00
Fabien Potencier
f75d8ff653 merged branch benjamindulau/ImageValidator (PR #1214)
Commits
-------

89f4791 Fixed CS
a348efe Removed trailing whitespaces
135531a Replaced setExpectedException() methods by annotations
6ad83e7 Updated according to PR review
2de243c * Added Fixtures 2x2px test.gif image file * Updated tests for using fixture image instead of imagecreate function
a5a2dfa [ImageValidator] Added dedicated ImageValidator class with min width, max width, min height and max height validations

Discussion
----------

[2.1] [ImageValidator] Improved ImageValidator + tests

Added dedicated ImageValidator class with min width, max width, min height and max height validations

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

by kriswallsmith at 2011/06/04 10:32:56 -0700

This is nice but doesn't belong in the core as it adds a dependency on GD.

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

by benjamindulau at 2011/06/04 10:41:02 -0700

@kriswallsmith i'm not sure, php.net doc says :

    Note:

    This function does not require the GD image library.

Well, that could also be a mistake :)

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

by pborreli at 2011/06/04 11:17:25 -0700

i think @benjamindulau is right

```
$ php -m
[PHP Modules]
bcmath
calendar
com_dotnet
Core
ctype
date
dom
ereg
filter
ftp
hash
iconv
json
libxml
mcrypt
mhash
mysqlnd
odbc
pcre
PDO
Phar
Reflection
session
SimpleXML
SPL
sqlite3
standard
tokenizer
wddx
xdebug
xml
xmlreader
xmlwriter
zip
zlib
```

```
$ php -r "var_dump(getimagesize(__DIR__.'/src/Symfony/Bundle/FrameworkBund
le/Resources/public/images/blue_picto_less.gif'));"
array(7) {
  [0]=>
  int(18)
  [1]=>
  int(18)
  [2]=>
  int(1)
  [3]=>
  string(22) "width="18" height="18""
  ["bits"]=>
  int(5)
  ["channels"]=>
  int(3)
  ["mime"]=>
  string(9) "image/gif"
}
```

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

by benjamindulau at 2011/06/04 11:22:57 -0700

However, the tests use imagejpeg and imagedestroy, that's not valid.
But, i'm not sure how to correctly test the validator then.

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

by benjamindulau at 2011/06/04 11:31:51 -0700

Can i use an image from FrameworkBundle resources ?

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

by pborreli at 2011/06/06 03:47:24 -0700

just add your own image inside Fixture folder (smaller the better, 1x1, 1x2 ..)

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

by stof at 2011/09/04 05:27:42 -0700

@benjamindulau could you rebase your PR and update it according to the comments ?

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

by benjamindulau at 2011/09/04 06:31:34 -0700

Yep, i think i can find some time today to do that

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

by benjamindulau at 2011/09/04 09:27:29 -0700

I've updated the PR.

A big thank to Stof who helped me with my git mess ;-)
2011-09-06 08:18:07 +02:00
Fabien Potencier
e4654745c7 [FrameworkBundle] added CSV translation loader and dumper as services 2011-09-06 08:07:33 +02:00
Fabien Potencier
22548d0537 merged branch stealth35/csv_dumper (PR #2092)
Commits
-------

dea46c7 [Translation] support CsvDumper [Translation] support CsvDumper [Translation] support CsvDumper [Translation] support CsvDumper [Translation] support CsvDumper

Discussion
----------

[2.1][Translation] support CsvDumper

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

by michelsalib at 2011/09/05 04:56:47 -0700

The DumperInterface is probably going to change soon, it should be considered when merging : #2051.
2011-09-06 08:03:26 +02:00
Fabien Potencier
d84aecfea4 updated CHANGELOG for 2.1 2011-09-06 08:02:25 +02:00
Fabien Potencier
6c9331650f merged branch beberlei/QtTranslations (PR #1154)
Commits
-------

f2761dd Fix typo and include suggestion by Stof
4ac380e Adjust QtTranslations patch and include QtTranslationsDumper + test aswell
5712798 Adjust QtTranslationLoader to throw RuntimeException
21b29c2 Merge symfony/master
6bf43a1 [Translation] Add .ts as file extension to search for Qt Translation files.
5808715 [Translation] Add Qt Translation component with tests

Discussion
----------

[2.1] Qt translations

Add support for QT translations - it has a GUI and www.crowdin.net supports it.

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

by stof at 2011/05/30 07:24:48 -0700

You also need to register it in FrameworkBundle.

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

by tristanbes at 2011/06/26 12:08:47 -0700

crowdin seems to be a cool service. didn't know about this website. thanks

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

by fabpot at 2011/07/11 02:58:31 -0700

Just for the record: I've just removed all usage of `\Exception` in Symfony2 master:

6a7359389d

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

by beberlei at 2011/07/11 03:02:14 -0700

I will adjust the PR.

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

by tristanbes at 2011/08/28 11:10:02 -0700

Any news @beberlei ?

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

by beberlei at 2011/08/29 01:07:28 -0700

Yes, i have to allocate some time. Havent managed to do so yet.

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

by stof at 2011/09/04 05:28:16 -0700

@beberlei the PR also need to be rebased as it conflicts with master.
2011-09-06 08:00:21 +02:00
Fabien Potencier
1d74073b6a updated CHANGELOG for 2.1 2011-09-06 07:54:13 +02:00
Fabien Potencier
a00c1f5927 merged branch Wotre/profiler_mongodb (PR #1784)
Commits
-------

41b7a19 Updated the tests so that tests will be marked as skipped when there is no MongoDB server present!
233c7db Updated the code to follow the symfony coding standards
7b24de5 Updated the code to follow the symfony coding standard using stof his remarks
fbcbdde - Fixed a small bug - Updated some phpdoc
00fdfec Added a MongoDbProfilerStorage engine

Discussion
----------

[2.1] [HttpKernel] MongoDb storage for Profiler

As a documentbased database like MongoDB is [supposedly fantastic in logging](http://blog.mongodb.org/post/172254834/mongodb-is-fantastic-for-logging) I implemented a storage engine for the profiler that should enable us to use this database as storage for this.

Activate it using this way:

    framework:
        profiler:
            dsn:     mongodb://user:pass@location/database/collection

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

by stof at 2011/07/24 11:23:06 -0700

btw, the MongoDB session storage has already be rejected from the core so this should probably be moved to the DoctrineMongoDBBundle (even if it uses only the PHP extension and not Doctrine). @fabpot thoughts about this ?

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

by Wotre at 2011/07/24 11:52:56 -0700

Just my personal opinion, if it is prefered that way I will move this into the DoctrineMongoDBBundle.

While it is reasonable to bundle all Mongo related things together, I do believe that in the case of logging we want to avoid as many depencies as possible. Some exceptions can occur pretty early inside the framework, and it would be a shame if those aren't logged because this layer is written on top of doctrine. I'm not exactly familliar enough with the symfony internals as I only started using it a few days ago, but I can imagine that this can make a difference with some exceptions.

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

by stof at 2011/07/24 11:59:10 -0700

I don't ask you to use Doctrine in this code. It is fine to use the extension directly if it is enough.

Btw, the profiler is *not* used early. :)

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

by Wotre at 2011/07/26 10:45:05 -0700

So... Any final remark whether this should be moved to [the DoctrineMongoDBBundle](https://github.com/symfony/DoctrineMongoDBBundle) or not?

If it has to be moved, any comment on where in that bundle this should be put?

Also, if it has to be moved, how can we arrange the configuration using DI? Currently I've put a line in the FrameworkExtension file to use this engine for everything with a $dsn starting with mongodb; I imagine this kind of ugly depency can't really exist between the FrameworkBundle and another one.

Although it seems completely illogical to me, I will move it, but I do need some directions on how to elegantly do this...

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

by stof at 2011/07/26 11:03:04 -0700

@fabpot what do you think ?

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

by stof at 2011/09/04 01:28:48 -0700

@fabpot what do you think about the place where this should be done ?
2011-09-06 07:53:28 +02:00
Fabien Potencier
748cb842cc updated CHANGELOG for 2.1 2011-09-06 07:47:18 +02:00
Fabien Potencier
ed472d36b7 merged branch alexandresalome/new-profiler-storage (PR #1772)
Commits
-------

9f0bd03 [HttpKernel] Update tests for FileProfilerStorage
b7032bc [HttpKernel] Update FileProfileStorage to search from EOF
188a5fa [HttpKernel] Override the existing tokens in FileProfilerStorage
b1b1424 [HttpKernel] Delete folders in the profiler cache
88bc3ec [HttpKernel] Fixes standards of FileProfilerStorage
affe66c Merge remote-tracking branch 'origin/master' into new-profiler-storage
ea916c3 [HttpKernel] Coding convention for the file profiler storage
9ae2c8d [HttpKernel] CS in file storage
b415efd [HttpKernel] Add a test for semicolon in file storage test
1c1215f [HttpKernel] Use subfolders for better storage in file storage of profiler
4b1dc1f [HttpKernel] Fix the folder attribute of file storage to private
70f73e1 [HttpKernel] Fix tests for the file storage of profiler
d5313d9 [HttpKernel] Add tests for the file profiler storage
09fc0a2 [HttpKernel] Add Symfony credits to the file storage class for the profiler
d1d5892 [HttpKernel] Finalize the file storage for the profiler
2f65cf2 Add POC for file storage system

Discussion
----------

[2.1] [HttpKernel] File storage for profiler

Symfony2 has some problems when dealing with multiple concurrency queries in the SQLite storage, resulting in a timeout error or terrible lack.

I've implemented after discussions with @fabpot a filesystem storage.

Enable it in your project with :

    framework:
        profiler:
          dsn:             "file:%kernel.cache_dir%/profiler"

I also studied the possibility to store only big data string in files and rest in the SQLite, but not concluant.

Results of my measures (4 concurrency, 120 total) :

* SQLite with data : 1057ms
* SQLite without data : 615ms
* MySQL : 40ms
* This File storage : 54ms

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

by alexandresalome at 2011/07/22 12:01:10 -0700

An idea for the find method : a csv file containing ip;url;token

The iteration could be done over a big file, without loading the whole file in memory.

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

by alexandresalome at 2011/07/23 14:22:32 -0700

OK new version, with as explained previously : a CSV file containing the index + file for each profile.

The speed is similar to the speed of MySQL, and no memory overhead should occur with this solution.

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

by alexandresalome at 2011/07/23 14:37:14 -0700

Hm... Created tests, duplicated from SqliteProfilerStorageTest.

Any idea on how to put this code in common ? Is it usual to create a base class for 2 tests ?

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

by alexandresalome at 2011/07/23 14:48:39 -0700

Just tested with 24.000 requests, the 24.001'th request still takes less than 50ms to execute.

The index file is about 2Mb, and iterating the whole file is fast.

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

by alexandresalome at 2011/07/23 14:53:19 -0700

I've filled the file with 120Mb of data, requests are still less than 50ms for executing.

Iterating the index takes more than 30s (so it crashed), but it's because of the amount of lines. 30 seconds = 1,400,000 lines in this computer. The file = 1,500,000 lines

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

by alexandresalome at 2011/07/23 14:56:54 -0700

I've tested it with Linux, is someone can test with Windows

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

by stloyd at 2011/07/24 00:32:32 -0700

IMO to speedup it a bit more and not end up with "crash" (to not end with "limit" of files per directory, also to many files in dir slow down every OS) you should use same method to write as Twig, split up files in to directories. If you do this you can speed up index more, because you can create smaller one per directory.

Also you should fix CS (coding standards).

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

by stloyd at 2011/07/24 02:10:20 -0700

Tested on Win 7, seems ok. Similar speed to sqlite, dunno why ;-) but used a bit less of memory.

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

by alexandresalome at 2011/07/24 02:13:21 -0700

Did you tried with concurrent requests ? It makes sense when you use assetic
and your browser hits the application 4 times simultaneously for CSS
generation

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

by alexandresalome at 2011/07/24 02:17:23 -0700

I used Apache Benchmark for producing results :

    ab -c 4 -n 120 URL

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

by alexandresalome at 2011/07/24 02:56:55 -0700

OK I used subfolders, based on last characters (because the first part of token is mostly the same between queries.

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

by stof at 2011/09/04 01:27:15 -0700

@fabpot any news about it ? Can it be merged ?
2011-09-06 07:45:55 +02:00
Fabien Potencier
e0a3605e63 merged branch stealth35/trans_few_op (PR #2093)
Commits
-------

8d50c16 few optimisations for XliffFileLoader and XmlFileLoader

Discussion
----------

few optimisations for XliffFileLoader and XmlFileLoader

 - file_put_contents + file_get_contents -> copy
 - use stripos insteed preg_match
 - removed useless `$tmpfiles` in XliffFileLoader
2011-09-06 07:38:29 +02:00
Fabien Potencier
63db2357c5 merged branch stealth35/asset_com_v2 (PR #2094)
Commits
-------

3a7e038 [FrameworkBundle] sanitize target arg in asset:install command

Discussion
----------

[FrameworkBundle] sanitize target arg in asset:install command

`php app/console assets:install web/`

(removed tailing /)

 before
`Installing assets for Symfony\Bundle\FrameworkBundle into web//bundles/framework`
after
`Installing assets for Symfony\Bundle\FrameworkBundle into web/bundles/framework`
2011-09-06 07:37:26 +02:00
Fabien Potencier
834cc138ec merged branch bait-sk/master (PR #2096)
Commits
-------

bbb68b7 Added RSS HTTP request format

Discussion
----------

Added RSS HTTP request format

Hi,

We have added RSS HTTP request format to `initializeFormats()` function in HttpFoundation Request class, to enable specifying `_format: rss` in routing files.

We couldn't find a reason for not having the rss format specified, and even the [cookbook refers](http://symfony.com/doc/2.0/book/routing.html#advanced-routing-example) to using of `_format: rss` .

Thanks,
Bait.sk
2011-09-06 07:36:26 +02:00
Fabien Potencier
a3ff291edc merged branch stloyd/pl_translation_sync (PR #2098)
Commits
-------

83254b8 [Validator] Sync polish translation

Discussion
----------

[Validator] Sync polish translation
2011-09-06 07:31:46 +02:00
stloyd
83254b8b37 [Validator] Sync polish translation 2011-09-05 18:55:50 +02:00
Teo
bbb68b7df9 Added RSS HTTP request format 2011-09-05 17:10:26 +03:00
stealth35
3a7e038fb9 [FrameworkBundle] sanitize target arg in asset:install command 2011-09-05 15:17:10 +02:00
stealth35
8d50c162b9 few optimisations for XliffFileLoader and XmlFileLoader 2011-09-05 15:06:29 +02:00
stealth35
dea46c721f [Translation] support CsvDumper
[Translation] support CsvDumper
[Translation] support CsvDumper
[Translation] support CsvDumper
[Translation] support CsvDumper
2011-09-05 13:14:52 +02:00
Fabien Potencier
41b25a404a merged branch yethee/ru_translations (PR #2090)
Commits
-------

515fe27 [FrameworkBundle] Sync the Russian translations

Discussion
----------

[FrameworkBundle] Sync the Russian translations
2011-09-05 12:20:04 +02:00
Deni
515fe27ce8 [FrameworkBundle] Sync the Russian translations 2011-09-05 13:58:36 +04:00
Fabien Potencier
747dc3f73b merged branch aboks/dutch_validator_translations (PR #2086)
Commits
-------

8cf7990 [FrameworkBundle] Added Dutch validator translation for trans-unit 41

Discussion
----------

[FrameworkBundle] Added Dutch validator translation for trans-unit 41

This message was added in #2065.
2011-09-05 09:28:08 +02:00
Fabien Potencier
2cdbec0f9e merged branch jdreesen/trans-update-1 (PR #2084)
Commits
-------

df3bde4 [FrameworkBundle] Updated German validator translation

Discussion
----------

[FrameworkBundle] Updated German validator translation

Updated german translation to include trans-id 41, which was added in #2065.
2011-09-05 09:28:00 +02:00
Arnout Boks
8cf79903e5 [FrameworkBundle] Added Dutch validator translation for trans-unit 41 2011-09-05 09:16:00 +02:00
Jordi Boggiano
d675c28123 [FrameworkBundle] Use Router instead of RouterInterface 2011-09-04 21:53:06 +02:00
Benjamin Eberlei
f2761dd627 Fix typo and include suggestion by Stof 2011-09-04 20:47:45 +02:00
Benjamin Eberlei
4ac380e016 Adjust QtTranslations patch and include QtTranslationsDumper + test aswell 2011-09-04 20:43:59 +02:00
Benjamin Eberlei
571279823a Adjust QtTranslationLoader to throw RuntimeException 2011-09-04 20:29:01 +02:00
Benjamin Eberlei
21b29c201b Merge symfony/master 2011-09-04 20:25:40 +02:00
Benjamin Dulau
89f4791704 Fixed CS 2011-09-04 19:10:51 +02:00
Benjamin Dulau
a348efec19 Removed trailing whitespaces 2011-09-04 18:12:05 +02:00
Benjamin Dulau
135531a2de Replaced setExpectedException() methods by annotations 2011-09-04 17:45:31 +02:00
Benjamin Dulau
6ad83e7970 Updated according to PR review 2011-09-04 17:45:25 +02:00
Benjamin Dulau
2de243cf07 * Added Fixtures 2x2px test.gif image file
* Updated tests for using fixture image instead of imagecreate function
2011-09-04 17:28:52 +02:00