Commit Graph

305 Commits

Author SHA1 Message Date
Fabien Potencier
8356d15dfa fixed CS 2016-06-29 07:43:32 +02:00
Fabien Potencier
c53cb57b9d Merge branch '3.1'
* 3.1:
  fixed CS
  fixed CS
  fixed CS
  fixed form tests
  [Console] Fix formatting of SymfonyStyle::comment()
  [Form] fix post max size translation type extension for >= 2.8
  [Security] Allow LDAP loadUser override
  removed dots at the end of @param and @return
  fixed typo
2016-06-29 07:43:10 +02:00
Fabien Potencier
a434e7b419 fixed CS 2016-06-29 07:42:25 +02:00
Titouan Galopin
28a40d21f5 [Cache] Add PhpArrayAdapter to use shared memory on PHP 7.0+ 2016-06-28 11:48:20 +02:00
Nicolas Grekas
19764af74f [Cache] Add tags based invalidation + TagAwareRedisAdapter 2016-06-17 17:55:45 +02:00
Nicolas Grekas
7581f71b34 Merge branch '3.1'
* 3.1: (30 commits)
  Fix merge
  [HttpFoundation] Use UPSERT for sessions stored in PgSql >= 9.5
  [Console] fixed PHPDoc
  [Cache] Fix double fetch in ProxyAdapter
  [travis] HHVM 3.12 LTS
  Fix feature detection for IE
  [Form] Fixed collapsed choice attributes
  [Console] added explanation of messages usage in a progress bar
  force enabling the external XML entity loaders
  [Yaml] properly count skipped comment lines
  [WebProfilerBundle] Fix invalid CSS style
  Added progressive jpeg to mime types guesser
  [Yaml] Fix wrong line number when comments are inserted in the middle of a block.
  Fixed singular of committee
  Fixed singular of committee
  Do not inject web debug toolbar on attachments
  Fixed issue with legacy client initialization
  [FrameworkBundle] Remove unused variable
  bumped Symfony version to 3.0.8
  updated VERSION for 3.0.7
  ...
2016-06-14 13:18:32 +02:00
Nicolas Grekas
040f53d3e6 [Cache] Fix double fetch in ProxyAdapter 2016-06-14 07:54:16 +02:00
Kévin Dunglas
8f2ea525af [Cache] AbstractAdapter: avoid an extra call to ApcuAdapter::isSupported 2016-06-08 12:08:03 +02:00
Nicolas Grekas
6f833284cb feature #18894 [Cache] Added PhpFilesAdapter (trakos, nicolas-grekas)
This PR was merged into the 3.2-dev branch.

Discussion
----------

[Cache] Added PhpFilesAdapter

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

This is taking over #18832.
With a warm cache I get these numbers consistently (PhpArrayAdapter being the implem in #18823 ):
```
Fetching randomly 5000 items 10000 times:

 Symfony\Component\Cache\Adapter\FilesystemAdapter: 0.1367,    2 megabytes
   Symfony\Component\Cache\Adapter\PhpArrayAdapter: 0.0071,    2 megabytes
   Symfony\Component\Cache\Adapter\PhpFilesAdapter: 0.0389,    2 megabytes
       Symfony\Component\Cache\Adapter\ApcuAdapter: 0.0361,    2 megabytes
```

This means that the PhpArrayAdapter should be used first, then ApcuAdapter preferred over PhpFilesAdapter, then FilesystemAdapter. This is what AbstractAdapter does here.

Also note that to get the cache working, one should stay within the limits defined by the following ini settings:
- memory_limit
- apc.shm_size
- opcache.memory_consumption
- opcache.interned_strings_buffer
- opcache.max_accelerated_files

Commits
-------

8983e83 [Cache] Optimize & wire PhpFilesAdapter
14bcd79 [Cache] Added PhpFilesAdapter
2016-06-06 10:10:42 +02:00
Nicolas Grekas
8983e83d91 [Cache] Optimize & wire PhpFilesAdapter 2016-05-31 18:28:43 +02:00
Piotr Stankowski
14bcd799c7 [Cache] Added PhpFilesAdapter 2016-05-29 11:12:17 +02:00
Nicolas Grekas
48710790af feature #18825 [Cache] Create NullAdapter to disable cache if needed (tgalopin)
This PR was merged into the 3.2-dev branch.

Discussion
----------

[Cache] Create NullAdapter to disable cache if needed

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | WIP
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Tthis PR aims to implement a Symfony Cache Null adapter able to disable cache if needed (very useful in tests or in the case of the fallback of the OpCacheAdapter for instance).

This PR is required by https://github.com/symfony/symfony/pull/18823 and https://github.com/symfony/symfony/pull/18533

Commits
-------

0519d22 [Cache] Create NullAdapter to disable cache if needed
2016-05-26 17:18:31 +02:00
Titouan Galopin
0519d22e7e [Cache] Create NullAdapter to disable cache if needed 2016-05-25 13:35:08 +02:00
Nicolas Grekas
9461750bd0 [Cache] Drop counting hit/miss in ProxyAdapter 2016-05-25 09:47:04 +02:00
Nicolas Grekas
0c8358b3fe [Cache] Rename nonce to version 2016-05-17 19:16:01 +02:00
Fabien Potencier
b5b141cf9a feature #18715 [FrameworkBundle] Default to Apcu+Filesystem cache chain (nicolas-grekas)
This PR was merged into the 3.1-dev branch.

Discussion
----------

[FrameworkBundle] Default to Apcu+Filesystem cache chain

| Q             | A
| ------------- | ---
| Branch?       | 3.1
| Bug fix?      | yes (perf)
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

In #16838, @dunglas benched that the filesystem cache is not the fastest one (not a surprise).
Yet, it is the default for now. I propose to replace this default by a dynamically created one that uses APCu when available (of course, we cannot do the check at container-build time), chained with the filesystem.

The benefit is double: APCu is automatically used when available without any configuration, and cache warming up is seeded by the filesystem cache so that the apcu cache can benefit from it.

Commits
-------

b9b57f9 [FrameworkBundle] Default to Apcu+Filesystem cache chain
2016-05-13 12:53:26 -05:00
Nicolas Grekas
b9b57f93cb [FrameworkBundle] Default to Apcu+Filesystem cache chain 2016-05-13 12:36:10 -05:00
Fabien Potencier
8f6c3b0711 bug #18724 [Cache] Lock-less FilesystemAdapter (nicolas-grekas)
This PR was merged into the 3.1-dev branch.

Discussion
----------

[Cache] Lock-less FilesystemAdapter

| Q             | A
| ------------- | ---
| Branch?       | 3.1
| Bug fix?      | yes (perf)
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Commits
-------

53b1ee5 [Cache] Lock-less FilesystemAdapter
2016-05-12 15:12:44 -05:00
Fabien Potencier
c9c875e008 minor #18714 [Cache] Clean RedisAdapter pipelining + FilesystemAdapter (nicolas-grekas)
This PR was merged into the 3.1-dev branch.

Discussion
----------

[Cache] Clean RedisAdapter pipelining + FilesystemAdapter

| Q             | A
| ------------- | ---
| Branch?       | 3.1
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

This PR refactorize Redis pipelining so that the case for handling RedisArray is abstracted, thus less bug prone.

Commits
-------

acf0075 [Cache] Clean RedisAdapter pipelining + FilesystemAdapter
2016-05-12 13:43:28 -05:00
Nicolas Grekas
acf007529f [Cache] Clean RedisAdapter pipelining + FilesystemAdapter 2016-05-12 12:01:30 -05:00
Nicolas Grekas
53b1ee52a2 [Cache] Lock-less FilesystemAdapter 2016-05-08 05:02:40 +02:00
Nicolas Grekas
a7899fe65c [Cache] Add nonce based cache invalidation to ApcuAdapter 2016-05-06 21:40:17 +02:00
Nicolas Grekas
b004243cb3 [Cache] Add support for Predis, RedisArray and RedisCluster 2016-05-04 18:13:46 +02:00
Nicolas Grekas
9a56498c8d [Cache] Cleanups 2016-05-02 14:16:25 +02:00
Nicolas Grekas
3073efb6d1 [Cache] Add DSN based Redis connection factory 2016-05-01 11:31:04 +02:00
Nicolas Grekas
11654591e7 [Cache] Dont use Redis connection when not required 2016-04-28 10:49:16 +02:00
Nicolas Grekas
5786f3d532 [Cache] Minor cleanup 2016-04-27 08:45:20 +02:00
Christian Flothmann
8b0d990a0c [Cache] fix expiration handling in ArrayAdapter 2016-04-24 19:31:20 +02:00
Nicolas Grekas
4256add915 [Cache] Test & tweak CacheItem::validateKey() 2016-04-20 18:47:41 +02:00
Nicolas Grekas
af09cdef49 [Cache] Add CacheItem::validateKey utility method 2016-04-20 11:19:01 +02:00
Nicolas Grekas
9dcbe3403c [Cache] Minor tweaks 2016-04-17 13:51:09 +02:00
Nicolas Grekas
98dce411e8 [Cache] Workaround krakjoe/apcu#170 2016-04-12 08:30:53 +02:00
Nicolas Grekas
714b916d5d [FrameworkBundle] Add & use Psr6CacheClearer 2016-04-05 16:36:41 +02:00
Nicolas Grekas
bc51fdeec3 [Cache] Normalize constructor arguments order 2016-04-04 11:41:14 +02:00
Fabien Potencier
b0fffac156 fixed CS 2016-03-27 14:54:44 +02:00
Fabien Potencier
ae86e5bc88 feature #18215 [Cache] Add a Chain adapter (dunglas, nicolas-grekas)
This PR was merged into the 3.1-dev branch.

Discussion
----------

[Cache] Add a Chain adapter

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | no
| Fixed tickets | #17556
| License       | MIT
| Doc PR        | -

Made in coordination with @dunglas

Commits
-------

68d9cea [Cache] Optimize Chain adapter
ebdcd16 [Cache] Add a Chain adapter
2016-03-27 14:53:58 +02:00
Masterklavi
e132763f55 Fast multiple setEx with the pipeline transcation (RedisAdapter::doSave) 2016-03-23 18:33:57 +01:00
Masterklavi
47f45b1d5e Fixed a bug: saving with not serializable values (RedisAdapter) 2016-03-21 10:30:40 +01:00
Nicolas Grekas
68d9ceabb2 [Cache] Optimize Chain adapter 2016-03-17 11:33:40 +01:00
Kévin Dunglas
ebdcd16bdd [Cache] Add a Chain adapter 2016-03-17 09:39:21 +01:00
Fabien Potencier
f29d46f29b feature #18176 [Cache] Restrict flushes to namespace scopes (nicolas-grekas)
This PR was merged into the 3.1-dev branch.

Discussion
----------

[Cache] Restrict flushes to namespace scopes

| Q             | A
| ------------- | ---
| Branch        | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | no
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Instead of flushing all cache namespaces all the time, we can flush only the keys in the namespace.

Commits
-------

8744443 [Cache] Restrict flushes to namespace scopes
2016-03-15 17:54:37 +01:00
Nicolas Grekas
8744443b49 [Cache] Restrict flushes to namespace scopes 2016-03-15 17:43:22 +01:00
Nicolas Grekas
6b7a1fcefa [Cache] Finish Redis adapter 2016-03-15 17:09:11 +01:00
Aurimas Niekis
4893cbc24a Added RedisAdapter 2016-03-15 10:28:32 +01:00
Fabien Potencier
117d83bd95 minor #18085 [Cache] Hash using B64+MD5 in FilesystemAdapter (nicolas-grekas)
This PR was merged into the 3.1-dev branch.

Discussion
----------

[Cache] Hash using B64+MD5 in FilesystemAdapter

| Q             | A
| ------------- | ---
| Branch        | master
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | no
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Using MD5+B64 is good enough to avoid any hash collision, even on case-insensitive filesystems.
On Windows where the total path length is limited, this saves 44 chars worth.
Even if collisions are extremely unlikely, they are detected by adding then comparing the raw key to saved payloads. This also has the added benefit of easing debugging/grepping the cached items on the filesystem.

Commits
-------

e96bb10 [Cache] Hash using B64+MD5 in FilesystemAdapter
2016-03-10 17:37:34 +01:00
Nicolas Grekas
5068f8751a [Cache] Add namespace handling to all adapters 2016-03-10 10:26:34 +01:00
Nicolas Grekas
e96bb10af4 [Cache] Hash using B64+MD5 in FilesystemAdapter 2016-03-10 09:59:31 +01:00
Nicolas Grekas
e6f21f999e [Cache] Count cache hits/misses in ProxyAdapter 2016-03-04 10:23:38 +01:00
Nicolas Grekas
e5d6db5c69 [Cache] Add FilesystemAdapter 2016-02-13 10:15:46 +01:00
Nicolas Grekas
064ec0b578 [Cache] Fix expiries handling 2016-02-08 08:22:02 +01:00
Nicolas Grekas
8605417b55 [Cache] Don't clone, serialize 2016-02-03 09:37:11 +01:00
Nicolas Grekas
d21fab0d0b [Cache] Handle and log errors properly 2016-01-25 20:18:55 +01:00
Aurimas Niekis
367e784f25 [Cache] Use generator in ArrayAdapter 2016-01-25 15:49:11 +01:00
Nicolas Grekas
0ba851abeb [Cache] Allow and use generators in AbstractAdapter 2016-01-20 10:11:05 +01:00
Nicolas Grekas
91e482ae8e [Cache] Symfony PSR-6 implementation 2016-01-19 08:02:17 +01:00