Simple static Composer repository generator - For a full private Composer repo use Private Packagist
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.
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.
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:
{{ component('marketing-slot', { slug, color, cache: { ttl: 300 } }) }}
{{ cached_component('marketing-slot', { slug, color }, { ttl: 300 } }) }}
With an annotation
#[AsTwigComponent(cache: { ttl: 300 }]
class MarketingSlot {}
This have to be implemented in all the components that needs cache.
#[AsTwigComponent()]
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));
}
}
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.
As a complement to https://github.com/openai-php/client/pull/84
The default value was changed in https://github.com/symfony/symfony/pull/44575
update default value for framework.ide