Rekapager v1.0.0 - Keyset pagination library for Doctrine
https://github.com/rekalogika/rekapager
https://redd.it/1kfgzhb
@r_php
https://github.com/rekalogika/rekapager
https://redd.it/1kfgzhb
@r_php
GitHub
GitHub - rekalogika/rekapager: Pagination library for PHP, supporting both offset-based and keyset-based pagination.
Pagination library for PHP, supporting both offset-based and keyset-based pagination. - rekalogika/rekapager
"FrankenPHP | Graceful reload" How?
I use FrankenPHP on production. It works perfectly and - almost - fits my CI/CD noscripts and actually I would recommend to anybody who want to work w/ PHP.
I think I understood every main features of the FrankenPHP and I use a lot of them to speed up my applications. There is only one exception: the graceful reload. I understand the use-case and its goal to result zero downtime.
My question is simple: How?
When everything is ready for the new version to release, my noscript is building and start the noscript like this
The building of the app takes time, that is around ~2-3 minutes on the VPS. The docker app seems to be "Unhealthy" during the application building and starting.
Surely my knowledge is incomplete. So, does anybody know how to create a noscript that completely cover the "Graceul reload" functionality?
Edit: During the building and starting the application, the user cannot reach the application.
https://redd.it/1kfix2t
@r_php
I use FrankenPHP on production. It works perfectly and - almost - fits my CI/CD noscripts and actually I would recommend to anybody who want to work w/ PHP.
I think I understood every main features of the FrankenPHP and I use a lot of them to speed up my applications. There is only one exception: the graceful reload. I understand the use-case and its goal to result zero downtime.
My question is simple: How?
When everything is ready for the new version to release, my noscript is building and start the noscript like this
$ docker compose build --no-cache
$ docker compose up -d --wait
The building of the app takes time, that is around ~2-3 minutes on the VPS. The docker app seems to be "Unhealthy" during the application building and starting.
Surely my knowledge is incomplete. So, does anybody know how to create a noscript that completely cover the "Graceul reload" functionality?
Edit: During the building and starting the application, the user cannot reach the application.
https://redd.it/1kfix2t
@r_php
frankenphp.dev
FrankenPHP: the modern PHP app server
FrankenPHP is a new app server for PHP apps (built on top of Caddy) and a library to embed the PHP interpreter in Go web servers.
fgets doesn't detect newline over http
There is a remote computer I can't access to, but it can access me. I need to send it some data as soon as something happens.
I decided to keep it simple, and have the remote computer connect a webpage of mine, and that webpage answers with a line reading '0' every second, and something else if there is something to do. To achieve this, the webpage simply echoes "0\n" (or whatever) then
The remote computer is in an infinite loop reading from
Now, all this is on php 5 (can't update due to reasons), but the real remote computer has php 8, and there, it fails.
I've pinpointed the error to
Running tests, adding a parameter to
I've solved this issue by reimplementing the function using
https://redd.it/1kfldh8
@r_php
There is a remote computer I can't access to, but it can access me. I need to send it some data as soon as something happens.
I decided to keep it simple, and have the remote computer connect a webpage of mine, and that webpage answers with a line reading '0' every second, and something else if there is something to do. To achieve this, the webpage simply echoes "0\n" (or whatever) then
flush, every second. Calling this webpage directly I can see a new '0' appear every second, as intended.The remote computer is in an infinite loop reading from
fgets, processing each line as it arrives. The whole things works wonders... in testing.Now, all this is on php 5 (can't update due to reasons), but the real remote computer has php 8, and there, it fails.
I've pinpointed the error to
fgets: it reads one line (or many, as long as they are sent in one go), but further lines are not received. fgets hangs ~~forever~~ for a long time. It doesn't timeout, either.Running tests, adding a parameter to
fgets to limit the maximum amount of characters, made me realize the issue: it doesn't detect the end of a line after the first flush (which happens in the local computer)I've solved this issue by reimplementing the function using
fgetc, and everything works now, but it still bugs me. What happened? Anyone knows?https://redd.it/1kfldh8
@r_php
Reddit
From the PHP community on Reddit
Explore this post and more from the PHP community
Why do we need auto-loading?
(This is mostly just me thinking out loud.)
I do remember working with PHP being a lot more tedious before auto-loading, and more recently any time I've worked on projects where auto-loading isn't working for all files using the non-autoloaded files being much more annoying.
But on the other hand I also work with Typenoscript, and there there is no auto-loading, you just explicitly give the path to any symbol you want to import and that seems to work fine. And compared to PHP it has the big advantage that you can import many things from the same file if you want to, and of course they don't have to be classes.
So I'm wondering how bad it would be to go back to explicit require_once, if we had tooling support to automatically insert it whenever needed. You might end up with a big list of require_once at the top of the file but you wouldn't have to read it.
I guess you'd have the complication in PHP that you still can't load two classes with the same fully qualified name, but you could still avoid that by following PSR-4 or a slight variant of it to allow having multiple classlikes in one file if the filename matches the penultimate section of the FQN.
Maybe there'd be use for syntax to combine require_once and import into a single statement to allow importing one or multiple symbols from a PHP file, although that might be more confusing than helpful if was just equivalent to using those two functions separately and didn't actually check that the file contained the symbol.
https://redd.it/1kfo5dg
@r_php
(This is mostly just me thinking out loud.)
I do remember working with PHP being a lot more tedious before auto-loading, and more recently any time I've worked on projects where auto-loading isn't working for all files using the non-autoloaded files being much more annoying.
But on the other hand I also work with Typenoscript, and there there is no auto-loading, you just explicitly give the path to any symbol you want to import and that seems to work fine. And compared to PHP it has the big advantage that you can import many things from the same file if you want to, and of course they don't have to be classes.
So I'm wondering how bad it would be to go back to explicit require_once, if we had tooling support to automatically insert it whenever needed. You might end up with a big list of require_once at the top of the file but you wouldn't have to read it.
I guess you'd have the complication in PHP that you still can't load two classes with the same fully qualified name, but you could still avoid that by following PSR-4 or a slight variant of it to allow having multiple classlikes in one file if the filename matches the penultimate section of the FQN.
Maybe there'd be use for syntax to combine require_once and import into a single statement to allow importing one or multiple symbols from a PHP file, although that might be more confusing than helpful if was just equivalent to using those two functions separately and didn't actually check that the file contained the symbol.
https://redd.it/1kfo5dg
@r_php
Reddit
From the PHP community on Reddit
Explore this post and more from the PHP community
Blocking Disposable Emails with the laravel-disposable-email
https://codingtricks.co/posts/blocking-disposable-emails-with-the-laravel-disposable-email-package
https://redd.it/1kfwfw0
@r_php
https://codingtricks.co/posts/blocking-disposable-emails-with-the-laravel-disposable-email-package
https://redd.it/1kfwfw0
@r_php
codingtricks.co
Blocking Disposable Emails with the laravel-disposable-email Package - CodingTricks
Block disposable emails in Laravel using the laravel-disposable-email package. Prevent spam and fake sign-ups with simple and effective validation.
Laravel Nova vs Backpack (It's that time of the year)
Client needs to extend a project with a big dashboard. Metrics here, user management there, etc.
Years ago I always recommended Backpack since Nova was kinda rocky, but I'm seeing Backpack offers a free version and a premium version. If I'm going to pay (and pass the cost to the client, of course)... Cons and pros, apart for one being free?
https://redd.it/1kfvzrg
@r_php
Client needs to extend a project with a big dashboard. Metrics here, user management there, etc.
Years ago I always recommended Backpack since Nova was kinda rocky, but I'm seeing Backpack offers a free version and a premium version. If I'm going to pay (and pass the cost to the client, of course)... Cons and pros, apart for one being free?
https://redd.it/1kfvzrg
@r_php
Reddit
From the laravel community on Reddit
Explore this post and more from the laravel community
New in Symfony 7.3: Static Error Pages
https://symfony.com/blog/new-in-symfony-7-3-static-error-pages?utm_source=Symfony%20Blog%20Feed&utm_medium=feed
https://redd.it/1kfz1bm
@r_php
https://symfony.com/blog/new-in-symfony-7-3-static-error-pages?utm_source=Symfony%20Blog%20Feed&utm_medium=feed
https://redd.it/1kfz1bm
@r_php
Symfony
New in Symfony 7.3: Static Error Pages (Symfony Blog)
In Symfony 7.3, you can export your error pages as static HTML so the server serves them instantly without running the app.
PHPverse 2025, a free online event celebrating PHP's 30th anniversary
https://stitcher.io/blog/php-verse-2025
https://redd.it/1kfylzn
@r_php
https://stitcher.io/blog/php-verse-2025
https://redd.it/1kfylzn
@r_php
stitcher.io
PHPverse 2025 - stitcher.io
Celebrating 30 years of PHP
PHP 8.4's new Dom\HTMLDocument in Diffs
https://liamhammett.com/php-84s-new-domhtmldocument-in-diffs
https://redd.it/1kg0hyi
@r_php
https://liamhammett.com/php-84s-new-domhtmldocument-in-diffs
https://redd.it/1kg0hyi
@r_php
Liamhammett
PHP 8.4's new Dom\HTMLDocument in Diffs
Long running command using httpClient starts printing curl debug info
I've got a command that uses a service that repeatedly calls httpClient->request('POST'. The process runs for around 45 min and makes a post request a few thousand times.
What's odd is after running for a few minutes (and a few hundred POST requests) I start getting debug information from CURL for every new request - like this:
Connection #2 to host generativelanguage.googleapis.com left intact
. Found bundle for host: 0x1b134070c11 can multiplex
Re-using existing connection with host generativelanguage.googleapis.com
HTTP/2 1769 OPENED stream for https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-flash-8b:generateContent?key=--------
[HTTP/2] [1769] [:method: POST]
HTTP/2 1769 :scheme: https
[HTTP/2] [1769] [:authority: generativelanguage.googleapis.com]
HTTP/2 1769 :path: /v1beta/models/gemini-1.5-flash-8b:generateContent?key=--------
[HTTP/2] [1769] [content-type: application/json]
HTTP/2 1769 accept: */*
[HTTP/2] [1769] [user-agent: Symfony HttpClient (Curl)]
HTTP/2 1769 accept-encoding: gzip
[HTTP/2] [1769] [content-length: 83719]
> POST /v1beta/models/gemini-1.5-flash-8b:generateContent?key=-------- HTTP/2
Host: generativelanguage.googleapis.com
Content-Type: application/json
Accept: /
User-Agent: Symfony HttpClient (Curl)
Accept-Encoding: gzip
Content-Length: 83719
upload completely sent off: 83719 bytes
< HTTP/2 200
< content-type: application/json; charset=UTF-8
< vary: Origin
< vary: X-Origin
< vary: Referer
< content-encoding: gzip
< date: Tue, 06 May 2025 02:57:32 GMT
< server: scaffolding on HTTPServer2
< content-length: 610
< x-xss-protection: 0
< x-frame-options: SAMEORIGIN
< x-content-type-options: nosniff
< server-timing: gfet4t7; dur=1763
< alt-svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000
anyone have an idea why this is happening?
https://redd.it/1kg7tgi
@r_php
I've got a command that uses a service that repeatedly calls httpClient->request('POST'. The process runs for around 45 min and makes a post request a few thousand times.
What's odd is after running for a few minutes (and a few hundred POST requests) I start getting debug information from CURL for every new request - like this:
Connection #2 to host generativelanguage.googleapis.com left intact
. Found bundle for host: 0x1b134070c11 can multiplex
Re-using existing connection with host generativelanguage.googleapis.com
HTTP/2 1769 OPENED stream for https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-flash-8b:generateContent?key=--------
[HTTP/2] [1769] [:method: POST]
HTTP/2 1769 :scheme: https
[HTTP/2] [1769] [:authority: generativelanguage.googleapis.com]
HTTP/2 1769 :path: /v1beta/models/gemini-1.5-flash-8b:generateContent?key=--------
[HTTP/2] [1769] [content-type: application/json]
HTTP/2 1769 accept: */*
[HTTP/2] [1769] [user-agent: Symfony HttpClient (Curl)]
HTTP/2 1769 accept-encoding: gzip
[HTTP/2] [1769] [content-length: 83719]
> POST /v1beta/models/gemini-1.5-flash-8b:generateContent?key=-------- HTTP/2
Host: generativelanguage.googleapis.com
Content-Type: application/json
Accept: /
User-Agent: Symfony HttpClient (Curl)
Accept-Encoding: gzip
Content-Length: 83719
upload completely sent off: 83719 bytes
< HTTP/2 200
< content-type: application/json; charset=UTF-8
< vary: Origin
< vary: X-Origin
< vary: Referer
< content-encoding: gzip
< date: Tue, 06 May 2025 02:57:32 GMT
< server: scaffolding on HTTPServer2
< content-length: 610
< x-xss-protection: 0
< x-frame-options: SAMEORIGIN
< x-content-type-options: nosniff
< server-timing: gfet4t7; dur=1763
< alt-svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000
anyone have an idea why this is happening?
https://redd.it/1kg7tgi
@r_php
Struggling to grasp Laravel after learning PHP — advice needed!
I recently learned PHP and wanted to start with Laravel, but I’m having a hard time understanding how everything works—especially Composer, artisan commands, and the overall structure of the framework. It feels like there’s a gap between learning core PHP and jumping into Laravel. Should I spend more time on advanced PHP concepts first, or just keep going with Laravel tutorials? Any advice or beginner-friendly resources that explain things clearly would be really helpful.
https://redd.it/1kg8qzq
@r_php
I recently learned PHP and wanted to start with Laravel, but I’m having a hard time understanding how everything works—especially Composer, artisan commands, and the overall structure of the framework. It feels like there’s a gap between learning core PHP and jumping into Laravel. Should I spend more time on advanced PHP concepts first, or just keep going with Laravel tutorials? Any advice or beginner-friendly resources that explain things clearly would be really helpful.
https://redd.it/1kg8qzq
@r_php
Reddit
From the PHP community on Reddit
Explore this post and more from the PHP community
PHP lib for character / avatar drawing
Hello there! Not an advanced dev here, mainly used vanilla PHP or CMS-based.
I'm trying to create a small project to teach about stereotypes.
From an official source, I got percentages about particularities (age, disability, ...). Next, I generate a random person based on these particularities and, last step, I want to create an avatar of this person (example: blind old lady, good rent, low education, ...).
Do you know any library with an high level of customization? Or maybe I should try differently, with JS or CSS5?
Thanks in advance for your help!
https://redd.it/1kg7z4e
@r_php
Hello there! Not an advanced dev here, mainly used vanilla PHP or CMS-based.
I'm trying to create a small project to teach about stereotypes.
From an official source, I got percentages about particularities (age, disability, ...). Next, I generate a random person based on these particularities and, last step, I want to create an avatar of this person (example: blind old lady, good rent, low education, ...).
Do you know any library with an high level of customization? Or maybe I should try differently, with JS or CSS5?
Thanks in advance for your help!
https://redd.it/1kg7z4e
@r_php
Reddit
From the PHP community on Reddit
Explore this post and more from the PHP community
The Patch for Laravel Container
https://tomasvotruba.com/blog/the-patch-for-laravel-container
https://redd.it/1kgc4bp
@r_php
https://tomasvotruba.com/blog/the-patch-for-laravel-container
https://redd.it/1kgc4bp
@r_php
Tomasvotruba
The Patch for Laravel Container
[I switched this website from Symfony to Laravel](/blog/why-I-migrated-this-website-from-symfony-to-laravel) 2,5 years ago, and I [love Laravel Container](/blog/what-i-prefer-about-laravel-dependency-injection-over-symfony) ever since.
Symfony and Laravel…
Symfony and Laravel…
An RFC to add RFC3986 and WHATWG URL compliant parsers to PHP
https://wiki.php.net/rfc/url_parsing_api
https://redd.it/1kgdf8t
@r_php
https://wiki.php.net/rfc/url_parsing_api
https://redd.it/1kgdf8t
@r_php
The Patch for Laravel Container
https://tomasvotruba.com/blog/the-patch-for-laravel-container
https://redd.it/1kgc57y
@r_php
https://tomasvotruba.com/blog/the-patch-for-laravel-container
https://redd.it/1kgc57y
@r_php
Tomasvotruba
The Patch for Laravel Container
[I switched this website from Symfony to Laravel](/blog/why-I-migrated-this-website-from-symfony-to-laravel) 2,5 years ago, and I [love Laravel Container](/blog/what-i-prefer-about-laravel-dependency-injection-over-symfony) ever since.
Symfony and Laravel…
Symfony and Laravel…
Developers, Don't Despair, Big Tech and AI Hype is off the Rails Again
https://cicero.sh/forums/thread/developers-don-t-despair-big-tech-and-ai-hype-is-off-the-rails-again-000007
https://redd.it/1kgm1xm
@r_php
https://cicero.sh/forums/thread/developers-don-t-despair-big-tech-and-ai-hype-is-off-the-rails-again-000007
https://redd.it/1kgm1xm
@r_php
cicero.sh
Cicero - Developers, Don't Despair, Big Tech and AI Hype is off the Rails Again
Cicero is a private, self-hosted AI assistant that combines robust capabilities with an unwavering commitment to user privacy and security.
We just launched php-operators.com: a reference page for operators in PHP!
https://php-operators.com
https://redd.it/1kgqygx
@r_php
https://php-operators.com
https://redd.it/1kgqygx
@r_php
Php-Operators
PHP Operators
Livewire and Inertia: how we love and use both at Spatie
https://spatie.be/blog/livewire-and-inertia-how-we-love-and-use-both
https://redd.it/1kgqxxt
@r_php
https://spatie.be/blog/livewire-and-inertia-how-we-love-and-use-both
https://redd.it/1kgqxxt
@r_php
spatie.be
Livewire and Inertia: how we love and use both
We've been building Laravel applications with Livewire and Inertia for over 5 years. If you held an individual Spatie employee at gunpoint (please don't) and forced them to pick a favorite, you'll get a 50/50 split. It's like choosing between chocolate or…
New in Symfony 7.3: New and Improved Console Helpers
https://symfony.com/blog/new-in-symfony-7-3-new-and-improved-console-helpers?utm_source=Symfony%20Blog%20Feed&utm_medium=feed
https://redd.it/1kgspsg
@r_php
https://symfony.com/blog/new-in-symfony-7-3-new-and-improved-console-helpers?utm_source=Symfony%20Blog%20Feed&utm_medium=feed
https://redd.it/1kgspsg
@r_php
Symfony
New in Symfony 7.3: New and Improved Console Helpers (Symfony Blog)
In Symfony 7.3, the Console component added a new Markdown table style and a Tree helper for rendering tree-like data.
Symfony repo featured on the Temporal Code Exchange
I am pleased and honored to announce that my open source package to get started with Temporal durable workflows and Symfony is now featured on the Temporal Code Exchange.
https://temporal.io/code-exchange/temporal-samples-for-the-symfony-framework
https://redd.it/1kgrnf4
@r_php
I am pleased and honored to announce that my open source package to get started with Temporal durable workflows and Symfony is now featured on the Temporal Code Exchange.
https://temporal.io/code-exchange/temporal-samples-for-the-symfony-framework
https://redd.it/1kgrnf4
@r_php
Conditional Fluent & Improved AsCollection Mapping in Laravel 12.10
https://youtu.be/jrFYhptM_m0
https://redd.it/1kgs234
@r_php
https://youtu.be/jrFYhptM_m0
https://redd.it/1kgs234
@r_php
YouTube
Conditional Fluent Methods & Collection Object Casting in Laravel 12.10
What's new in Laravel is back! We share new features of the Laravel framework every week 🙌 (v12.10)
1️⃣ Add Conditionable Trait to Fluent
https://github.com/laravel/framework/pull/55455
2️⃣ AsCollection can map items...
https://github.com/laravel/f…
1️⃣ Add Conditionable Trait to Fluent
https://github.com/laravel/framework/pull/55455
2️⃣ AsCollection can map items...
https://github.com/laravel/f…