28 Commits

Author SHA1 Message Date
Nicolas Grekas
db1adb004e Apply php-cs-fixer fix --rules nullable_type_declaration_for_default_null_value 2024-01-23 14:51:25 +01:00
Nicolas Grekas
590f1d55d0 [Cache] Add MarshallerInterface allowing to change the serializer, providing a default one that automatically uses igbinary when available 2018-07-08 10:55:08 +02:00
Nicolas Grekas
02007f5b69 Remove some visual debt by adding type hints on final methods/classes 2017-10-24 16:36:35 +02:00
Rob Frawley 2nd
7675ebf2ab add (filesystem|phpfiles) cache (adapter|simple) prune method and prune command
- added `Symfony\Component\Cache\PruneableInterface` so PSR-6 or PSR-16 cache implementations can declare support
  for manual stale cache pruning
- added FilesystemTrait::prune() and PhpFilesTrait::prune() implementations
- now FilesystemAdapter, PhpFilesAdapter, FilesystemCache, and PhpFilesCache implement PruneableInterface and
  supports manual stale cache pruning
- Added `cache:pool:prune` command via `Symfony\Bundle\FrameworkBundle\Command\CachePoolPruneCommand` to allow
  manual stale cache item pruning of supported PSR-6 and PSR-16 cache pool implementations
- Added `Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\CachePoolPrunerPass` compiler pass to fetch
  all cache pools implementing `PruneableInterface` and pass them to the command as an `IteratorArgument` so
  these references are lazy loaded by the command
- updated changelogs as appropriate
2017-07-20 11:29:24 -04:00
Fabien Potencier
bed96b19d1 Merge branch '3.2' into 3.3
* 3.2:
  [Security] Fix wrong term in UserProviderInterface
  [HttpFoundation] Set meta refresh time to 0 in RedirectResponse content
  disable inlining deprecated services
  [Cache] add constructor docblocks for clarity
  [Security] validate empty passwords again
  [DI] Remove irrelevant comment from container
  [TwigBridge] cleaner implementation of the TwigRenderer
2017-07-17 16:07:10 +02:00
Christian Flothmann
b3245bf59f [Cache] add constructor docblocks for clarity 2017-07-14 16:39:18 +02:00
Nicolas Grekas
4e0ef50c19 [Cache] Create PSR-16 variants of all PSR-6 adapters 2017-01-23 15:02:05 +01:00
Nicolas Grekas
afb1c1e6a7 [Cache] Move adapter implementations to traits 2017-01-23 14:57:50 +01:00
Jérôme Parmentier
43c9fbf132 Add missing use statement in FilesystemAdapter 2017-01-13 14:35:13 +01:00
Nicolas Grekas
523ae79150 Merge branch '3.1' into 3.2
* 3.1:
  do not depend on a fixed date in layout tests
  [Console] Escape default value when dumping help
  [Console] OS X Can't call cli_set_process_title php without superuser
  Fixed @return when returning this or static #bis
  fixed @return when returning this or static
  Polish translation improvement in Validator component
  [Console] Descriptors should use Helper::strlen
  [Config] Improve PHPdoc / IDE autocomplete
  [Debug] Wrap call to ->log in a try catch block
  [Debug] UndefinedMethodFatalErrorHandler - Handle anonymous classes
  fix merge
  [cache] Bump RedisAdapter timeout to 5s
  fixed @return when returning this or static
  [SecurityBundle] Made collection of user provider unique when injecting them to the RemberMeService
  remove is_writable check on filesystem cache
2017-01-02 15:57:35 +01:00
Arthur de Moulins
5ec10f3fa4 remove is_writable check on filesystem cache 2016-12-23 13:05:40 +01:00
Nicolas Grekas
0f5881c9b8 [Cache] Make directory hashing case insensitive 2016-11-09 15:09:05 +01:00
Nicolas Grekas
5acefcdf88 Merge branch '2.8' into 3.1
* 2.8:
  Compatibility with Twig 1.27
  [VarDumper] Fix dumping Twig source in stack traces
  Enhance GAE compat by removing some realpath()
  bumped Symfony version to 2.8.14
  updated VERSION for 2.8.13
  updated CHANGELOG for 2.8.13
  bumped Symfony version to 2.7.21
  updated VERSION for 2.7.20
  update CONTRIBUTORS for 2.7.20
  updated CHANGELOG for 2.7.20
  [SecurityBundle] Fix twig-bridge lowest dep
2016-10-28 10:18:15 +02:00
Nicolas Grekas
2bb9d84f49 Merge branch '3.1'
* 3.1:
  [Routing] Add missing options in docblock
  [VarDumper] Fix dumping continuations
  [PropertyInfo] Fix an error in PropertyInfoCacheExtractor
  [HttpFoundation] fixed Request::getContent() reusage bug
  [Form] Skip CSRF validation on form when POST max size is exceeded
  Use try-finally where it possible
  [DependencyInjection] ContainerBuilder: Remove obsolete definitions
  Enhance the phpDoc return types so IDEs can handle the configuration tree.
  fixes
  Remove 3.0 from branch suggestions for fixes in PR template
  [Process] Strengthen Windows pipe files opening (again...)
  [Cache] Handle unserialize() failures gracefully
  Fix #19531 [Form] DateType fails parsing when midnight is not a valid time
2016-08-16 18:09:30 +02:00
Nicolas Grekas
876d7df95e [Cache] Handle unserialize() failures gracefully 2016-08-10 19:24:03 +02:00
Nicolas Grekas
a8376e1f51 Merge branch '3.1'
* 3.1:
  [TwigBundle] Removed redundant return statement.
  enable property info
  [Cache] Fix default lifetime being ignored
  [DependencyInjection] Fixed deprecated default message template with XML
  Reference the actual location of the documentation
  [TwigBridge] Removed extra arguments in 2 places.
  [Cache] Fix incorrect timestamps generated by FilesystemAdapter
  [Process] Fix write access check for pipes on Windows
  [HttpKernel] Use flock() for HttpCache's lock files

Conflicts:
	src/Symfony/Component/Cache/Adapter/FilesystemAdapter.php
2016-07-28 13:15:50 +02:00
Nicolas Grekas
9e9e678fde [Cache] Fix incorrect timestamps generated by FilesystemAdapter 2016-07-26 15:05:38 +02:00
Nicolas Grekas
88b5e97eac [Cache] Optimize & wire PhpFilesAdapter 2016-05-31 18:28:43 +02:00
Piotr Stankowski
86ffe388da [Cache] Added PhpFilesAdapter 2016-05-29 11:12:17 +02:00
Fabien Potencier
919284c37c 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
Nicolas Grekas
20630b416d [Cache] Clean RedisAdapter pipelining + FilesystemAdapter 2016-05-12 12:01:30 -05:00
Nicolas Grekas
fa834c108d [Cache] Lock-less FilesystemAdapter 2016-05-08 05:02:40 +02:00
Nicolas Grekas
a5d852c405 [FrameworkBundle] Add & use Psr6CacheClearer 2016-04-05 16:36:41 +02:00
Nicolas Grekas
094826c03d [Cache] Normalize constructor arguments order 2016-04-04 11:41:14 +02:00
Fabien Potencier
d27a3e51b8 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
62023e7ec1 [Cache] Add namespace handling to all adapters 2016-03-10 10:26:34 +01:00
Nicolas Grekas
e4044e474b [Cache] Hash using B64+MD5 in FilesystemAdapter 2016-03-10 09:59:31 +01:00
Nicolas Grekas
97b38b7bb5 [Cache] Add FilesystemAdapter 2016-02-13 10:15:46 +01:00