Symfony bundle to expose your own metrics to Prometheus


XML toolbox for PHP


The Symfony PHP framework


Simple static Composer repository generator - For a full private Composer repo use Private Packagist


Symfony Live Paris 2022



issue comment
[Validator] Remove `bjeavons/zxcvbn-php` in favor of a builtin solution

Here is a late reaction to this validation constraint. If we can't explain to the end user why their "password strength is too low," that's bad for UX. The more complex the algorithm, the more users will get lost.

The UI will have to explain that the username/first name/application name is forbidden.

Created at 9 hours ago
issue comment
[TwigComponent] Cached component

Yes, configuring the cache on the PHP side seems better. The cache would contain the output HTML, so subcomponents would be in this cache and not called when the cache is used.

Created at 1 day ago
opened issue
[TwigComponent] Cached component

I would like to combine the features of a TwigComponent and the Twig cache extension.

My use-cache is a marketing slot that requires a DB or API call to fetch the data. This is have to be displayed identically on all the pages of the website so I want to cache it.

The current approach if I want to cache the result of a twig component is to use the cache tag:

{% cache "marketing-slot-#{slug}-#{color}" ttl(300) %}
    {{ component('marketing-slot', { slug, color }) }}
{% endcache %}

What can be improved:

  • generate the cache key automatically from options
  • ensure we have the same cache policy in every location of the component
  • bonus: expose the cache policy as HTTP cache header when using turbo?

Proposition 1: the cache policy is part of the options

{{ component('marketing-slot', { slug, color, cache: { ttl: 300 } }) }}

Proposition 2: add a new helper

{{ cached_component('marketing-slot', { slug, color }, { ttl: 300 } }) }}

Proposition 3: define the cache policy in the PHP class

With an annotation

#[AsTwigComponent(cache: { ttl: 300 }]
class MarketingSlot {}

Already possible alternatives:

Alternative 1: Use the cache in the PHP class

This have to be implemented in all the components that needs cache.

class MarketingSlot {
    public string $slug;
    public string $color;

    public function __construct(
        private CacheInterface $cache,
        private Repository $repo,
    ) {}
    public function getSlot(): array
        return $this->cache->get('marketing-slot-'.$this->slug, fn () => $this->repo->find($this->slug));

Alternative 2: Use ESI

  • More complex architecture involving a reverse proxy and HTML parsing.
  • Need to create a dedicated controller for each component
  • Symfony HTTP Cache supports only filesystem storage
Created at 1 day ago
Created at 1 day ago
Created at 3 days ago
issue comment
[HttpClient] Add support for client pool

I have a similar need for AWS opensearch. The DNS resolves to several IP addresses (shuffled) but if the request fails on the first IP, I'd like to try an other. Ideally I would like the IP to be shuffled by the client after DNS resolution, to maximize the randomness because the DNS resolution cache may be shared by all php processes on the the server.

Created at 5 days ago
Created at 5 days ago
pull request opened
Add streaming function for Symfony Http Client

As a complement to

Created at 5 days ago
GromNaN create branch stream-sf-http
Created at 5 days ago
Created at 5 days ago
pull request opened
update default value for framework.ide

The default value was changed in

Created at 1 week ago

update default value for framework.ide

Created at 1 week ago